From adcb0052a16f8268b29ca550916563f4c84e1f79 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Tue, 20 Oct 2015 00:30:44 -0700 Subject: [PATCH] Implement --standalone as specified. Closes #1036 --- letsencrypt/cli.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index 208d629b5..1ece941ae 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -382,6 +382,8 @@ def choose_configurator_plugins(args, config, plugins, verb): if args.apache: req_inst = set_configurator(req_inst, "apache") req_auth = set_configurator(req_auth, "apache") + if args.standalone: + req_auth = set_configurator(req_auth, "standalone") logger.debug("Requested authenticator %s and installer %s", req_auth, req_inst) # Try to meet the user's request and/or ask them to pick plugins @@ -636,8 +638,12 @@ class HelpfulArgumentParser(object): self.verb = token return reordered - self.verb = "run" - return args + ["run"] + if "--standalone" in args and "--installer" not in args and "-i" not in args: + self.verb = "auth" + return args + ["auth"] + else: + self.verb = "run" + return args + ["run"] def prescan_for_flag(self, flag, possible_arguments): """Checks cli input for flags. @@ -744,6 +750,8 @@ def create_parser(plugins, args): help="Obtain and install certs using Apache") helpful.add(None, "--nginx", action="store_true", help="Obtain and install certs using Nginx") + helpful.add(None, "--standalone`", action="store_true", + help='Obtain certs using a "standalone" webserver on port 443.') # positional arg shadows --domains, instead of appending, and # --domains is useful, because it can be stored in config #for subparser in parser_run, parser_auth, parser_install: