From 98c47162da28f3b1d661f0e1e7c6a8811ebfc930 Mon Sep 17 00:00:00 2001 From: James Kasten Date: Sun, 25 Jan 2015 04:57:36 -0800 Subject: [PATCH 1/3] Add IRC notifications --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 54ed84263..4ef4bb735 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,3 +24,4 @@ env: notifications: email: false + irc: "chat.freenode.net#letsencrypt" From 6fbc6b275000808ef06ec2114e23eadefad213bd Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 25 Jan 2015 14:02:54 +0100 Subject: [PATCH 2/3] remove out-of-sync cli help, just say how to get it --- README.md | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 85b176b58..320943156 100644 --- a/README.md +++ b/README.md @@ -116,32 +116,10 @@ documentation: ## Command line usage +The letsencrypt commandline tool has a builtin help: + ``` -usage: sudo letsencrypt.py [-h] [-d DOMAIN [DOMAIN ...]] [-s SERVER] [-p PRIVKEY] - [-c CSR] [-b ROLLBACK] [-k] [-v] [-r] [-n] [-e] [-t] - [--test] - -An ACME client that can update Apache configurations. - -optional arguments: - -h, --help show this help message and exit - -d DOMAIN [DOMAIN ...], --domains DOMAIN [DOMAIN ...] - -s SERVER, --server SERVER - The ACME CA server address. - -p PRIVKEY, --privkey PRIVKEY - Path to the private key file for certificate - generation. - -b N, --rollback N Revert configuration N number of checkpoints. - -k, --revoke Revoke a certificate. - -v, --view-config-changes - View checkpoints and associated configuration changes. - -r, --redirect Automatically redirect all HTTP traffic to HTTPS for - the newly authenticated vhost. - -n, --no-redirect Skip the HTTPS redirect question, allowing both HTTP - and HTTPS. - -e, --agree-eula Skip the end user license agreement screen. - -t, --text Use the text output instead of the curses UI. - --test Run in test mode. +letsencrypt --help ``` ## More Information From 7e7093e821bb52c3902c74ce5144e7d6112390df Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Mon, 26 Jan 2015 01:21:15 +0100 Subject: [PATCH 3/3] check late for root, so letsencrypt --help also works without being root --- letsencrypt/scripts/main.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/letsencrypt/scripts/main.py b/letsencrypt/scripts/main.py index 0fd3f99c8..24569ac87 100755 --- a/letsencrypt/scripts/main.py +++ b/letsencrypt/scripts/main.py @@ -19,11 +19,6 @@ from letsencrypt.client.apache import configurator def main(): # pylint: disable=too-many-statements """Command line argument parsing and main script execution.""" - if not os.geteuid() == 0: - sys.exit( - "{0}Root is required to run letsencrypt. Please use sudo.{0}" - .format(os.linesep)) - parser = argparse.ArgumentParser( description="An ACME client that can update Apache configurations.") @@ -63,8 +58,15 @@ def main(): # pylint: disable=too-many-statements parser.add_argument("--test", dest="test", action="store_true", help="Run in test mode.") + # note: arg parser internally handles --help (and exits afterwards) args = parser.parse_args() + # note: check is done after arg parsing as --help should work w/o root also. + if not os.geteuid() == 0: + sys.exit( + "{0}Root is required to run letsencrypt. Please use sudo.{0}" + .format(os.linesep)) + # Set up logging logger = logging.getLogger() logger.setLevel(logging.INFO)