diff --git a/cmd/start/start.go b/cmd/start/start.go index 7d2c1e61f..e424a3d90 100644 --- a/cmd/start/start.go +++ b/cmd/start/start.go @@ -551,15 +551,17 @@ func showBasicInformation(startConfig *Config) { consoleURL := fmt.Sprintf("%s://%s:%v/ui/console\n", http, startConfig.ExternalDomain, startConfig.ExternalPort) healthCheckURL := fmt.Sprintf("%s://%s:%v/debug/healthz\n", http, startConfig.ExternalDomain, startConfig.ExternalPort) + machineIdMethod := id.MachineIdentificationMethod() insecure := !startConfig.TLS.Enabled && !startConfig.ExternalSecure fmt.Printf(" ===============================================================\n\n") - fmt.Printf(" Version : %s\n", build.Version()) - fmt.Printf(" TLS enabled : %v\n", startConfig.TLS.Enabled) - fmt.Printf(" External Secure : %v\n", startConfig.ExternalSecure) - fmt.Printf(" Console URL : %s", color.BlueString(consoleURL)) - fmt.Printf(" Health Check URL : %s", color.BlueString(healthCheckURL)) + fmt.Printf(" Version : %s\n", build.Version()) + fmt.Printf(" TLS enabled : %v\n", startConfig.TLS.Enabled) + fmt.Printf(" External Secure : %v\n", startConfig.ExternalSecure) + fmt.Printf(" Machine Id Method : %v\n", machineIdMethod) + fmt.Printf(" Console URL : %s", color.BlueString(consoleURL)) + fmt.Printf(" Health Check URL : %s", color.BlueString(healthCheckURL)) if insecure { fmt.Printf("\n %s: you're using plain http without TLS. Be aware this is \n", color.RedString("Warning")) fmt.Printf(" not a secure setup and should only be used for test systems. \n") diff --git a/internal/id/sonyflake.go b/internal/id/sonyflake.go index 6b05186c2..609570436 100644 --- a/internal/id/sonyflake.go +++ b/internal/id/sonyflake.go @@ -89,6 +89,22 @@ func isPrivateIPv4(ip net.IP) bool { (ip[0] == 10 || ip[0] == 172 && (ip[1] >= 16 && ip[1] < 32) || ip[0] == 192 && ip[1] == 168) } +func MachineIdentificationMethod() string { + if GeneratorConfig.Identification.PrivateIp.Enabled { + return "Private Ip" + } + + if GeneratorConfig.Identification.Hostname.Enabled { + return "Hostname" + } + + if GeneratorConfig.Identification.Webhook.Enabled { + return "Webhook" + } + + return "No machine identification method has been enabled" +} + func machineID() (uint16, error) { if GeneratorConfig == nil { logging.Panic("cannot create a unique id for the machine, generator has not been configured")