Start again from agentos: a read-only, verity-checked /usr with A/B updates, and a TPM-encrypted btrfs root made at first boot that holds /etc and /var. On top of that the runner: gitea-runner from gitea.com, a path unit that starts it once registered, and a drain before update reboots. Jobs run in plain Fedora on root's podman. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0569bce676
commit
0733ff55f3
49 files changed
+492
-509
No files matched your search
@@ -1,33 +0,0 @@
|
||||
#!/bin/bash
|
||||
# First boot: asks for the root password and the runner's registration, on the screen (tty1) and the
|
||||
# serial console (ttyS0) at once (gitea-runner-setup@.service).
|
||||
# /etc is read-only, so the answers go to /var: the password to /var/lib/shadow (etc-shadow.mount
|
||||
# puts it over /etc/shadow), the rest to the runner's runner.env.
|
||||
set -euo pipefail
|
||||
echo "== Gitea runner setup =="
|
||||
|
||||
while :; do
|
||||
read -rsp "Root password: " pw; echo
|
||||
read -rsp "Again: " pw2; echo
|
||||
[[ -n $pw && $pw == "$pw2" ]] && break
|
||||
echo "Passwords do not match, try again."
|
||||
done
|
||||
install -d -m 0700 /var/lib/shadow/etc
|
||||
cp /etc/passwd /etc/shadow /var/lib/shadow/etc/
|
||||
echo "root:$pw" | chpasswd --prefix /var/lib/shadow
|
||||
systemctl start etc-shadow.mount
|
||||
|
||||
read -rp "Hostname (also the runner name): " name
|
||||
read -rp "Gitea URL (e.g. https://gitea.example.com): " url
|
||||
read -rp "Runner registration token: " token
|
||||
read -rp "Parallel jobs [1]: " capacity
|
||||
[[ $capacity =~ ^[1-9][0-9]*$ ]] || capacity=1
|
||||
install -D -m 0600 /dev/stdin /var/lib/gitea-runner/runner.env <<ENV
|
||||
GITEA_RUNNER_NAME=$name
|
||||
GITEA_INSTANCE_URL=$url
|
||||
GITEA_RUNNER_REGISTRATION_TOKEN=$token
|
||||
GITEA_RUNNER_CAPACITY=$capacity
|
||||
ENV
|
||||
echo "Done. The runner registers itself within a few seconds."
|
||||
# Stop the setup on the other console, which then shows its login.
|
||||
systemctl --no-block stop "gitea-runner-setup@*.service"
|
||||
Reference in new issue
Block a user