Skip to content

Commit

Permalink
Switch to pseudo-random cron minutes
Browse files Browse the repository at this point in the history
Fixes #6
  • Loading branch information
bviktor committed Nov 9, 2023
1 parent 8ae3a6b commit 59e015f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion templates/acme.j2
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 59e015f

Please sign in to comment.