Add quick-register one-liner for target-host registration
CI / Lint + build + test (push) Failing after 5m15s
CI / Lint + build + test (push) Failing after 5m15s
Operator pastes `curl -fsSL $ORCH/register/quick.sh | sudo bash` on the target host (pre-wipe). The script probes MAC + CPU/RAM/disks/NICs/GPUs, emits an expected-spec YAML, and POSTs to a new LAN-trusted JSON endpoint /api/v1/hosts. The register page shows the command prefilled with the orchestrator URL; the manual form moves into a collapsible "Register manually" disclosure.
This commit is contained in:
@@ -49,6 +49,11 @@ func NewRouter(d Deps) http.Handler {
|
||||
r.Post("/sensor", d.Agent.Sensor)
|
||||
})
|
||||
|
||||
// Quick-register: the bash one-liner fetched from /register/quick.sh
|
||||
// POSTs here from the target host. LAN-trusted, same threat model
|
||||
// as the browser UI.
|
||||
r.Post("/api/v1/hosts", d.UI.CreateHostJSON)
|
||||
|
||||
// Browser UI — no auth; bind to loopback or LAN only, or front
|
||||
// with a reverse proxy if you need a password.
|
||||
r.Get("/", d.UI.Dashboard)
|
||||
@@ -58,6 +63,7 @@ func NewRouter(d Deps) http.Handler {
|
||||
r.Post("/hosts/{id}/start", d.UI.StartRun)
|
||||
r.Post("/hosts/{id}/override-wipe", d.UI.OverrideWipeStorage)
|
||||
r.Get("/reports/{runID}", d.UI.Report)
|
||||
r.Get("/register/quick.sh", d.UI.QuickRegisterScript)
|
||||
r.Get("/events", d.UI.SSE)
|
||||
|
||||
return r
|
||||
|
||||
Reference in New Issue
Block a user