Files
dokku/plugins/haproxy-vhosts/pre-restore
Jose Diaz-Gonzalez bbbe0e763d fix: do not start proxy implementations during server restore if they weren't manually started via the :start command
This change ensures users don't have unnecessary proxies starting on their servers and potentially have apps not routing correctly due to another proxy squatting on a port.

Closes #5846
2023-08-05 10:58:57 -04:00

21 lines
564 B
Bash
Executable File

#!/usr/bin/env bash
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/haproxy-vhosts/command-functions"
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
trigger-haproxy-pre-restore() {
declare desc="pre-restore the caddy proxy"
declare trigger="install"
if [[ "$(fn-plugin-property-get "haproxy" "--global" "proxy-status")" != "started" ]]; then
return
fi
if ! cmd-haproxy-start; then
dokku_log_warn "Failed to restore haproxy proxy, requests may not route as expected"
fi
}
trigger-haproxy-pre-restore "$@"