feat: add Deploy Keys function to Machines UI

- sshmanager/deploy.go: new DeployKeysToMachine function that uploads
  private keys, populates known_hosts via ssh-keyscan, and adds server
  pub key to authorized_keys on remote machines
- handlers_machines.go: new DeployKeys handler with auto-detection of
  keys needed per sync pair (source->dest uploads dest key, dest->source
  uploads source key)
- router.go: POST /machines/{id}/deploy-keys route
- client.ts: deployKeys() API method
- Machines.tsx: Deploy Keys button + modal with result display
This commit is contained in:
2026-07-09 20:33:04 -04:00
parent 5d708e1d7b
commit dbf998703f
5 changed files with 390 additions and 5 deletions
+2 -1
View File
@@ -34,7 +34,7 @@ func NewServer(cfg *config.Config, db *sql.DB, engine *syncengine.Engine) *Serve
s := &Server{router: r, cfg: cfg, engine: engine}
authHandler := NewAuthHandler(db)
machineHandler := NewMachineHandler(db, engine)
machineHandler := NewMachineHandler(db, engine, cfg)
syncPairHandler := NewSyncPairHandler(db)
jobHandler := NewJobHandler(db, engine)
sseHandler := NewSSEHandler(engine)
@@ -57,6 +57,7 @@ func NewServer(cfg *config.Config, db *sql.DB, engine *syncengine.Engine) *Serve
r.Post("/{id}/test-wol", machineHandler.TestWoL)
r.Post("/{id}/test-connection", machineHandler.TestConnection)
r.Post("/{id}/approve-fingerprint", machineHandler.ApproveFingerprint)
r.Post("/{id}/deploy-keys", machineHandler.DeployKeys)
})
r.With(auth.RequireAuth).Route("/sync-pairs", func(r chi.Router) {