Merge pull request #6992 from dokku/nginx-template-logging

feat: add logging when hsts nginx config is not using built-in template
This commit is contained in:
Jose Diaz-Gonzalez
2024-07-13 17:59:28 -04:00
committed by GitHub
2 changed files with 6 additions and 1 deletions

View File

@@ -226,6 +226,7 @@ nginx_build_config() {
CUSTOM_NGINX_TEMPLATE="$(plugn trigger nginx-app-template-source "$APP" "app-config")"
if [[ -n "$CUSTOM_NGINX_TEMPLATE" ]]; then
local NGINX_TEMPLATE_SOURCE="plugin-supplied"
NGINX_TEMPLATE="$CUSTOM_NGINX_TEMPLATE"
fi

View File

@@ -460,9 +460,13 @@ fn-nginx-vhosts-manage-hsts() {
local HSTS_PRELOAD="$(fn-nginx-computed-hsts-preload "$APP")"
local NGINX_HSTS_CONF="$DOKKU_ROOT/$APP/nginx.conf.d/hsts.conf"
local HSTS_TEMPLATE="$PLUGIN_AVAILABLE_PATH/nginx-vhosts/templates/hsts.conf.sigil"
local NGINX_TEMPLATE_SOURCE="built-in"
local is_custom_hsts_template=false
CUSTOM_HSTS_TEMPLATE="$(plugn trigger nginx-app-template-source "$APP" "hsts-config")"
if [[ -n "$CUSTOM_HSTS_TEMPLATE" ]]; then
is_custom_hsts_template=true
NGINX_TEMPLATE_SOURCE="plugin-supplied"
HSTS_TEMPLATE="$CUSTOM_HSTS_TEMPLATE"
fi
@@ -471,7 +475,7 @@ fn-nginx-vhosts-manage-hsts() {
return
fi
dokku_log_verbose_quiet "Enabling HSTS"
dokku_log_verbose_quiet "Enabling HSTS (using $NGINX_TEMPLATE_SOURCE template)"
local HSTS_HEADERS=""
if [[ -n "$HSTS_MAX_AGE" ]]; then
HSTS_HEADERS="max-age=$HSTS_MAX_AGE"