Clan-var secrets are newline-free at source and carry an explicit mode #418
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#418
Loading…
Add table
Add a link
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?
Two hygiene gaps in the rendered generators, both invisible to
nix eval(seedocs/GOTCHAS.md#4):openssl rand -base64 -out "$out"/<file> 24(internal/clan/vmguest.go,files.go), which emits a trailing newline. OurCloud has both consumer styles:gatewayEnvExportsreads$(cat …)(newline stripped) whileadminpassFile/dbpassFile/provision.adminPasswordFileare read verbatim by NixOS modules. No single secret feeds both styles today; the first one that does reproduces the mauke fleet's fleet-wide SigV4403 SignatureDoesNotMatch(65-byte vs 64-byte secret). Fix at generation: pipe throughtr -d '\n'.modeis never set anywhere in the tree. Clan vars default0400— fine while consumers are root; the first non-root consumer gets permission-denied at runtime with a green deploy behind it.Acceptance criteria
clan vars generatere-run it, rotating its files (GOTCHAS #5) — say what happens to standing communities (the dev community on benz-HP included) and sequence accordingly.tr -d '\n'(or equivalent) is present per secret file.Source: the clan-community (mauke reference fleet) lessons review,
docs/research/2026-08-10-clan-community-lessons.md(lands on main this sitting), lesson 7.Landed on main as
9209ded.Newline (blanket rule): the random-secret generators now strip openssl's trailing newline at source —
openssl rand -base64 24 | tr -d '\n' > "$out"/…— for kanidm-admins (admin, idm_admin;internal/clan/vmguest.go), nextcloud-admin (adminpass) and nextcloud-db (dbpass;internal/clan/files.go). PEM generators (kanidm-tls, front-door-tls) keep their structural trailing newline; only random secrets are stripped.Mode: every var file with a non-root consumer carries explicit
mode = "0400"(the value clan already defaults to, made a contract): kanidm-tls cert/key/ca (kanidm), kanidm-admins admin/idm_admin (kanidm), nextcloud-admin adminpass + nextcloud-db dbpass (nextcloud), front-door-tls cert/key (caddy). The front-doorcastays public (secret = false).Render tests assert the
tr -dper random secret and the mode per file:TestRenderFiles_SecretGeneratorsRendered(files_test.go),TestRenderGatewayGuest_KanidmSecretsNewlineFreeAndModed(vmguest_test.go), and the caddy owner/mode check in frontdoor_private_test.go. Fullinternal/clansuite + the pre-push go-ci gate are green.Rotation impact (GOTCHAS #5): the
| tr -dedit changes those three generators' scripts, soclan vars generaterotates admin/idm_admin/adminpass/dbpass on next run. The standing dev community on benz-HP re-provisions those credentials on its next deploy (the kanidm provisioning / nextcloud-setup oneshots re-apply the rotated values). The mode-only files (kanidm-tls, front-door-tls) do NOT rotate — mode is activation metadata, not part of the generator script, so the pinned file sets are unchanged.