Run the runner as root; shorten the workflow

The gitea-runner user had root's podman socket, which is root access anyway, so it bought no
isolation. Run it as root and drop the user, the podman.socket drop-in and the /run/podman
permission workaround.

The workflow publishes in one step with small helpers, and filters assets with awk, which,
unlike grep, does not fail the step when nothing matches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V27snor4EJUATK7VoiKne6
This commit is contained in:
Job79andClaude Opus 5.5 committed 2026-11-14 11:26:52 +00:00
1 parent b0a49de3e6
commit cdc4a84658
6 files changed
+21 -35

No files matched your search

@@ -7,14 +7,13 @@ After=network-online.target podman.socket gitea-runner-images.service gitea-runn
Requires=podman.socket
[Service]
# The runner drives root's podman (podman.socket.d gives this user the socket). The jobs it starts
# never get the socket (see config.yaml).
User=gitea-runner
# Runs as root: it drives root's podman, which is root access anyway. The jobs it starts never
# get the socket (see config.yaml).
WorkingDirectory=/var/lib/gitea-runner
EnvironmentFile=/var/lib/gitea-runner/runner.env
Environment=DOCKER_HOST=unix:///run/podman/podman.sock
# The hostname is the runner's name. /etc is read-only, so it is set on every start (as root: +).
ExecStartPre=+/usr/bin/hostnamectl hostname --transient ${GITEA_RUNNER_NAME}
# The hostname is the runner's name. /etc is read-only, so it is set on every start.
ExecStartPre=/usr/bin/hostnamectl hostname --transient ${GITEA_RUNNER_NAME}
# Register once; the result is kept in .runner.
ExecStartPre=/bin/sh -c '[ -f .runner ] || exec gitea-runner register --no-interactive --config /usr/lib/gitea-runner/config.yaml --instance "$GITEA_INSTANCE_URL"'
ExecStart=/usr/bin/gitea-runner daemon --config /usr/lib/gitea-runner/config.yaml
@@ -1,4 +0,0 @@
# The runner may use root's podman. Jobs never get this socket.
[Socket]
SocketGroup=gitea-runner
SocketMode=0660