Compare commits

..

No commits in common. "3fd395a23fde812b406db1b9167b9f1e1f7ec294" and "ea40385dccde2be7da1bdea9334feec0e26e85b0" have entirely different histories.

3 changed files with 0 additions and 47 deletions

View File

@ -1,10 +0,0 @@
[Unit]
Description=Certbot certificate renewal for Keycloak
Wants=certbot-keycloak.timer
[Service]
ExecStart=/opt/certbot/certbot-keycloak.sh
WorkingDirectory=/opt/certbot
[Install]
WantedBy=multi-user.target

View File

@ -1,26 +0,0 @@
#!/bin/bash
CERTBOT_VER=v1.30.0
CNT=keycloak_nginx_proxy
DOM=acceso.txs.es
NGINX=/opt/nginx-proxy
cd /opt/certbot
docker run --rm \
-v $(pwd)/conf:/etc/letsencrypt \
-v $(pwd)/var:/var/lib/letsencrypt \
-v $(pwd)/log:/var/log/letsencrypt \
-v $NGINX/acme:/acme \
certbot/certbot:$CERTBOT_VER certonly -n --webroot -w /acme -d $DOM
## Check if the Certbot execution modified the certificate in the expected path, then
## copy the new one to the NGINX install folder and restart its container.
cmp $NGINX/certs/keycloak-cert.pem conf/live/$DOM/fullchain.pem </dev/null >&0 2>&0
if [ $? -ne 0 ]; then
echo "Updating certificate in $CNT container"
cp -afL conf/live/$DOM/fullchain.pem $NGINX/certs/keycloak-cert.pem
cp -afL conf/live/$DOM/privkey.pem $NGINX/certs/keycloak-key.pem
docker restart -t 2 $CNT
else
echo "No new certificates detected: omitting installation in $CNT container"
fi

View File

@ -1,11 +0,0 @@
[Unit]
Description=Run certbot-keycloak service every 5 days since the last time the unit was activated
Requires=certbot-keycloak.service
[Timer]
Unit=certbot-keycloak.service
OnUnitInactiveSec=5days
AccuracySec=12h
[Install]
WantedBy=timers.target