86 lines
4.4 KiB
Markdown
86 lines
4.4 KiB
Markdown
# Local Gitea runner (Assignment 5 preparation)
|
|
|
|
Run from the repository root in PowerShell with Docker Desktop's Linux engine running:
|
|
|
|
```powershell
|
|
.\gitea\local-runner\runner.ps1 -Action Check
|
|
.\gitea\local-runner\runner.ps1 -Action Register
|
|
.\gitea\local-runner\runner.ps1 -Action Start
|
|
.\gitea\local-runner\runner.ps1 -Action Logs
|
|
```
|
|
|
|
Register only when instructed: select the token for the existing group repository
|
|
at `https://git.yebilly.me/ssw590-group1/vpn-dns-gateway/settings/actions/runners`.
|
|
The script prompts with hidden input and passes the token through stdin. Do not
|
|
paste it into chat, source, screenshots, command arguments, or transcripts.
|
|
Registration is not performed by the Check action. No token is kept in the
|
|
running container's environment. Clear the clipboard after pasting your token.
|
|
|
|
The stdin wrapper removes CR/LF added by PowerShell's native-command pipeline.
|
|
Runner 2.3.0 reads `--token-file` verbatim; without this normalization the
|
|
extra line ending causes Gitea to reject an otherwise valid registration token.
|
|
The wrapper streams the normalized bytes directly to the runner without a
|
|
temporary token file or token-bearing process argument.
|
|
|
|
Runner identity/API credentials persist in the Docker volume
|
|
`ssw590-local-runner-data`, at `/data/.runner`. This is secret runtime state;
|
|
never print, export into Git, or screenshot its contents. It is not an evidence file.
|
|
|
|
## Configuration
|
|
|
|
- Official runner version verified locally: `v2.3.0`, 2026-10-07.
|
|
- Runner image pinned to `sha256:66d80966792e621c9761c47919644198d35fd1c297e9a01e69ed3c1ae37db0c7`.
|
|
- Host: student's Windows computer, Docker Desktop Linux engine.
|
|
- Name: `ssw590-vince-local`; capacity 1; scope comes from the selected token.
|
|
- Label: `latex-local`; Docker execution; no published ports.
|
|
- HTTPS certificate verification remains enabled; cache server disabled.
|
|
- The runner reaches Docker's internal socket; `container.docker_host: "-"`
|
|
prevents automatic mounting of that socket into job containers.
|
|
- Workflows still require trust: runner 2.x does not comprehensively filter
|
|
workflow container options. Restrict workflow edit rights to trusted teammates.
|
|
- Logs rotate at 10 MB per file with 3 files. Workflow step logs belong in Gitea.
|
|
- No automatic restart after Docker restarts: start deliberately before builds.
|
|
|
|
The job label selects the locally built `ssw590-manual-ci:20261007` image,
|
|
which includes Git, Node.js, and the complete TeX Live compiler environment.
|
|
See `ci/manual/README.md` for the Dockerfile, tested image ID, workflow,
|
|
and local checks. Registration and online status were verified after the
|
|
student privately registered the runner; a real Actions job remains pending.
|
|
|
|
## Evidence checkpoints
|
|
|
|
1. Check: capture the version and non-secret summary.
|
|
2. Start: refresh Gitea's runner page and capture its online status/name/label.
|
|
3. Later workflow: capture assigned runner, successful compilation, commit/run
|
|
version metadata, artifact download, two changes, failure, and repair.
|
|
|
|
To stop without removing registration:
|
|
|
|
```powershell
|
|
.\gitea\local-runner\runner.ps1 -Action Stop
|
|
```
|
|
|
|
Do not use `docker compose down -v` unless intentionally retiring the runner;
|
|
it deletes the registration volume and would require registration again.
|
|
|
|
Sources:
|
|
- https://docs.gitea.com/runner/2/installation/docker/
|
|
- https://docs.gitea.com/runner/2/registration/
|
|
- https://docs.gitea.com/runner/2/configuration/
|
|
|
|
AI assistance: OpenAI Codex prepared these files after the student chose a
|
|
local runner and requested setup guidance with screenshot reminders. The student
|
|
privately supplied registration input. The agent verified online declaration,
|
|
prepared the compiler/workflow, and performed token-free local build checks.
|
|
Real job execution and the active assignment chapter are still pending.
|
|
|
|
Correction, 2026-10-07: the student supplied a sanitized screenshot of a
|
|
registration rejection after the preflight check. Inspection of the official
|
|
v2.3.0 `register.go` identified untrimmed token-file bytes, and the helper was
|
|
corrected to remove PowerShell line endings. A fake-token local HTTP test
|
|
verifies what the actual runner sends; it does not register a real runner.
|
|
Observed result: the original pipeline sent a token with CR/LF and failed
|
|
exact-byte comparison; the corrected wrapper passed exact-byte comparison
|
|
with no CR/LF. The test endpoint intentionally rejected both requests after
|
|
capturing only the fake value. Temporary test containers/networks were removed.
|