Optimize multisite check in certbot-renew job

This commit is contained in:
Théophile Diot 2024-06-27 09:05:22 +01:00
parent f64be28eba
commit bb0dc15dec
No known key found for this signature in database
GPG key ID: FA995104A0BA376A

View file

@ -34,13 +34,13 @@ LETS_ENCRYPT_LOGS_DIR = join(sep, "var", "log", "bunkerweb")
try:
# Check if we're using let's encrypt
use_letsencrypt = False
if getenv("AUTO_LETS_ENCRYPT", "no") == "yes":
use_letsencrypt = True
elif getenv("MULTISITE", "no") == "yes":
if getenv("MULTISITE", "no") == "yes":
for first_server in getenv("SERVER_NAME", "").split(" "):
if first_server and getenv(f"{first_server}_AUTO_LETS_ENCRYPT", "no") == "yes":
use_letsencrypt = True
break
elif getenv("AUTO_LETS_ENCRYPT", "no") == "yes":
use_letsencrypt = True
if not use_letsencrypt:
LOGGER.info("Let's Encrypt is not activated, skipping renew...")