Ask for the registration and capacity at first boot

gitea-runner-setup asks on the console for the number of parallel jobs,
the Gitea URL and a registration token, and registers the runner. It runs
until the runner is registered, and logins wait for it, as for
systemd-firstboot. The capacity goes to a drop-in of gitea-runner.service,
which passes it to the config as CAPACITY, so the config stays read-only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Job79andClaude Opus 5.5 committed 2026-11-23 18:57:23 +00:00
1 parent 094ee671d7
commit 018f15172d
7 files changed
+59 -9

No files matched your search

@@ -0,0 +1,21 @@
# gitea-runner-setup.service runs /usr/libexec/gitea-runner-setup on the
# console until the runner is registered, after systemd-firstboot has asked
# its questions there. Logins wait for it, as for systemd-firstboot, so no
# getty reads the same console.
[Unit]
Description=Gitea runner setup
ConditionPathExists=!/var/lib/gitea-runner/.runner
Wants=network-online.target
After=systemd-firstboot.service network-online.target
Before=systemd-user-sessions.service
[Service]
Type=oneshot
# HOME is where gitea-runner keeps its cache, as in gitea-runner.service.
Environment=HOME=/var/lib/gitea-runner
ExecStart=/usr/libexec/gitea-runner-setup
StandardInput=tty
StandardOutput=tty
[Install]
WantedBy=multi-user.target
@@ -1,5 +1,5 @@
# gitea-runner.path starts the runner once it is registered, so a new machine
# waits for `gitea-runner -c /etc/gitea-runner/config.yaml register`.
# waits for gitea-runner-setup.service.
[Unit]
Description=Start the Gitea runner once registered
@@ -11,6 +11,9 @@ After=network-online.target podman.socket
Requires=podman.socket
[Service]
# CAPACITY is the number of parallel jobs. gitea-runner-setup writes a drop-in
# that overrides it, which `systemctl edit gitea-runner` changes.
Environment=CAPACITY=1
# HOME holds the cache of actions/cache, next to the registration.
Environment=HOME=/var/lib/gitea-runner
Environment=DOCKER_HOST=unix:///run/podman/podman.sock