Added rate limit check / logging for certificate request

This commit is contained in:
root 2022-12-14 21:59:14 +00:00
parent 924d63eba8
commit 7efedcd8e9

View File

@ -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