mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-15 02:20:31 +02:00
fix: set PUID=0/PGID=0 so entrypoint stays as root and can write /config/data
This commit is contained in:
@@ -5,18 +5,23 @@
|
||||
|
||||
DOWNLOAD_FOLDER=$(bashio::config 'download_folder')
|
||||
|
||||
# Ensure host-side download directory exists
|
||||
# Ensure persistent directories exist
|
||||
mkdir -p "${DOWNLOAD_FOLDER}"
|
||||
mkdir -p /config/data
|
||||
|
||||
bashio::log.info "Starting Aurral"
|
||||
bashio::log.info " Data : /config/data (HA addon_config)"
|
||||
bashio::log.info " Downloads : ${DOWNLOAD_FOLDER}"
|
||||
|
||||
# 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.
|
||||
# PUID=0/PGID=0 tells the upstream docker-entrypoint.sh to skip the
|
||||
# su-exec drop to nodejs (1001) and stay as root. HA addons always run
|
||||
# as root so this is safe and ensures /config/data is writable.
|
||||
export PUID=0
|
||||
export PGID=0
|
||||
|
||||
# AURRAL_DATA_DIR redirects the DB/config to HA's addon_config mount.
|
||||
export AURRAL_DATA_DIR="/config/data"
|
||||
export DOWNLOAD_FOLDER="${DOWNLOAD_FOLDER}"
|
||||
export WEEKLY_FLOW_FOLDER="${DOWNLOAD_FOLDER}/weekly-flow"
|
||||
|
||||
exec node /app/server.js
|
||||
exec docker-entrypoint.sh node server.js
|
||||
|
||||
Reference in New Issue
Block a user