%PDF- %PDF-
Mini Shell

Mini Shell

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

�

M/�e�J��*�dZddlZddlZddlZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddlZddl
mZdd	l
mZdd
lmZddlmZddlmZej*e�ZGd
�dej0�ZGd�d�Zdeddfd�Zdedefd�Zy)z$Certbot user-supplied configuration.�N)�Any)�Dict)�List)�Optional)�parse)�errors)�util)�	constants)�misc)�osc���eZdZdZej
�Z	ej
�Z	ej
�Z	ej
�Z		ej
�Z
y)�ArgumentSourcez;Enum for describing where a configuration argument was set.N)�__name__�
__module__�__qualname__�__doc__�enum�auto�COMMAND_LINE�CONFIG_FILE�DEFAULT�ENV_VAR�RUNTIME���7/usr/lib/python3/dist-packages/certbot/configuration.pyrrsU��E��4�9�9�;�L�4��$�)�)�+�K�6��d�i�i�k�G�N��d�i�i�k�G�;��d�i�i�k�G�0rrc��eZdZdZdej
ddfd�Zdeee	fddfd�Z
dedefd	�Zdeee
ffd
�Zdeddfd�Zedeeee	ffd
��Zdede
fd�Zdede
ddfd�Zedefd��Zej,deddfd��Zedeefd��Zej,deddfd��Zedefd��Zej,deddfd��Zedefd��Zej,deddfd��Zedefd��Zej,deddfd��Zedefd ��Zedefd!��Zedefd"��Zedefd#��Zedefd$��Z edefd%��Z!edefd&��Z"edefd'��Z#edefd(��Z$edefd)��Z%edefd*��Z&edefd+��Z'edefd,��Z(ede)efd-��Z*edefd.��Z+edefd/��Z,edefd0��Z-edeefd1��Z.edefd2��Z/d3edefd4�Z0edefd5��Z1edefd6��Z2edefd7��Z3edefd8��Z4edefd9��Z5edefd:��Z6edefd;��Z7edefd<��Z8edefd=��Z9d>e
ddfd?�Z:y)@�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`

    �	namespace�returnNc�4�|tj|d|�tj|dd�tj|di�tjj	|j
j�|j
_tjj	|j
j�|j
_tjj	|j
j�|j
_t|�y)Nr�_argument_sources�_previously_accessed_mutables)
�object�__setattr__r�path�abspathr�
config_dir�work_dir�logs_dir�_check_config_sanity)�selfrs  r�__init__zNamespaceConfig.__init__As�������4��i�8����4�!4�d�;����4�!@�"�E�$&�G�G�O�O�D�N�N�4M�4M�$N����!�"$�'�'�/�/�$�.�.�2I�2I�"J�����"$�'�'�/�/�$�.�.�2I�2I�"J�����	�T�"r�argument_sourcesc�2�tj|d|�y)al
        Associate the NamespaceConfig with a dictionary describing where each of
        its arguments came from, e.g. `{ 'email': ArgumentSource.CONFIG_FILE }`.
        This is necessary for making runtime evaluations on whether an argument
        was specified by the user or not (see `set_by_user`).

        For an example of how to build such a dictionary, see
        `certbot._internal.cli.helpful.HelpfulArgumentParser._build_sources_dict`

        :ivar argument_sources: dictionary of argument names to their :class:`ArgumentSource`
        :type argument_sources: :class:`Dict[str, ArgumentSource]`
        r"N)r$r%)r,r.s  r�set_argument_sourcesz$NamespaceConfig.set_argument_sourcesOs��	���4�!4�6F�Gr�varc	��ddlm}ddlm}ddlm}|j
�t
d��||vry|dvr&|j|�\}}|d	k(r|duS|d
k(r|duS||j
vrB|j
|tjk7r"tjd|t||��y|j|g�D]<}|j|�s�tjd||j|g��yy)
ad
        Return True if a particular config variable has been set by the user
        (via CLI or config file) including if the user explicitly set it to the
        default, or if it was dynamically set at runtime.  Returns False if the
        variable was assigned a default value.

        Raises an exception if `argument_sources` is not set.
        r)�DEPRECATED_OPTIONS)�
VAR_MODIFIERS)�	selectionNzoNamespaceConfig.set_by_user called without an ArgumentSources dict. See NamespaceConfig.set_argument_sources().F)�
authenticator�	installerr6r7zVar %s=%s (set by user).T)�#certbot._internal.cli.cli_constantsr3r4�certbot._internal.pluginsr5r.�RuntimeError�cli_plugin_requestsrr�logger�debug�getattr�get�set_by_user)r,r1r3r4r5�auth�inst�modifiers        rr@zNamespaceConfig.set_by_useras��	K�E�7�� � �(��>�?�
?��$�$���0�0�"�6�6�t�<�J�D�$��o�%��4�'�'��k�!��4�'�'��$�'�'�'�D�,A�,A�#�,F�.�J`�J`�,`��L�L�3�S�'�$��:L�M��%�)�)�#�r�2�	�H�����)����7���*�*�3��3�5��		�rc�,�t|j�S)zQ
        Returns a dictionary mapping all argument names to their values
        )�varsr�r,s r�to_dictzNamespaceConfig.to_dict�s���D�N�N�#�#r�namec��|j�:tj|j|<||jvr|j|=yyy)a)
        If an argument_sources dict was set, overwrites an argument's source to
        be ArgumentSource.RUNTIME. Used when certbot sets an argument's values
        at runtime. This also clears the modified value from
        _previously_accessed_mutables since it is no longer needed.
        N)r"rrr#)r,rHs  r�_mark_runtime_overridez&NamespaceConfig._mark_runtime_override�sL���!�!�-�+9�+A�+A�D�"�"�4�(��t�9�9�9��6�6�t�<�:�.rc���|jj�j�D]2\}}t|j|�}||k7s�"|j|��4|jS)zPReturns _argument_sources after handling any changes to accessed mutable values.)r#�copy�itemsr>rrJr")r,rH�
prev_value�
current_values    rr.z NamespaceConfig.argument_sources�sd��!%� B� B� G� G� I� O� O� Q�	2��D�*�#�D�N�N�D�9�M��
�*��+�+�D�1�	2��%�%�%rc��|j}t|j|�}|�U||vs||tjk7r;||j
vr-t
|�s"tj|�|j
|<|S�N)	r.r>rrrr#�
_is_immutablerL�deepcopy)r,rH�arg_sources�values    r�__getattr__zNamespaceConfig.__getattr__�su���+�+�������-���"��;�&�+�d�*;�~�?U�?U�*U�
�t�A�A�A�-�X]�J^�?C�}�}�U�?S�D�6�6�t�<��rrUc�T�|j|�t|j||�yrQ)rJ�setattrr)r,rHrUs   rr%zNamespaceConfig.__setattr__�s ���#�#�D�)������e�,rc�.�|jjS)zACME Directory Resource URI.)r�serverrFs rrZzNamespaceConfig.server�s���~�~�$�$�$r�server_c�H�|jd�||j_y)NrZ)rJrrZ)r,r[s  rrZzNamespaceConfig.server�s���#�#�H�-� '����rc�.�|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�emailrFs rr^zNamespaceConfig.email�s���~�~�#�#�#r�mailc�H�|jd�||j_y)Nr^)rJrr^)r,r_s  rr^zNamespaceConfig.email�s���#�#�G�,�#����rc�.�|jjS)zSize of the RSA key.)r�rsa_key_sizerFs rrbzNamespaceConfig.rsa_key_size�s���~�~�*�*�*r�ksizec�H�|jd�||j_y)zSet the rsa_key_size propertyrbN)rJrrb)r,rcs  rrbzNamespaceConfig.rsa_key_size�s��	
�#�#�N�3�&+����#rc�.�|jjS)z`The SECG elliptic curve name to use.

        Please see RFC 8446 for supported values.
        )r�elliptic_curverFs rrfzNamespaceConfig.elliptic_curve�s���~�~�,�,�,r�ecurvec�H�|jd�||j_y)zSet the elliptic_curve propertyrfN)rJrrf)r,rgs  rrfzNamespaceConfig.elliptic_curve�s��	
�#�#�$4�5�(.����%rc�.�|jjS)zhType of generated private key.

        Only *ONE* per invocation can be provided at this time.
        )r�key_typerFs rrjzNamespaceConfig.key_type�s���~�~�&�&�&r�ktypec�H�|jd�||j_y)zSet the key_type propertyrjN)rJrrj)r,rks  rrjzNamespaceConfig.key_type�s��	
�#�#�J�/�"'����rc�.�|jjS)z�Adds the OCSP Must-Staple extension to the certificate.

        Autoconfigures OCSP Stapling for supported setups
        (Apache version >= 2.3.3 ).
        )r�must_staplerFs rrnzNamespaceConfig.must_staple����~�~�)�)�)rc�.�|jjS)zConfiguration directory.)rr(rFs rr(zNamespaceConfig.config_dirs���~�~�(�(�(rc�.�|jjS)zWorking directory.)rr)rFs rr)zNamespaceConfig.work_dirs���~�~�&�&�&rc�8�|j|j�S)z2Directory where all account information is stored.)�accounts_dir_for_server_path�server_pathrFs r�accounts_dirzNamespaceConfig.accounts_dirs���0�0��1A�1A�B�Brc��tjj|jjt
j�S)z Configuration backups directory.)rr&�joinrr)r
�
BACKUP_DIRrFs r�
backup_dirzNamespaceConfig.backup_dirs)���w�w�|�|�D�N�N�3�3�Y�5I�5I�J�Jrc��tjdt�tjj|jjtj�S)zBDirectory where new Certificate Signing Requests (CSRs) are saved.z[NamespaceConfig.csr_dir is deprecated and will be removed in an upcoming release of Certbot)
�warnings�warn�DeprecationWarningrr&rwrr(r
�CSR_DIRrFs r�csr_dirzNamespaceConfig.csr_dir �>��	�
�
�+�,>�	@��w�w�|�|�D�N�N�5�5�y�7H�7H�I�Irc��tjj|jjt
j�S)z:Directory used before a permanent checkpoint is finalized.)rr&rwrr)r
�IN_PROGRESS_DIRrFs r�in_progress_dirzNamespaceConfig.in_progress_dir's)���w�w�|�|�D�N�N�3�3�Y�5N�5N�O�Orc��tjdt�tjj|jjtj�S)z
Keys storage.z[NamespaceConfig.key_dir is deprecated and will be removed in an upcoming release of Certbot)
r{r|r}rr&rwrr(r
�KEY_DIRrFs r�key_dirzNamespaceConfig.key_dir,r�rc��tjj|jjt
j�S)zTemporary checkpoint directory.)rr&rwrr)r
�TEMP_CHECKPOINT_DIRrFs r�temp_checkpoint_dirz#NamespaceConfig.temp_checkpoint_dir3s0���w�w�|�|��N�N�#�#�Y�%B�%B�D�	Drc�.�|jjS)z�Disable verification of the ACME server's certificate.

        The root certificates trusted by Certbot can be overriden by setting the
        REQUESTS_CA_BUNDLE environment variable.
        )r�
no_verify_sslrFs rr�zNamespaceConfig.no_verify_ssl9s���~�~�+�+�+rc�.�|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_portrFs rr�zNamespaceConfig.http01_portBrorc�.�|jjS)z;The address the server listens to during http-01 challenge.)r�http01_addressrFs rr�zNamespaceConfig.http01_addressKs���~�~�,�,�,rc�.�|jjS)z�Port used to serve HTTPS.

        This affects which port Nginx will listen on after a LE certificate
        is installed.
        )r�
https_portrFs rr�zNamespaceConfig.https_portPs���~�~�(�(�(rc�.�|jjS)zuList of user specified preferred challenges.

        Sorted with the most preferred challenge listed first.
        )r�pref_challsrFs rr�zNamespaceConfig.pref_challsYs���~�~�)�)�)rc�.�|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_namesrFs rr�z%NamespaceConfig.allow_subset_of_namesas���~�~�3�3�3rc�.�|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_permissionsrFs rr�z"NamespaceConfig.strict_permissionsms���~�~�0�0�0rc�.�|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_updatesrFs rr�z%NamespaceConfig.disable_renew_updatesvs���~�~�3�3�3rc�.�|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_chainrFs rr�zNamespaceConfig.preferred_chains���~�~�-�-�-rc���tj|jj�}|j|j
zj
dtj
j�S)zFile path based on ``server``.�/)	r�urlparserrZ�netlocr&�replacer�sep)r,�parseds  rrtzNamespaceConfig.server_path�sD�������� 5� 5�6���
�
����+�4�4�S�"�'�'�+�+�F�Frrtc��tj|�}tjj	|j
jtj|�S)z/Path to accounts directory based on server_path)	r�.underscores_for_unsupported_characters_in_pathrr&rwrr(r
�ACCOUNTS_DIR)r,rts  rrsz,NamespaceConfig.accounts_dir_for_server_path�s@���I�I�+�V���w�w�|�|��N�N�%�%�y�'=�'=�{�L�	Lrc��tjj|jjt
j�SrQ)rr&rwrr(r
�ARCHIVE_DIRrFs r�default_archive_dirz#NamespaceConfig.default_archive_dir�s'���w�w�|�|�D�N�N�5�5�y�7L�7L�M�Mrc��tjj|jjt
j�SrQ)rr&rwrr(r
�LIVE_DIRrFs r�live_dirzNamespaceConfig.live_dir�s'���w�w�|�|�D�N�N�5�5�y�7I�7I�J�Jrc��tjj|jjt
j�SrQ)rr&rwrr(r
�RENEWAL_CONFIGS_DIRrFs r�renewal_configs_dirz#NamespaceConfig.renewal_configs_dir�s.���w�w�|�|��N�N�%�%�y�'D�'D�F�	Frc��tjj|jjt
j�S)z>Path to directory with hooks to run with the renew subcommand.)rr&rwrr(r
�RENEWAL_HOOKS_DIRrFs r�renewal_hooks_dirz!NamespaceConfig.renewal_hooks_dir�s.���w�w�|�|�D�N�N�5�5�%�7�7�9�	9rc�r�tjj|jtj
�S)z8Path to the pre-hook directory for the renew subcommand.)rr&rwr�r
�RENEWAL_PRE_HOOKS_DIRrFs r�renewal_pre_hooks_dirz%NamespaceConfig.renewal_pre_hooks_dir�s*���w�w�|�|�D�2�2�%�;�;�=�	=rc�r�tjj|jtj
�S)z;Path to the deploy-hook directory for the renew subcommand.)rr&rwr�r
�RENEWAL_DEPLOY_HOOKS_DIRrFs r�renewal_deploy_hooks_dirz(NamespaceConfig.renewal_deploy_hooks_dir�s,���w�w�|�|�D�2�2�%�>�>�@�	@rc�r�tjj|jtj
�S)z9Path to the post-hook directory for the renew subcommand.)rr&rwr�r
�RENEWAL_POST_HOOKS_DIRrFs r�renewal_post_hooks_dirz&NamespaceConfig.renewal_post_hooks_dir�s*���w�w�|�|�D�2�2�%�<�<�>�	>rc�.�|jjS)zuThis option specifies how long (in seconds) Certbot will wait
        for the server to issue a certificate.
        )r�issuance_timeoutrFs rr�z NamespaceConfig.issuance_timeout�s��
�~�~�.�.�.rc�.�|jjS)z�This option specifies whether Certbot should generate a new private
        key when replacing a certificate, even if reuse_key is set.
        )r�new_keyrFs rr�zNamespaceConfig.new_key�s��
�~�~�%�%�%r�_memoc�6�tj|j�}t|�|�}tj|dtj|j��tj|dtj|j��|S)Nr"r#)rLrSr�typer$r%r.r#)r,r��new_ns�
new_configs    r�__deepcopy__zNamespaceConfig.__deepcopy__�sr�����t�~�~�.���T�$�Z��'�
����:�':�D�M�M�$�J_�J_�<`�a����:�'F��=�=��)K�)K�L�	N��r);rrrr�argparse�	Namespacer-r�strrr0�boolr@rrGrJ�propertyrr.rVr%rZ�setterr^�intrbrfrjrnr(r)ruryrr�r�r�r�r�r�r�rr�r�r�r�r�rtrsr�r�r�r�r�r�r�r�r�r�rrrrr&sg���4#�(�"4�"4�#��#�H�T�#�~�:M�5N�H�SW�H�$(�s�(�t�(�T$��c�3�h��$�
=�3�
=�4�
=��&�(�4��^�0C�+D�"E�&��&�&
��
��
�-��-�C�-�D�-��%��%��%��]�]�(�c�(�d�(��(��$�x��}�$��$��\�\�$�#�$�$�$��$��+�c�+��+����,�#�,�$�,��,�
�-��-��-����/�S�/�T�/��/�
�'�#�'��'��_�_�(�c�(�d�(��(�
�*�T�*��*��)�C�)��)��'�#�'��'��C�c�C��C��K�C�K��K��J��J��J��P��P��P��J��J��J��D�S�D��D�
�,�t�,��,��*�S�*��*��-��-��-��)�C�)��)��*�T�#�Y�*��*��	4�t�	4��	4��1�D�1��1��4�t�4��4��.��#��.��.��G�S�G��G�
L��L��L��N�S�N��N��K�#�K��K��F�S�F��F��9�3�9��9�
�=�s�=��=�
�@�#�@��@�
�>��>��>�
�/�#�/��/��&��&��&��#��*;�rr�configr c� �|j|jk(r.tjdj	|j���|j
j�1|j
jD]}tj|��yy)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)	r�r�r�ConfigurationError�formatr�domainsr	�enforce_domain_sanity)r��domains  rr+r+�s������V�.�.�.��'�'�
%�%+�V�F�,=�,=�%>�@�	@�
�����+��&�&�.�.�	/�F��&�&�v�.�	/�,rrUc��t|t�rtd�|D��Sttt
ttttfD]}t||�s�y|duS)zIs value of an immutable type?c3�2K�|]}t|����y�wrQ)rR)�.0�subvalues  r�	<genexpr>z _is_immutable.<locals>.<genexpr>�s����A�x�=��*�A�s�TN)
�
isinstance�tuple�allr��float�complexr��bytesr��	frozenset)rU�immutable_types  rrRrR�sT���%����A�5�A�A�A���w��U�D�)�M����e�^�,����D�=�r)rr�rLr�logging�typingrrrr�urllibrr{�certbotrr	�certbot._internalr
�certbot.compatrr�	getLoggerrr<�Enumrrr+r�rRrrr�<module>r�s���*�������������'���
��	�	�8�	$��1�T�Y�Y�1�l�l�^
/��/�T�/�*	��	��	r

Zerion Mini Shell 1.0