fix(gitea-runner): workspace outside the StateDirectory symlink to private/
test-runner / smoke (push) Failing after 0s

The NixOS gitea-actions-runner module sets StateDirectory to private/gitea-runner
(mode 700 in /var/lib/), so symlink /var/lib/gitea-runner -> private/gitea-runner
resolves into a root-only directory tree. The static gitea-runner user (uid 973)
cannot traverse that tree → mkdir within host.workdir_parent failed with EACCES.

Move workdir_parent to /var/lib/gitea-runner-work (sibling of the symlink,
no parent traversal through /var/lib/private). tmpfiles creates it owned
by gitea-runner with mode 0755.

Also still using rootfs to avoid the bind-mount RO issue that bit earlier.
This commit is contained in:
oqyude committed 2026-10-14 20:14:58 +03:00
1 parent 95166cee60
commit 6a6ddc4681
1 file changed
+9 -9
+9 -9
View File
@@ -67,12 +67,12 @@ in
health_check.interval = "5m";
health_check.timeout = "30s";
# Workspace on rootfs (not on the /mnt/services bind mount) — observed
# in 2026-10-14 16:04/16:11 runs that a transient RO remount of the
# bind during nixos-rebuild activation surfaces as
# mkdir …: read-only file system
# to act_runner. Workdir on /var/lib survives activation cycles.
host.workdir_parent = "/var/lib/gitea-runner/work";
# Workspace on rootfs, outside the StateDirectory symlink at
# /var/lib/gitea-runner -> private/gitea-runner. The NixOS module
# drops /var/lib/private/* at mode 700 (root-only) so the runner
# user can't traverse into the symlink target. Use a sibling of
# the symlink instead — /var/lib/gitea-runner-work (mode 0755 in tmpfiles).
host.workdir_parent = "/var/lib/gitea-runner-work";
# Defence in depth even though host labels never pull images.
container.docker_host = "";
@@ -93,10 +93,10 @@ in
# ----- Workspace directory on rootfs --------------------------------------
# `d` creates if missing; `z` resets ownership if missing. Path is
# /var/lib/gitea-runner/work (rootfs), not on the external bind mount —
# see comment on `host.workdir_parent` above for why.
# /var/lib/gitea-runner-work (rootfs, sibling of the StateDirectory symlink),
# not under /var/lib/private/ which is mode 700 and only traversable by root.
systemd.tmpfiles.rules = xlib.helpers.mkTmpDirs {
dir = "/var/lib/gitea-runner/work";
dir = "/var/lib/gitea-runner-work";
mode = "0755";
user = "gitea-runner";
group = "gitea-runner";