fix: restore default domains and reset proxy ports on vhost enable
Re-enabling vhost (via `proxy:enable`, `domains:enable`, or `domains:add` with no global VHOST) was leaving the app pinned to the random high port and the empty VHOST file from the previous disabled state, so the new catch-all vhost intercepted requests for the app's domain. The `domains-enable` trigger now restores default vhosts via `domains_enable`, and `pre-enable-vhost` clears any stored proxy ports so they can be recomputed to 80/443. Also fixes the netrc lookup in the `git:auth` test to read dokku's netrc file directly.
This commit is contained in:
3 files changed
+6
-6
No files matched your search
@@ -9,9 +9,9 @@ trigger-domains-domains-enable() {
|
|||||||
declare APP="$1" RESTART_APP="$2"
|
declare APP="$1" RESTART_APP="$2"
|
||||||
|
|
||||||
if [[ "$RESTART_APP" == "true" ]]; then
|
if [[ "$RESTART_APP" == "true" ]]; then
|
||||||
enable_app_vhost "$APP"
|
domains_enable "$APP"
|
||||||
else
|
else
|
||||||
enable_app_vhost "$APP" --no-restart
|
domains_enable "$APP" --no-restart
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,14 +13,14 @@ trigger-nginx-vhosts-pre-enable-vhost() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# only clear ports if they are port 80 or 443
|
# clear stored proxy ports so they can be recomputed for the enabled state
|
||||||
local PROXY_PORT=$(plugn trigger ports-get-property "$APP" "proxy-port")
|
local PROXY_PORT=$(plugn trigger ports-get-property "$APP" "proxy-port")
|
||||||
local PROXY_SSL_PORT=$(plugn trigger ports-get-property "$APP" "proxy-ssl-port")
|
local PROXY_SSL_PORT=$(plugn trigger ports-get-property "$APP" "proxy-ssl-port")
|
||||||
|
|
||||||
if [[ "$PROXY_PORT" == "80" ]]; then
|
if [[ -n "$PROXY_PORT" ]]; then
|
||||||
fn-plugin-property-delete "proxy" "$APP" "proxy-port"
|
fn-plugin-property-delete "proxy" "$APP" "proxy-port"
|
||||||
fi
|
fi
|
||||||
if [[ "$PROXY_SSL_PORT" == "443" ]]; then
|
if [[ -n "$PROXY_SSL_PORT" ]]; then
|
||||||
fn-plugin-property-delete "proxy" "$APP" "proxy-ssl-port"
|
fn-plugin-property-delete "proxy" "$APP" "proxy-ssl-port"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ teardown() {
|
|||||||
assert_success
|
assert_success
|
||||||
assert_output_contains "Setting netrc auth entry for host github.com"
|
assert_output_contains "Setting netrc auth entry for host github.com"
|
||||||
|
|
||||||
run /bin/bash -c "netrc get github.com"
|
run /bin/bash -c "netrc get --netrc-file ${DOKKU_ROOT}/.netrc github.com"
|
||||||
echo "output: $output"
|
echo "output: $output"
|
||||||
echo "status: $status"
|
echo "status: $status"
|
||||||
assert_success
|
assert_success
|
||||||
|
|||||||
Reference in new issue
Block a user