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 <noreply@anthropic.com>

* 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 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alexandre
2026-09-28 13:36:29 +02:00
committed by GitHub
parent 9dac479dac
commit d271856a3b
6 changed files with 35 additions and 20 deletions

View File

@@ -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`

View File

@@ -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

View File

@@ -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]"

View File

@@ -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

View File

@@ -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"

View File

@@ -2,7 +2,7 @@
# shellcheck shell=bash
set -e
CONFIGSOURCE="/config/addons_config/fireflyiii_fints_importer"
CONFIGSOURCE="/config/configurations"
#################
# CONFIG IMPORT #