#!/usr/bin/env bash # ci-box — the forgejo-runner binary. Run BY THE MECHANISM as root, with # TENANT_USER/TENANT_HOME/TENANT_GROUP/ROLE exported. # # This lands the BINARY ONLY. Registration is deliberately not here: it needs a # registration token from the Forgejo instance, and a tenant install is # creds-free by contract — box auto-runs it at mint, holding nothing. The # operator registers afterwards, out loud: # # Deliberately NOT described the way the GitHub sibling describes its own # registration token, which really does expire in about an hour. That adjective # must not cross this forge boundary — a test pins its absence from this file # and from creds.md, so do not reintroduce it by copying from `rig runner`. # Forgejo's ActionRunnerToken carries no expiry field at all; # NewRunnerToken invalidates prior tokens only when a replacement is minted at # the same scope, and Register leaves the one it was handed active. It is # reusable until replaced, so a leak stays live. See creds.md, which is the # copy an agent inside the box actually reads. # # box shell ci-box # sudo rig forgejo-runner install --instance https://forgejo.example.com # # Same split as staging-box's tailnet join, for the same reason. # # Root-owned under /usr/local/bin rather than the tenant's home: unlike an # agent CLI, this binary is run by a systemd unit as the tenant user, and a # tenant-writable binary that root's unit executes is a trivial path to root # inside the box. set -euo pipefail # fetch_and_verify_sha256