From 0e395ba763a16c030d5e05e4c1551a9c97e3a2bd Mon Sep 17 00:00:00 2001 From: root Date: Sat, 24 Oct 2015 19:57:24 +0100 Subject: [PATCH 1/6] Close #1030 --- letsencrypt/cli.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index 822f231ef..b2c072a37 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -436,6 +436,7 @@ def run(args, config, plugins): # pylint: disable=too-many-branches,too-many-lo le_client.deploy_certificate( domains, lineage.privkey, lineage.cert, lineage.chain, lineage.fullchain) + le_client.enhance_config(domains, args.redirect) if len(lineage.available_versions("cert")) == 1: @@ -808,7 +809,11 @@ def create_parser(plugins, args): helpful.add( "security", "-r", "--redirect", action="store_true", help="Automatically redirect all HTTP traffic to HTTPS for the newly " - "authenticated vhost.") + "authenticated vhost.", dest="redirect", default=None) + helpful.add( + "security", "-n", "--no-redirect", action="store_false", + help="Do not automatically redirect all HTTP traffic to HTTPS for the newly " + "authenticated vhost.", dest="redirect", default=None) helpful.add( "security", "--strict-permissions", action="store_true", help="Require that all configuration files are owned by the current " From 1cb787cefee37edc4ba75fde53771255684d756e Mon Sep 17 00:00:00 2001 From: root Date: Sat, 24 Oct 2015 20:15:25 +0100 Subject: [PATCH 2/6] Remove TODO comment for current issue --- letsencrypt/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index b2c072a37..2651edfa8 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -805,7 +805,6 @@ def create_parser(plugins, args): helpful.add( "security", "-B", "--rsa-key-size", type=int, metavar="N", default=flag_default("rsa_key_size"), help=config_help("rsa_key_size")) - # TODO: resolve - assumes binary logic while client.py assumes ternary. helpful.add( "security", "-r", "--redirect", action="store_true", help="Automatically redirect all HTTP traffic to HTTPS for the newly " @@ -1107,3 +1106,4 @@ if __name__ == "__main__": if err_string: logger.warn("Exiting with message %s", err_string) sys.exit(err_string) # pragma: no cover +v From 9d92a4c4ae2d1ca5e8febcc8ce6f0cbeb5c0d5e8 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 24 Oct 2015 20:38:50 +0100 Subject: [PATCH 3/6] Fix random "v" at bottom of file (stupid nano) --- letsencrypt/cli.py | 1 - 1 file changed, 1 deletion(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index 2651edfa8..ef8700796 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -1106,4 +1106,3 @@ if __name__ == "__main__": if err_string: logger.warn("Exiting with message %s", err_string) sys.exit(err_string) # pragma: no cover -v From e8f90ff9939b018f40444490bdff87ef38f62415 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 24 Oct 2015 23:59:36 +0100 Subject: [PATCH 4/6] Add flag in to _common.sh integration test --- tests/integration/_common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/integration/_common.sh b/tests/integration/_common.sh index 1dffaa4e3..bdd73244a 100755 --- a/tests/integration/_common.sh +++ b/tests/integration/_common.sh @@ -20,6 +20,7 @@ letsencrypt_test () { --manual-test-mode \ $store_flags \ --text \ + --redirect \ --agree-dev-preview \ --agree-tos \ --email "" \ From 1f6cc52e6696102d0585a4d2a82071edfd4ceaa5 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 25 Oct 2015 00:07:00 +0100 Subject: [PATCH 5/6] Fix integration test bug --- tests/integration/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/_common.sh b/tests/integration/_common.sh index bdd73244a..db514134d 100755 --- a/tests/integration/_common.sh +++ b/tests/integration/_common.sh @@ -20,7 +20,7 @@ letsencrypt_test () { --manual-test-mode \ $store_flags \ --text \ - --redirect \ + -r \ --agree-dev-preview \ --agree-tos \ --email "" \ From b13006ce1af7b2d1f2c44d851de8d17698643c77 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 25 Oct 2015 00:14:46 +0100 Subject: [PATCH 6/6] Change -n flag in _commit.py to --no-redirect for clarity. --- tests/integration/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/_common.sh b/tests/integration/_common.sh index db514134d..07eca44b2 100755 --- a/tests/integration/_common.sh +++ b/tests/integration/_common.sh @@ -20,7 +20,7 @@ letsencrypt_test () { --manual-test-mode \ $store_flags \ --text \ - -r \ + --no-redirect \ --agree-dev-preview \ --agree-tos \ --email "" \