This commit is contained in:
James Kasten
2015-02-09 14:39:49 -08:00
parent 356ede0c8e
commit f476a49387
6 changed files with 15 additions and 16 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ class ClientAuthenticator(object):
""" """
self.rec_token = recovery_token.RecoveryToken( 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 def get_chall_pref(self, unused_domain): # pylint: disable=no-self-use
"""Return list of challenge preferences.""" """Return list of challenge preferences."""
+3 -3
View File
@@ -18,7 +18,7 @@ class NamespaceConfig(object):
- ``temp_checkpoint_dir`` - ``temp_checkpoint_dir``
- ``in_progress_dir`` - ``in_progress_dir``
- ``cert_key_backup`` - ``cert_key_backup``
- ``rev_tokens_dir`` - ``rec_token_dir``
:ivar namespace: Namespace typically produced by :ivar namespace: Namespace typically produced by
:meth:`argparse.ArgumentParser.parse_args`. :meth:`argparse.ArgumentParser.parse_args`.
@@ -48,5 +48,5 @@ class NamespaceConfig(object):
self.namespace.work_dir, constants.CERT_KEY_BACKUP_DIR) self.namespace.work_dir, constants.CERT_KEY_BACKUP_DIR)
@property @property
def rev_tokens_dir(self): # pylint: disable=missing-docstring def rec_token_dir(self): # pylint: disable=missing-docstring
return os.path.join(self.namespace.work_dir, constants.REV_TOKENS_DIR) return os.path.join(self.namespace.work_dir, constants.REC_TOKEN_DIR)
+2 -2
View File
@@ -60,6 +60,6 @@ CERT_KEY_BACKUP_DIR = "keys-certs"
"""Directory where all certificates and keys are stored (relative to """Directory where all certificates and keys are stored (relative to
IConfig.work_dir. Used for easy revocation.""" IConfig.work_dir. Used for easy revocation."""
REV_TOKENS_DIR = "revocation_tokens" REC_TOKEN_DIR = "recovery_tokens"
"""Directory where all revocation tokens are saved (relative to """Directory where all recovery tokens are saved (relative to
IConfig.work_dir).""" IConfig.work_dir)."""
+3 -3
View File
@@ -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 " "CA hostname (and optionally :port). The server certificate must "
"be trusted in order to avoid further modifications to the client.") "be trusted in order to avoid further modifications to the client.")
rsa_key_size = zope.interface.Attribute("Size of the RSA key.") 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( cert_key_backup = zope.interface.Attribute(
"Directory where all certificates and keys are stored. " "Directory where all certificates and keys are stored. "
"Used for easy revocation.") "Used for easy revocation.")
rev_tokens_dir = zope.interface.Attribute( rec_token_dir = zope.interface.Attribute(
"Directory where all revocation tokens are saved.") "Directory where all recovery tokens are saved.")
key_dir = zope.interface.Attribute("Keys storage.") key_dir = zope.interface.Attribute("Keys storage.")
cert_dir = zope.interface.Attribute("Certificates storage.") cert_dir = zope.interface.Attribute("Certificates storage.")
@@ -21,11 +21,11 @@ class NamespaceConfigTest(unittest.TestCase):
constants.TEMP_CHECKPOINT_DIR = 't' constants.TEMP_CHECKPOINT_DIR = 't'
constants.IN_PROGRESS_DIR = '../p' constants.IN_PROGRESS_DIR = '../p'
constants.CERT_KEY_BACKUP_DIR = 'c/' 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.temp_checkpoint_dir, '/tmp/foo/t')
self.assertEqual(self.config.in_progress_dir, '/tmp/foo/../p') self.assertEqual(self.config.in_progress_dir, '/tmp/foo/../p')
self.assertEqual(self.config.cert_key_backup, '/tmp/foo/c/') 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__': if __name__ == '__main__':
+4 -5
View File
@@ -30,8 +30,8 @@ def create_parser():
config_help = lambda name: interfaces.IConfig[name].__doc__ config_help = lambda name: interfaces.IConfig[name].__doc__
add("-d", "--domains", metavar="DOMAIN", nargs="+") add("-d", "--domains", metavar="DOMAIN", nargs="+")
add("-s", "--acme-server", "--server", default="letsencrypt-demo.org:443", add("-s", "--server", default="letsencrypt-demo.org:443",
help=config_help("acme_server")) help=config_help("server"))
add("-p", "--privkey", type=read_file, add("-p", "--privkey", type=read_file,
help="Path to the private key file for certificate generation.") help="Path to the private key file for certificate generation.")
@@ -43,7 +43,7 @@ def create_parser():
help="Revert configuration N number of checkpoints.") help="Revert configuration N number of checkpoints.")
add("-v", "--view-config-changes", action="store_true", add("-v", "--view-config-changes", action="store_true",
help="View checkpoints and associated configuration changes.") 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 " help="Automatically redirect all HTTP traffic to HTTPS for the newly "
"authenticated vhost.") "authenticated vhost.")
@@ -51,8 +51,7 @@ def create_parser():
help="Skip the end user license agreement screen.") help="Skip the end user license agreement screen.")
add("-t", "--text", dest="use_curses", action="store_false", add("-t", "--text", dest="use_curses", action="store_false",
help="Use the text output instead of the curses UI.") 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", add("--config-dir", default="/etc/letsencrypt",
help=config_help("config_dir")) help=config_help("config_dir"))
add("--work-dir", default="/var/lib/letsencrypt", add("--work-dir", default="/var/lib/letsencrypt",