mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
Fix #220
This commit is contained in:
parent
356ede0c8e
commit
f476a49387
6 changed files with 15 additions and 16 deletions
|
|
@ -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."""
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)."""
|
||||
|
|
|
|||
|
|
@ -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.")
|
||||
|
||||
|
|
|
|||
|
|
@ -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__':
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue