-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from mutablelogic/v4
Lots of changes
- Loading branch information
Showing
80 changed files
with
7,849 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ import ( | |
|
||
// Packages | ||
server "github.com/mutablelogic/go-server" | ||
routerFrontend "github.com/mutablelogic/go-server/npm/router" | ||
ctx "github.com/mutablelogic/go-server/pkg/context" | ||
auth "github.com/mutablelogic/go-server/pkg/handler/auth" | ||
certmanager "github.com/mutablelogic/go-server/pkg/handler/certmanager" | ||
|
@@ -119,9 +120,13 @@ func main() { | |
tasks = append(tasks, certmanager) | ||
} | ||
|
||
// Location of the FCGI unix socket - this should be the same | ||
// as that listed in the nginx configuration | ||
socket := filepath.Join(n.(nginx.Nginx).DataPath(), "nginx/go-server.sock") | ||
// Router frontend | ||
routerFrontend, err := routerFrontend.Config{}.New() | ||
if err != nil { | ||
log.Fatal("routerFrontend: ", err) | ||
} else { | ||
tasks = append(tasks, routerFrontend) | ||
} | ||
|
||
// Router | ||
// TODO: Promote middleware to the root of the configuration to reduce | ||
|
@@ -157,10 +162,13 @@ func main() { | |
tasks = append(tasks, r) | ||
} | ||
|
||
// Add router | ||
// Add router and frontend | ||
// The API is served from http[s]://[any]/api/router and the frontend is served from http[s]://static/router | ||
// see the nginx default configuration to understand how the routing occurs in the proxy | ||
r.(router.Router).AddServiceEndpoints("router", r.(server.ServiceEndpoints), logger.(server.Middleware), auth.(server.Middleware)) | ||
r.(router.Router).AddServiceEndpoints("static/router", routerFrontend.(server.ServiceEndpoints), logger.(server.Middleware)) | ||
|
||
// LDAP | ||
// LDAP gets enabled if a password is set | ||
if *ldap_password != "" { | ||
ldap, err := ldap.Config{ | ||
URL: "ldap://[email protected]/", | ||
|
@@ -175,6 +183,10 @@ func main() { | |
} | ||
} | ||
|
||
// Location of the FCGI unix socket - this should be the same | ||
// as that listed in the nginx configuration | ||
socket := filepath.Join(n.(nginx.Nginx).DataPath(), "nginx/go-server.sock") | ||
|
||
// HTTP Server | ||
httpserver, err := httpserver.Config{ | ||
Listen: socket, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
# JSON configuration files | ||
# JSON configuration & parser test files | ||
|
||
Examples of JSON configuration files for the run command. This is not yet | ||
implemented, but will be in the future. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"arrays": { | ||
"bool_array": [ | ||
true, | ||
false | ||
], | ||
"string_array": [ | ||
"default", | ||
"prefix" | ||
], | ||
"number_array": [ | ||
1, | ||
2 | ||
], | ||
"null_array": [ | ||
null, | ||
null | ||
] | ||
}, | ||
"maps": { | ||
"bool_map": { | ||
"true": true, | ||
"false": false | ||
}, | ||
"string_map": { | ||
"default": "default", | ||
"prefix": "prefix" | ||
}, | ||
"number_map": { | ||
"one": 1, | ||
"two": 2 | ||
}, | ||
"null_map": { | ||
"null1": null, | ||
"null2": null | ||
} | ||
}, | ||
"fields": { | ||
"bool": true, | ||
"string": "string", | ||
"number": 1, | ||
"null": null | ||
}, | ||
"map_of_array": { | ||
"bool_array": [ | ||
true, | ||
false | ||
], | ||
"string_array": [ | ||
"default", | ||
"prefix" | ||
], | ||
"number_array": [ | ||
1, | ||
2 | ||
], | ||
"null_array": [ | ||
null, | ||
null | ||
] | ||
}, | ||
"empty_map": {}, | ||
"empty_map_array": { | ||
"array1": [], | ||
"array2": [] | ||
}, | ||
"empty_map_map": { | ||
"map1": {}, | ||
"map2": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"plugin": { | ||
"string": "string", | ||
"number": 1, | ||
"null": null, | ||
"bool": true | ||
} | ||
} |
Oops, something went wrong.