change variable names

This commit is contained in:
2025-08-13 13:54:43 +03:00
parent 5e98593f0a
commit aa341c0d62
4 changed files with 9 additions and 9 deletions

View File

@@ -7,8 +7,8 @@ services:
image: registry.bitdeals.org/certbot
restart: unless-stopped
environment:
- DOMAIN=
- EMAIL= # optional for notifications
- CERTBOT_DOMAIN=
- CERTBOT_EMAIL= # optional for notifications
volumes:
- certificates:/etc/certificates
- letsencrypt:/etc/letsencrypt

View File

@@ -11,20 +11,20 @@ if [ ! -f /etc/certificates/site.pem ]; then
fi
# check e-mail for letsencrypt notifications
if [ -n "$EMAIL" ]; then
CERTBOT_OPTS="--email $EMAIL"
if [ -n "$CERTBOT_EMAIL" ]; then
CERTBOT_OPTS="--email $CERTBOT_EMAIL"
else
CERTBOT_OPTS="--register-unsafely-without-email"
fi
if [ -n "$DOMAIN" ]; then
if [ -n "$CERTBOT_DOMAIN" ]; then
# Request certificate
certbot certonly --standalone \
--non-interactive --agree-tos --http-01-port=380 \
"$CERTBOT_OPTS" \
--cert-name "$DOMAIN" \
-d "$DOMAIN"
--cert-name "$CERTBOT_DOMAIN" \
-d "$CERTBOT_DOMAIN"
# Concatenate certificates
. $(dirname $0)/2-concatenate-cert.sh

View File

@@ -1,7 +1,7 @@
#!/bin/sh
# Certificates exist
if [ -n "$DOMAIN" -a -d /etc/letsencrypt/live/"$DOMAIN" ]; then
if [ -n "$CERTBOT_DOMAIN" -a -d /etc/letsencrypt/live/"$CERTBOT_DOMAIN" ]; then
# Check certificates and renew them
certbot renew --http-01-port=380

View File

@@ -1,6 +1,6 @@
#!/bin/sh
cd /etc/letsencrypt/live/"$DOMAIN"
cd /etc/letsencrypt/live/"$CERTBOT_DOMAIN"
if [ -f fullchain.pem -a -f privkey.pem ]; then
cat fullchain.pem privkey.pem > /etc/certificates/site.pem