feat(install_site): handle multiple URL for certs
This commit is contained in:
parent
b640f953b2
commit
d49c066585
@ -4,6 +4,7 @@ services:
|
||||
build: install_site
|
||||
environment:
|
||||
- BASE_URL=subdomain.domain.tld
|
||||
- OTHER_URLS=subdomain1.domain.tld subdomain2.domain.tld
|
||||
- EMAIL=user@domain.tld
|
||||
volumes:
|
||||
- ./app_nginx.conf:/web/app.conf
|
||||
@ -19,4 +20,3 @@ volumes:
|
||||
external: true
|
||||
certbotroot:
|
||||
external: true
|
||||
config:
|
||||
|
@ -1,12 +1,20 @@
|
||||
#!/bin/sh -e
|
||||
#!/bin/bash -e
|
||||
|
||||
certbot certonly -n \
|
||||
--webroot \
|
||||
-w /var/www/certbot/ \
|
||||
--agree-tos \
|
||||
--no-eff-email \
|
||||
-m "$EMAIL" \
|
||||
CERTBOTCMD=(
|
||||
certbot certonly -n
|
||||
--webroot
|
||||
-w /var/www/certbot/
|
||||
--agree-tos
|
||||
--no-eff-email
|
||||
-m "$EMAIL"
|
||||
-d "$BASE_URL"
|
||||
)
|
||||
|
||||
for URL in $OTHER_URLS; do
|
||||
CERTBOTCMD+=(-d "$URL")
|
||||
done
|
||||
|
||||
"${CERTBOTCMD[@]}"
|
||||
|
||||
for f in *; do
|
||||
envsubst "$(env | xargs printf '$%s ')" < "$f" > "/sites/$f"
|
||||
|
@ -1,9 +1,10 @@
|
||||
---
|
||||
services:
|
||||
matrix_install_site:
|
||||
install_site:
|
||||
build: install_site
|
||||
environment:
|
||||
- BASE_URL=$MATRIX_BASE_URL
|
||||
- OTHER_URLS=$COTURN_BASE_URL
|
||||
- EMAIL
|
||||
volumes:
|
||||
- ./nginx.conf:/web/matrix.conf
|
||||
@ -12,15 +13,6 @@ services:
|
||||
- certbotroot:/var/www/certbot/
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
|
||||
coturn_install_site:
|
||||
build: install_site
|
||||
environment:
|
||||
- BASE_URL=$COTURN_BASE_URL
|
||||
- EMAIL
|
||||
volumes:
|
||||
- certs:/etc/letsencrypt/
|
||||
- certbotroot:/var/www/certbot/
|
||||
|
||||
db:
|
||||
image: docker.io/postgres:15
|
||||
restart: unless-stopped
|
||||
|
Loading…
Reference in New Issue
Block a user