Created
September 4, 2024 10:29
-
-
Save sub314xxl/6f5be8472c24e7b0a22e053fccd5df85 to your computer and use it in GitHub Desktop.
avoid let's encrypt certificate daily renewal limitation for prod environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# paste to .bashrc on host with domain's public IP | |
# usage: certbotless YOUR.DOMAIN.TLD | |
certbotless() { | |
if [ -z "$1" ]; then | |
return 1 | |
fi | |
DOMAIN=$1 | |
sudo systemctl stop nginx && \ | |
sudo systemctl disable nginx && \ | |
if sudo lsof -i :80; then | |
sudo fuser -k 80/tcp | |
fi | |
docker run -it --rm --name certbot \ | |
-v /etc/letsencrypt:/etc/letsencrypt \ | |
-v /var/lib/letsencrypt:/var/lib/letsencrypt \ | |
-p 80:80 \ | |
certbot/certbot certonly --standalone -d $DOMAIN && \ | |
sudo systemctl start nginx && \ | |
sudo systemctl enable nginx && \ | |
sudo systemctl status nginx --no-pager | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment