Add fj runner token #289

Merged
stephen merged 2 commits from feat/runner-token into main 2026-10-13 02:49:14 +00:00
Owner

fj runner token prints an Actions runner registration token and nothing else, so provisioning can run forgejo-runner register --token "$(fj runner token --org rasterstate)" instead of a hand-rolled API call.

Scope follows the rest of the CLI: the repository from -R or the current clone by default, --org <ORG> for an organization, --user for your own account, --instance for the whole forge (instance administrators only). The issue sketched a bare fj runner token as the instance scope; that would have made the one command that ignores the clone it is run from, so the instance scope is an explicit flag. The scope flags conflict with each other and with -R.

A 403 or 404 comes back through the usual error mapping (exit 4 and 3). An empty token in a 200 is an error instead of an empty line on stdout.

The token is printed without the terminal guard fj auth token has. It is a join credential, but the web UI shows it in the clear and the point of the command is to be pasted or piped, so a --force step seemed like friction with no gain. Easy to add if you would prefer the stricter default.

Checked live against rasterhub.com for all four scopes (lengths only, tokens not logged). scripts/e2e-smoke.sh gains the repo-scope read under FJ_E2E_ADMIN=1; its run helper discards stdout.

The second commit is the same quinn-proto lockfile bump as #288, carried here so the audit gate passes on this branch too. Whichever merges second drops it on rebase.

The fjord-docs CLI reference needs regenerating once this lands, with runner added to the Actions section of scripts/gen-cli-reference.py.

Closes #193

`fj runner token` prints an Actions runner registration token and nothing else, so provisioning can run `forgejo-runner register --token "$(fj runner token --org rasterstate)"` instead of a hand-rolled API call. Scope follows the rest of the CLI: the repository from `-R` or the current clone by default, `--org <ORG>` for an organization, `--user` for your own account, `--instance` for the whole forge (instance administrators only). The issue sketched a bare `fj runner token` as the instance scope; that would have made the one command that ignores the clone it is run from, so the instance scope is an explicit flag. The scope flags conflict with each other and with `-R`. A 403 or 404 comes back through the usual error mapping (exit 4 and 3). An empty token in a 200 is an error instead of an empty line on stdout. The token is printed without the terminal guard `fj auth token` has. It is a join credential, but the web UI shows it in the clear and the point of the command is to be pasted or piped, so a `--force` step seemed like friction with no gain. Easy to add if you would prefer the stricter default. Checked live against rasterhub.com for all four scopes (lengths only, tokens not logged). `scripts/e2e-smoke.sh` gains the repo-scope read under `FJ_E2E_ADMIN=1`; its `run` helper discards stdout. The second commit is the same quinn-proto lockfile bump as #288, carried here so the audit gate passes on this branch too. Whichever merges second drops it on rebase. The fjord-docs CLI reference needs regenerating once this lands, with `runner` added to the Actions section of `scripts/gen-cli-reference.py`. Closes #193
Prints an Actions runner registration token and nothing else, so runner
provisioning can call it from a script instead of hand-rolling the API
request. Scope is the repository (-R, or the current clone) by default,
or --org, --user, or --instance for an instance administrator.

The instance scope uses /admin/runners/registration-token, the admin
route Forgejo and Gitea share.
Update quinn-proto past five RustSec advisories
All checks were successful
ci / check (pull_request) Successful in 11m59s
ci / coverage (pull_request) Successful in 2m0s
ci / live-e2e (pull_request) Successful in 2m38s
fd4c920d52
RUSTSEC-2026-0338 through 0342 landed against quinn-proto 0.11.15 and fail
the audit gate. The lockfile moves to a fixed release; nothing in fj's own
manifest changes.

(cherry picked from commit 4aa845981e)
stephen deleted branch feat/runner-token 2026-10-13 02:49:15 +00:00
stephen referenced this pull request from a commit 2026-10-13 02:49:16 +00:00
Sign in to join this conversation.
No description provided.