feat(install_site): handle multiple URL for certs

This commit is contained in:
ange 2024-02-08 15:01:03 +01:00
parent b640f953b2
commit d49c066585
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D
4 changed files with 20 additions and 21 deletions

View File

@ -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:

View File

@ -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"

View File

@ -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

5
todo
View File

@ -1,7 +1,6 @@
openvpn auto download config from mullvad?
https://docs.gitea.com/installation/install-with-docker#ssh-container-passthrough
mullvad config api download
docs
matrix auto init postgres config
matrix key server not matrix.org
- modoboa
- collabora