2026-03-20 22:38:17 -05:00
|
|
|
//go:build linux && !android
|
|
|
|
|
|
|
|
|
|
package config
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"log"
|
|
|
|
|
"os"
|
|
|
|
|
"strings"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func platformMachineID() string {
|
|
|
|
|
data, err := os.ReadFile("/etc/machine-id")
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.Printf("[identity] WARNING: failed to read /etc/machine-id: %v", err)
|
|
|
|
|
return ""
|
|
|
|
|
}
|
2026-05-17 01:12:56 -05:00
|
|
|
machineID := strings.TrimSpace(string(data))
|
|
|
|
|
|
|
|
|
|
seed := getOrCreateInstanceSeed()
|
|
|
|
|
if seed != "" {
|
|
|
|
|
return machineID + "|" + seed
|
|
|
|
|
}
|
|
|
|
|
return machineID
|
2026-03-20 22:38:17 -05:00
|
|
|
}
|