diff --git a/README.md b/README.md index 5fd4680..ba62282 100644 --- a/README.md +++ b/README.md @@ -70,11 +70,13 @@ on every syscall (see Known limits). version renames the state vocabulary, config keys and environment variables to English and fixes four bugs (listed under Board). Those changes are covered by unit tests, not yet by a soak on a device. -What the device has run, as of 2026-12-03: seven real CI jobs, all for one repository. On 2026-11-26 two light +What the device has run, as of 2026-12-03: eight real CI jobs for two repositories. On 2026-11-26 two light jobs passed and three full builds failed (the one inspected stopped on vitest's 5 s per-test timeout, see Known -limits); on 2026-12-03 two plugin scans passed in about 5 minutes each. Nothing else has run on it. -The start check (`check-repo.sh` through `GH_RUNNER_REPOS` or `GITLAB_RUNNER_PROJECTS`) has not run on the -device yet: neither key is set there. +limits); on 2026-12-03 two plugin scans passed in about 5 minutes each and this repository's own `hygiene` job +passed in 20 seconds. Nothing else has run on it. The start check (`check-repo.sh` through `GH_RUNNER_REPOS` +or `GITLAB_RUNNER_PROJECTS`) first ran on the device on 2026-12-03 and passed for the three repositories its +GitHub runners serve (two private, one public with fork approval required). The 24 h soak and a reboot test +have not been done. ## What runs @@ -215,8 +217,9 @@ check the narrowest token that answers it: the repository permission **Administration: read-only** (Metadata: read-only comes with every fine-grained token). The check reads `GET /repos/{owner}/{repo}` (Metadata) and, for a public repository, `GET /repos/{owner}/{repo}/actions/permissions/fork-pr-contributor-approval` (Administration). A - fine-grained token belongs to one owner (a user or an organization), and the check takes one `GH_TOKEN`, - so the repositories in `GH_RUNNER_REPOS` must share that owner. + fine-grained token belongs to one owner (a user or an organization), and the check takes one `GH_TOKEN` + per call. With repositories under two owners, make one token per owner and let the wrapper below pick the + token from the repository it is called with: the control scripts call the check once per repository. - **GitLab:** a project access token with the **Maintainer** role and scope **`read_api`**; Maintainer is what the fork pipeline setting and the project's runner list need. A project token covers one project: with several in `GITLAB_RUNNER_PROJECTS`, or on GitLab.com Free (project access tokens need Premium or @@ -228,12 +231,20 @@ check the narrowest token that answers it: Keep the tokens out of `mini-runner.env`: it lives in the repository checkout, and what it exports is inherited by every process the boot and control scripts start, the board included. Write a wrapper outside the proot rootfs that only the check runs, -`~/.config/mini-runner/check-repo`, `chmod 600`, keeping the lines of the forges you use: +`~/.config/mini-runner/check-repo`, `chmod 700`. Keep each token in its own file next to it (`chmod 600`), +written without printing it, for example `pbpaste | ssh phone 'umask 077; cat > ~/.config/mini-runner/token-OWNER'` +from the computer that holds the clipboard. A wrapper for two GitHub owners: ```sh -export GH_TOKEN=... # GitHub, as above -export GITLAB_TOKEN=... # GitLab, as above -export GITLAB_HOST=gitlab.com # the token's server, the only one check-repo.sh sends it to +#!/bin/sh +d=$HOME/.config/mini-runner +case "${1:-}" in + OWNER_ONE/*) f=$d/token-OWNER_ONE ;; + OWNER_TWO/*) f=$d/token-OWNER_TWO ;; + *) f= ;; +esac +if [ -n "$f" ] && [ -r "$f" ]; then GH_TOKEN=$(cat "$f"); export GH_TOKEN; fi +# GitLab: export GITLAB_TOKEN=... and GITLAB_HOST=gitlab.com (the token's server, the only one it is sent to) exec sh "${MINIRUNNER_HOME:-$HOME/mini-runner}/scripts/check-repo.sh" "$@" ```