feat: pre-validate custom nginx.conf.sigil during core-post-extract

Renders the user-supplied nginx.conf.sigil via sigil into a tmp file and runs `nginx -t` against a wrapped copy as soon as the template is extracted from the source tree, so syntactically invalid templates abort the deploy before the build phase runs. Skipped when `proxy-type` is not `nginx`, when `disable-custom-config=true`, or when no custom template was extracted. Closes #7827.
This commit is contained in:
Jose Diaz-Gonzalez
2026-04-29 04:22:56 -04:00
parent 9b6c32f39c
commit 63b809f64c
6 changed files with 315 additions and 124 deletions

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env bash
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/internal-functions"
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
@@ -49,6 +50,8 @@ trigger-nginx-vhosts-core-post-extract() {
else
fn-nginx-vhosts-copy-from-directory "$APP" "$SOURCECODE_WORK_DIR" "$CONF_SIGIL_PATH"
fi
fn-nginx-vhosts-pre-validate-custom-template "$APP"
}
trigger-nginx-vhosts-core-post-extract "$@"