Edit File: __init__.cpython-36.pyc
3 گa�i � @ s� U d Z ddlZddlZddlZddlZddlmZ ddlmZ ddlmZ ddlm Z ddl Z ddlmZ ddl mZ dd l mZ dd l mZ ddl mZ ddl mZ dd l mZ ddl mZ ddl mZ ddl mZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm!Z! ddlm"Z" ddlm#Z# ddlm$Z$ ddlm%Z% ddlm&Z& dd lm'Z' dd!l(m)Z) dd"l*m+Z+ dd#l,m-Z- dd$l.m/Z/ dd%l0m1Z1 dd&l2m3Z3 dd'l2m4Z4 dd(l5m6Z7 ddl8j9j:j;Z<dd)l=m>Z> ej?e@�ZAdaBee+ Bd9e7jCeeD eEejFd+�d,d-�ZGeDeEd.�d/d0�ZHdeH_IeDeeEd1�d2d3�ZJeDeeEd1�d4d5�ZKee d6�d7d8�ZLdS ):z2Certbot command line argument & config processing.� N)�Any)�List)�Optional)�Type)� constants)�ARGPARSE_PARAMS_TO_REMOVE)�cli_command)�COMMAND_OVERVIEW)�DEPRECATED_OPTIONS)�EXIT_ACTIONS)�HELP_AND_VERSION_USAGE)�SHORT_USAGE)� VAR_MODIFIERS)�ZERO_ARG_ACTIONS)�_Default)�_DeployHookAction)�_DomainsAction)�_EncodeReasonAction)�_PrefChallAction)�_RenewHookAction)�_user_agent_comment_type)�add_domains)�CaseInsensitiveList)�config_help)�CustomHelpFormatter)�flag_default)�HelpfulArgumentGroup)�nonnegative_int)�parse_preferred_challenges)� read_file)�_add_all_groups)�HelpfulArgumentParser)� _paths_parser)�_plugins_parsing)�_create_subparsers)� VERB_HELP)� VERB_HELP_MAP)�disco)�enhancementsF)�plugins�args�detect_defaults�returnc C s~ t || |�}t|� |jdddddtd�dd� |jddd td �tjd � |jdddd dtd �tjd� |jddttd�dd� |jddddtd�tjd� |jdddddgdddddtd�dd� |jdddddgtjdtd�d d!� |jdddd"dgd#d$d%d&d't td&�d(d)� |jddddgd*d+d,d-d.� |jddddgd/d0d1d2d.� |jdddd3d4d"d5dgd6d7d8td7�d9d:� |jdd;d5dgd<dd=td=�d>d?� |jddgd@dtdA�dBd!� |jddCdDdgdEdFtdG�t dG�dH� |jddCdgdIdtdJ�dJdKdL� |jddCdgdMdNtdJ�dJdOdL� |jdddgdPdQdRdSdtdS�dTd� |jddUdtdV�dWd!� |jddXdYdZjtj �d[d\� |jdd5gd]d^d_dtd_�d`d� |jddadbdtdb�dcd� |jddddedtde�dfd� |jddgdedNtde�dhd� |jdd5dgdidtdj�dkd!� |jddldmdtdm�dnd� |jdDdgdodptdq�drds� |jddtdudtdu�dvd� |jdd5ddgdwdxdydtdy�dzd� |jd;d{dgd|d}d~dtd~�dtj d� |jd;d�dtd��d�d!� |jdddgd�dtd��d�d!� |jd;d�dt d��td��d�� |jd;d�d�gd�td�td��t d��d�� |jd;d�gd�d�td��t d��d � |jd;d�gd�ttd��t d��d� |jd;d�dtd��d�d!� |jd�d�td�td��t d��d�� |jd�d�d�d�gttd��t d��d�� |jd�d�td�d�d�gd�td��t d��d�� |jd�d�dd�td��t d��d?� |jd�dgd�dd�td��d�d?� |jd�d�dNd�td��d�d?� |jd�dgd�dd�td��d�d?� |jd�d�dNd�td��tjd?� |jd�dgd�dd�td��d�d?� |jd�d�dNd�td��tjd?� |jd�d�dd�td��d�d?� |jd�d�dNd�td��tjd?� |jd�d�dtd��d�d!� |jddd5dgd�d�td��t d��d � |jd�d�dd5gd�d�ttd��d�d� |jdddgd�td�tdt dd�� |jd5d�d�dō |jd5d�d�dō |jd5d�ttjdɍ |jd5d�dNtd˃d�tjdL� |jd5d�td�dɍ |jd5d�dNd�tdσd�d?� |jd5d�dNtd҃d�d�dL� |jd5d�dtdՃd�d�dL� |jd5d�dNtdd�d�dL� |jd�dۃ |jd�dۃ |jd�dۃ |jd�dۃ tj|j� t|� t|� t|| � |�sv|a|j� S )�z�Returns parsed command line arguments. :param .PluginsRegistry plugins: available plugins :param list args: command line arguments with the program name removed :returns: parsed command line arguments :rtype: argparse.Namespace Nz-vz --verboseZ verbose_count�countzbThis flag can be used multiple times to incrementally increase the verbosity of output, e.g. -vvv.)�dest�action�default�helpz--verbose-levelZ verbose_level)r. r0 r1 z-tz--textZ text_mode� store_truez--max-log-backupsZmax_log_backupsz�Specifies the maximum number of backup logs that should be kept by Certbot's built in log rotation. Setting this flag to 0 disables log rotation entirely, causing Certbot to always append to the same log file.)�typer0 r1 z--preconfigured-renewalZpreconfigured_renewalZ automationZrunZcertonlyZenhancez-nz--non-interactivez--noninteractiveZnoninteractive_modez�Run without ever asking for user input. This may require additional command line flags; the client will try to explain which ones are required if it finds one missing�registerZforce_interactivez�Force Certbot to be interactive even if it detects it's not being run in a terminal. This flag cannot be used with the renew subcommand.)r/ r0 r1 Zcertificatesz-dz --domainsz--domainZdomainsZDOMAINaK Domain names to apply. For multiple domains you can use multiple -d flags or enter a comma separated list of domains as a parameter. The first domain provided will be the subject CN of the certificate, and all domains will be Subject Alternative Names on the certificate. The first domain will also be used in some software user interfaces and as the file paths for the certificate and related material unless otherwise specified or you already have a certificate with the same name. In the case of a name collision it will append a number like 0001 to the file path name. (default: Ask))r. �metavarr/ r0 r1 z --eab-kidZeab_kidZEAB_KIDz+Key Identifier for External Account Binding)r. r5 r1 z--eab-hmac-keyZeab_hmac_keyZEAB_HMAC_KEYz%HMAC key for External Account BindingZmanage�deleteZrenewz--cert-nameZcertnameZCERTNAMEa� Certificate name to apply. This name is used by Certbot for housekeeping and in file paths; it doesn't affect the content of the certificate itself. To see certificate names, run 'certbot certificates'. When creating a new certificate, specifies the new certificate's name. (default: the first provided domain or the name of an existing certificate on your system for the same domains))r. r5 r0 r1 Ztestingz --dry-runZdry_runa� Perform a test run of the client, obtaining test (invalid) certificates but not saving them to disk. This can currently only be used with the 'certonly' and 'renew' subcommands. Note: Although --dry-run tries to avoid making any persistent changes on a system, it is not completely side-effect free: if used with webserver authenticator plugins like apache and nginx, it makes and then reverts temporary config changes in order to obtain test certificates, and reloads webservers to deploy and then roll back those changes. It also calls --pre-hook and --post-hook commands if they are defined because they may be necessary to accurately simulate renewal. --deploy-hook commands are not called.)r/ r. r0 r1 z!--register-unsafely-without-emailZregister_unsafely_without_emaila" Specifying this flag enables registering an account with no email address. This is strongly discouraged, because you will be unable to receive notice about impending expiration or revocation of your certificates or problems with your Certbot installation that will lead to failure to renew.Zupdate_accountZ unregisterz-mz--emailZemail)r0 r1 z--eff-emailZ eff_emailz"Share your e-mail address with EFF)r/ r0 r. r1 z--no-eff-emailZstore_falsez(Don't share your e-mail address with EFFz--keep-until-expiringz--keepz--reinstallZ reinstallz�If the requested certificate matches an existing certificate, always keep the existing one until it is due for renewal (for the 'run' subcommand this means reinstall the existing certificate). (default: Ask)z--expand�expandz�If an existing certificate is a strict subset of the requested names, always expand and replace it with the additional names. (default: Ask)z --version�versionz%(prog)s {0}z&show program's version number and exit)r/ r8 r1 z--force-renewalz--renew-by-defaultZrenew_by_defaultz�If a certificate already exists for the requested domains, renew it now, regardless of whether it is near expiry. (Often --keep-until-expiring is more appropriate). Also implies --expand.z--renew-with-new-domainsZrenew_with_new_domainsz�If a certificate already exists for the requested certificate name but does not match the requested domains, renew it now, regardless of whether it is near expiry.z--reuse-keyZ reuse_keyzDWhen renewing, use the same private key as the existing certificate.z--no-reuse-keyz�When renewing, do not use the same private key as the existing certificate. Not reusing private keys is the default behavior of Certbot. This option may be used to unset --reuse-key on an existing certificate.z--allow-subset-of-namesZallow_subset_of_namesa8 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. This option cannot be used with --csr.z--agree-tosZtosz5Agree to the ACME Subscriber Agreement (default: Ask)z --accountZ ACCOUNT_IDZaccountzAccount ID to use)r5 r0 r1 z--duplicateZ duplicatezdAllow making a certificate lineage that duplicates an existing one (both can be renewed in parallel)z-qz--quiet�quietz\Silence all output except errors. Useful for automation via cron. Implies --non-interactive.Zrevokez--test-certz --stagingZstagingz_Use the staging server to obtain or revoke test (invalid) certificates; equivalent to --server z--debug�debugz!Show tracebacks in case of errorsz--debug-challengesZdebug_challengeszHAfter setting up challenges, wait for user input before submitting to CAz--no-verify-sslZ no_verify_ssl)r/ r1 r0 Z standaloneZmanualz--http-01-portZhttp01_port)r3 r. r0 r1 z--http-01-addressZhttp01_addressZnginxz--https-portZ https_portz--break-my-certsZbreak_my_certsz]Be willing to replace or renew valid certificates with invalid (testing/staging) certificatesZsecurityz--rsa-key-size�NZrsa_key_size)r3 r5 r0 r1 z --key-typeZrsaZecdsaZkey_type)�choicesr3 r0 r1 z--elliptic-curveZ secp256r1Z secp384r1Z secp521r1Zelliptic_curve)r3 r<