From afb7970b87da2ea1d539b76e296ac546a08a1623 Mon Sep 17 00:00:00 2001 From: Jared Hampson Date: Fri, 14 Jul 2023 21:26:13 -0500 Subject: [PATCH] Add ability to enable or disable startup debugging --- nginx_proxy/CHANGELOG.md | 4 ++++ nginx_proxy/config.json | 2 +- nginx_proxy/rootfs/run.sh | 14 +++++++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/nginx_proxy/CHANGELOG.md b/nginx_proxy/CHANGELOG.md index 84e0c98..1d1ca29 100644 --- a/nginx_proxy/CHANGELOG.md +++ b/nginx_proxy/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 5.0.3 + +Make enabling startup debugging configurable + ## 5.0.2 Add debugging for startup error diff --git a/nginx_proxy/config.json b/nginx_proxy/config.json index 2f3adea..539908e 100644 --- a/nginx_proxy/config.json +++ b/nginx_proxy/config.json @@ -1,6 +1,6 @@ { "name": "NGINX Home Assistant SSL proxy with WAF", - "version": "5.0.2", + "version": "5.0.3", "slug": "nginx_proxy_waf", "description": "An SSL/TLS proxy", "url": "https://github.com/jhampson-dbre/addon-nginx-proxy-waf", diff --git a/nginx_proxy/rootfs/run.sh b/nginx_proxy/rootfs/run.sh index c8c2993..f4eb625 100755 --- a/nginx_proxy/rootfs/run.sh +++ b/nginx_proxy/rootfs/run.sh @@ -1,5 +1,17 @@ #!/usr/bin/with-contenv bashio -set -ex +set -e + +# If there is a problem loading options, +# then we need verbose output to troubleshoot. +# But if the options aren't loading, then we +# can't rely on options config to enable debug +# so we toggle debug with a touch file instead. +DEBUG_TOUCH_FILE=/share/nginx_proxy_waf.debug + +if ! bashio::fs.file_exists "${DEBUG_TOUCH_FILE}"; then + bashio::log.info "Addon startup debug is enabled..." + set -x +fi DHPARAMS_PATH=/data/dhparams.pem