From f71edf1aad97c1a82456ba48d437f82c6dddb885 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 20 Jun 2026 13:56:22 +0000 Subject: [PATCH] wolf: read WOLF_STATE_DIR from .env at runtime, not baked into compose MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit docker compose reads variables from .env automatically. Use ${WOLF_STATE_DIR} in docker-compose.yml so the state folder path is dynamic — editing .env is enough to relocate it without regenerating the compose file. IP/MAC/render node stay baked in (hardware-specific, not in .env). Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01D8ckUJQtj1pH8jtAddBDZs --- services/wolf.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/services/wolf.sh b/services/wolf.sh index d6f811f..8087814 100644 --- a/services/wolf.sh +++ b/services/wolf.sh @@ -866,6 +866,11 @@ UDEV WOLF_MAC="$LAN_MAC" fi + # Write compose using a mixed heredoc: WOLF_STATE_DIR comes from .env at + # runtime (docker compose variable substitution), so it stays correct even + # if the drive is remounted at a different path. IP/MAC/render-node are + # baked in at install time because they're hardware-specific and not stored + # in .env — use 'manage.sh update-network' to regenerate if they change. cat > docker-compose.yml << EOF name: wolf @@ -877,17 +882,17 @@ services: restart: unless-stopped environment: - NVIDIA_DRIVER_VOLUME_NAME=nvidia-driver-vol - # State + config live on the game drive. HOST_APPS_STATE_FOLDER must be a - # HOST path because Wolf hands it to the host Docker daemon when spawning - # app containers — so it's mounted at the SAME path inside this container. - - HOST_APPS_STATE_FOLDER=${WOLF_STATE_DIR} - - WOLF_CFG_FOLDER=${WOLF_STATE_DIR}/cfg + # WOLF_STATE_DIR is read from .env at runtime — edit .env to relocate. + # Must be the same path inside and outside the container so that app + # containers Wolf spawns via the Docker socket resolve it on the host. + - HOST_APPS_STATE_FOLDER=\${WOLF_STATE_DIR} + - WOLF_CFG_FOLDER=\${WOLF_STATE_DIR}/cfg - WOLF_INTERNAL_IP=${WOLF_IP} - WOLF_INTERNAL_MAC=${WOLF_MAC} - WOLF_RENDER_NODE=${WOLF_RENDER_NODE} - LD_LIBRARY_PATH=/usr/nvidia/lib:/usr/nvidia/lib32 volumes: - - ${WOLF_STATE_DIR}:${WOLF_STATE_DIR}:rw + - \${WOLF_STATE_DIR}:\${WOLF_STATE_DIR}:rw - /var/run/docker.sock:/var/run/docker.sock:rw - /dev/:/dev/:rw - /run/udev:/run/udev:rw