fix: haproxy letsencrypt integration and upgrade EasyHAProxy to 6.5.1
The letsencrypt integration set EASYHAPROXY_LETSENCRYPT_EMAIL (with a stray quote) and a letsencrypt label, which EasyHAProxy has not read since before 4.6.0. With an email set, http redirected to https and nothing answered on 443. - Pass EASYHAPROXY_CERTBOT_EMAIL and EASYHAPROXY_CERTBOT_SERVER. - Label the app with certbot=true on its http definition: EasyHAProxy requests the certificate and serves https itself, so the separate 443 definition goes. https labels are only added when a letsencrypt email is set, as documented. - Keep the certificates in /var/lib/dokku/data/haproxy. - Turn the stats page off with HAPROXY_STATS_ENABLE=false. - Upgrade EasyHAProxy from 6.1.1 to 6.5.1.
This commit is contained in:
1 parent
898924e541
commit
4887cf458e
6 files changed
+19
-20
No files matched your search
@@ -103,22 +103,11 @@ trigger-haproxy-vhosts-docker-args-process-deploy() {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -n "$proxy_container_https_port" ]] || [[ -n "$proxy_container_https_port_candidate" ]]; then
|
||||
if [[ -z "$proxy_container_https_port" ]]; then
|
||||
dokku_log_warn "Warning: https:443 port mapping not found"
|
||||
dokku_log_warn "Utilizing first https port mapping, http:$proxy_host_https_port_candidate:$proxy_container_https_port_candidate"
|
||||
proxy_container_https_port="$proxy_container_https_port_candidate"
|
||||
fi
|
||||
|
||||
# EasyHAProxy serves https itself: it requests the certificate (certbot), terminates
|
||||
# TLS on 443 and forwards to the same container port as http
|
||||
if [[ -n "$letsencrypt_email" ]] && { [[ -n "$proxy_container_https_port" ]] || [[ -n "$proxy_container_https_port_candidate" ]]; }; then
|
||||
output="$output --label haproxy.$APP-$PROC_TYPE.redirect_ssl=true"
|
||||
output="$output --label haproxy.$APP-$PROC_TYPE-https.localport=$proxy_container_https_port"
|
||||
output="$output --label haproxy.$APP-$PROC_TYPE-https.letsencrypt=true"
|
||||
output="$output --label haproxy.$APP-$PROC_TYPE-https.mode=http"
|
||||
output="$output --label haproxy.$APP-$PROC_TYPE-https.port=443"
|
||||
|
||||
if [[ -n "$haproxy_domains" ]]; then
|
||||
output="$output --label haproxy.$APP-$PROC_TYPE-https.host=$haproxy_domains"
|
||||
fi
|
||||
output="$output --label haproxy.$APP-$PROC_TYPE.certbot=true"
|
||||
else
|
||||
output="$output --label haproxy.$APP-$PROC_TYPE.redirect_ssl=false"
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user