thedevdojo/larasail

Help: certbot auto renew SSL certs?

sutcliffe121 opened this issue · 2 comments

Does Larasail setup certbot to auto renew SSL certifications?

If not, what is the best way to set this up? I have read different methods.

https://eff-certbot.readthedocs.io/en/stable/using.html#setting-up-automated-renewal says to run:

SLEEPTIME=$(awk 'BEGIN{srand(); print int(rand()*(3600+1))}'); echo "0 0,12 * * * root sleep $SLEEPTIME && certbot renew -q" | sudo tee -a /etc/crontab > /dev/null

https://www.nginx.com/blog/using-free-ssltls-certificates-from-lets-encrypt-with-nginx/ says:

$ crontab -e and add
0 12 * * * /usr/bin/certbot renew --quiet

Thanks in advance,

Hi @sutcliffe121, Yes Larasail adds a certificates auto renewal during larasail setup in this line below:

echo "0 0,12 * * * root /opt/certbot/bin/python -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew -q" | sudo tee -a /etc/crontab > /dev/null

For most setups, this should be able to renew and keep your ssl certificate renewed

Okay great. I can see the entry in /etc/crontab on my droplet.

Thanks for your help.