golden hour
/lib/python2.7/site-packages/certbot/_internal
⬆️ Go Up
Upload
File/Folder
Size
Actions
__init__.py
184 B
Del
OK
__init__.pyc
349 B
Del
OK
__init__.pyo
349 B
Del
OK
account.py
14.5 KB
Del
OK
account.pyc
14.89 KB
Del
OK
account.pyo
14.89 KB
Del
OK
auth_handler.py
18.38 KB
Del
OK
auth_handler.pyc
17.21 KB
Del
OK
auth_handler.pyo
17.1 KB
Del
OK
cert_manager.py
15.59 KB
Del
OK
cert_manager.pyc
16.42 KB
Del
OK
cert_manager.pyo
16.42 KB
Del
OK
cli
-
Del
OK
client.py
30.2 KB
Del
OK
client.pyc
26.95 KB
Del
OK
client.pyo
26.95 KB
Del
OK
configuration.py
5.75 KB
Del
OK
configuration.pyc
7.77 KB
Del
OK
configuration.pyo
7.77 KB
Del
OK
constants.py
6.37 KB
Del
OK
constants.pyc
5.02 KB
Del
OK
constants.pyo
5.02 KB
Del
OK
display
-
Del
OK
eff.py
4.56 KB
Del
OK
eff.pyc
5.2 KB
Del
OK
eff.pyo
5.2 KB
Del
OK
error_handler.py
7.05 KB
Del
OK
error_handler.pyc
6.59 KB
Del
OK
error_handler.pyo
6.59 KB
Del
OK
hooks.py
7.88 KB
Del
OK
hooks.pyc
9.28 KB
Del
OK
hooks.pyo
9.28 KB
Del
OK
lock.py
9.94 KB
Del
OK
lock.pyc
9.92 KB
Del
OK
lock.pyo
9.92 KB
Del
OK
log.py
13.43 KB
Del
OK
log.pyc
13.56 KB
Del
OK
log.pyo
13.45 KB
Del
OK
main.py
50.33 KB
Del
OK
main.pyc
43.83 KB
Del
OK
main.pyo
43.61 KB
Del
OK
plugins
-
Del
OK
renewal.py
22.29 KB
Del
OK
renewal.pyc
17.4 KB
Del
OK
renewal.pyo
17.4 KB
Del
OK
reporter.py
3.48 KB
Del
OK
reporter.pyc
3.75 KB
Del
OK
reporter.pyo
3.68 KB
Del
OK
snap_config.py
3.38 KB
Del
OK
snap_config.pyc
4.73 KB
Del
OK
snap_config.pyo
4.73 KB
Del
OK
storage.py
45.96 KB
Del
OK
storage.pyc
42.26 KB
Del
OK
storage.pyo
42.26 KB
Del
OK
updater.py
3.87 KB
Del
OK
updater.pyc
4.35 KB
Del
OK
updater.pyo
4.35 KB
Del
OK
Edit: configuration.py
"""Certbot user-supplied configuration.""" import copy from six.moves.urllib import parse import zope.interface from certbot import errors from certbot import interfaces from certbot import util from certbot._internal import constants from certbot.compat import misc from certbot.compat import os @zope.interface.implementer(interfaces.IConfig) class NamespaceConfig(object): """Configuration wrapper around :class:`argparse.Namespace`. For more documentation, including available attributes, please see :class:`certbot.interfaces.IConfig`. However, note that the following attributes are dynamically resolved using :attr:`~certbot.interfaces.IConfig.work_dir` and relative paths defined in :py:mod:`certbot._internal.constants`: - `accounts_dir` - `csr_dir` - `in_progress_dir` - `key_dir` - `temp_checkpoint_dir` And the following paths are dynamically resolved using :attr:`~certbot.interfaces.IConfig.config_dir` and relative paths defined in :py:mod:`certbot._internal.constants`: - `default_archive_dir` - `live_dir` - `renewal_configs_dir` :ivar namespace: Namespace typically produced by :meth:`argparse.ArgumentParser.parse_args`. :type namespace: :class:`argparse.Namespace` """ def __init__(self, namespace): object.__setattr__(self, 'namespace', namespace) self.namespace.config_dir = os.path.abspath(self.namespace.config_dir) self.namespace.work_dir = os.path.abspath(self.namespace.work_dir) self.namespace.logs_dir = os.path.abspath(self.namespace.logs_dir) # Check command line parameters sanity, and error out in case of problem. check_config_sanity(self) def __getattr__(self, name): return getattr(self.namespace, name) def __setattr__(self, name, value): setattr(self.namespace, name, value) @property def server_path(self): """File path based on ``server``.""" parsed = parse.urlparse(self.namespace.server) return (parsed.netloc + parsed.path).replace('/', os.path.sep) @property def accounts_dir(self): # pylint: disable=missing-function-docstring return self.accounts_dir_for_server_path(self.server_path) def accounts_dir_for_server_path(self, server_path): """Path to accounts directory based on server_path""" server_path = misc.underscores_for_unsupported_characters_in_path(server_path) return os.path.join( self.namespace.config_dir, constants.ACCOUNTS_DIR, server_path) @property def backup_dir(self): # pylint: disable=missing-function-docstring return os.path.join(self.namespace.work_dir, constants.BACKUP_DIR) @property def csr_dir(self): # pylint: disable=missing-function-docstring return os.path.join(self.namespace.config_dir, constants.CSR_DIR) @property def in_progress_dir(self): # pylint: disable=missing-function-docstring return os.path.join(self.namespace.work_dir, constants.IN_PROGRESS_DIR) @property def key_dir(self): # pylint: disable=missing-function-docstring return os.path.join(self.namespace.config_dir, constants.KEY_DIR) @property def temp_checkpoint_dir(self): # pylint: disable=missing-function-docstring return os.path.join( self.namespace.work_dir, constants.TEMP_CHECKPOINT_DIR) def __deepcopy__(self, _memo): # Work around https://bugs.python.org/issue1515 for py26 tests :( :( # https://travis-ci.org/letsencrypt/letsencrypt/jobs/106900743#L3276 new_ns = copy.deepcopy(self.namespace) return type(self)(new_ns) @property def default_archive_dir(self): # pylint: disable=missing-function-docstring return os.path.join(self.namespace.config_dir, constants.ARCHIVE_DIR) @property def live_dir(self): # pylint: disable=missing-function-docstring return os.path.join(self.namespace.config_dir, constants.LIVE_DIR) @property def renewal_configs_dir(self): # pylint: disable=missing-function-docstring return os.path.join( self.namespace.config_dir, constants.RENEWAL_CONFIGS_DIR) @property def renewal_hooks_dir(self): """Path to directory with hooks to run with the renew subcommand.""" return os.path.join(self.namespace.config_dir, constants.RENEWAL_HOOKS_DIR) @property def renewal_pre_hooks_dir(self): """Path to the pre-hook directory for the renew subcommand.""" return os.path.join(self.renewal_hooks_dir, constants.RENEWAL_PRE_HOOKS_DIR) @property def renewal_deploy_hooks_dir(self): """Path to the deploy-hook directory for the renew subcommand.""" return os.path.join(self.renewal_hooks_dir, constants.RENEWAL_DEPLOY_HOOKS_DIR) @property def renewal_post_hooks_dir(self): """Path to the post-hook directory for the renew subcommand.""" return os.path.join(self.renewal_hooks_dir, constants.RENEWAL_POST_HOOKS_DIR) def check_config_sanity(config): """Validate command line options and display error message if requirements are not met. :param config: IConfig instance holding user configuration :type args: :class:`certbot.interfaces.IConfig` """ # Port check if config.http01_port == config.https_port: raise errors.ConfigurationError( "Trying to run http-01 and https-port " "on the same port ({0})".format(config.https_port)) # Domain checks if config.namespace.domains is not None: for domain in config.namespace.domains: # This may be redundant, but let's be paranoid util.enforce_domain_sanity(domain)
Save