Including system metadata when posting to utility API

This commit is contained in:
Cuong Manh Le
2025-12-18 17:10:39 +07:00
committed by Cuong Manh Le
parent 57a9bb9fab
commit 22122c45b2
20 changed files with 378 additions and 98 deletions
+22
View File
@@ -0,0 +1,22 @@
package ctrld
import (
"context"
"github.com/Control-D-Inc/ctrld/internal/system"
)
// partOfDomainOrWorkgroup checks if the computer is part of a domain or workgroup and returns "true" or "false".
func partOfDomainOrWorkgroup(ctx context.Context) string {
status, err := system.DomainJoinedStatus()
if err != nil {
ProxyLogger.Load().Debug().Err(err).Msg("Failed to get domain join status")
return "false"
}
switch status {
case 2, 3:
return "true"
default:
return "false"
}
}