From 7efedcd8e93b2fb5648b6c312014a2eacde2865e Mon Sep 17 00:00:00 2001 From: root Date: Wed, 14 Dec 2022 21:59:14 +0000 Subject: [PATCH] Added rate limit check / logging for certificate request --- lib/dns.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/dns.sh b/lib/dns.sh index 1ea5470..815b5ae 100644 --- a/lib/dns.sh +++ b/lib/dns.sh @@ -218,6 +218,13 @@ start_dns() { # Keep trying to see that certificates are generated RETRY="18" while [ $RETRY -gt 0 ]; do + # Check if we have hit limit for requesting certificate too many times / limits + docker exec -it dns grep "too many certificates" /var/log/letsencrypt/letsencrypt.log &> /dev/null + if [ $? -eq 0 ]; then + fail "There was a problem starting /federated/apps/dns\nYou have requested this certificate too many times.\nWait 24 hours before requesting it again.\n" + fi + + # Check if certs are generated ls /federated/apps/dns/data/etc/letsencrypt/live/$DOMAIN/*.pem &> /dev/null if [ $? -eq 0 ]; then kill -9 $SPINPID &> /dev/null