From adcb0052a16f8268b29ca550916563f4c84e1f79 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Tue, 20 Oct 2015 00:30:44 -0700 Subject: [PATCH 01/10] 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: From 54a738492b67ac6764499783b1448aa3b058ae73 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Tue, 20 Oct 2015 01:22:04 -0700 Subject: [PATCH 02/10] Fix typo --- letsencrypt/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index 1ece941ae..eba5e8685 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -750,7 +750,7 @@ 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", + 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 From efe51e02becf50a686eb8d3ed9c9bc128850909a Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Tue, 20 Oct 2015 10:34:31 -0700 Subject: [PATCH 03/10] Explain the --standalone change in defaults --- letsencrypt/cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index eba5e8685..b79ec7ae4 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -751,7 +751,8 @@ def create_parser(plugins, args): 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.') + help=('Obtain certs using a "standalone" webserver. ' + 'Changes the default "run" command to "auth".') # 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: From 2c4d4a81692fbd05320493c3cc0d19f05d75013a Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Tue, 20 Oct 2015 10:35:17 -0700 Subject: [PATCH 04/10] "letsencrypt everything" is not yet implemented :/ --- letsencrypt/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index b79ec7ae4..237d1741c 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -60,7 +60,7 @@ the cert. """ # altogether USAGE = SHORT_USAGE + """Major SUBCOMMANDS are: - (default) everything Obtain & install a cert in your current webserver + (default) run Obtain & install a cert in your current webserver auth Authenticate & obtain cert, but do not install it install Install a previously obtained cert in a server revoke Revoke a previously obtained certificate From 719cbdb4884d9559fa95fb0ac3a61356cf927b0c Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Tue, 20 Oct 2015 10:58:47 -0700 Subject: [PATCH 05/10] --apache etc should be documented in the "plugins" section --- letsencrypt/cli.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index 237d1741c..fb6f74937 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -71,7 +71,8 @@ Choice of server for authentication/installation: --apache Use the Apache plugin for authentication & installation --nginx Use the Nginx plugin for authentication & installation - --standalone Run a standalone HTTPS server (for authentication only) + --standalone Run a standalone webserver (for authentication only, changes + the default command to "auth") OR: --authenticator standalone --installer nginx @@ -746,13 +747,6 @@ def create_parser(plugins, args): None, "-t", "--text", dest="text_mode", action="store_true", help="Use the text output instead of the curses UI.") helpful.add(None, "-m", "--email", help=config_help("email")) - helpful.add(None, "--apache", action="store_true", - 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. ' - 'Changes the default "run" command to "auth".') # 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: @@ -865,7 +859,6 @@ def _create_subparsers(helpful): "--checkpoints", type=int, metavar="N", default=flag_default("rollback_checkpoints"), help="Revert configuration N number of checkpoints.") - helpful.add("plugins", "--init", action="store_true", help="Initialize plugins.") helpful.add("plugins", @@ -930,6 +923,15 @@ def _plugins_parsing(helpful, plugins): "plugins", "--configurator", help="Name of the plugin that is " "both an authenticator and an installer. Should not be used " "together with --authenticator or --installer.") + helpful.add("plugins", "--apache", action="store_true", + help="Obtain and install certs using Apache") + helpful.add("plugins", "--nginx", action="store_true", + help="Obtain and install certs using Nginx") + helpful.add("plugins", "--standalone", action="store_true", + help=('Obtain certs using a "standalone" webserver. ' + 'Changes the default "run" command to "auth".')) + + # things should not be reorder past/pre this comment: # plugins_group should be displayed in --help before plugin From 738684d43708ce43c7c5d3ae430aeceba09357b4 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Tue, 20 Oct 2015 13:28:56 -0700 Subject: [PATCH 06/10] Revert to "run" as the default in all cases --- letsencrypt/cli.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index fb6f74937..e9c78437a 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -71,8 +71,8 @@ Choice of server for authentication/installation: --apache Use the Apache plugin for authentication & installation --nginx Use the Nginx plugin for authentication & installation - --standalone Run a standalone webserver (for authentication only, changes - the default command to "auth") + --standalone Run a standalone webserver for authentication + OR: --authenticator standalone --installer nginx @@ -639,12 +639,8 @@ class HelpfulArgumentParser(object): self.verb = token return reordered - 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"] + self.verb = "run" + return args + ["run"] def prescan_for_flag(self, flag, possible_arguments): """Checks cli input for flags. From dde3e685f00ee919177e8d1c9d395b4a885656fc Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Tue, 20 Oct 2015 13:49:44 -0700 Subject: [PATCH 07/10] Fix stray --standalone help And a few layout nits --- letsencrypt/cli.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index e9c78437a..4303e158b 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -72,8 +72,7 @@ Choice of server for authentication/installation: --apache Use the Apache plugin for authentication & installation --nginx Use the Nginx plugin for authentication & installation --standalone Run a standalone webserver for authentication - - OR: +OR: --authenticator standalone --installer nginx More detailed help: @@ -924,10 +923,7 @@ def _plugins_parsing(helpful, plugins): helpful.add("plugins", "--nginx", action="store_true", help="Obtain and install certs using Nginx") helpful.add("plugins", "--standalone", action="store_true", - help=('Obtain certs using a "standalone" webserver. ' - 'Changes the default "run" command to "auth".')) - - + help=("Obtain certs using a "standalone" webserver.") # things should not be reorder past/pre this comment: # plugins_group should be displayed in --help before plugin From 05293cd59714be5a650381ca6bf335aa5fd10111 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Tue, 20 Oct 2015 14:01:29 -0700 Subject: [PATCH 08/10] typosquash --- letsencrypt/cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index 4303e158b..54bdb7285 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -72,7 +72,7 @@ Choice of server for authentication/installation: --apache Use the Apache plugin for authentication & installation --nginx Use the Nginx plugin for authentication & installation --standalone Run a standalone webserver for authentication -OR: + OR: --authenticator standalone --installer nginx More detailed help: @@ -923,7 +923,7 @@ def _plugins_parsing(helpful, plugins): helpful.add("plugins", "--nginx", action="store_true", help="Obtain and install certs using Nginx") helpful.add("plugins", "--standalone", action="store_true", - help=("Obtain certs using a "standalone" webserver.") + help="Obtain certs using a "standalone" webserver.") # things should not be reorder past/pre this comment: # plugins_group should be displayed in --help before plugin From b01bf571ca4c8c34bcffa47f3c2bb70339f05429 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Tue, 20 Oct 2015 14:02:34 -0700 Subject: [PATCH 09/10] more typos --- letsencrypt/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index 54bdb7285..6e2f8749b 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -923,7 +923,7 @@ def _plugins_parsing(helpful, plugins): helpful.add("plugins", "--nginx", action="store_true", help="Obtain and install certs using Nginx") helpful.add("plugins", "--standalone", action="store_true", - help="Obtain certs using a "standalone" webserver.") + help='Obtain certs using a "standalone" webserver.') # things should not be reorder past/pre this comment: # plugins_group should be displayed in --help before plugin From e7182848a0b222f23b7c621b92830f881bcffa89 Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Tue, 20 Oct 2015 14:04:58 -0700 Subject: [PATCH 10/10] Keep @bmw's sense of aesthetics happy :) --- letsencrypt/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index 6e2f8749b..923fcbae7 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -72,7 +72,7 @@ Choice of server for authentication/installation: --apache Use the Apache plugin for authentication & installation --nginx Use the Nginx plugin for authentication & installation --standalone Run a standalone webserver for authentication - OR: + OR: --authenticator standalone --installer nginx More detailed help: