ok

Mini Shell

Direktori : /lib/python3.6/site-packages/certbot/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/certbot/__pycache__/configuration.cpython-36.pyc

3

گa�+�@s�dZddlZddlZddlmZddlmZddlmZddlmZddl	m
Z
ddl	mZdd	lm
Z
dd
lmZddlmZGdd
�d
�Zedd�dd�ZdS)z$Certbot user-supplied configuration.�N)�Any)�List)�Optional)�parse)�errors)�util)�	constants)�misc)�osc@seZdZdZejdd�dd�Zeed�dd�Z	eedd	�d
d�Z
eed�d
d��Zej
edd�dd��Zeeed�dd��Zej
edd�dd��Zeed�dd��Zej
edd�dd��Zeed�dd��Zej
edd�dd��Zeed�dd��Zej
edd�d d��Zeed�d!d"��Zeed�d#d$��Zeed�d%d&��Zeed�d'd(��Zeed�d)d*��Zeed�d+d,��Zeed�d-d.��Zeed�d/d0��Zeed�d1d2��Zeed�d3d4��Zeed�d5d6��Zeed�d7d8��Z eed�d9d:��Z!ee"ed�d;d<��Z#eed�d=d>��Z$eed�d?d@��Z%eed�dAdB��Z&eeed�dCdD��Z'eed�dEdF��Z(eedG�dHdI�Z)eed�dJdK��Z*eed�dLdM��Z+eed�dNdO��Z,eed�dPdQ��Z-eed�dRdS��Z.eed�dTdU��Z/eed�dVdW��Z0eed�dXdY��Z1eddZ�d[d\�Z2dS)]�NamespaceConfiga4Configuration wrapper around :class:`argparse.Namespace`.

    Please note that the following attributes are dynamically resolved using
    :attr:`~certbot.configuration.NamespaceConfig.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.configuration.NamespaceConfig.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`

    N)�	namespace�returncCsZ|tj|d|�tjj|jj�|j_tjj|jj�|j_tjj|jj�|j_t	|�dS)Nr)
�object�__setattr__r
�path�abspathr�
config_dir�work_dirZlogs_dir�_check_config_sanity)�selfr�r�#/usr/lib/python3.6/configuration.py�__init__+szNamespaceConfig.__init__)�namer
cCst|j|�S)N)�getattrr)rrrrr�__getattr__9szNamespaceConfig.__getattr__)r�valuer
cCst|j||�dS)N)�setattrr)rrrrrrr<szNamespaceConfig.__setattr__)r
cCs|jjS)zACME Directory Resource URI.)r�server)rrrrr?szNamespaceConfig.server)�server_r
cCs||j_dS)N)rr)rrrrrrDscCs|jjS)z�Email used for registration and recovery contact.

        Use comma to register multiple emails,
        ex: u1@example.com,u2@example.com. (default: Ask).
        )r�email)rrrrr HszNamespaceConfig.email)�mailr
cCs||j_dS)N)rr )rr!rrrr QscCs|jjS)zSize of the RSA key.)r�rsa_key_size)rrrrr"UszNamespaceConfig.rsa_key_size)�ksizer
cCs||j_dS)zSet the rsa_key_size propertyN)rr")rr#rrrr"ZscCs|jjS)z`The SECG elliptic curve name to use.

        Please see RFC 8446 for supported values.
        )r�elliptic_curve)rrrrr$_szNamespaceConfig.elliptic_curve)�ecurver
cCs||j_dS)zSet the elliptic_curve propertyN)rr$)rr%rrrr$gscCs|jjS)zhType of generated private key.

        Only *ONE* per invocation can be provided at this time.
        )r�key_type)rrrrr&lszNamespaceConfig.key_type)�ktyper
cCs||j_dS)zSet the key_type propertyN)rr&)rr'rrrr&tscCs|jjS)z�Adds the OCSP Must Staple extension to the certificate.

        Autoconfigures OCSP Stapling for supported setups
        (Apache version >= 2.3.3 ).
        )r�must_staple)rrrrr(yszNamespaceConfig.must_staplecCs|jjS)zConfiguration directory.)rr)rrrrr�szNamespaceConfig.config_dircCs|jjS)zWorking directory.)rr)rrrrr�szNamespaceConfig.work_dircCs|j|j�S)z2Directory where all account information is stored.)�accounts_dir_for_server_path�server_path)rrrr�accounts_dir�szNamespaceConfig.accounts_dircCstjj|jjtj�S)z Configuration backups directory.)r
r�joinrrrZ
BACKUP_DIR)rrrr�
backup_dir�szNamespaceConfig.backup_dircCstjj|jjtj�S)zBDirectory where new Certificate Signing Requests (CSRs) are saved.)r
rr,rrrZCSR_DIR)rrrr�csr_dir�szNamespaceConfig.csr_dircCstjj|jjtj�S)z:Directory used before a permanent checkpoint is finalized.)r
rr,rrrZIN_PROGRESS_DIR)rrrr�in_progress_dir�szNamespaceConfig.in_progress_dircCstjj|jjtj�S)z
Keys storage.)r
rr,rrrZKEY_DIR)rrrr�key_dir�szNamespaceConfig.key_dircCstjj|jjtj�S)zTemporary checkpoint directory.)r
rr,rrrZTEMP_CHECKPOINT_DIR)rrrr�temp_checkpoint_dir�sz#NamespaceConfig.temp_checkpoint_dircCs|jjS)z6Disable verification of the ACME server's certificate.)r�
no_verify_ssl)rrrrr2�szNamespaceConfig.no_verify_sslcCs|jjS)z�Port used in the http-01 challenge.

        This only affects the port Certbot listens on.
        A conforming ACME server will still attempt to connect on port 80.
        )r�http01_port)rrrrr3�szNamespaceConfig.http01_portcCs|jjS)z;The address the server listens to during http-01 challenge.)r�http01_address)rrrrr4�szNamespaceConfig.http01_addresscCs|jjS)z�Port used to serve HTTPS.

        This affects which port Nginx will listen on after a LE certificate
        is installed.
        )r�
https_port)rrrrr5�szNamespaceConfig.https_portcCs|jjS)zuList of user specified preferred challenges.

        Sorted with the most preferred challenge listed first.
        )r�pref_challs)rrrrr6�szNamespaceConfig.pref_challscCs|jjS)a�Allow only a subset of names to be authorized to perform validations.

        When performing domain validation, do not consider it a failure
        if authorizations can not be obtained for a strict subset of
        the requested domains. This may be useful for allowing renewals for
        multiple domains to succeed even if some domains no longer point
        at this system.
        )r�allow_subset_of_names)rrrrr7�s
z%NamespaceConfig.allow_subset_of_namescCs|jjS)z�Enable strict permissions checks.

        Require that all configuration files are owned by the current
        user; only needed if your config is somewhere unsafe like /tmp/.
        )r�strict_permissions)rrrrr8�sz"NamespaceConfig.strict_permissionscCs|jjS)z�Disable renewal updates.

        If updates provided by installer enhancements when Certbot is being run
        with "renew" verb should be disabled.
        )r�disable_renew_updates)rrrrr9�sz%NamespaceConfig.disable_renew_updatescCs|jjS)z�Set the preferred certificate chain.

        If the CA offers multiple certificate chains, prefer the chain whose
        topmost certificate was issued from this Subject Common Name.
        If no match, the default offered chain will be used.
        )r�preferred_chain)rrrrr:�szNamespaceConfig.preferred_chaincCs&tj|jj�}|j|jjdtjj�S)zFile path based on ``server``.�/)	rZurlparserrZnetlocr�replacer
�sep)rZparsedrrrr*�szNamespaceConfig.server_path)r*r
cCs tj|�}tjj|jjtj|�S)z/Path to accounts directory based on server_path)	r	Z.underscores_for_unsupported_characters_in_pathr
rr,rrrZACCOUNTS_DIR)rr*rrrr)�s
z,NamespaceConfig.accounts_dir_for_server_pathcCstjj|jjtj�S)N)r
rr,rrrZARCHIVE_DIR)rrrr�default_archive_dirsz#NamespaceConfig.default_archive_dircCstjj|jjtj�S)N)r
rr,rrrZLIVE_DIR)rrrr�live_dirszNamespaceConfig.live_dircCstjj|jjtj�S)N)r
rr,rrrZRENEWAL_CONFIGS_DIR)rrrr�renewal_configs_dirsz#NamespaceConfig.renewal_configs_dircCstjj|jjtj�S)z>Path to directory with hooks to run with the renew subcommand.)r
rr,rrrZRENEWAL_HOOKS_DIR)rrrr�renewal_hooks_dirsz!NamespaceConfig.renewal_hooks_dircCstjj|jtj�S)z8Path to the pre-hook directory for the renew subcommand.)r
rr,rArZRENEWAL_PRE_HOOKS_DIR)rrrr�renewal_pre_hooks_dirs
z%NamespaceConfig.renewal_pre_hooks_dircCstjj|jtj�S)z;Path to the deploy-hook directory for the renew subcommand.)r
rr,rArZRENEWAL_DEPLOY_HOOKS_DIR)rrrr�renewal_deploy_hooks_dirs
z(NamespaceConfig.renewal_deploy_hooks_dircCstjj|jtj�S)z9Path to the post-hook directory for the renew subcommand.)r
rr,rArZRENEWAL_POST_HOOKS_DIR)rrrr�renewal_post_hooks_dir"s
z&NamespaceConfig.renewal_post_hooks_dircCs|jjS)zuThis option specifies how long (in seconds) Certbot will wait
        for the server to issue a certificate.
        )r�issuance_timeout)rrrrrE(sz NamespaceConfig.issuance_timeout)�_memor
cCstj|j�}t|�|�S)N)�copy�deepcopyr�type)rrFZnew_nsrrr�__deepcopy__1szNamespaceConfig.__deepcopy__)3�__name__�
__module__�__qualname__�__doc__�argparseZ	Namespacer�strrrr�propertyr�setterrr �intr"r$r&�boolr(rrr+r-r.r/r0r1r2r3r4r5rr6r7r8r9r:r*r)r>r?r@rArBrCrDrErJrrrrrs�	r)�configr
cCsJ|j|jkrtjdj|j���|jjdk	rFx|jjD]}tj|�q4WdS)z�Validate command line options and display error message if
    requirements are not met.

    :param config: NamespaceConfig instance holding user configuration
    :type args: :class:`certbot.configuration.NamespaceConfig`

    z;Trying to run http-01 and https-port on the same port ({0})N)	r3r5rZConfigurationError�formatrZdomainsrZenforce_domain_sanity)rUZdomainrrrr8s	
r)rNrOrGZtypingrrrZurllibrZcertbotrrZcertbot._internalrZcertbot.compatr	r
rrrrrr�<module>s*

Zerion Mini Shell 1.0