diff --git a/letsencrypt/client/client_authenticator.py b/letsencrypt/client/client_authenticator.py index 5ac93c383..7229239dc 100644 --- a/letsencrypt/client/client_authenticator.py +++ b/letsencrypt/client/client_authenticator.py @@ -26,7 +26,7 @@ class ClientAuthenticator(object): """ self.rec_token = recovery_token.RecoveryToken( - config.acme_server, config.rev_token_dir) + config.server, config.rec_token_dir) def get_chall_pref(self, unused_domain): # pylint: disable=no-self-use """Return list of challenge preferences.""" diff --git a/letsencrypt/client/configuration.py b/letsencrypt/client/configuration.py index 048746b12..1bdbe2059 100644 --- a/letsencrypt/client/configuration.py +++ b/letsencrypt/client/configuration.py @@ -18,7 +18,7 @@ class NamespaceConfig(object): - ``temp_checkpoint_dir`` - ``in_progress_dir`` - ``cert_key_backup`` - - ``rev_tokens_dir`` + - ``rec_token_dir`` :ivar namespace: Namespace typically produced by :meth:`argparse.ArgumentParser.parse_args`. @@ -48,5 +48,5 @@ class NamespaceConfig(object): self.namespace.work_dir, constants.CERT_KEY_BACKUP_DIR) @property - def rev_tokens_dir(self): # pylint: disable=missing-docstring - return os.path.join(self.namespace.work_dir, constants.REV_TOKENS_DIR) + def rec_token_dir(self): # pylint: disable=missing-docstring + return os.path.join(self.namespace.work_dir, constants.REC_TOKEN_DIR) diff --git a/letsencrypt/client/constants.py b/letsencrypt/client/constants.py index e1a8ebaed..3652face7 100644 --- a/letsencrypt/client/constants.py +++ b/letsencrypt/client/constants.py @@ -60,6 +60,6 @@ CERT_KEY_BACKUP_DIR = "keys-certs" """Directory where all certificates and keys are stored (relative to IConfig.work_dir. Used for easy revocation.""" -REV_TOKENS_DIR = "revocation_tokens" -"""Directory where all revocation tokens are saved (relative to +REC_TOKEN_DIR = "recovery_tokens" +"""Directory where all recovery tokens are saved (relative to IConfig.work_dir).""" diff --git a/letsencrypt/client/interfaces.py b/letsencrypt/client/interfaces.py index 5f6539940..8ae995d4f 100644 --- a/letsencrypt/client/interfaces.py +++ b/letsencrypt/client/interfaces.py @@ -67,7 +67,7 @@ class IConfig(zope.interface.Interface): """ - acme_server = zope.interface.Attribute( + server = zope.interface.Attribute( "CA hostname (and optionally :port). The server certificate must " "be trusted in order to avoid further modifications to the client.") rsa_key_size = zope.interface.Attribute("Size of the RSA key.") @@ -82,8 +82,8 @@ class IConfig(zope.interface.Interface): cert_key_backup = zope.interface.Attribute( "Directory where all certificates and keys are stored. " "Used for easy revocation.") - rev_tokens_dir = zope.interface.Attribute( - "Directory where all revocation tokens are saved.") + rec_token_dir = zope.interface.Attribute( + "Directory where all recovery tokens are saved.") key_dir = zope.interface.Attribute("Keys storage.") cert_dir = zope.interface.Attribute("Certificates storage.") diff --git a/letsencrypt/client/tests/configuration_test.py b/letsencrypt/client/tests/configuration_test.py index efc645ad4..a07953396 100644 --- a/letsencrypt/client/tests/configuration_test.py +++ b/letsencrypt/client/tests/configuration_test.py @@ -21,11 +21,11 @@ class NamespaceConfigTest(unittest.TestCase): constants.TEMP_CHECKPOINT_DIR = 't' constants.IN_PROGRESS_DIR = '../p' constants.CERT_KEY_BACKUP_DIR = 'c/' - constants.REV_TOKENS_DIR = '/r' + constants.REC_TOKEN_DIR = '/r' self.assertEqual(self.config.temp_checkpoint_dir, '/tmp/foo/t') self.assertEqual(self.config.in_progress_dir, '/tmp/foo/../p') self.assertEqual(self.config.cert_key_backup, '/tmp/foo/c/') - self.assertEqual(self.config.rev_tokens_dir, '/r') + self.assertEqual(self.config.rec_token_dir, '/r') if __name__ == '__main__': diff --git a/letsencrypt/scripts/main.py b/letsencrypt/scripts/main.py index 7eeb8ebe7..bb080ce4f 100755 --- a/letsencrypt/scripts/main.py +++ b/letsencrypt/scripts/main.py @@ -30,8 +30,8 @@ def create_parser(): config_help = lambda name: interfaces.IConfig[name].__doc__ add("-d", "--domains", metavar="DOMAIN", nargs="+") - add("-s", "--acme-server", "--server", default="letsencrypt-demo.org:443", - help=config_help("acme_server")) + add("-s", "--server", default="letsencrypt-demo.org:443", + help=config_help("server")) add("-p", "--privkey", type=read_file, help="Path to the private key file for certificate generation.") @@ -43,7 +43,7 @@ def create_parser(): help="Revert configuration N number of checkpoints.") add("-v", "--view-config-changes", action="store_true", help="View checkpoints and associated configuration changes.") - add("-r", "--redirect", action="store_true", + add("-r", "--redirect", type=bool, default=None, help="Automatically redirect all HTTP traffic to HTTPS for the newly " "authenticated vhost.") @@ -51,8 +51,7 @@ def create_parser(): help="Skip the end user license agreement screen.") add("-t", "--text", dest="use_curses", action="store_false", help="Use the text output instead of the curses UI.") - add("--test", action="store_true", help="Run in test mode.") - + add("--config-dir", default="/etc/letsencrypt", help=config_help("config_dir")) add("--work-dir", default="/var/lib/letsencrypt",