mirror of
https://github.com/slackhq/nebula.git
synced 2025-11-22 00:15:37 +01:00
Do not allow someone to run a nebula lighthouse with an ephemeral port (#399)
* Do not allow someone to run a nebula lighthouse with an ephemeral port * derp - we discover the port so we have to check the config setting * No context needed for this error * gofmt yourself * Revert "gofmt yourself" This reverts commitc01423498e. * Revert "No context needed for this error" This reverts commit6792af6846. * snip snap snip snap
This commit is contained in:
5
main.go
5
main.go
@@ -244,6 +244,11 @@ func Main(config *Config, configTest bool, buildVersion string, logger *logrus.L
|
||||
|
||||
amLighthouse := config.GetBool("lighthouse.am_lighthouse", false)
|
||||
|
||||
// fatal if am_lighthouse is enabled but we are using an ephemeral port
|
||||
if amLighthouse && (config.GetInt("listen.port", 0) == 0) {
|
||||
return nil, NewContextualError("lighthouse.am_lighthouse enabled on node but no port number is set in config", nil, nil)
|
||||
}
|
||||
|
||||
// warn if am_lighthouse is enabled but upstream lighthouses exists
|
||||
rawLighthouseHosts := config.GetStringSlice("lighthouse.hosts", []string{})
|
||||
if amLighthouse && len(rawLighthouseHosts) != 0 {
|
||||
|
||||
Reference in New Issue
Block a user