|
@@ -430,7 +430,13 @@ func GetPublicIP() (string, error) {
|
|
|
iplist := []string{"https://ip.server.gravitl.com", "https://ifconfig.me", "https://api.ipify.org", "https://ipinfo.io/ip"}
|
|
|
publicIpService := os.Getenv("PUBLIC_IP_SERVICE")
|
|
|
if publicIpService != "" {
|
|
|
- logger.Log(3, "User provided public IP service is", publicIpService)
|
|
|
+ logger.Log(3, "User (environment variable) provided public IP service is", publicIpService)
|
|
|
+
|
|
|
+ // prepend the user-specified service so it's checked first
|
|
|
+ iplist = append([]string{publicIpService}, iplist...)
|
|
|
+ } else if config.Config.Server.PublicIPService != "" {
|
|
|
+ publicIpService = config.Config.Server.PublicIPService
|
|
|
+ logger.Log(3, "User (config file) provided public IP service is", publicIpService)
|
|
|
|
|
|
// prepend the user-specified service so it's checked first
|
|
|
iplist = append([]string{publicIpService}, iplist...)
|