Files
hassio-addons/fireflyiii_data_importer/rootfs/templates/cronupdate
copilot-swe-agent[bot] 9893ad41dc Fix cron auto-import env vars and health check log spam for Firefly III Data Importer
- Source /etc/environment in cronupdate to load addon env vars (FIREFLY_III_URL, etc.)
- Persist cron-needed vars (JSON_CONFIGURATION_DIR, IMPORT_DIR_WHITELIST, etc.) to /etc/environment
- Fix inverted nginx map values that caused health check logs to spam while suppressing real requests

Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
2026-02-23 12:33:50 +00:00

20 lines
894 B
Plaintext

#!/usr/bin/env bashio
# shellcheck shell=bash
set -e
# Source environment variables for cron context
# shellcheck disable=SC1091
if [ -f /etc/environment ]; then set -a; . /etc/environment; set +a; fi
CONFIGSOURCE="$(bashio::config "CONFIG_LOCATION")"
(
bashio::log.info "Running update according to defined schedule. Files located in $CONFIGSOURCE/import_files will be imported. If /config, it is accessible in the folder /addon_configs/xxx-firefly_data_importer when using the Filebrowser addon"
if bashio::config.true 'silent'; then
bashio::log.warning "Silent mode activated. Only errors will be shown. Please disable in addon options if you need to debug"
/usr/local/bin/php /var/www/html/artisan importer:auto-import "$CONFIGSOURCE/import_files" >/dev/null
else
/usr/local/bin/php /var/www/html/artisan importer:auto-import "$CONFIGSOURCE/import_files"
fi
) &>/proc/1/fd/1