mirror of
https://github.com/netbirdio/netbird.git
synced 2025-04-14 14:38:27 +02:00
refactor: move LetsEncryptDomain to HttpServer config
This commit is contained in:
parent
1f29975737
commit
08d44b1d5f
@ -11,8 +11,8 @@
|
||||
{
|
||||
"Proto": "udp",
|
||||
"URI": "turn:stun.wiretrustee.com:3468",
|
||||
"Username": "some_turn_user",
|
||||
"Password": "some_turn_passwd"
|
||||
"Username": "some_user",
|
||||
"Password": "c29tZV9wYXNzd29yZA=="
|
||||
}
|
||||
],
|
||||
"Signal": {
|
||||
@ -20,5 +20,14 @@
|
||||
"URI": "signal.wiretrustee.com:10000",
|
||||
"Username": "",
|
||||
"Password": null
|
||||
},
|
||||
"Datadir": "",
|
||||
"HttpConfig": {
|
||||
"LetsEncryptDomain": "",
|
||||
"Address": "0.0.0.0:3000",
|
||||
"AuthDomain": "<PASTE YOUR AUTH0 DOMAIN HERE>",
|
||||
"AuthClientId": "<PASTE YOUR AUTH0 CLIENT ID HERE>",
|
||||
"AuthClientSecret": "<PASTE YOUR AUTH0 SECRET>",
|
||||
"AuthCallback": "http://localhost:3000/callback"
|
||||
}
|
||||
}
|
@ -59,8 +59,8 @@ var (
|
||||
var opts []grpc.ServerOption
|
||||
|
||||
var httpServer *http_server.Server
|
||||
if config.LetsEncryptDomain != "" {
|
||||
certManager := encryption.CreateCertManager(config.Datadir, config.LetsEncryptDomain)
|
||||
if config.HttpConfig.LetsEncryptDomain != "" {
|
||||
certManager := encryption.CreateCertManager(config.Datadir, config.HttpConfig.LetsEncryptDomain)
|
||||
transportCredentials := credentials.NewTLS(certManager.TLSConfig())
|
||||
opts = append(opts, grpc.Creds(transportCredentials))
|
||||
|
||||
@ -119,7 +119,7 @@ func loadConfig() (*server.Config, error) {
|
||||
return nil, err
|
||||
}
|
||||
if mgmtLetsencryptDomain != "" {
|
||||
config.LetsEncryptDomain = mgmtLetsencryptDomain
|
||||
config.HttpConfig.LetsEncryptDomain = mgmtLetsencryptDomain
|
||||
}
|
||||
if mgmtDataDir != "" {
|
||||
config.Datadir = mgmtDataDir
|
||||
|
@ -16,18 +16,19 @@ type Config struct {
|
||||
Turns []*Host
|
||||
Signal *Host
|
||||
|
||||
Datadir string
|
||||
LetsEncryptDomain string
|
||||
Datadir string
|
||||
|
||||
HttpConfig *HttpServerConfig
|
||||
}
|
||||
|
||||
// HttpServerConfig is a config of the HTTP Management service server
|
||||
type HttpServerConfig struct {
|
||||
Address string
|
||||
AuthDomain string
|
||||
AuthClientId string
|
||||
AuthClientSecret string
|
||||
AuthCallback string
|
||||
LetsEncryptDomain string
|
||||
Address string
|
||||
AuthDomain string
|
||||
AuthClientId string
|
||||
AuthClientSecret string
|
||||
AuthCallback string
|
||||
}
|
||||
|
||||
// Host represents a Wiretrustee host (e.g. STUN, TURN, Signal)
|
||||
|
10
management/server/testdata/management.json
vendored
10
management/server/testdata/management.json
vendored
@ -21,5 +21,13 @@
|
||||
"Username": "",
|
||||
"Password": null
|
||||
},
|
||||
"DataDir": ""
|
||||
"DataDir": "",
|
||||
"HttpConfig": {
|
||||
"LetsEncryptDomain": "",
|
||||
"Address": "0.0.0.0:3000",
|
||||
"AuthDomain": "<PASTE YOUR AUTH0 DOMAIN HERE>",
|
||||
"AuthClientId": "<PASTE YOUR AUTH0 CLIENT ID HERE>",
|
||||
"AuthClientSecret": "<PASTE YOUR AUTH0 SECRET>",
|
||||
"AuthCallback": "http://localhost:3000/callback"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user