From b617305927e54b0abd815715eb6396ff415362ac Mon Sep 17 00:00:00 2001 From: Seth Schoen Date: Wed, 27 May 2015 12:38:47 -0700 Subject: [PATCH] Inelegant approach to support --renewer-config-file command-line argument --- letsencrypt/cli.py | 3 +++ letsencrypt/client.py | 12 +++++++++++- letsencrypt/constants.py | 1 + letsencrypt/interfaces.py | 3 +++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index fb9a7244a..3a5b88b2a 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -340,6 +340,9 @@ def _paths_parser(parser): add("--chain-path", default=flag_default("chain_path"), help=config_help("chain_path")) + add("--renewer-config-file", default=flag_default("renewer_config_file"), + help=config_help("renewer_config_file")) + add("--enroll-autorenew", default=None, action="store_true", help=config_help("enroll_autorenew")) diff --git a/letsencrypt/client.py b/letsencrypt/client.py index 58bdb6fda..6e6714955 100644 --- a/letsencrypt/client.py +++ b/letsencrypt/client.py @@ -182,9 +182,19 @@ class Client(object): authenticator).name if installer is not None: self.config.namespace.installer = plugins.find_init(installer).name + + # XXX: We clearly need a more general and correct way of getting + # options into the configobj for the RenewableCert instance. + # This is a quick-and-dirty way to do it to allow integration + # testing to start. (Note that the config parameter to new_lineage + # ideally should be a ConfigObj, but in this case a dict will be + # accepted in practice.) + params = vars(self.config.namespace) + config = {"renewer_config_file": + params["renewer_config_file"]} if "renewer_config_file" in params else None return storage.RenewableCert.new_lineage(domains[0], cert_pem, privkey, chain_pem, - vars(self.config.namespace)) + params, config) def obtain_certificate(self, domains): """Public method to obtain a certificate for the specified domains diff --git a/letsencrypt/constants.py b/letsencrypt/constants.py index 4b3b79e36..4ef7cfb66 100644 --- a/letsencrypt/constants.py +++ b/letsencrypt/constants.py @@ -22,6 +22,7 @@ CLI_DEFAULTS = dict( certs_dir="/etc/letsencrypt/certs", cert_path="/etc/letsencrypt/certs/cert-letsencrypt.pem", chain_path="/etc/letsencrypt/certs/chain-letsencrypt.pem", + renewer_config_file="/etc/letsencrypt/renewer.conf", test_mode=False, ) """Defaults for CLI flags and `.IConfig` attributes.""" diff --git a/letsencrypt/interfaces.py b/letsencrypt/interfaces.py index e154bd5d3..10a551ec8 100644 --- a/letsencrypt/interfaces.py +++ b/letsencrypt/interfaces.py @@ -176,6 +176,9 @@ class IConfig(zope.interface.Interface): le_vhost_ext = zope.interface.Attribute( "SSL vhost configuration extension.") + renewer_config_file = zope.interface.Attribute( + "Location of renewal configuration file.") + enroll_autorenew = zope.interface.Attribute( "Register this certificate in the database to be renewed" " automatically.")