mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-17 19:40: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')
|
DOWNLOAD_FOLDER=$(bashio::config 'download_folder')
|
||||||
|
|
||||||
# Ensure host-side download directory exists
|
# Ensure persistent directories exist
|
||||||
mkdir -p "${DOWNLOAD_FOLDER}"
|
mkdir -p "${DOWNLOAD_FOLDER}"
|
||||||
|
mkdir -p /config/data
|
||||||
|
|
||||||
bashio::log.info "Starting Aurral"
|
bashio::log.info "Starting Aurral"
|
||||||
bashio::log.info " Data : /config/data (HA addon_config)"
|
bashio::log.info " Data : /config/data (HA addon_config)"
|
||||||
bashio::log.info " Downloads : ${DOWNLOAD_FOLDER}"
|
bashio::log.info " Downloads : ${DOWNLOAD_FOLDER}"
|
||||||
|
|
||||||
# AURRAL_DATA_DIR tells Aurral to write its DB/config to /config/data
|
# PUID=0/PGID=0 tells the upstream docker-entrypoint.sh to skip the
|
||||||
# (HA's writable addon_config mount) instead of /app/backend/data.
|
# su-exec drop to nodejs (1001) and stay as root. HA addons always run
|
||||||
# This avoids any symlink that docker-entrypoint.sh might try to chown.
|
# 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 AURRAL_DATA_DIR="/config/data"
|
||||||
export DOWNLOAD_FOLDER="${DOWNLOAD_FOLDER}"
|
export DOWNLOAD_FOLDER="${DOWNLOAD_FOLDER}"
|
||||||
export WEEKLY_FLOW_FOLDER="${DOWNLOAD_FOLDER}/weekly-flow"
|
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