From 2c6cfe3f81aa6ae999206b3c6ba5b2e988d48e02 Mon Sep 17 00:00:00 2001 From: Seth Schoen Date: Wed, 13 May 2015 13:18:37 -0700 Subject: [PATCH] Cleanup to get rid of scripts directory --- letsencrypt/renewer.py | 10 +++++----- letsencrypt/scripts/renewer.py | 20 -------------------- setup.py | 1 + 3 files changed, 6 insertions(+), 25 deletions(-) delete mode 100755 letsencrypt/scripts/renewer.py diff --git a/letsencrypt/renewer.py b/letsencrypt/renewer.py index 062cf0910..ca731a1d6 100644 --- a/letsencrypt/renewer.py +++ b/letsencrypt/renewer.py @@ -2,11 +2,6 @@ certs within lineages of successor certificates, according to configuration.""" -# os.path.islink -# os.readlink -# os.path.dirname / os.path.basename -# os.path.join - # TODO: sanity checking consistency, validity, freshness? # TODO: call new installer API to restart servers after deployment @@ -87,6 +82,11 @@ def renew(cert, old_version): def main(config=DEFAULTS): """main function for autorenewer script.""" + # TODO: Distinguish automated invocation from manual invocation, + # perhaps by looking at sys.argv[0] and inhibiting automated + # invocations if /etc/letsencrypt/renewal.conf defaults have + # turned it off. (The boolean parameter should probably be + # called renewer_enabled.) for i in os.listdir(config["renewal_configs_dir"]): print "Processing", i if not i.endswith(".conf"): diff --git a/letsencrypt/scripts/renewer.py b/letsencrypt/scripts/renewer.py deleted file mode 100755 index f1e5358a4..000000000 --- a/letsencrypt/scripts/renewer.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python - -"""Let's Encrypt certificate renewer command-line / cron script.""" - -import configobj - -from letsencrypt.client import renewer - -DEFAULTS = configobj.ConfigObj("renewal.conf") -DEFAULTS["renewal_configs_dir"] = "/tmp/etc/letsencrypt/configs" -DEFAULTS["official_archive_dir"] = "/tmp/etc/letsencrypt/archive" -DEFAULTS["live_dir"] = "/tmp/etc/letsencrypt/live" - -if __name__ == 'main': - if ("renewer_enabled" in DEFAULTS - and not DEFAULTS.as_bool("renewer_enabled")): - print "Renewer is disabled by configuration! Exiting." - raise SystemExit - else: - renewer.main() diff --git a/setup.py b/setup.py index 7ee7b3e5e..cc11f3924 100644 --- a/setup.py +++ b/setup.py @@ -115,6 +115,7 @@ setup( entry_points={ 'console_scripts': [ 'letsencrypt = letsencrypt.cli:main', + 'letsencrypt-renewer = letsencrypt.renewer:main', 'jws = letsencrypt.acme.jose.jws:CLI.run', ], 'letsencrypt.plugins': [