fix: use env vars instead of symlinks to redirect data/download paths

The upstream docker-entrypoint.sh chowns /app/backend/data which fails
when it's a symlink to a host-mounted HA path. Instead, use the env vars
that Aurral natively supports to redirect paths:
  - AURRAL_DATA_DIR  -> data_folder config option
  - DOWNLOAD_FOLDER  -> download_folder config option
  - WEEKLY_FLOW_FOLDER -> download_folder/weekly-flow

This lets the entrypoint chown the real (container-internal) /app/backend/data
unmolested, while node writes persistent data directly to the HA share paths.
This commit is contained in:
petruknw
2026-05-20 23:17:45 +10:00
parent a089e5271b
commit 0808883159

View File

@@ -9,15 +9,15 @@ DATA_FOLDER=$(bashio::config 'data_folder')
# Ensure host-side directories exist
mkdir -p "${DOWNLOAD_FOLDER}" "${DATA_FOLDER}"
# Symlink HA share paths into the locations Aurral expects internally
rm -rf /app/downloads
ln -sf "${DOWNLOAD_FOLDER}" /app/downloads
rm -rf /app/backend/data
ln -sf "${DATA_FOLDER}" /app/backend/data
bashio::log.info "Starting Aurral"
bashio::log.info " Downloads : ${DOWNLOAD_FOLDER}"
bashio::log.info " Data : ${DATA_FOLDER}"
bashio::log.info " Downloads : ${DOWNLOAD_FOLDER}"
# Use Aurral's native env vars to redirect paths to HA share locations.
# This avoids symlinks into host-mounted paths which the upstream
# docker-entrypoint.sh cannot chown (Operation not permitted).
export AURRAL_DATA_DIR="${DATA_FOLDER}"
export DOWNLOAD_FOLDER="${DOWNLOAD_FOLDER}"
export WEEKLY_FLOW_FOLDER="${DOWNLOAD_FOLDER}/weekly-flow"
exec node /app/backend/server.js