2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-24 23:48:24 +00:00

Letsencrypt fix develop (#407)

* [Fix] Letsencrypt error - Please specify user or filename to write.

* Fix bug global hashlib is not defined (#399)

* Don't need $query_string (#390)

* [Fix] Issue #404 - write to system cron

* letsencrypt.py - renamed user_crontab to system_crontab
This commit is contained in:
Revant Nandgaonkar 2017-05-22 15:07:40 +05:30 committed by Rushabh Mehta
parent de0d88c0fa
commit d53f2b07fd

View File

@ -81,12 +81,12 @@ def run_certbot_and_setup_ssl(site, custom_domain, bench_path):
def setup_crontab():
job_command = 'sudo service nginx stop && /opt/certbot-auto renew && sudo service nginx start'
user_crontab = CronTab()
if job_command not in str(user_crontab):
job = user_crontab.new(command=job_command, comment="Renew lets-encrypt every month")
system_crontab = CronTab(tabfile='/etc/crontab', user=True)
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()
user_crontab.write()
system_crontab.write()
def create_dir_if_missing(path):