mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-04-05 21:56:27 +02:00
Fix maintainerr config lost after restart: use persistent /addon_configs/maintainerr path
The entrypoint was setting DATA_DIR="/config" which is NOT a persistent path in HA addon containers using addon_config:rw with init: false. Changed to /addon_configs/maintainerr (the persistent path mapped by addon_config:rw in config.yaml), matching the pattern used by the cleanuparr addon. Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/40b7927f-cd03-4b83-a80a-ad56bd6dce32 Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
|
||||
## 3.2.0-2 (2026-03-31)
|
||||
- Fix configuration lost after container restart by using persistent addon_config directory
|
||||
|
||||
## 3.2.0 (2026-03-28)
|
||||
- Update to latest version from maintainerr/maintainerr (changelog : https://github.com/maintainerr/maintainerr/releases)
|
||||
|
||||
|
||||
@@ -87,5 +87,5 @@ schema:
|
||||
TZ: str?
|
||||
slug: maintainerr
|
||||
url: https://github.com/alexbelgium/hassio-addons/tree/master/maintainerr
|
||||
version: "3.2.0"
|
||||
version: "3.2.0-2"
|
||||
webui: "[PROTO:ssl]://[HOST]:[PORT:6246]"
|
||||
|
||||
@@ -24,17 +24,26 @@ if [ -d /etc/cont-init.d ]; then
|
||||
fi
|
||||
|
||||
# ─── Setup persistent data directory ─────────────────────────────────────────
|
||||
# /opt/data is a Docker VOLUME in the upstream image and cannot be removed.
|
||||
# Maintainerr supports the DATA_DIR env var to redirect data storage.
|
||||
DATA_DIR="/config"
|
||||
echo "[Maintainerr] Setting up data directory: $DATA_DIR"
|
||||
mkdir -p "$DATA_DIR"
|
||||
# Only chown on first run to avoid slow startup on large directories
|
||||
if [ ! -f "$DATA_DIR/.initialized" ]; then
|
||||
chown -R node:node "$DATA_DIR"
|
||||
touch "$DATA_DIR/.initialized"
|
||||
# /opt/data is a Docker VOLUME in the upstream image; it is NOT persistent
|
||||
# across addon updates/reinstalls in HA. Use the addon_config directory
|
||||
# which is mapped by "addon_config:rw" in config.yaml and survives restarts.
|
||||
HA_DATA_DIR="/addon_configs/maintainerr"
|
||||
echo "[Maintainerr] Setting up data directory: $HA_DATA_DIR"
|
||||
mkdir -p "$HA_DATA_DIR"
|
||||
|
||||
# Copy any seed / initial data from the upstream volume on first run
|
||||
if [ -d /opt/data ] && [ ! -f "$HA_DATA_DIR/.initialized" ]; then
|
||||
cp -rn /opt/data/. "$HA_DATA_DIR/" 2>/dev/null || true
|
||||
fi
|
||||
export DATA_DIR
|
||||
|
||||
# Only chown on first run to avoid slow startup on large directories
|
||||
if [ ! -f "$HA_DATA_DIR/.initialized" ]; then
|
||||
chown -R node:node "$HA_DATA_DIR"
|
||||
touch "$HA_DATA_DIR/.initialized"
|
||||
fi
|
||||
|
||||
# Tell Maintainerr to use the persistent directory
|
||||
export DATA_DIR="$HA_DATA_DIR"
|
||||
|
||||
# ─── Start Maintainerr as unprivileged node user ─────────────────────────────
|
||||
echo "[Maintainerr] Starting application on port ${UI_PORT:-6246}..."
|
||||
|
||||
Reference in New Issue
Block a user