diff --git a/fireflyiii_data_importer/Dockerfile b/fireflyiii_data_importer/Dockerfile index 6a82d6ebc..764437b5d 100644 --- a/fireflyiii_data_importer/Dockerfile +++ b/fireflyiii_data_importer/Dockerfile @@ -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 diff --git a/fireflyiii_data_importer/rootfs/etc/cont-init.d/99-run.sh b/fireflyiii_data_importer/rootfs/etc/cont-init.d/99-run.sh index 1448cc1dc..7e5e1cbca 100755 --- a/fireflyiii_data_importer/rootfs/etc/cont-init.d/99-run.sh +++ b/fireflyiii_data_importer/rootfs/etc/cont-init.d/99-run.sh @@ -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 # ################ diff --git a/fireflyiii_data_importer/rootfs/templates/cronupdate b/fireflyiii_data_importer/rootfs/templates/cronupdate index 61de301cd..b9e8db10a 100644 --- a/fireflyiii_data_importer/rootfs/templates/cronupdate +++ b/fireflyiii_data_importer/rootfs/templates/cronupdate @@ -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")" (