Merge pull request #2525 from alexbelgium/copilot/fix-cron-auto-import-issue

Fix cron auto-import and health check log spam in Firefly III Data Importer
This commit is contained in:
Alexandre
2026-02-23 13:55:07 +01:00
committed by GitHub
5 changed files with 21 additions and 2 deletions

View File

@@ -1,4 +1,8 @@
## 2.1.1-2 (2026-02-23)
- Fix cron auto-import no longer triggering after env changes (https://github.com/alexbelgium/hassio-addons/issues/1839)
- Fix health check log spam in nginx
## 2.1.1 (2026-02-21)
- Update to latest version from firefly-iii/data-importer (changelog : https://github.com/firefly-iii/data-importer/releases)

View File

@@ -168,7 +168,7 @@ RUN \
\
# Handle Nginx configuration
if [ -f /etc/nginx/nginx.conf ]; then \
awk '/http \{/{print; print "map $http_user_agent $dontlog {\n default 0;\n \"~*HealthCheck\" 1;\n}\naccess_log /var/log/nginx/access.log combined if=$dontlog;"; next}1' /etc/nginx/nginx.conf > /etc/nginx/nginx.conf.new && \
awk '/http \{/{print; print "map $http_user_agent $loggable {\n default 1;\n \"~*HealthCheck\" 0;\n}\naccess_log /var/log/nginx/access.log combined if=$loggable;"; next}1' /etc/nginx/nginx.conf > /etc/nginx/nginx.conf.new && \
mv /etc/nginx/nginx.conf.new /etc/nginx/nginx.conf; \
fi

View File

@@ -101,5 +101,5 @@ schema:
slug: fireflyiii_data_importer
udev: true
url: https://github.com/alexbelgium/hassio-addons
version: "2.1.1"
version: "2.1.1-2"
webui: "[PROTO:ssl]://[HOST]:[PORT:8080]"

View File

@@ -25,6 +25,17 @@ export CAN_POST_FILES="$(bashio::config "CAN_POST_FILES")"
# shellcheck disable=SC2155
export CAN_POST_AUTOIMPORT="$(bashio::config "CAN_POST_AUTOIMPORT")"
# Persist variables to /etc/environment for cron jobs
{
[ -n "$JSON_CONFIGURATION_DIR" ] && echo "JSON_CONFIGURATION_DIR=\"$JSON_CONFIGURATION_DIR\""
echo "IMPORT_DIR_ALLOWLIST=\"$IMPORT_DIR_ALLOWLIST\""
echo "IMPORT_DIR_WHITELIST=\"$IMPORT_DIR_WHITELIST\""
echo "AUTO_IMPORT_SECRET=\"$AUTO_IMPORT_SECRET\""
echo "CAN_POST_FILES=\"$CAN_POST_FILES\""
echo "CAN_POST_AUTOIMPORT=\"$CAN_POST_AUTOIMPORT\""
} >> /etc/environment
chmod 600 /etc/environment
################
# CRON OPTIONS #
################

View File

@@ -2,6 +2,10 @@
# 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")"
(