Ë
    M/ÅeuD  ã            
       ó  — d Z ddlmZ ddlmZ ddlZddlZddlZddlZddlZddl	Z	ddl
mZ ddl
mZ ddl
mZ ddl
mZ dd	l
mZ dd
l
mZ ddl
mZ ddl
mZ ddl
mZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z  ddlm!Z! ddl"m#Z$ ddl"m%Z& ddl'm(Z( ejR                  dk\  rddl*m+Z, nddl,Z, ejZ                  e.«      Z/de0de0fd„Z1de0de0fd„Z2 ejf                  d «      Z4 ejf                  d!ejj                  «      Z6 G d"„ d#e&e¬$«      Z% G d%„ d&e$e%e¬$«      Z# G d'„ d(e#ejn                  e¬$«      Z8 ed)d*¬+«      Z9 G d,„ d*«      Z: G d-„ d.«      Z;d/e0d0e0d1e0d2ee0   ddf
d3„Z<d4e0d5e0dee0e0e0f   fd6„Z=y)7zPlugin common functions.é    )ÚABCMeta)ÚabstractmethodN)ÚAny)ÚCallable)ÚIterable)ÚList)ÚOptional)ÚSet)ÚTuple)ÚType)ÚTypeVar)Ú
challenges)Úachallenges)Úconfiguration)Úcrypto_util)Úerrors)Ú
interfaces)Úreverter)Ú	constants)Ú
filesystem)Úos)Ú	Installer)ÚPlugin)ÚPluginStorage)é   é	   ÚnameÚreturnc                 ó   — | dz   S )ú9ArgumentParser options namespace (prefix of all options).ú-© ©r   s    ú8/usr/lib/python3/dist-packages/certbot/plugins/common.pyÚoption_namespacer%   *   s   € à�#‰:Ðó    c                 ó,   — | j                  dd«      dz   S )ú;ArgumentParser dest namespace (prefix of all destinations).r!   Ú_)Úreplacer#   s    r$   Údest_namespacer+   /   s   € à�<‰<˜˜SÓ! CÑ'Ð'r&   zX(^127\.0\.0\.1)|(^10\.)|(^172\.1[6-9]\.)|(^172\.2[0-9]\.)|(^172\.3[0-1]\.)|(^192\.168\.)z3^(([a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\.)*[a-z]+$c                   ó&  ‡ — e Zd ZdZdej
                  deddfˆ fd„Zee	de
d   ddfd	„«       «       Zed
ej                  deddfd„«       Zedefd„«       Zdedefd„Zedefd„«       Zdedefd„Zdedefd„Zdeej0                     defd„Zˆ xZS )r   zGeneric plugin.Úconfigr   r   Nc                 óB   •— t         ‰| �  ||«       || _        || _        y ©N)ÚsuperÚ__init__r-   r   )Úselfr-   r   Ú	__class__s      €r$   r1   zPlugin.__init__>   s    ø€ Ü‰Ñ˜ Ô&ØˆŒØˆ�	r&   Úadd).Nc                  ó   — y)zéAdd plugin arguments to the CLI argument parser.

        :param callable add: Function that proxies calls to
            `argparse.ArgumentParser.add_argument` prepending options
            with unique plugin name prefix.

        Nr"   )Úclsr4   s     r$   Úadd_parser_argumentszPlugin.add_parser_argumentsC   s   � r&   Úparserc                 ó^   ‡‡— dt         dt        dt        ddfˆˆfd„}| j                  |«      S )zkInject parser options.

        See `~.certbot.interfaces.Plugin.inject_parser_options` for docs.

        Úarg_name_no_prefixÚargsÚkwargsr   Nc                 ód   •—  ‰j                   dj                  t        ‰«      | «      g|¢­i |¤Ž y )Nz--{0}{1})Úadd_argumentÚformatr%   )r:   r;   r<   r   r8   s      €€r$   r4   z)Plugin.inject_parser_options.<locals>.addV   s:   ø€ ØˆF×ÑØ×!Ñ!Ô"2°4Ó"8Ð:LÓMð!àò!àó!r&   )Ústrr   r7   )r6   r8   r   r4   s    `` r$   Úinject_parser_optionszPlugin.inject_parser_optionsN   s7   ù€ ð	!¤Cð 	!´ð 	!¼sð 	!Àtö 	!ð ×'Ñ'¨Ó,Ð,r&   c                 ó,   — t        | j                  «      S )r    )r%   r   ©r2   s    r$   r%   zPlugin.option_namespace\   s   € ô   §	¡	Ó*Ð*r&   c                 ó    — | j                   |z   S )z'Option name (include plugin namespace).)r%   )r2   r   s     r$   Úoption_namezPlugin.option_namea   s   € à×$Ñ$ tÑ+Ð+r&   c                 ó,   — t        | j                  «      S )r(   )r+   r   rC   s    r$   r+   zPlugin.dest_namespacee   s   € ô ˜dŸi™iÓ(Ð(r&   Úvarc                 ó@   — | j                   |j                  dd«      z   S )z.Find a destination for given variable ``var``.r!   r)   )r+   r*   ©r2   rG   s     r$   ÚdestzPlugin.destj   s    € ð ×"Ñ" S§[¡[°°cÓ%:Ñ:Ð:r&   c                 óL   — t        | j                  | j                  |«      «      S )z0Find a configuration value for variable ``var``.)Úgetattrr-   rJ   rI   s     r$   ÚconfzPlugin.confp   s   € ä�t—{‘{ D§I¡I¨c£NÓ3Ð3r&   Úfailed_achallsc                 óª   — dj                  t        |D �ch c]  }|j                  ’Œ c}«      «      }dj                  | j                  |¬«      S c c}w )a9  Human-readable string to help the user troubleshoot the authenticator.

        Shown to the user if one or more of the attempted challenges were not a success.

        Should describe, in simple language, what the authenticator tried to do, what went
        wrong and what the user should try as their "next steps".

        TODO: auth_hint belongs in Authenticator but can't be added until the next major
        version of Certbot. For now, it lives in .Plugin and auth_handler will only call it
        on authenticators that subclass .Plugin. For now, inherit from `.Plugin` to implement
        and/or override the method.

        :param list failed_achalls: List of one or more failed challenges
                                    (:class:`achallenges.AnnotatedChallenge` subclasses).

        :rtype str:
        z and záThe Certificate Authority couldn't externally verify that the {name} plugin completed the required {challs} challenges. Ensure the plugin is configured correctly and that the changes it makes are accessible from the internet.)r   Úchalls)ÚjoinÚsortedÚtypr?   r   )r2   rN   ÚachallrP   s       r$   Ú	auth_hintzPlugin.auth_hintt   sK   € ð( —‘œf¸~Ö%N°V f§j£jÒ%NÓOÓPˆð\÷ ‘˜TŸY™Y¨v�Ó6ð	8ùò &Os   •A)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚNamespaceConfigr@   r1   Úclassmethodr   r   r7   ÚargparseÚArgumentParserrA   Úpropertyr%   rE   r+   rJ   r   rM   r   r   ÚAnnotatedChallengerU   Ú__classcell__©r3   s   @r$   r   r   ;   s  ø„ Ùð˜}×<Ñ<ð ÀCð ÈDõ ð
 Øð x°	Ñ':ð ¸tò ó ó ðð ð-¨8×+BÑ+Bð -È#ð -ÐRVò -ó ð-ð ð+ #ò +ó ð+ð, ð ,¨ó ,ð ð) ò )ó ð)ð;˜ð ; ó ;ð4˜ð 4 ó 4ð8¨¨[×-KÑ-KÑ(Lð 8ÐQT÷ 8r&   r   )Ú	metaclassc            	       ó¸   ‡ — e Zd ZdZdededdfˆ fd„Z	 ddee   ded	eddfd
„Z	deddfd„Z
dd„Zdd„Zddeddfd„Zedefd„«       Zedefd„«       Zdd„Zˆ xZS )r   z‹An installer base class with reverter and ssl_dhparam methods defined.

    Installer plugins do not have to inherit from this class.

    r;   r<   r   Nc                 ó¶   •— t        ‰| �  |i |¤Ž t        | j                  | j                  «      | _        t        j                  | j                  «      | _        y r/   )r0   r1   r   r-   r   Ústorager   ÚReverter)r2   r;   r<   r3   s      €r$   r1   zInstaller.__init__•   sA   ø€ Ü‰Ñ˜$Ð) &Ò)Ü$ T§[¡[°$·)±)Ó<ˆŒÜ ×)Ñ)¨$¯+©+Ó6ˆ�r&   Ú
save_filesÚ
save_notesÚ	temporaryc                 óè   — |r| j                   j                  }n| j                   j                  }	  |||«       y# t        j                  $ r#}t        j
                  t        |«      «      ‚d}~ww xY w)a´  Add files to a checkpoint.

        :param set save_files: set of filepaths to save
        :param str save_notes: notes about changes during the save
        :param bool temporary: True if the files should be added to a
            temporary checkpoint rather than a permanent one. This is
            usually used for changes that will soon be reverted.

        :raises .errors.PluginError: when unable to add to checkpoint

        N)r   Úadd_to_temp_checkpointÚadd_to_checkpointr   ÚReverterErrorÚPluginErrorr@   )r2   rg   rh   ri   Úcheckpoint_funcÚerrs         r$   rl   zInstaller.add_to_checkpointš   s_   € ñ Ø"Ÿm™m×BÑB‰Oà"Ÿm™m×=Ñ=ˆOð	/Ù˜J¨
Õ3øÜ×#Ñ#ò 	/Ü×$Ñ$¤S¨£XÓ.Ð.ûð	/ús   ±	; »A1ÁA,Á,A1Útitlec                 ó®   — 	 | j                   j                  |«       y# t        j                  $ r#}t        j                  t        |«      «      ‚d}~ww xY w)z±Timestamp and save changes made through the reverter.

        :param str title: Title describing checkpoint

        :raises .errors.PluginError: when an error occurs

        N)r   Úfinalize_checkpointr   rm   rn   r@   )r2   rq   rp   s      r$   rs   zInstaller.finalize_checkpoint±   sD   € ð	/Ø�M‰M×-Ñ-¨eÕ4øÜ×#Ñ#ò 	/Ü×$Ñ$¤S¨£XÓ.Ð.ûð	/úó   ‚ žA±AÁAc                 ó¬   — 	 | j                   j                  «        y# t        j                  $ r#}t        j                  t        |«      «      ‚d}~ww xY w)zÉRevert all previously modified files.

        Reverts all modified files that have not been saved as a checkpoint

        :raises .errors.PluginError: If unable to recover the configuration

        N)r   Úrecovery_routiner   rm   rn   r@   ©r2   rp   s     r$   rv   zInstaller.recovery_routine¾   sB   € ð	/Ø�M‰M×*Ñ*Õ,øÜ×#Ñ#ò 	/Ü×$Ñ$¤S¨£XÓ.Ð.ûð	/úó   ‚ �A°AÁAc                 ó¬   — 	 | j                   j                  «        y# t        j                  $ r#}t        j                  t        |«      «      ‚d}~ww xY w)zkRollback temporary checkpoint.

        :raises .errors.PluginError: when unable to revert config

        N)r   Úrevert_temporary_configr   rm   rn   r@   rw   s     r$   rz   z!Installer.revert_temporary_configË   sB   € ð	/Ø�M‰M×1Ñ1Õ3øÜ×#Ñ#ò 	/Ü×$Ñ$¤S¨£XÓ.Ð.ûð	/úrx   Úrollbackc                 ó®   — 	 | j                   j                  |«       y# t        j                  $ r#}t        j                  t        |«      «      ‚d}~ww xY w)zúRollback saved checkpoints.

        :param int rollback: Number of checkpoints to revert

        :raises .errors.PluginError: If there is a problem with the input or
            the function is unable to correctly revert the configuration

        N)r   Úrollback_checkpointsr   rm   rn   r@   )r2   r{   rp   s      r$   r}   zInstaller.rollback_checkpointsÖ   sD   € ð	/Ø�M‰M×.Ñ.¨xÕ8øÜ×#Ñ#ò 	/Ü×$Ñ$¤S¨£XÓ.Ð.ûð	/úrt   c                 ó†   — t         j                  j                  | j                  j                  t
        j                  «      S )z(Full absolute path to ssl_dhparams file.)r   ÚpathrQ   r-   Ú
config_dirr   ÚSSL_DHPARAMS_DESTrC   s    r$   Ússl_dhparamszInstaller.ssl_dhparamsä   s)   € ô �w‰w�|‰|˜DŸK™K×2Ñ2´I×4OÑ4OÓPÐPr&   c                 ó†   — t         j                  j                  | j                  j                  t
        j                  «      S )z:Full absolute path to digest of updated ssl_dhparams file.)r   r   rQ   r-   r€   r   ÚUPDATED_SSL_DHPARAMS_DIGESTrC   s    r$   Úupdated_ssl_dhparams_digestz%Installer.updated_ssl_dhparams_digesté   s)   € ô �w‰w�|‰|˜DŸK™K×2Ñ2´I×4YÑ4YÓZÐZr&   c                 ó€   — t        | j                  | j                  t        j                  t        j
                  «       y)zJCopy Certbot's ssl_dhparams file into the system's config dir if required.N)Úinstall_version_controlled_filer‚   r…   r   ÚSSL_DHPARAMS_SRCÚALL_SSL_DHPARAMS_HASHESrC   s    r$   Úinstall_ssl_dhparamszInstaller.install_ssl_dhparamsî   s.   € ä'Ø×ÑØ×,Ñ,Ü×&Ñ&Ü×-Ñ-õ		/r&   ©F©r   N)é   )rV   rW   rX   rY   r   r1   r
   r@   Úboolrl   rs   rv   rz   Úintr}   r^   r‚   r…   rŠ   r`   ra   s   @r$   r   r   �   s¿   ø„ ñð
7˜cð 7¨Sð 7°Tõ 7ð -2ñ/¨C°©Hð /À#ð /Ø%)ð/Ø6:ó/ð./¨ð /°ó /ó/ó	/ñ/¨Sð /¸ó /ð ðQ˜cò Qó ðQð ð[¨Sò [ó ð[÷/r&   r   c                   ó   — e Zd ZdZy)ÚConfiguratorzt
    A plugin that extends certbot.plugins.common.Installer
    and implements certbot.interfaces.Authenticator
    N)rV   rW   rX   rY   r"   r&   r$   r‘   r‘   ÷   s   „ òr&   r‘   ÚGenericAddrÚAddr)Úboundc                   óø   — e Zd ZdZddeeef   defd„Zede	e
   dedee
   fd„«       Zdefd	„Zdeeef   fd
„Zdedefd„Zdefd„Zdefd„Zdefd„Zde
dede
fd„Zdedee   fd„Zdefd„Zdedee   fd„Zy)r“   zˆRepresents an virtual host address.

    :param str addr: addr part of vhost address
    :param str port: port number or \*, or ""

    ÚtupÚipv6c                 ó    — || _         || _        y r/   )r–   r—   )r2   r–   r—   s      r$   r1   zAddr.__init__  s   € ØˆŒØˆ�	r&   r6   Ústr_addrr   c                 óü   — |j                  d«      rK|j                  d«      }|d|dz    }d}t        |«      |dz   kD  r||dz      dk(  r||dz   d } | ||fd¬	«      S |j                  d«      } | |d
   |d   f«      S )zInitialize Addr from string.ú[ú]Nr�   Ú é   ú:T)r—   r   )Ú
startswithÚrfindÚlenÚ	partition)r6   r™   ÚendIndexÚhostÚportr–   s         r$   Ú
fromstringzAddr.fromstring  sž   € ð ×Ñ˜sÔ#à—~‘~ cÓ*ˆHØ˜M˜X¨™\Ð*ˆDØˆDÜ�8‹}˜x¨!™|Ò+°¸ÀA¹Ñ0FÈ#Ò0MØ ¨1¡ Ð.�Ù˜˜d�|¨$Ô/Ð/à×$Ñ$ SÓ)ˆCÙ˜˜A™  A¡Ð'Ó(Ð(r&   c                 ó\   — | j                   d   rd| j                   z  S | j                   d   S )Nr�   z%s:%sr   ©r–   rC   s    r$   Ú__str__zAddr.__str__  s*   € Ø�8‰8�AŠ;Ø˜TŸX™XÑ%Ð%Ø�x‰x˜‰{Ðr&   c                 óp   — | j                   r| j                  «       | j                  d   fS | j                  S )z5Normalized representation of addr/port tuple
        r�   )r—   Úget_ipv6_explodedr–   rC   s    r$   Únormalized_tuplezAddr.normalized_tuple   s0   € ð �9Š9Ø×)Ñ)Ó+¨T¯X©X°a©[Ð8Ð8Ø�x‰xˆr&   Úotherc                 ór   — t        || j                  «      r!| j                  «       |j                  «       k(  S y)NF)Ú
isinstancer3   r­   )r2   r®   s     r$   Ú__eq__zAddr.__eq__'  s2   € Ü�e˜TŸ^™^Ô,ð ×(Ñ(Ó*¨e×.DÑ.DÓ.FÑFÐFàr&   c                 ó,   — t        | j                  «      S r/   )Úhashr–   rC   s    r$   Ú__hash__zAddr.__hash__/  s   € Ü�D—H‘H‹~Ðr&   c                 ó    — | j                   d   S )z Return addr part of Addr object.r   r©   rC   s    r$   Úget_addrzAddr.get_addr2  ó   € à�x‰x˜‰{Ðr&   c                 ó    — | j                   d   S )zReturn port.r�   r©   rC   s    r$   Úget_portzAddr.get_port6  r·   r&   r2   r¦   c                 óX   — | j                  | j                  d   |f| j                  «      S )z6Return new address object with same addr and new port.r   )r3   r–   r—   )r2   r¦   s     r$   Úget_addr_objzAddr.get_addr_obj:  s$   € à�~‰~˜tŸx™x¨™{¨DÐ1°4·9±9Ó=Ð=r&   Úaddrc                 óh   — |j                  d«      }|j                  d«      }| j                  |«      S )z7Return IPv6 address in normalized form, helper functionr›   rœ   )ÚlstripÚrstripÚ_explode_ipv6)r2   r¼   s     r$   Ú_normalize_ipv6zAddr._normalize_ipv6>  s/   € à�{‰{˜3ÓˆØ�{‰{˜3ÓˆØ×!Ñ! $Ó'Ð'r&   c                 óv   — | j                   r-dj                  | j                  | j                  d   «      «      S y)zReturn IPv6 in normalized formrŸ   r   r�   )r—   rQ   rÁ   r–   rC   s    r$   r¬   zAddr.get_ipv6_explodedD  s.   € à�9Š9Ø—8‘8˜D×0Ñ0°·±¸!±Ó=Ó>Ð>Ør&   c                 óB  — g d¢}|j                  d«      }t        |«      t        |«      kD  r|dt        |«       }d}t        |«      D ]T  \  }}|sd}Œt        |«      dkD  r|j                  d«      }|st	        |«      ||<   Œ;t	        |«      ||t        |«      z
  <   ŒV |S )z#Explode IPv6 address for comparison)Ú0rÄ   rÄ   rÄ   rÄ   rÄ   rÄ   rÄ   rŸ   r   FTr�   rÄ   )Úsplitr¢   Ú	enumerater¾   r@   )r2   r¼   ÚresultÚ	addr_listÚappend_to_endÚiÚblocks          r$   rÀ   zAddr._explode_ipv6J  s§   € â9ˆØ—J‘J˜s“Oˆ	Üˆy‹>œC ›KÒ'à! !¤C¨£KÐ0ˆIØˆÜ! )Ó,ò 	6‰HˆAˆuÙð !%�ØÜ�5‹z˜AŠ~àŸ™ SÓ)�Ù Ü ›J��q’	ô ,/¨u«:��qœ˜Y›Ñ'Ò(ð	6ð ˆr&   Nr‹   )rV   rW   rX   rY   r   r@   rŽ   r1   r[   r   r’   r	   r§   rª   r­   r   r±   r�   r´   r¶   r¹   r»   r   rÁ   r¬   rÀ   r"   r&   r$   r“   r“     s   „ ññ˜E # s (™Oð °4ó ð ð)˜˜[Ñ)ð )°Sð )¸XÀkÑ=Rò )ó ð)ð˜ó ð
 %¨¨S¨¡/ó ð˜Cð  Dó ð˜#ó ð˜#ó ð˜#ó ð>˜;ð >¨cð >°kó >ð( Cð (¨D°©Ió (ð 3ó ð #ð ¨$¨s©)ô r&   c                   ót   — e Zd ZdZdefd„Z	 d
dej                  dee	   ddfd„Z
deej                     fd	„Zy)ÚChallengePerformerav  Abstract base for challenge performers.

    :ivar configurator: Authenticator and installer plugin
    :ivar achalls: Annotated challenges
    :vartype achalls: `list` of `.KeyAuthorizationAnnotatedChallenge`
    :ivar indices: Holds the indices of challenges from a larger array
        so the user of the class doesn't have to.
    :vartype indices: `list` of `int`

    Úconfiguratorc                 ó.   — || _         g | _        g | _        y r/   )rÎ   ÚachallsÚindices)r2   rÎ   s     r$   r1   zChallengePerformer.__init__o  s   € Ø(ˆÔØMOˆŒØ"$ˆ�r&   NrT   Úidxr   c                 óv   — | j                   j                  |«       |�| j                  j                  |«       yy)zÝStore challenge to be performed when perform() is called.

        :param .KeyAuthorizationAnnotatedChallenge achall: Annotated
            challenge.
        :param int idx: index to challenge in a larger array

        N)rÐ   ÚappendrÑ   )r2   rT   rÒ   s      r$   Ú	add_challzChallengePerformer.add_challt  s2   € ð 	�‰×Ñ˜FÔ#Øˆ?Ø�L‰L×Ñ Õ$ð r&   c                 ó   — t        «       ‚)z�Perform all added challenges.

        :returns: challenge responses
        :rtype: `list` of `acme.challenges.KeyAuthorizationChallengeResponse`


        )ÚNotImplementedErrorrC   s    r$   ÚperformzChallengePerformer.perform�  s   € ô "Ó#Ð#r&   r/   )rV   rW   rX   rY   r‘   r1   r   Ú"KeyAuthorizationAnnotatedChallenger	   r�   rÕ   r   r   Ú!KeyAuthorizationChallengeResponserØ   r"   r&   r$   rÍ   rÍ   c  sU   „ ñ	ð% \ó %ð (,ñ% × NÑ Nð %Ø ‘}ð%Ø04ó%ð$˜˜j×JÑJÑKô $r&   rÍ   Ú	dest_pathÚdigest_pathÚsrc_pathÚ
all_hashesc                 óÜ  ‡ ‡‡‡‡	— t        j                  ‰«      Š	dˆ	ˆfd„Šdˆˆ ˆfd„}t        j                  j	                  ‰ «      s |«        yt        j                  ‰ «      }|‰	k(  ry||v r |«        yt        j                  j	                  ‰«      r+t        ‰d«      5 }|j                  «       }ddd«       ‰	k(  ry ‰«        t        j                  d‰ ‰‰ «       y# 1 sw Y   Œ/xY w)aƒ  Copy a file into an active location (likely the system's config dir) if required.

       :param str dest_path: destination path for version controlled file
       :param str digest_path: path to save a digest of the file in
       :param str src_path: path to version controlled file found in distribution
       :param list all_hashes: hashes of every released version of the file
    Nc                  ój   •— t        ‰d«      5 } | j                  ‰«       d d d «       y # 1 sw Y   y xY w)NÚw)ÚopenÚwrite)Úfile_hÚcurrent_hashrÜ   s    €€r$   Ú_write_current_hashz<install_version_controlled_file.<locals>._write_current_hash—  s0   ø€ Ü�+˜sÓ#ð 	' vØ�L‰L˜Ô&÷	'÷ 	'ñ 	'ús   Ž)©2c                  ó@   •— t        j                  ‰‰«        ‰ «        y r/   )ÚshutilÚcopyfile)ræ   rÛ   rÝ   s   €€€r$   Ú_install_current_filez>install_version_controlled_file.<locals>._install_current_file›  s   ø€ Ü�‰˜ )Ô,ÙÕr&   Úrzh%s has been manually modified; updated file saved to %s. We recommend updating %s for security purposes.rŒ   )	r   Ú	sha256sumr   r   Úisfilerâ   ÚreadÚloggerÚwarning)
rÛ   rÜ   rÝ   rÞ   rê   Úactive_file_digestÚfÚsaved_digestræ   rå   s
   ```     @@r$   r‡   r‡   Œ  sÒ   ü€ ô ×(Ñ(¨Ó2€Lö'÷ô
 �7‰7�>‰>˜)Ô$ÙÔØô %×.Ñ.¨yÓ9ÐØ˜\Ò)ØØ˜ZÑ'ÙÕô �7‰7�>‰>˜+Ô&Ü�k 3Ó'ð (¨1Ø Ÿv™v›x�÷(ð ˜|Ò+Øñ 	ÔÜ�‰ð Kà�x õ	,÷(ð (ús   Â#C"Ã"C+Útest_dirÚpkgc                 óZ  — dt         dt         fd„} |d«      } |d«      } |d«      }t        j                  |t        j                  «       t        j                  |t        j                  «       t        j                  |t        j                  «       t        j                  |«      j                  d«      j                  | «      }t        j                  |«      5 }t        j                  |t        j                  j                  || «      d¬	«       d
d
d
«       |||fS # 1 sw Y   ŒxY w)z5Setup the directories necessary for the configurator.Úprefixr   c                 óR   — t        j                  t        j                  | «      «      S )a�  Return the real path of a temp directory with the specified prefix

        Some plugins rely on real paths of symlinks for working correctly. For
        example, certbot-apache uses real paths of configuration files to tell
        a virtual host from another. On systems where TMP itself is a symbolic
        link, (ex: OS X) such plugins will be confused. This function prevents
        such a case.
        )r   ÚrealpathÚtempfileÚmkdtemp)r÷   s    r$   Úexpanded_tempdirz#dir_setup.<locals>.expanded_tempdirÁ  s    € ô ×"Ñ"¤8×#3Ñ#3°FÓ#;Ó<Ð<r&   Útempr-   ÚworkÚtestdataT)ÚsymlinksN)r@   r   Úchmodr   ÚCONFIG_DIRS_MODEÚimportlib_resourcesÚfilesÚjoinpathÚas_filerè   Úcopytreer   r   rQ   )rô   rõ   rü   Útemp_dirr€   Úwork_dirÚtest_dir_refr   s           r$   Ú	dir_setupr  ¿  sù   € ð	=¤ð 	=¬ó 	=ñ   Ó'€HÙ! (Ó+€JÙ Ó'€Hä×Ñ�Xœy×9Ñ9Ô:Ü×Ñ�Z¤×!;Ñ!;Ô<Ü×Ñ�Xœy×9Ñ9Ô:ä&×,Ñ,¨SÓ1×:Ñ:¸:ÓF×OÑOÐPXÓY€LÜ	×	$Ñ	$ \Ó	2ð C°dÜ�‰Ø”"—'‘'—,‘,˜x¨Ó2¸Tõ	C÷Cð �Z Ð)Ð)÷	Cð Cús   Ã7D!Ä!D*)>rY   Úabcr   r   r\   ÚloggingÚrerè   Úsysrú   Útypingr   r   r   r   r	   r
   r   r   r   Úacmer   Úcertbotr   r   r   r   r   r   Úcertbot._internalr   Úcertbot.compatr   r   Úcertbot.interfacesr   ÚAbstractInstallerr   ÚAbstractPluginÚcertbot.plugins.storager   Úversion_infoÚimportlib.resourcesÚ	resourcesr  Ú	getLoggerrV   rï   r@   r%   r+   ÚcompileÚprivate_ips_regexÚ
IGNORECASEÚhostname_regexÚAuthenticatorr‘   r’   r“   rÍ   r‡   r  r"   r&   r$   ú<module>r"     s˜  ðÙ Ý Ý Û Û Û 	Û Û 
Û Ý Ý Ý Ý Ý Ý Ý Ý Ý å Ý Ý !Ý Ý Ý Ý Ý 'Ý %Ý Ý =Ý 7Ý 1à×Ñ�vÒÞ5ãà	ˆ×	Ñ	˜8Ó	$€ð˜3ð  3ó ð
(˜ð ( ó (ð
 �B—J‘Jð7ó8Ð ð �—‘Ø:¸B¿M¹MóK€ôQ8ˆ^ wõ Q8ôhe/Ð! 6°Wõ e/ôP�9˜j×6Ñ6À'õ ñ �m¨6Ô2€÷_ñ _÷D&$ñ &$ðR,,¨sð ,,Àð ,,ÐPSð ,,Ø08¸±ð,,ØBFó,,ðf*˜ð * #ð *¨%°°S¸#°Ñ*>ô *r&   