mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 08:45:22 +02:00
Configuration: server_url, server_path
This commit is contained in:
@@ -63,7 +63,7 @@ class Client(object):
|
||||
|
||||
# TODO: Allow for other alg types besides RS256
|
||||
self.network = network2.Network(
|
||||
"https://" + config.server, jwk.JWKRSA.load(self.account.key.pem))
|
||||
config.server_url, jwk.JWKRSA.load(self.account.key.pem))
|
||||
|
||||
self.config = config
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@ class NamespaceConfig(object):
|
||||
zope.interface.implements(interfaces.IConfig)
|
||||
|
||||
def __init__(self, namespace):
|
||||
assert not namespace.server.startswith('https://')
|
||||
assert not namespace.server.startswith('http://')
|
||||
self.namespace = namespace
|
||||
|
||||
def __getattr__(self, name):
|
||||
@@ -42,24 +44,32 @@ class NamespaceConfig(object):
|
||||
def in_progress_dir(self): # pylint: disable=missing-docstring
|
||||
return os.path.join(self.namespace.work_dir, constants.IN_PROGRESS_DIR)
|
||||
|
||||
@property
|
||||
def server_path(self):
|
||||
"""File path based on ``server``."""
|
||||
return self.namespace.server.replace('/', os.path.sep)
|
||||
|
||||
@property
|
||||
def server_url(self):
|
||||
"""Full server URL (including HTTPS scheme)."""
|
||||
return 'https://' + self.namespace.server
|
||||
|
||||
@property
|
||||
def cert_key_backup(self): # pylint: disable=missing-docstring
|
||||
return os.path.join(
|
||||
self.namespace.work_dir, constants.CERT_KEY_BACKUP_DIR,
|
||||
self.namespace.server.partition(":")[0])
|
||||
self.server_path)
|
||||
|
||||
@property
|
||||
def accounts_dir(self): #pylint: disable=missing-docstring
|
||||
return os.path.join(
|
||||
self.namespace.config_dir, constants.ACCOUNTS_DIR,
|
||||
self.namespace.server.replace(':', '-').replace('/', '-'))
|
||||
self.namespace.config_dir, constants.ACCOUNTS_DIR, self.server_path)
|
||||
|
||||
@property
|
||||
def account_keys_dir(self): #pylint: disable=missing-docstring
|
||||
return os.path.join(
|
||||
self.namespace.config_dir, constants.ACCOUNTS_DIR,
|
||||
self.namespace.server.replace(':', '-').replace('/', '-'),
|
||||
constants.ACCOUNT_KEYS_DIR)
|
||||
self.server_path, constants.ACCOUNT_KEYS_DIR)
|
||||
|
||||
# TODO: This should probably include the server name
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user