mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 18:33:28 +00:00
feat(cmd): Added machine ID mode to zitadel start up logs (#8251)
# Which Problems Are Solved Logs the type of sonyflake strategy used for generating unique machine IDs # How the Problems Are Solved - Created function to log machine id strategy on the start up logs # Additional Changes - Added public function for retrieving current strategy set by configuration # Additional Context - Closes #7750
This commit is contained in:
@@ -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")
|
||||
|
Reference in New Issue
Block a user