mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-25 23:40:31 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user