Skip to content

Instantly share code, notes, and snippets.

@sub314xxl
Created September 4, 2024 10:29
Show Gist options
  • Save sub314xxl/6f5be8472c24e7b0a22e053fccd5df85 to your computer and use it in GitHub Desktop.
Save sub314xxl/6f5be8472c24e7b0a22e053fccd5df85 to your computer and use it in GitHub Desktop.
avoid let's encrypt certificate daily renewal limitation for prod environment
# 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