fix(gitea-runner): workspace outside the StateDirectory symlink to private/
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:
1 parent
899e6faa84
commit
cdff5b2672
1 file changed
+9
-9
@@ -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";
|
||||
|
||||
Reference in new issue
Block a user