diff --git a/maintainerr/CHANGELOG.md b/maintainerr/CHANGELOG.md index 81edfeffd..d16c4f1a2 100644 --- a/maintainerr/CHANGELOG.md +++ b/maintainerr/CHANGELOG.md @@ -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) diff --git a/maintainerr/config.yaml b/maintainerr/config.yaml index 30adc5bda..636cb4860 100644 --- a/maintainerr/config.yaml +++ b/maintainerr/config.yaml @@ -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]" diff --git a/maintainerr/rootfs/ha_entrypoint.sh b/maintainerr/rootfs/ha_entrypoint.sh index ba0dbe693..0ca852ab8 100755 --- a/maintainerr/rootfs/ha_entrypoint.sh +++ b/maintainerr/rootfs/ha_entrypoint.sh @@ -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}..."