Watch
0
0
Fork
You've already forked hyperhive
0

swarmctl bao init: save bao's raw output before parsing, and accept null key lists

This commit is contained in:
atlas 2026-11-24 15:35:57 +01:00
commit 870a0a6697

View file

@ -96,9 +96,20 @@ swarmctl bao init
```
It prints the unseal (or, under the default `pkcs11` seal, recovery) keys
and the root token **once**, and stores none of them: not in a file, and the root token is
never in a process's argument list (so not in `ps`). Record them off this host before you do
anything else. It refuses an initialised store, and works
and the root token **once**. Record them off this host before you do
anything else.
Before it parses what `bao operator init` printed, it saves that raw output to
`bao-init.json` in swarmctl's state directory: `$XDG_STATE_HOME/swarmctl`, else
`~/.local/state/swarmctl` (`/root/.local/state/swarmctl` as root). The file is mode 0600
in a 0700 directory. If the output isn't what swarmctl expects, it prints the
raw output and the file's path, and exits non-zero. The store holds keys
then, so keep the output and don't run `bao operator init` again. Once you
have recorded the keys, delete the file with `shred -u`; until you do, a
second `swarmctl bao init` refuses to run. The root token is never in a
process's argument list (so not in `ps`).
`swarmctl bao init` refuses an initialised store, and works
from any host that can reach the store and has `bao` on `PATH`; the
wrapper installed on the store host already knows the store's address and CA, and
presents a client certificate: the hive's own where a hive runs on that host, else