From 37962b2ba86d40f231b4e9179bfa71be4078abfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoran=20Peri=C4=8Di=C4=87?= Date: Sun, 2 Aug 2026 16:16:14 +0200 Subject: [PATCH] Fix cache storage landing in ephemeral /tmp Upstream joins STORAGE_PATH onto os.tmpdir() unless STORAGE_PATH_USE_TMP_FOLDER=false, even for absolute paths, so the container wrote artifacts to /tmp/app/cache instead of the bind mount and lost them on every restart. Set the flag in both config.env (native service) and the quadlet, and chown the host cache dir to the container user via the :U volume option. --- config.env | 5 +++++ turborepo-remote-cache.container | 9 +++++++-- turborepo-remote-cache.spec | 10 +++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/config.env b/config.env index 3c02ca0..9aa83bc 100644 --- a/config.env +++ b/config.env @@ -20,6 +20,11 @@ STORAGE_PROVIDER=local # /var/cache/turborepo-remote-cache from the host to this path. STORAGE_PATH=/var/cache/turborepo-remote-cache +# Use STORAGE_PATH as-is. Without this the server joins STORAGE_PATH +# onto os.tmpdir() (even when absolute) and the cache lands in /tmp, +# which is wiped on every restart. +STORAGE_PATH_USE_TMP_FOLDER=false + # Listen address and port. Bound to localhost by default — runners # reach the host via host.containers.internal (Podman) on this port. HOST=127.0.0.1 diff --git a/turborepo-remote-cache.container b/turborepo-remote-cache.container index 4d27ae7..6d508af 100644 --- a/turborepo-remote-cache.container +++ b/turborepo-remote-cache.container @@ -10,9 +10,14 @@ Image=docker.io/ducktors/turborepo-remote-cache:2.11.5 EnvironmentFile=/etc/turborepo-remote-cache/config.env # Bind to loopback on the host; runners reach via host.containers.internal PublishPort=127.0.0.1:3128:3000 -Volume=/var/cache/turborepo-remote-cache:/app/cache:Z -# Override STORAGE_PATH inside the container to match the bind mount +# :U chowns the host dir to the container's "app" user on start +Volume=/var/cache/turborepo-remote-cache:/app/cache:Z,U +# Override STORAGE_PATH inside the container to match the bind mount. +# STORAGE_PATH_USE_TMP_FOLDER=false is required: by default the server +# joins STORAGE_PATH onto os.tmpdir() (even absolute paths) and writes +# to the ephemeral /tmp/app/cache instead of the bind mount. Environment=STORAGE_PATH=/app/cache +Environment=STORAGE_PATH_USE_TMP_FOLDER=false Environment=PORT=3000 Environment=HOST=0.0.0.0 diff --git a/turborepo-remote-cache.spec b/turborepo-remote-cache.spec index ae25543..a555149 100644 --- a/turborepo-remote-cache.spec +++ b/turborepo-remote-cache.spec @@ -10,7 +10,7 @@ Name: turborepo-remote-cache Version: 2.11.5 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Self-hosted Turborepo remote cache server License: MIT Group: Development/Tools @@ -157,6 +157,14 @@ install -p -D -m 644 %{SOURCE12} \ %{_datadir}/containers/systemd/%{name}.container %changelog +* Sun Aug 02 2026 Zoran Pericic - 2.11.5-2 +- Set STORAGE_PATH_USE_TMP_FOLDER=false in config.env and quadlet: + upstream joins STORAGE_PATH onto os.tmpdir() by default (even for + absolute paths), so artifacts were written to ephemeral /tmp instead + of /var/cache/turborepo-remote-cache and lost on restart +- Add :U to the quadlet volume so the host cache dir is chowned to the + container's app user + * Sun Aug 02 2026 Zoran Pericic - 2.11.5-1 - Update to 2.11.5 - Adds local cache cleanup endpoint (2.9.0) and read-only mode (2.10.0)