Private
Public Access
CI / rust (push) Successful in 3m6s
CI / go (push) Successful in 33s
CI / js (push) Successful in 34s
Standalone clients that resolve a machine unique ID (OS machine ID first, falling back to a generated UUID persisted to disk), detect hostname/IP/ container/orchestrator, and register+re-ping origin.warky.dev's public service-checkin endpoint on a daily interval. Ported from icy2's internal origincheckin package but extended to the full check-in contract and made dependency-light for external reuse. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
22 lines
543 B
Go
22 lines
543 B
Go
//go:build windows
|
|
|
|
package originclient
|
|
|
|
import "golang.org/x/sys/windows/registry"
|
|
|
|
// machineID reads MachineGuid from the registry, which is generated at
|
|
// Windows install time and stable across reboots.
|
|
func machineID() (string, error) {
|
|
key, err := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Cryptography`, registry.QUERY_VALUE|registry.WOW64_64KEY)
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
defer key.Close()
|
|
|
|
value, _, err := key.GetStringValue("MachineGuid")
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return value, nil
|
|
}
|