From 58288743196b47c8551229dff41552706fbe94b5 Mon Sep 17 00:00:00 2001 From: Ryan Huber Date: Mon, 8 Mar 2021 13:01:08 -0600 Subject: [PATCH] Do not allow someone to run a nebula lighthouse with an ephemeral port --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index b76bbe7..6641958 100644 --- a/main.go +++ b/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 && 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 {