feat(cli): break-glass emergency console TUI

Add `felis breakGlass`, a root-only interactive TUI that provisions or
resets the Owner account directly against Postgres and enables local
password login. It is the local-root recovery path that bypasses web
Zero Trust by design - used to bootstrap the first Owner credential and
to recover when the web login is unreachable.

- Bare `felis` prints CLI usage only; breakGlass is the sole subcommand
  that enters a TUI rather than running as a CLI.
- Refuses to run unless euid is 0 (try: sudo felis breakGlass); on
  non-Unix platforms the euid check also refuses.
- Generates a one-time Owner password, sets must_change_password, and
  prints a durable summary (username, one-time password, op.console
  login URL derived from the configured root domain) after the
  alt-screen TUI is torn down.

Covered by Go unit tests over a fake owner store.
This commit is contained in:
flyemoji committed 2026-06-27 04:23:21 +09:00
1 parent af14f02f38
commit e108a3709a
3 files changed
+635

No files matched your search

+3
View File
@@ -18,6 +18,7 @@ Commands:
restore Extract a world archive into a world volume (internal Job entrypoint)
manifests Render the control-plane RBAC + NetworkPolicy install bundle as YAML
apply Apply a MinecraftServer manifest
breakGlass Open the local break-glass emergency console (TUI; requires root/sudo)
Run "felis <command> -h" for command-specific flags.
`
@@ -45,6 +46,8 @@ func run(args []string, stdout, stderr io.Writer) int {
return cmdManifests(rest, stdout, stderr)
case "apply":
return notImplemented("apply", "MinecraftServer manifest apply", stderr)
case "breakGlass":
return cmdBreakGlass(rest, stdout, stderr)
case "-h", "--help", "help":
fmt.Fprint(stdout, usage)
return 0