testing: bootstrap UI, agent reliability, NS-01..04 + alert username #18
Reference in New Issue
Block a user
Delete Branch "ns-batch-host-ops"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Round of post-onboarding-test polish. Five themes:
First-run bootstrap UI
/bootstrappage (chrome-less, mirrors/loginstyle) with a username + password form. Uses the in-memory bootstrap token directly — operator never sees or types it./loginredirects to/bootstrapwhile a token + 0 users./api/bootstrappath.Agent reliability
failJobhelper emits a syntheticjob.started+job.finished{failed}for every early-return path inrunJob(missing restic, missing creds, malformed payload). Previously the server left the job inrunningandcommand.cancellater hit "unknown job".restic.SupportsRestoreNoOwnershipprobesrestic restore --helpat agent startup and gates--no-ownershipinstead of version-sniffing —0.18.xremoved the flag, so the SemVer gate misfired.ProtectSystem=full+ targetedReadWritePaths=/etc/restic-manager, noProtectHome— restore can now land anywhere on a real filesystem.Restore wizard polish
/root/rm-restore/<job-id>/with shorter help text..field(was.input, which doesn't exist in the stylesheet — typed text was invisible against the dark theme).NS-01..NS-04
Store.DeleteHost(FK cascade revokes the agent bearer with everything else), admin-bandPOST /hosts/{id}/delete, danger-zone form on host detail with hostname-confirm,host.deletedaudit, live WS close.Store.ListOutstandingEnrollmentTokens+DeleteEnrollmentToken; outstanding-tokens panel on the Add-host page (short hash, redacted repo URL, created/expires); operator-band Regenerate (revokes old hash, mints fresh raw token preserving repo creds + initial paths, 303s to/hosts/pending/{newToken}) and Revoke (delete + audit).hosts.repo_status+repo_status_error; WS handler projects every init job's terminal state onto the host row (idempotent "already initialised" collapses toready); creds-save resets status and dispatches a fresh probe;/hosts/{id}/repo/proberetry endpoint with status banner on the repo page./parsesq/status/repo_status/tag/sort/dirquery params (round-trip durable); 5s htmx live poll mirroring the alerts pattern with a localStorage live toggle; sortable column headers; filter row + clear.Alerts page
ack'd by …line resolves theacknowledged_byuser_id ULID to the actual username (falls back to raw id if the user has been deleted).Misc
compose.yamladded to.gitignore— host-specific dev/test bench file (canonical reference deployment lives indeploy/).Test plan
go vet ./...cleango test ./...clean/home/<user>/...succeeds → host delete from danger zone → outstanding-token recovery → dashboard filter/sort/live refreshSmoothes the rough edges that came up exercising a live deployment. First-run bootstrap UI: /bootstrap renders a username + password form that uses the in-memory token directly (operator no longer copies it out of the log); /login redirects there while bootstrap is available. Agent reliability: failJob synthetic envelopes so command.run early returns no longer hang the server-side job; runtime probe of restic restore --help drives --no-ownership instead of version sniffing (0.18.x had it removed). Server unit re-shaped: ProtectSystem=full plus ReadWritePaths=/etc/restic-manager, no ProtectHome — restore can now write anywhere a user might want. Restore wizard: default target is /root/rm-restore/<job-id>/ with clearer help text. Re-init confirm input uses .field (was .input, which doesn't exist — text was invisible). NS-01 host delete: store DeleteHost, admin-band /hosts/{id}/delete with hostname-confirm danger zone, audit, FK cascade, live WS close. NS-02 enrollment-token recovery: outstanding-tokens panel on /hosts/new, regenerate (preserves attachments) and revoke handlers + audit, store-level ListOutstandingEnrollmentTokens and DeleteEnrollmentToken. NS-03 repo init / probe surface: migration 0020 adds hosts.repo_status + repo_status_error; WS handler projects every init job's outcome onto the host row (idempotent already-initialised collapses to ready); creds-save resets status and dispatches a fresh probe; /hosts/{id}/repo/probe retry endpoint with banner. NS-04 dashboard live + sort + filter: query-string filter (q/status/repo_status/tag/sort/dir), 5s htmx live poll mirroring the alerts pattern with a localStorage live toggle, sortable column headers, filter row + clear. Alerts page: ack'd-by line resolves user_id ULID to username. Compose.yaml ignored — host-specific.