git: verify Forgejo instance-signed commits locally (allowed_signers missing instance key) #64
Labels
No labels
automerge
bug
dependencies
duplicate
help wanted
invalid
lang
rust
migrations
opencode
question
security
type
documentation
type
enhancement
type
maintenance
type
refactor
vulnerability
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Personal/nixos-configuration#64
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?
Context
Discovered during the cluster repository transfer work (Personal/cluster#76), while checking whether commits stayed signed across the move.
Forgejo-side signing already works. The gap is local verification:
git verify-commiton a server-generated merge commit reportsNo principal matchedand%G?=Ubecause the Forgejo instance signing key is missing from~/.config/git/allowed_signers.Current state (verified, Forgejo 17.0.1)
Instance signing is configured in
/var/lib/forgejo/custom/conf/app.ini(generated byshared/base/modules/services/forgejo.nix):Instance public key (public material, safe to commit):
Server-side verification is correct for both kinds of commit:
Local verification is inconsistent — user-signed commits are trusted, instance-signed merges are not:
Root cause
shared/base/home-manager/development/git.nixbuilds the allowed signers file from host SSH keys only, all under one principal:The Forgejo instance key is never added, so signatures made by the server (squash merges, initial commits, CRUD actions, wiki edits) cannot be matched to a principal.
Proposed change
Add the instance signing key as an allowed signer, preferably single-sourced from the same module that configures
[repository.signing]so the two cannot drift.Option A — declare the public key as an option on the service module and consume it from the git module (which already receives
systemConfig):Option B — if wiring the NixOS option into Home Manager is undesirable, append the key literally in the git module:
Do not commit the private signing key; it stays in SOPS (
forgejo/signing-key) and is materialised at/run/forgejo/id_ed25519.Verification examples
Acceptance criteria
~/.config/git/allowed_signerscontains the Forgejo instance signing key under a dedicated principal (forgejo@${common.domain})./run/forgejo/id_ed25519.pub.git verify-commiton a server-signed merge commit reportsGood "git" signature for forgejo@…and%G?=G.G(git@martials.noprincipal).just fmtclean andjust build nidaros+ one workstation host succeed.AGENTS.mdgets a short note that instance-signed merges verify under theforgejo@principal, soUis not mistaken for an unsigned commit.Out of scope