Certificate renewal: certbot timer, nginx reload hook, doctor checks renewal configuration

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
denis
2026-10-17 13:03:13 +02:00
parent 973fb98b91
commit 3f10adb36b
5 changed files with 79 additions and 1 deletions
+8 -1
View File
@@ -87,7 +87,8 @@ else
fi
echo "Certificat"
domain="$(ls /etc/letsencrypt/live 2>/dev/null | grep -v README | head -n1 || true)"
domain="${SITE_HOST}"
[[ -d "/etc/letsencrypt/live/${domain}" ]] || domain="$(ls /etc/letsencrypt/live 2>/dev/null | grep -v README | head -n1 || true)"
if [[ -n "${domain}" ]]; then
end="$(as_root openssl x509 -enddate -noout -in "/etc/letsencrypt/live/${domain}/fullchain.pem" 2>/dev/null | cut -d= -f2)"
if [[ -n "${end}" ]]; then
@@ -96,11 +97,17 @@ if [[ -n "${domain}" ]]; then
else
info "certificat ${domain} non lisible sans root"
fi
if [[ -f "/etc/letsencrypt/renewal/${domain}.conf" ]]; then
ok "configuration de renouvellement certbot présente pour ${domain}"
else
ko "pas de configuration de renouvellement pour ${domain} (certificat obtenu hors certbot ?) : voir la documentation, section certificat"
fi
if systemctl is-active --quiet certbot.timer 2>/dev/null || [[ -f /etc/cron.d/certbot ]]; then
ok "renouvellement automatique du certificat (certbot.timer ou cron)"
else
ko "renouvellement automatique absent : « systemctl enable --now certbot.timer » (puis « certbot renew --dry-run » pour tester)"
fi
[[ -x /etc/letsencrypt/renewal-hooks/deploy/pyquest-reload-nginx ]] && ok "nginx rechargé après chaque renouvellement" || ko "hook de rechargement nginx absent : relancer ./deploy/server_setup.sh --domain ${domain}"
else
info "aucun certificat Let's Encrypt trouvé"
fi