Open jasperf opened 2 months ago
Split matters into two crontabs, one to run the docker image command and one for reloading, but perhaps a renewal hook can be used in /etc/letsencrypt/renewal/example.com.conf
and this under
[renewalparams]:
renew_hook = systemctl reload nginx
But not sure if the Docker image picks up on that.
Using the hook in the Docker image seems to fail however
docker run -ti --rm \
-v "/etc/letsencrypt:/etc/letsencrypt" \
-w /etc/letsencrypt \
hsmade/certbot-transip \
certonly -n --dry-run -v \
-d '*.domain.com' -d 'domain.com' \
-a dns-transip \
--dns-transip-credentials /etc/letsencrypt/transip.ini \
--dns-transip-propagation-seconds 240 \
-m admin@domain.com \
--agree-tos \
--eff-email \
--post-hook "nginx -s reload"
Unable to find post-hook command nginx in the PATH.
(PATH is /usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /tmp/certbot-log-voxmd2q0/log or re-run Certbot with -v for more details.
But I guess that is because Nginx is on the host system.
No, I cannot add hook to host system /etc/letsencrypt/renewal/example.com.conf
either as .. Docker will not be able to read from it. So I think I have to stick to running Docker command as shell script via one cronjob and Nginx reload via another.
How do you do automated renewals?Wiht a shell script in a crontab run by root like:
Or do you use another way? Normaly the reload is done with a post script in the cronjob as root and like
Shell script not tested yet, but just wondering how you all take care of this.