Public: anyone can read this; nobody can change it.

coldstart: gate host germination on Forgejo's trust verdict, not on a username #119

Merged opened this view on origin

Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.

Merged

The coldstart job runs PR-head code as host code on the vxrail box that also serves production, and the only thing in front of it was an allowlist of three username strings. A username is not a durable identity on this instance.

Notes

shipped merged

opened this view on origin

The coldstart job runs PR-head code as host code on the vxrail box that also serves production, and the only thing in front of it was an allowlist of three username strings.

A username is not a durable identity on this instance. Forgejo frees a name for re-registration the instant an account is deleted (no tombstone, no cooldown), and it cannot reserve one — RESERVED_USER_NAMES is not a real Forgejo config key at all, verified against the 15.0.6 binary. Delete ci-bot and a stranger can register the name and satisfy the gate.

This adds a fail-closed first step that asks Forgejo instead of trusting a name. Forgejo withholds every Actions secret from a run it considers untrusted, and it forces that verdict for AGit PRs as well as forks — precisely the case the existing comment worried a .fork test would miss. So a non-empty secret is a server-side, ID-backed statement that the head branch lives in this repo and was pushed with write access. Username squatting cannot produce one.

The allowlist stays as a cheap first filter.

Verified this breaks nothing: every coldstart PR to date, from plat and ci-bot alike, is a standard in-repo branch PR (flow=0, head_repo_id = base_repo_id), so secrets are in scope and the gate passes. Uses a dedicated TRUSTED_RUN_CANARY repo secret so the check is not coupled to an unrelated credential's lifecycle.

This PR exercises the new gate on itself.

🤖 Generated with Claude Code

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs