Inelegant approach to support --renewer-config-file command-line argument

This commit is contained in:
Seth Schoen 2015-05-27 12:38:47 -07:00
parent 9bc9abecbe
commit b617305927
4 changed files with 18 additions and 1 deletions

View file

@ -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"))

View file

@ -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

View file

@ -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."""

View file

@ -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.")