fix: do not generate https urls when there is no certificate available

This commit is contained in:
Jose Diaz-Gonzalez
2025-09-07 22:04:57 -04:00
parent aa5c365e93
commit ca32172e1d

View File

@@ -147,10 +147,14 @@ fn-domains-generate-urls-from-config() {
done
shopt -u nullglob
elif [[ -n "$APP_PORT_MAP" ]]; then
CERTS_EXIST="$(plugn trigger certs-exists "$APP")"
local port_map
while IFS= read -r port_map; do
local scheme="$(awk -F ':' '{ print $1 }' <<<"$port_map")"
local listen_port="$(awk -F ':' '{ print $2 }' <<<"$port_map")"
if [[ "$CERTS_EXIST" != "true" ]] && [[ "$scheme" == "https" ]]; then
continue
fi
fn-domains-generate-url "$scheme" "$VHOST" "$listen_port"
done <<<"$APP_PORT_MAP"
else