Skip to content

Commit

Permalink
fix: removed force renewal as it would extend by 3 months every month…
Browse files Browse the repository at this point in the history
…, now the job runs daily
  • Loading branch information
abhishekbalam committed Sep 9, 2020
1 parent ac2afb3 commit 408676c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bench/config/lets_encrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ def run_certbot_and_setup_ssl(site, custom_domain, bench_path, interactive=True)


def setup_crontab():
job_command = '/opt/certbot-auto renew --force-renewal -a nginx --post-hook "systemctl reload nginx"'
job_command = '/opt/certbot-auto renew -a nginx --post-hook "systemctl reload nginx"'
system_crontab = CronTab(user='root')
if job_command not in str(system_crontab):
job = system_crontab.new(command=job_command, comment="Renew lets-encrypt every month")
job.setall('0 0 1 * *') # Run at 00:00 on every day-of-month 1
job.setall('0 0 */1 * *') # Run at 00:00 every day-of-month
system_crontab.write()


Expand Down
6 changes: 3 additions & 3 deletions bench/patches/v5/fix_letsencrypt_renew_frequency.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ def execute(bench_path):
This patch fixes a cron job that would renew letsencrypt certificate
"""

job_command = '/opt/certbot-auto renew --force-renewal -a nginx --post-hook "systemctl reload nginx"'
job_command = '/opt/certbot-auto renew -a nginx --post-hook "systemctl reload nginx"'
system_crontab = CronTab(user='root')
job_comment = "Renew lets-encrypt every month"

for job in system_crontab.find_comment(job_comment)
for job in system_crontab.find_comment(job_comment):
system_crontab.remove(job)
job = system_crontab.new(command=job_command, comment=job_comment)
job.setall('0 0 1 * *') # Run at 00:00 on every day-of-month 1
job.setall('0 0 */1 * *') # Run at 00:00 every day-of-month
system_crontab.write()
break

0 comments on commit 408676c

Please sign in to comment.