feat(breakglass): add "back up a world now" console peer (§B4 Sync)

Adds a break-glass console operation that snapshots a stopped world by
calling the felis-api internal face while the API is alive, rather than
rendering the backup Job locally: the Job needs felis-api deployment
coordinates the console does not hold.

The peer resolves the felis-api-internal ClusterIP Service + service
token from the control namespace, POSTs the internal backup endpoint
with the operator os_user for audit attribution, and maps 409/503/404
to friendly outcome cards. Core decision logic lives in backupnow.go
(unit-tested against a fake client + httptest); tui_backupnow.go is the
untested bubbletea glue mirroring tui_halt.go.
This commit is contained in:
flyemoji committed 2026-07-07 19:32:13 +09:00
1 parent 4918d93412
commit fc748d3462
9 files changed
+594 -2

No files matched your search

+2
View File
@@ -15,6 +15,7 @@ const (
bgProvisionOwner bgOperation = iota
bgAddOperator
bgHaltServer
bgSyncBackup
)
// menuChoiceMsg is emitted to the root once the operator picks an operation. The
@@ -52,6 +53,7 @@ func (m *menuModel) build() *huh.Form {
huh.NewOption("Provision or reset the Owner account", bgProvisionOwner),
huh.NewOption("Add an Operator account", bgAddOperator),
huh.NewOption("Halt a running server", bgHaltServer),
huh.NewOption("Back up a world now (Sync)", bgSyncBackup),
),
// A dim footnote spelling out the one behavioural difference that matters:
// Owner-reset re-enables local-password login, operator-add never touches the