Your IP : 216.73.216.224


Current Path : /lib/python3/dist-packages/certbot/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/certbot/__pycache__/configuration.cpython-38.pyc

U

�]��@s�dZddlZddlZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	lm
Z
ej�e	j�Gd
d�de��Zdd
�ZdS)z$Certbot user-supplied configuration.�N)�parse)�	constants)�errors)�
interfaces)�util)�misc)�osc@s�eZdZdZdd�Zdd�Zdd�Zedd	��Zed
d��Z	dd
�Z
edd��Zedd��Zedd��Z
edd��Zedd��Zdd�Zedd��Zedd��Zedd��Zed d!��Zed"d#��Zed$d%��Zed&d'��Zd(S))�NamespaceConfiga|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.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.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`

    cCsVt�|d|�tj�|jj�|j_tj�|jj�|j_tj�|jj�|j_t	|�dS)N�	namespace)
�object�__setattr__r�path�abspathr
�
config_dir�work_dirZlogs_dir�check_config_sanity)�selfr
�r�7/usr/lib/python3/dist-packages/certbot/configuration.py�__init__-s
zNamespaceConfig.__init__cCst|j|�S�N)�getattrr
)r�namerrr�__getattr__7szNamespaceConfig.__getattr__cCst|j||�dSr)�setattrr
)rr�valuerrrr:szNamespaceConfig.__setattr__cCs&t�|jj�}|j|j�dtjj�S)zFile path based on ``server``.�/)	rZurlparser
ZserverZnetlocr
�replacer�sep)rZparsedrrr�server_path=szNamespaceConfig.server_pathcCs|�|j�Sr)�accounts_dir_for_server_pathr�rrrr�accounts_dirCszNamespaceConfig.accounts_dircCs t�|�}tj�|jjtj|�S)z/Path to accounts directory based on server_path)	rZ.underscores_for_unsupported_characters_in_pathrr
�joinr
rrZACCOUNTS_DIR)rrrrrr Gs
�z,NamespaceConfig.accounts_dir_for_server_pathcCstj�|jjtj�Sr)rr
r#r
rrZ
BACKUP_DIRr!rrr�
backup_dirMszNamespaceConfig.backup_dircCstj�|jjtj�Sr)rr
r#r
rrZCSR_DIRr!rrr�csr_dirQszNamespaceConfig.csr_dircCstj�|jjtj�Sr)rr
r#r
rrZIN_PROGRESS_DIRr!rrr�in_progress_dirUszNamespaceConfig.in_progress_dircCstj�|jjtj�Sr)rr
r#r
rrZKEY_DIRr!rrr�key_dirYszNamespaceConfig.key_dircCstj�|jjtj�Sr)rr
r#r
rrZTEMP_CHECKPOINT_DIRr!rrr�temp_checkpoint_dir]s�z#NamespaceConfig.temp_checkpoint_dircCst�|j�}t|�|�Sr)�copy�deepcopyr
�type)rZ_memoZnew_nsrrr�__deepcopy__bszNamespaceConfig.__deepcopy__cCstj�|jjtj�Sr)rr
r#r
rrZARCHIVE_DIRr!rrr�default_archive_dirhsz#NamespaceConfig.default_archive_dircCstj�|jjtj�Sr)rr
r#r
rrZLIVE_DIRr!rrr�live_dirlszNamespaceConfig.live_dircCstj�|jjtj�Sr)rr
r#r
rrZRENEWAL_CONFIGS_DIRr!rrr�renewal_configs_dirps�z#NamespaceConfig.renewal_configs_dircCstj�|jjtj�S)z>Path to directory with hooks to run with the renew subcommand.)rr
r#r
rrZRENEWAL_HOOKS_DIRr!rrr�renewal_hooks_dirus�z!NamespaceConfig.renewal_hooks_dircCstj�|jtj�S)z8Path to the pre-hook directory for the renew subcommand.)rr
r#r0rZRENEWAL_PRE_HOOKS_DIRr!rrr�renewal_pre_hooks_dir{s
�z%NamespaceConfig.renewal_pre_hooks_dircCstj�|jtj�S)z;Path to the deploy-hook directory for the renew subcommand.)rr
r#r0rZRENEWAL_DEPLOY_HOOKS_DIRr!rrr�renewal_deploy_hooks_dir�s
�z(NamespaceConfig.renewal_deploy_hooks_dircCstj�|jtj�S)z9Path to the post-hook directory for the renew subcommand.)rr
r#r0rZRENEWAL_POST_HOOKS_DIRr!rrr�renewal_post_hooks_dir�s
�z&NamespaceConfig.renewal_post_hooks_dirN)�__name__�
__module__�__qualname__�__doc__rrr�propertyrr"r r$r%r&r'r(r,r-r.r/r0r1r2r3rrrrr	sD













r	cCsF|j|jkrt�d�|j���|jjdk	rB|jjD]}t�|�q2dS)z�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`

    z;Trying to run http-01 and https-port on the same port ({0})N)	Zhttp01_portZ
https_portrZConfigurationError�formatr
ZdomainsrZenforce_domain_sanity)ZconfigZdomainrrrr�s	��r)r7r)Zzope.interface�zopeZsix.moves.urllibrZcertbotrrrrZcertbot.compatrrZ	interfaceZimplementerZIConfigrr	rrrrr�<module>s~