From d271856a3bc41e4509f9a341ac6c2a8cc4867980 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Mon, 28 Sep 2026 13:36:29 +0200 Subject: [PATCH] fix(fireflyiii_fints_importer): stop the configurations folder nesting inside itself; move storage to addon_config (#3094) * fix(fireflyiii_fints_importer): stop the configurations folder nesting inside itself /data persists across restarts, so from the second boot on `ln -sf $CONFIGSOURCE /data/configurations` dereferenced the existing link and created $CONFIGSOURCE/fireflyiii_fints_importer -> itself. The app then listed that entry as a configuration and file_get_contents() failed on it (#3091). Use ln -sfn, remove the leftover self-link, and drop the dead copy blocks (they tested -f on directories) and the /app/configurations link, which made the app list every configuration twice. Fixes #3091 Co-Authored-By: Claude Opus 5.5 * feat(fireflyiii_fints_importer): store configurations in addon_config Map app_config instead of config and keep configurations in /config/configurations (a subfolder, because the app lists every file in its configurations folder and 01-custom_script.sh places the autoscript in /config). 00-migrate_files.sh moves the old /homeassistant/addons_config/fireflyiii_fints_importer contents there once, dropping the self-link from #3091, and moves the autoscript, as free_games_claimer and nextcloud do. Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 --- fireflyiii_fints_importer/CHANGELOG.md | 5 +++++ fireflyiii_fints_importer/README.md | 6 ++++-- fireflyiii_fints_importer/config.yaml | 5 +++-- .../etc/cont-init.d/00-migrate_files.sh | 19 +++++++++++++++++++ .../rootfs/etc/cont-init.d/20-folders.sh | 18 +++--------------- .../rootfs/etc/cont-init.d/99-run.sh | 2 +- 6 files changed, 35 insertions(+), 20 deletions(-) create mode 100755 fireflyiii_fints_importer/rootfs/etc/cont-init.d/00-migrate_files.sh diff --git a/fireflyiii_fints_importer/CHANGELOG.md b/fireflyiii_fints_importer/CHANGELOG.md index 1f2597a594..e77d2124fb 100644 --- a/fireflyiii_fints_importer/CHANGELOG.md +++ b/fireflyiii_fints_importer/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.3.0.8 (28-09-2026) + +- Fix the configurations folder nesting inside itself on every restart, which made the web UI show `ConfigurationFactory.php` errors (#3091). +- Configurations now live in the add-on config folder, `/addon_configs/xxx_fireflyiii_fints_importer/configurations`. Files in the previous location `/homeassistant/addons_config/fireflyiii_fints_importer` are moved there automatically on first start, and the old folder is marked with a `migrated` file. A custom `addons_autoscripts/fireflyiii-fints-importer.sh` is moved to the add-on config folder as well. + ## 1.3.0.7 (23-09-2026) - Rebuilt against the current upstream `benkl/firefly-iii-fints-importer` diff --git a/fireflyiii_fints_importer/README.md b/fireflyiii_fints_importer/README.md index f662270bef..3c6c3611dc 100644 --- a/fireflyiii_fints_importer/README.md +++ b/fireflyiii_fints_importer/README.md @@ -79,8 +79,10 @@ The `Updates` option allows you to schedule automatic imports: ### Configuration Storage -Bank configurations and import settings are stored in: -`/config/addons_config/fireflyiii_fints_importer/` +Bank configurations (`.json` files) and import settings are stored in the add-on config folder: +`/addon_configs/xxx_fireflyiii_fints_importer/configurations/` + +Files from the previous location `/config/addons_config/fireflyiii_fints_importer/` are moved there automatically on first start. For configuration file format, see: https://github.com/bnw/firefly-iii-fints-importer#storing-configurations diff --git a/fireflyiii_fints_importer/config.yaml b/fireflyiii_fints_importer/config.yaml index 8eadaf2d2f..b0cddf4775 100644 --- a/fireflyiii_fints_importer/config.yaml +++ b/fireflyiii_fints_importer/config.yaml @@ -70,7 +70,8 @@ environment: TRUSTED_PROXIES: "**" image: ghcr.io/alexbelgium/fireflyiii_fints_importer-{arch} map: - - config:rw + - app_config:rw + - homeassistant_config:rw - share:rw - ssl name: Firefly iii FinTS Importer @@ -89,5 +90,5 @@ schema: slug: fireflyiii_fints_importer udev: true url: https://github.com/alexbelgium/hassio-addons -version: 1.3.0.7 +version: 1.3.0.8 webui: "[PROTO:ssl]://[HOST]:[PORT:8080]" diff --git a/fireflyiii_fints_importer/rootfs/etc/cont-init.d/00-migrate_files.sh b/fireflyiii_fints_importer/rootfs/etc/cont-init.d/00-migrate_files.sh new file mode 100755 index 0000000000..c6ffdfe1f5 --- /dev/null +++ b/fireflyiii_fints_importer/rootfs/etc/cont-init.d/00-migrate_files.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bashio +# shellcheck shell=bash +set -e + +# Migrate files for new config location +slug="fireflyiii_fints_importer" +if [ -d "/homeassistant/addons_config/$slug" ] && [ ! -f "/homeassistant/addons_config/$slug/migrated" ]; then + bashio::log.warning "Migrating configurations" + # Self-referencing link left by previous versions + if [ -L "/homeassistant/addons_config/$slug/$slug" ]; then rm "/homeassistant/addons_config/$slug/$slug"; fi + mkdir -p /config/configurations + mv "/homeassistant/addons_config/$slug"/* /config/configurations/ || true + echo "Migrated to internal config folder accessible at /addon_configs/xxx_$slug/configurations" > "/homeassistant/addons_config/$slug/migrated" +fi + +if [ -f "/homeassistant/addons_autoscripts/fireflyiii-fints-importer.sh" ]; then + bashio::log.warning "Migrating autoscript" + mv /homeassistant/addons_autoscripts/fireflyiii-fints-importer.sh /config/ || true +fi diff --git a/fireflyiii_fints_importer/rootfs/etc/cont-init.d/20-folders.sh b/fireflyiii_fints_importer/rootfs/etc/cont-init.d/20-folders.sh index a272ca21fd..d53a79a979 100755 --- a/fireflyiii_fints_importer/rootfs/etc/cont-init.d/20-folders.sh +++ b/fireflyiii_fints_importer/rootfs/etc/cont-init.d/20-folders.sh @@ -2,25 +2,13 @@ # shellcheck shell=bash set -e -CONFIGSOURCE="/config/addons_config/fireflyiii_fints_importer" +CONFIGSOURCE="/config/configurations" # Create directory mkdir -p "$CONFIGSOURCE" -# If no file, provide example -if [ ! "$(ls -A "${CONFIGSOURCE}")" ] && [ -f /data/configurations ]; then - cp -r /data/configurations/* "$CONFIGSOURCE"/ || true - rm -r /data/configurations -fi - -if [ ! "$(ls -A "${CONFIGSOURCE}")" ] && [ -f /app/configurations ]; then - cp -r /app/configurations/* "$CONFIGSOURCE"/ || true - rm -r /app/configurations -fi - -ln -sf "$CONFIGSOURCE" /data/configurations -mkdir -p /app -ln -sf "$CONFIGSOURCE" /app/configurations +# The app reads data/configurations; -n replaces the link kept in /data instead of nesting a new one inside it +ln -sfn "$CONFIGSOURCE" /data/configurations # Make sure permissions are right chown -R "$(id -u):$(id -g)" "$CONFIGSOURCE" diff --git a/fireflyiii_fints_importer/rootfs/etc/cont-init.d/99-run.sh b/fireflyiii_fints_importer/rootfs/etc/cont-init.d/99-run.sh index 3bc0959550..9a3afb8ffa 100755 --- a/fireflyiii_fints_importer/rootfs/etc/cont-init.d/99-run.sh +++ b/fireflyiii_fints_importer/rootfs/etc/cont-init.d/99-run.sh @@ -2,7 +2,7 @@ # shellcheck shell=bash set -e -CONFIGSOURCE="/config/addons_config/fireflyiii_fints_importer" +CONFIGSOURCE="/config/configurations" ################# # CONFIG IMPORT #