protected-refs-policy: the always-allowed forge is hardcoded, so a template deployment cannot push to its own forge VM #272
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#272
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?
git-hooks/protected-refs-policytreats one public forge as the deployment's own and refuses every other remote not listed inallowed-external-remotes, so on a deployment built from the public template the dev VM cannot push to its own forge VM.Evidence, public install walk, a template hypervisor after
getting-started.sh --forgeandprovision-vm --replace allod-dev, 2026-10-10:git push -u origin <branch>from~/work/allod/toolsinside the VM is refused by the VM's own pre-push hook withERROR: Push to 'ssh://git@192.168.122.12:2222/allod/tools.git' is not authorized.before the server is reached.Cause, read from the hook:
is_allowed_external_remotealways allows a URL containingforge.anarch.diyand otherwise consults~/.config/git/allowed-external-remotes, which the public secrets template ships empty. The deployment's forge is identity'sforgeHost, rendered into the VM byallod/archetypes(FORGE_URL, the ssh config), but the hook has no way to read it.Proposal: the "personal forge" the hook always allows comes from a file the dev builder renders beside the policy files,
~/.config/git/forge-host, carrying identity'sforgeHost; the hook reads it and keeps the allowlist for everything else. A deployment whose identity names the public forge behaves exactly as today. Until then the template allowlist carries the forge VM's address (allod/secrets, the template'sgit/allowed-external-remotes).Why the end-to-end witness in
allod/archetypes(checks/forge-sync.nix) did not catch it: its client runs with no git hooks on purpose, to prove the server-side refusal on master. A second client built with the dev VM's hooks would prove the push path an operator actually has.Part of allod/strategy#65.
Landed on allod/tools master
d3fad6dand514f2fd(the hook reads ~/.config/git/forge-hosts), with the renderer in allod/archetypes e1f97e6 and the pin chain through the deploy template. Witnessed by the forge-sync end-to-end check with a hooked client and by the sixth clean install's branch push.