mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-17 22:31:49 +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)
|
## 3.2.0 (2026-03-28)
|
||||||
- Update to latest version from maintainerr/maintainerr (changelog : https://github.com/maintainerr/maintainerr/releases)
|
- Update to latest version from maintainerr/maintainerr (changelog : https://github.com/maintainerr/maintainerr/releases)
|
||||||
|
|
||||||
|
|||||||
@@ -87,5 +87,5 @@ schema:
|
|||||||
TZ: str?
|
TZ: str?
|
||||||
slug: maintainerr
|
slug: maintainerr
|
||||||
url: https://github.com/alexbelgium/hassio-addons/tree/master/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]"
|
webui: "[PROTO:ssl]://[HOST]:[PORT:6246]"
|
||||||
|
|||||||
@@ -24,17 +24,26 @@ if [ -d /etc/cont-init.d ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# ─── Setup persistent data directory ─────────────────────────────────────────
|
# ─── Setup persistent data directory ─────────────────────────────────────────
|
||||||
# /opt/data is a Docker VOLUME in the upstream image and cannot be removed.
|
# /opt/data is a Docker VOLUME in the upstream image; it is NOT persistent
|
||||||
# Maintainerr supports the DATA_DIR env var to redirect data storage.
|
# across addon updates/reinstalls in HA. Use the addon_config directory
|
||||||
DATA_DIR="/config"
|
# which is mapped by "addon_config:rw" in config.yaml and survives restarts.
|
||||||
echo "[Maintainerr] Setting up data directory: $DATA_DIR"
|
HA_DATA_DIR="/addon_configs/maintainerr"
|
||||||
mkdir -p "$DATA_DIR"
|
echo "[Maintainerr] Setting up data directory: $HA_DATA_DIR"
|
||||||
# Only chown on first run to avoid slow startup on large directories
|
mkdir -p "$HA_DATA_DIR"
|
||||||
if [ ! -f "$DATA_DIR/.initialized" ]; then
|
|
||||||
chown -R node:node "$DATA_DIR"
|
# Copy any seed / initial data from the upstream volume on first run
|
||||||
touch "$DATA_DIR/.initialized"
|
if [ -d /opt/data ] && [ ! -f "$HA_DATA_DIR/.initialized" ]; then
|
||||||
|
cp -rn /opt/data/. "$HA_DATA_DIR/" 2>/dev/null || true
|
||||||
fi
|
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 ─────────────────────────────
|
# ─── Start Maintainerr as unprivileged node user ─────────────────────────────
|
||||||
echo "[Maintainerr] Starting application on port ${UI_PORT:-6246}..."
|
echo "[Maintainerr] Starting application on port ${UI_PORT:-6246}..."
|
||||||
|
|||||||
Reference in New Issue
Block a user