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

@ -238,7 +238,8 @@ enum Verb {
/// steps one at a time. It prompts for what a step needs, shows a running
/// action as one live line, and prints anything to record in colour under a
/// ⚠️ warning, such as the secret store's keys and root token. It prints those
/// once and stores none of them. A step that needs a service this host
/// once; `bao init` also saves the raw output in a 0600 file, whose path it
/// prints. A step that needs a service this host
/// doesn't run names the deploy option to enable and the host to run
/// `swarmctl setup` on. A step without a verb yet prints its command and
/// waits until you confirm you ran it.
@ -248,8 +249,9 @@ enum Verb {
/// Initialise the swarm's secret store and bootstrap its granter.
///
/// Runs the `bao` CLI against the store over HTTPS, so the store need
/// not run on this host. The root token never reaches a file, an
/// argument list or an environment variable of this process.
/// not run on this host. The root token never reaches an argument list or an
/// environment variable of this process; `init` saves `bao`'s raw output,
/// which holds it, to one 0600 file.
Bao {
#[command(subcommand)]
command: BaoVerb,
@ -338,9 +340,13 @@ struct SetupStatusArgs {
enum BaoVerb {
/// Initialise the store, printing its keys and the root token once.
///
/// Prints the unseal or recovery keys and the root token to stdout, once,
/// and stores none of them: record them off this host before doing
/// anything else. Refuses an initialised store.
/// Prints the unseal or recovery keys and the root token to stdout, once:
/// record them off this host before doing anything else. Before parsing, it
/// saves `bao`'s raw output to `bao-init.json` in `$XDG_STATE_HOME/swarmctl`
/// (else `~/.local/state/swarmctl`), mode 0600; on output it can't parse it
/// prints the raw output and that path and exits non-zero. Delete the file
/// with `shred -u` once you have recorded the keys. Refuses an initialised store,
/// and refuses to run while the file exists.
Init(bao::InitArgs),
/// Bootstrap the granter: the one-time step that lets `swarm-bao-granter-role`
/// write every `swarm-*` policy and role.