From 59e015f103c7b14cddbedddb77b8c4e0a528cc2d Mon Sep 17 00:00:00 2001 From: Viktor Berke Date: Thu, 9 Nov 2023 03:10:31 +0100 Subject: [PATCH] Switch to pseudo-random cron minutes Fixes #6 --- templates/acme.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/acme.j2 b/templates/acme.j2 index 6dc2d20..b3f29b4 100644 --- a/templates/acme.j2 +++ b/templates/acme.j2 @@ -1,4 +1,5 @@ -{{ 60 | random }} 07 1 * * root {{ acme_install_dir }}/acme.sh {% if eff_staging %}--staging{% else %}--server letsencrypt{% endif %} --ecc --renew --dns dns_{{ provider }} --dnssleep {{ eff_sleep }} --force --domain {{ domain }}{% if eff_wildcard %} --domain *.{{ domain }}{% endif %} >> /var/log/letsencrypt 2>&1 +# Minutes are pseudo-random, to ensure idempotency, but still don't flood ACME with all certs at once. +{{ name.split('.')[0] | length % 6 }}{{ name | length % 10 }} 07 1 * * root {{ acme_install_dir }}/acme.sh {% if eff_staging %}--staging{% else %}--server letsencrypt{% endif %} --ecc --renew --dns dns_{{ provider }} --dnssleep {{ eff_sleep }} --force --domain {{ domain }}{% if eff_wildcard %} --domain *.{{ domain }}{% endif %} >> /var/log/letsencrypt 2>&1 # TODO make params for this #1 08 1 * * root /sbin/nginx -s reload