From 5c6290b1d1b9e4e9fd6fe6b45bbf8f13e89ce12c Mon Sep 17 00:00:00 2001 From: petruknw Date: Wed, 20 May 2026 23:34:40 +1000 Subject: [PATCH] fix: remove image: field so HA builds from Dockerfile; use AURRAL_DATA_DIR env var When image: is set in config.yaml, HA pulls that image directly and never runs the Dockerfile, so the rootfs overlay (including the passthrough entrypoint) was never applied. Removing image: forces HA to build from the Dockerfile, which COPYs rootfs/ and applies our run script and entrypoint override. Also switch run script from symlink approach to AURRAL_DATA_DIR env var, which avoids the race condition where docker-entrypoint.sh runs before s6 and tries to chown a broken symlink target. --- aurral/config.yaml | 7 ------- aurral/rootfs/etc/services.d/aurral/run | 21 +++++++------------ .../rootfs/usr/local/bin/docker-entrypoint.sh | 4 ++++ 3 files changed, 11 insertions(+), 21 deletions(-) diff --git a/aurral/config.yaml b/aurral/config.yaml index 6fbea1ae17..3640e1dc0b 100644 --- a/aurral/config.yaml +++ b/aurral/config.yaml @@ -9,8 +9,6 @@ arch: - aarch64 - amd64 -image: ghcr.io/lklynet/aurral - init: false ports: @@ -29,11 +27,6 @@ map: - share:rw - media:rw -env_vars: - - name: DOWNLOAD_FOLDER - description: "Path for music downloads" - required: false - options: download_folder: /share/aurral/downloads diff --git a/aurral/rootfs/etc/services.d/aurral/run b/aurral/rootfs/etc/services.d/aurral/run index 4d259a7ad1..86065866ee 100644 --- a/aurral/rootfs/etc/services.d/aurral/run +++ b/aurral/rootfs/etc/services.d/aurral/run @@ -8,22 +8,15 @@ DOWNLOAD_FOLDER=$(bashio::config 'download_folder') # Ensure host-side download directory exists mkdir -p "${DOWNLOAD_FOLDER}" -# Aurral writes its database/config to /app/backend/data inside the container. -# We bind that to HA's addon_config directory (/config) which is always writable. -# The upstream entrypoint chowns /app/backend/data — this must be a real directory, -# not a symlink to a protected HA path, so we do NOT symlink it. -mkdir -p /config/data - -# If /app/backend/data exists as a real dir (from image), replace with our persistent dir -if [ ! -L /app/backend/data ]; then - rm -rf /app/backend/data - ln -sf /config/data /app/backend/data -fi - bashio::log.info "Starting Aurral" +bashio::log.info " Data : /config/data (HA addon_config)" bashio::log.info " Downloads : ${DOWNLOAD_FOLDER}" -bashio::log.info " Data : /config/data" +# AURRAL_DATA_DIR tells Aurral to write its DB/config to /config/data +# (HA's writable addon_config mount) instead of /app/backend/data. +# This avoids any symlink that docker-entrypoint.sh might try to chown. +export AURRAL_DATA_DIR="/config/data" export DOWNLOAD_FOLDER="${DOWNLOAD_FOLDER}" +export WEEKLY_FLOW_FOLDER="${DOWNLOAD_FOLDER}/weekly-flow" -exec /usr/local/bin/docker-entrypoint.sh node /app/server.js +exec node /app/server.js diff --git a/aurral/rootfs/usr/local/bin/docker-entrypoint.sh b/aurral/rootfs/usr/local/bin/docker-entrypoint.sh index 311cb8cb40..987a2e322c 100644 --- a/aurral/rootfs/usr/local/bin/docker-entrypoint.sh +++ b/aurral/rootfs/usr/local/bin/docker-entrypoint.sh @@ -1,2 +1,6 @@ #!/bin/sh +# Passthrough entrypoint — s6-overlay (via HA init: false) handles init. +# The upstream entrypoint tries to chown /app/backend/data which fails +# on HA-mounted host paths. We bypass it entirely and use AURRAL_DATA_DIR +# to redirect the data directory instead. exec "$@"