mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
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:
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user