Merge pull request #4121 from dokku/4087-nginx-extract-disable
Add ability to disable custom ninx.conf.sigil extraction
This commit is contained in:
@@ -41,6 +41,7 @@ cmd-nginx-report-single() {
|
||||
"--nginx-access-log-path: $(fn-nginx-access-log-path "$APP")"
|
||||
"--nginx-bind-address-ipv4: $(fn-plugin-property-get-default "nginx" "$APP" "bind-address-ipv4" "")"
|
||||
"--nginx-bind-address-ipv6: $(fn-plugin-property-get-default "nginx" "$APP" "bind-address-ipv6" "::")"
|
||||
"--nginx-disable-custom-config: $(fn-plugin-property-get-default "nginx" "$APP" "disable-custom-config" "false")"
|
||||
"--nginx-error-log-path: $(fn-nginx-error-log-path "$APP")"
|
||||
"--nginx-hsts: $(fn-plugin-property-get-default "nginx" "$APP" "hsts" "true")"
|
||||
"--nginx-hsts-include-subdomains: $(fn-plugin-property-get-default "nginx" "$APP" "hsts-include-subdomains" "true")"
|
||||
|
||||
@@ -198,6 +198,11 @@ get_custom_nginx_template() {
|
||||
local IMAGE_TAG="$(get_running_image_tag "$APP")"
|
||||
local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
|
||||
local NGINX_TEMPLATE_NAME="nginx.conf.sigil"
|
||||
local DISABLE_CUSTOM_CONFIG="$(fn-plugin-property-get-default "nginx" "$APP" "disable-custom-config" "false")"
|
||||
|
||||
if [[ "$DISABLE_CUSTOM_CONFIG" == "true" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
copy_from_image "$IMAGE" "$NGINX_TEMPLATE_NAME" "$DESTINATION_FILE" 2>/dev/null || true
|
||||
}
|
||||
|
||||
@@ -9,13 +9,13 @@ cmd-nginx-set() {
|
||||
declare cmd="nginx:set"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1" KEY="$2" VALUE="$3"
|
||||
local VALID_KEYS=("access-log-path" "bind-address-ipv4" "bind-address-ipv6" "error-log-path" "hsts" "hsts-include-subdomains" "hsts-preload" "hsts-max-age" "proxy-read-timeout")
|
||||
local VALID_KEYS=("access-log-path" "bind-address-ipv4" "bind-address-ipv6" "disable-custom-config" "error-log-path" "hsts" "hsts-include-subdomains" "hsts-preload" "hsts-max-age" "proxy-read-timeout")
|
||||
|
||||
[[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
|
||||
[[ -z "$KEY" ]] && dokku_log_fail "No key specified"
|
||||
|
||||
if ! fn-in-array "$KEY" "${VALID_KEYS[@]}"; then
|
||||
dokku_log_fail "Invalid key specified, valid keys include: access-log-path, bind-address-ipv4, bind-address-ipv6, error-log-path, hsts, hsts-include-subdomains, hsts-preload, hsts-max-age, proxy-read-timeout"
|
||||
dokku_log_fail "Invalid key specified, valid keys include: access-log-path, bind-address-ipv4, bind-address-ipv6, disable-custom-config, error-log-path, hsts, hsts-include-subdomains, hsts-preload, hsts-max-age, proxy-read-timeout"
|
||||
fi
|
||||
|
||||
if [[ -n "$VALUE" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user