allod secret rotate: move value rotation from rotate-token into the secret namespace #197
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/tools#197
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Move value rotation into
allod secret rotate <name>so every landing of a credential's ciphertext — first value, new value, new recipients — is one command on the host, androtate-tokencan retire.Primary goals:
secrets.nix, checks-then-commit-and-push behavior ofallod secret create(allod/tools#182), applied to replacing an existing ciphertext's value from stdin.credential-store-urlkeeps user and host;rclone-remote-stanzakeeps host and user and obscures the new password), asrotate-tokendoes today.service, with the Forgejo copy only forforgejogroups.rotate-token refresh-local-authinstalls root and user netrc bundles under sudo; decide whether that belongs inallod secretor stays a separate host script before building it.Current state and specifics
rotate-token(scripts/rotate-tokenin nexus, about 1450 lines of bash) handles group selection, three formats, local auth refresh, dry runs, and printed instructions, with 37 tests. allod/tools#182 deliberately shippedcreateandrekeyonly and deferred this, since building both would duplicate rotation. The registry stayed atforgejo-token-groups.jsonandlib.forgejoTokenGroupswithservicegeneralized toforgejoornone; renaming the file and export is cross-repo (archetypes reads it) and belongs with this work or its own issue, decided here.Scope
In: the rotate path in Go behind the
secrettag, the format carry-forward, dry run, and printed steps; the decision on local auth refresh and on the registry rename. Out: creating or revoking values at their source, rotation policy, and the Pi credential lifecycle, whichpi-providerowns.Registry shape input from the first non-Forgejo, non-rclone credential (per-machine tailscale auth keys, allod/nexus#53 and allod/nexus#54): the
formatandverify.typevocabularies are now enumerated in three places that must agree, rotate-token's validator, the deployment's secrets flake check, and whatever this port validates. Each new kind of credential is a code change in all three, and #54 was that change for one word each. Two shapes worth deciding here rather than carrying forward:A plain value is the default, not a format. Only two formats are real containers where rotation keeps part of the text (
credential-store-urlkeeps user and host,rclone-remote-stanzakeeps everything but the password).raw-forgejo-tokenandrawboth mean "the value itself" and differ only in a name that was Forgejo-shaped by accident. Letformatbe optional, meaning plain, and name only the containers; acceptraw-forgejo-tokenandrawas aliases of absent while registries still carry them.Verify is a per-target line, not an enum. rotate-token never runs the probe; it prints one command for the operator. A
verify.commandon the target, printed verbatim (prefixed withssh <system>when the target is not the host), needs no list to extend, and the three existing probes become three example lines. If a probe must stay structured for the local-auth refresh rule, keep that one and free the rest.Either way the vocabulary should live in one checked place that both the secrets flake and this command read, not be copied.