Do not allow someone to run a nebula lighthouse with an ephemeral port

This commit is contained in:
Ryan Huber
2021-03-08 13:01:08 -06:00
parent d604270966
commit 5828874319

View File

@@ -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 && port == 0 {
return nil, NewContextualError("lighthouse.am_lighthouse enabled on node but no port number is set in config", nil, err)
}
// warn if am_lighthouse is enabled but upstream lighthouses exists
rawLighthouseHosts := config.GetStringSlice("lighthouse.hosts", []string{})
if amLighthouse && len(rawLighthouseHosts) != 0 {