Skip to content

Commit

Permalink
fix: setup cron job for renewing ssl certificate (frappe#918)
Browse files Browse the repository at this point in the history
* fix: setup cronjob for renewing ssl certificate

cronjob set for 1st of every month

* fix: cannonical PYPI package name updates

    refs:
    - https://pypi.org/project/python-crontab/
    - frappe#918 (comment)
  • Loading branch information
gavindsouza authored Feb 24, 2020
1 parent d58fc11 commit 92d2fbd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions bench/config/lets_encrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,10 @@ def run_certbot_and_setup_ssl(site, custom_domain, bench_path, interactive=True)

def setup_crontab():
job_command = '/opt/certbot-auto renew -a nginx --post-hook "systemctl reload nginx"'
system_crontab = CronTab(tabfile='/etc/crontab', user=True)
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.every().month()
job.enable()
job = system_crontab.new(command=job_command, comment="Renew lets-encrypt every month")
job.day.on(1)
system_crontab.write()


Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Click==7.0
GitPython==2.1.11
honcho==1.0.1
Jinja2==2.10.3
python_crontab==2.4.0
python-crontab==2.4.0
requests==2.22.0
semantic_version==2.8.2
setuptools==40.8.0
Expand Down

0 comments on commit 92d2fbd

Please sign in to comment.