Expand description
Pure host-add logic: the POSIX probe script and its parser.
host add runs PROBE_SCRIPT on the target over the operator’s SSH
before writing a single byte to it. parse_probe turns the captured
key=value output into ProbeFacts for the capability check (next task).
Structs§
- Host
Plan - What
host addwill do to a host that passed capability assessment. - Probe
Facts - Facts about a probed host, parsed from
PROBE_SCRIPT’s output.
Constants§
- PROBE_
SCRIPT - POSIX
sh— no bashisms — run on the target host over the operator’s SSH. Emits onekey=valueline per fact; order doesn’t matter to the parser.
Functions§
- assess
- Decide whether a probed host is capable of hosting git-ark, and if so, plan how. Collects every blocking reason rather than stopping at the first, so the operator sees the whole picture before fixing anything.
- forced_
command_ line - The exact
authorized_keysentry for the forced-command key: restricted to runninggit-ark shellagainst this host’s own config, with no pty, port/agent/X11 forwarding. Uses the absoluteinstall_dir— sshd does not expand$HOMEincommand=. - parse_
probe - Parse
PROBE_SCRIPT’skey=valueoutput intoProbeFacts. - per_
host_ prefix - A host’s effective S3 prefix: the base prefix namespaced by host name, so each host writes to its own subtree (independent 1:1 copies).
- render_
config - Render the host’s
config.toml:repos_rootunderinstall_dir, the age recipient (public key only — the private identity never leaves the client), and an[s3]table.endpointis included only when the S3 config has one (real AWS S3 otherwise).mirror = trueis appended only whenmirroris set — the host’s backup arm gates the GitHub mirror on this line, so a non-mirror host omits it entirely rather than writingmirror = false. - render_
secrets - Render the host’s
secrets.toml: the write-only S3 credential,[aws], plus an optional[github]token. Writtenchmod 600by the caller; never printed. The token is the client-enforced singleton mirror’s credential — present only on the one host currently designatedmirror. - ssh_
config_ block - A client
~/.ssh/configblock wiringgit push git-ark-<name>:<repo>to the host over the forced-command key.