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.
This commit is contained in:
petruknw
2026-05-20 23:34:40 +10:00
parent 5bd01b5a06
commit 5c6290b1d1
3 changed files with 11 additions and 21 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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 "$@"