Merge pull request #8602 from dokku/8597-caddy-haproxy-traefik-accept-per-app-set-but-report-only-returns-global-value

This commit is contained in:
Jose Diaz-Gonzalez
2026-05-11 01:04:14 -04:00
committed by GitHub
6 changed files with 62 additions and 2 deletions

View File

@@ -11,6 +11,7 @@ cmd-caddy-set() {
declare APP="$1" KEY="$2" VALUE="$3"
local VALID_KEYS=("image" "letsencrypt-email" "letsencrypt-server" "log-level" "polling-interval" "tls-internal")
local GLOBAL_KEYS=("image" "letsencrypt-email" "letsencrypt-server" "log-level" "polling-interval")
local GLOBAL_ONLY_KEYS=("image" "letsencrypt-email" "letsencrypt-server" "log-level" "polling-interval")
[[ -z "$KEY" ]] && dokku_log_fail "No key specified"
@@ -25,6 +26,10 @@ cmd-caddy-set() {
verify_app_name "$APP"
fi
if fn-in-array "$KEY" "${GLOBAL_ONLY_KEYS[@]}" && [[ "$APP" != "--global" ]]; then
dokku_log_fail "The key '$KEY' can only be set globally"
fi
if [[ -n "$VALUE" ]]; then
dokku_log_info2_quiet "Setting ${KEY} to ${VALUE}"
fn-plugin-property-write "caddy" "$APP" "$KEY" "$VALUE"