ninedocker/misc/images/nineapache81/containers/nineapache/addcertif.sh

15 lines
511 B
Bash
Raw Normal View History

2024-10-26 12:16:37 +02:00
#!/bin/bash
if [[ $NINEAPACHE_LETSENCRYPT == 1 ]]
then
# On génère ou renouvel le certificat
echo "CERTIFICAT LETSENCRYPT"
certbot certonly --webroot -w /usr/local/apache2/htdocs -d ${WEB_URL} --non-interactive --agree-tos --email ${ADMIN_EMAIL}
# On supprime la conf ssl pour placer celle de letsencrypt en y placant la web_url
rm -f /etc/apache2/conf.d/ssl.conf
envsubst < "/nine/ssl.conf" > "/etc/apache2/conf.d/ssl.conf"
# On redemarre apache
httpd -k graceful
fi