Skip to main content

Module seed

Module seed 

Source
Expand description

choir seed — a fresh machine to a running seed of somebody else’s log, in one command (D80).

Everything this does was already possible: mint a node key where the daemon will look for it, hand the home’s operator three lines to paste, take the credential they issue, start choir-node with --seed, supervise it. The order is what nobody should have to know, and the daemon flags are what nobody should have to retype, which is the same reasoning as crate::host.

§Two runs, on purpose

A seed is a named reader of its home. Its key has to be registered and bound there, and a credential issued, before it can read a page, and all of that happens on a machine this command is not running on. So the first run stops after minting the identity and prints what the home registers, exit 3, the same handover shape as choir host’s certificate step; the second run, with --credential, finishes.

§What it writes

The marker crate::serve::Seed beside the state directory’s other markers, and the credential copied to 0600 inside it. After that choir node serve, node install, node status, node logs and doctor all work on a seed exactly as on a home, because the marker is what they read.

§Examples

use choir_cli::seed::registration;

// The three things the home's operator pastes: a keys line, a
// binding, and the two grants a seed needs (the log grant does not
// reach git, so `read` on the repositories is the second one).
let lines = registration("seed-a", "ab".repeat(32).as_str(), "https://home.example");
assert!(lines.iter().any(|l| l.contains("@node auditor")));
assert!(lines.iter().any(|l| l.contains("choir bind https://home.example")));

Structs§

Options
What choir seed was asked to do.

Functions§

identity
Reads the node key at path, or mints one there.
key_path
Where the daemon keeps a node’s key under repos.
parse
Parses choir seed’s arguments.
place_credential
Copies the issued credential into the state directory at 0600.
public_hex
The public half of a key, as the keys file spells it.
registration
What the home’s operator pastes to admit this seed, one line each.