first commit
Agent Release / build (push) Has been cancelled
Server Deploy / deploy (push) Has been cancelled

This commit is contained in:
domrichardson
2026-06-15 13:58:45 +01:00
commit c9868b2108
55 changed files with 11076 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
package main
import (
"flag"
"log"
"github.com/mrhid6/keymanager/agent/internal/config"
agentsync "github.com/mrhid6/keymanager/agent/internal/sync"
)
var Version = "dev"
func main() {
genKey := flag.String("generate-key", "", "Generate SSH keypair and upload with this label")
flag.Parse()
cfg, err := config.Load()
if err != nil {
log.Fatalf("failed to load config: %v", err)
}
if *genKey != "" {
if err := agentsync.GenerateAndUpload(cfg, *genKey); err != nil {
log.Fatalf("key generation failed: %v", err)
}
return
}
log.Printf("keymanager-agent %s starting (server=%s, poll=%s)", Version, cfg.ServerURL, cfg.PollInterval)
if err := agentsync.Run(cfg); err != nil {
log.Fatalf("agent error: %v", err)
}
}