forge-sync: the forge-key recipient cross-check compares key comments, so a template host always fails it #90

Closed
opened 2026-10-09 21:04:43 +01:00 by vnprc-agent · 1 comment

forge-sync forge on a hypervisor built from the public template creates both accounts and then refuses to write the dev VM's forge key, on every run.

Evidence, laptop, clean install with every earlier fix pinned through, 2026-10-09:

Error: secrets.nix derives different recipients for secrets/allod-dev-forge-key.age than this run encrypted to; nothing written
Completed before this failure:
-   created human account 'evan'
-   created agent account 'allod-agent'

Cause, read from the scripts: ensure_vm_forge_key builds its recipient list from cat ~/.ssh/host.pub, whose comment is nexus-host (getting-started.sh generates it with ssh-keygen -C "${HYPERVISOR}-host"), and compares it line for line with what secrets.nix derives, where the host key is identity's hostPublicKey, written by the same script with the comment nexus. Same key, different comment, so the sorted lists differ. The other two recipient checks in the command (assert_host_recipient, verify_token_recipients_include) already compare by key material; this one does not. The stub suite's fixture spells the host key identically on both sides, which is why it passed.

Workaround: sed -i 's/ nexus-host$/ nexus/' ~/.ssh/host.pub, then rerun; the comment is not part of the key.

`forge-sync forge` on a hypervisor built from the public template creates both accounts and then refuses to write the dev VM's forge key, on every run. Evidence, laptop, clean install with every earlier fix pinned through, 2026-10-09: Error: secrets.nix derives different recipients for secrets/allod-dev-forge-key.age than this run encrypted to; nothing written Completed before this failure: - created human account 'evan' - created agent account 'allod-agent' Cause, read from the scripts: `ensure_vm_forge_key` builds its recipient list from `cat ~/.ssh/host.pub`, whose comment is `nexus-host` (`getting-started.sh` generates it with `ssh-keygen -C "${HYPERVISOR}-host"`), and compares it line for line with what `secrets.nix` derives, where the host key is identity's `hostPublicKey`, written by the same script with the comment `nexus`. Same key, different comment, so the sorted lists differ. The other two recipient checks in the command (`assert_host_recipient`, `verify_token_recipients_include`) already compare by key material; this one does not. The stub suite's fixture spells the host key identically on both sides, which is why it passed. Workaround: `sed -i 's/ nexus-host$/ nexus/' ~/.ssh/host.pub`, then rerun; the comment is not part of the key.
Author

Landed on allod/nexus master cfc30f6: the forge-key recipient cross-check compares key material, not whole lines; bbcbb2f and 59bf75c beside it print the forge URL and drop the closing block's push lines. Pinned through the deploy template.

Landed on allod/nexus master cfc30f6: the forge-key recipient cross-check compares key material, not whole lines; bbcbb2f and 59bf75c beside it print the forge URL and drop the closing block's push lines. Pinned through the deploy template.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
allod/nexus#90
No description provided.