This commit is contained in:
Yann Autissier
2022-12-22 02:57:43 +00:00
parent 2dec68807e
commit 94a749e229
27 changed files with 2182 additions and 29 deletions
+3 -3
View File
@@ -24,15 +24,15 @@ host-ssl-certs:
alpine sh -c "mkdir -p /host/htpasswd && chmod 700 /host/htpasswd \
; mkdir -p /host/certs && chmod 0700 /host/certs \
; [ -f /host/htpasswd/default.htpasswd ] \
|| echo "default:{PLAIN}$(shell head -c 15 /dev/random |base64)" > /host/htpasswd/default.htpasswd \
|| echo "${HOSTNAME}:{PLAIN}$(shell head -c 15 /dev/random |base64)" > /host/htpasswd/default.htpasswd \
; apk --no-cache add openssl \
; for domain in ${DOMAIN}; do \
[ -f /host/live/\$${domain}/privkey.pem ] \
&& openssl x509 -in /host/live/\$${domain}/fullchain.pem -noout -issuer 2>/dev/null |grep -iqv staging \
&& cp -L /host/live/\$${domain}/fullchain.pem /host/certs/\$${domain}-cert.pem \
&& cp -L /host/live/\$${domain}/privkey.pem /host/certs/\$${domain}-key.pem \
; if [ ! -f /host/certs/\$${domain}-key.pem ]; then \
apk --no-cache add openssl \
&& openssl genrsa -out /host/certs/\$${domain}-key.pem 2048 \
openssl genrsa -out /host/certs/\$${domain}-key.pem 2048 \
&& openssl req -key /host/certs/\$${domain}-key.pem -out /host/certs/\$${domain}-cert.pem \
-addext extendedKeyUsage=serverAuth \
-addext subjectAltName=DNS:\$${domain},DNS:*.\$${domain} \