Skip to content

CLI/config fixes - #440

Merged
jdkasten merged 19 commits into
certbot:masterfrom
kuba:cli-config-fixes
Jun 24, 2015
Merged

jdkasten merged 19 commits into
certbot:masterfrom
kuba:cli-config-fixes

Conversation

@kuba

@kuba kuba commented May 22, 2015

Copy link
Copy Markdown
Contributor

Having global IConfig.cert_path, IConfig.chain_path, IConfig.cert_dir is confusing (which @jsha
experienced himself). This PR makes sure that --cert-path and --chain-path are now subparser flags (and not global IConfig params), with better help message depending on whether auth/run or install subparser is invoked. @jsha, does it make more sense now?

I have also:

  • moved --le-vhost-ext to --apache-le-vhost-ext as it was clearly plugin specific.
  • rearranged cli.py to make it more readable (adding some comments about the order of commands and its influence on --help output), added more docs for plugin related flags.

For the lazy:

usage: letsencrypt [-h] [-c CONFIG_FILE] [--version] [-v] [--no-confirm] [-e]
                   [-t] [--test-mode] [-d DOMAIN] [-s SERVER] [-k AUTHKEY]
                   [-m EMAIL] [-B N] [-r] [--config-dir CONFIG_DIR]
                   [--work-dir WORK_DIR] [--backup-dir BACKUP_DIR]
                   [--key-dir KEY_DIR] [--cert-dir CERT_DIR]
                   [-a AUTHENTICATOR] [-i INSTALLER]
                   [--configurator CONFIGURATOR]
                   [--apache-server-root APACHE_SERVER_ROOT]
                   [--apache-mod-ssl-conf APACHE_MOD_SSL_CONF]
                   [--apache-ctl APACHE_CTL] [--apache-enmod APACHE_ENMOD]
                   [--apache-init-script APACHE_INIT_SCRIPT]
                   [--apache-le-vhost-ext APACHE_LE_VHOST_EXT]
                   [--nginx-server-root NGINX_SERVER_ROOT]
                   [--nginx-mod-ssl-conf NGINX_MOD_SSL_CONF]
                   [--nginx-ctl NGINX_CTL]
                   SUBCOMMAND ...

Let's Encrypt CLI. Args that start with '--' (eg. --config) can also be set in
a config file (/etc/letsencrypt/cli.ini or specified via -c) by using .ini or
.yaml-style syntax (eg. config=value). If an arg is specified in more than one
place, then command-line values override config file values which override
defaults.

positional arguments:
  SUBCOMMAND
    run                 Obtain a certificate and install.
    auth                Obtain a certificate (no install).
    install             Install (no auth).
    plugins             List plugins.
    revoke              Revoke.
    rollback            Rollback.
    config_changes      View config changes.

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG_FILE, --config CONFIG_FILE
                        config file path (default: None)
  --version             show program's version number and exit
  -v, --verbose
  --no-confirm          Turn off confirmation screens, currently used for
                        --revoke (default: False)
  -e, --agree-tos       Skip the end user license agreement screen. (default:
                        False)
  -t, --text            Use the text output instead of the curses UI.
                        (default: False)
  --test-mode           Test mode. Disables certificate verification.
                        (default: False)
  -d DOMAIN, --domains DOMAIN
  -s SERVER, --server SERVER
                        CA hostname (and optionally :port). The server
                        certificate must be trusted in order to avoid further
                        modifications to the client. (default: https://www
                        .letsencrypt-demo.org/acme/new-reg)
  -k AUTHKEY, --authkey AUTHKEY
                        Path to the authorized key file (default: None)
  -m EMAIL, --email EMAIL
                        Email used for registration and recovery contact.
                        (default: None)
  -B N, --rsa-key-size N
                        Size of the RSA key. (default: 2048)
  -r, --redirect        Automatically redirect all HTTP traffic to HTTPS for
                        the newly authenticated vhost. (default: False)

paths:
  --config-dir CONFIG_DIR
                        Configuration directory. (default: /etc/letsencrypt)
  --work-dir WORK_DIR   Working directory. (default: /etc/letsencrypt)
  --backup-dir BACKUP_DIR
                        Configuration backups directory. (default:
                        /var/lib/letsencrypt/backups)
  --key-dir KEY_DIR     Keys storage. (default: /etc/letsencrypt/keys)
  --cert-dir CERT_DIR   Certificates and CSRs storage. (default:
                        /etc/letsencrypt/certs)

plugins:
  Let's Encrypt client supports an extensible plugins architecture. See
  'letsencrypt plugins' for a list of all available plugins and their names.
  You can force a particular plugin by setting options provided below.
  Futher down this help message you will find plugin-specific options
  (prefixed by --{plugin_name}.

  -a AUTHENTICATOR, --authenticator AUTHENTICATOR
                        Authenticator plugin name. (default: None)
  -i INSTALLER, --installer INSTALLER
                        Installer plugin name. (default: None)
  --configurator CONFIGURATOR
                        Name of the plugin that is both an authenticator and
                        an installer. Should not be used together with
                        --authenticator or --installer. (default: None)

plugins: apache:
  Apache Web Server

  --apache-server-root APACHE_SERVER_ROOT
                        Apache server root directory. (default: /etc/apache2)
  --apache-mod-ssl-conf APACHE_MOD_SSL_CONF
                        Contains standard Apache SSL directives. (default:
                        /etc/letsencrypt/options-ssl.conf)
  --apache-ctl APACHE_CTL
                        Path to the 'apache2ctl' binary, used for 'configtest'
                        and retrieving Apache2 version number. (default:
                        apache2ctl)
  --apache-enmod APACHE_ENMOD
                        Path to the Apache 'a2enmod' binary. (default:
                        a2enmod)
  --apache-init-script APACHE_INIT_SCRIPT
                        Path to the Apache init script (used for server
                        reload/restart). (default: /etc/init.d/apache2)
  --apache-le-vhost-ext APACHE_LE_VHOST_EXT
                        SSL vhost configuration extension. (default: -le-
                        ssl.conf)

plugins: nginx:
  Nginx Web Server

  --nginx-server-root NGINX_SERVER_ROOT
                        Nginx server root directory. (default: /etc/nginx)
  --nginx-mod-ssl-conf NGINX_MOD_SSL_CONF
                        Contains standard nginx SSL directives. (default:
                        /etc/letsencrypt/options-ssl-nginx.conf)
  --nginx-ctl NGINX_CTL
                        Path to the 'nginx' binary, used for 'configtest' and
                        retrieving nginx version number. (default: nginx)

plugins: standalone:
  Standalone Authenticator
usage: letsencrypt run [-h] [--cert-path CERT_PATH] [--chain-path CHAIN_PATH]

Obtain a certificate and install.

optional arguments:
  -h, --help            show this help message and exit
  --cert-path CERT_PATH
                        Candidate path where a freshly issued certificate will
                        be saved to. If a file already exists at the provided
                        path, dirpath/0001_filename.ext will be attempted
                        (securely).
  --chain-path CHAIN_PATH
                        Candidate path (see --cert-path help) where an
                        accompanying certificate chain will be saved.
usage: letsencrypt auth [-h] [--cert-path CERT_PATH] [--chain-path CHAIN_PATH]

Obtain a certificate (no install).

optional arguments:
  -h, --help            show this help message and exit
  --cert-path CERT_PATH
                        Candidate path where a freshly issued certificate will
                        be saved to. If a file already exists at the provided
                        path, dirpath/0001_filename.ext will be attempted
                        (securely).
  --chain-path CHAIN_PATH
                        Candidate path (see --cert-path help) where an
                        accompanying certificate chain will be saved.
usage: letsencrypt install [-h] --cert-path CERT_PATH
                           [--chain-path CHAIN_PATH]

Install (no auth).

optional arguments:
  -h, --help            show this help message and exit
  --cert-path CERT_PATH
                        Path to a certificate that is going to be installed.
  --chain-path CHAIN_PATH
                        Accompanying path to a certificate chain.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.01%) to 94.34% when pulling 53d65d0 on kuba:cli-config-fixes into ef8daba on letsencrypt:master.

@jsha

jsha commented May 22, 2015

Copy link
Copy Markdown
Contributor

The new output helps somewhat, but I still don't understand what --cert-dir is used for. Also, shouldn't the various subparser docs indicate that a cert won't be stored at that exact path, but at some prefixed version of it?

@kuba

kuba commented May 22, 2015

Copy link
Copy Markdown
Contributor Author

They do indicate:

                        Candidate path where a freshly issued certificate will
                        be saved to. If a file already exists at the provided
                        path, dirpath/0001_filename.ext will be attempted
                        (securely).

--cert-dir is currently only used to store CSRs

@jsha

jsha commented May 22, 2015

Copy link
Copy Markdown
Contributor

Ah, I feel silly for having missed that - I was focusing on the text for --chain-path.

Is --cert-dir planned to be used for other things in the future? If not we should rename it --csr-dir.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.01%) to 94.87% when pulling 71aa1a5 on kuba:cli-config-fixes into 3dbf47e on letsencrypt:master.

…fig-fixes

Conflicts:
	letsencrypt/cli.py
	letsencrypt/constants.py
	letsencrypt/interfaces.py
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.01%) to 94.85% when pulling 9ea5e20 on kuba:cli-config-fixes into e15b7b4 on letsencrypt:master.

@kuba

kuba commented May 29, 2015

Copy link
Copy Markdown
Contributor Author

@schoen, I have now merged it with the current renewer-enabled master, so --cert-path/--chain_path were removed from auth/run, but kept in install/revoke. Could you please review? :)

@kuba

kuba commented Jun 2, 2015

Copy link
Copy Markdown
Contributor Author

In the meantime I fixed #451, as well as limited path flags to --config-dir/--work-dir (every other directory or file is now hardcoded to be a path relative to IConfig.config_dir or IConfig.work_dir). Successfully tested against demo server with nginx and standalone plugins.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.02%) to 94.94% when pulling 8fed612 on kuba:cli-config-fixes into 325f2ae on letsencrypt:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.02%) to 94.94% when pulling cd7a5ec on kuba:cli-config-fixes into 325f2ae on letsencrypt:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.02%) to 94.94% when pulling 9ecfecb on kuba:cli-config-fixes into 325f2ae on letsencrypt:master.

@kuba

kuba commented Jun 2, 2015

Copy link
Copy Markdown
Contributor Author

I believe this also fixes #456.

@kuba

kuba commented Jun 2, 2015

Copy link
Copy Markdown
Contributor Author

As requested, cert_dir has been renamed to csr_dir.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.09%) to 95.01% when pulling 9a7ade7 on kuba:cli-config-fixes into 325f2ae on letsencrypt:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.02%) to 95.01% when pulling 05ad602 on kuba:cli-config-fixes into 7b23147 on letsencrypt:master.

…fig-fixes

Conflicts:
	letsencrypt_apache/constants.py
	letsencrypt_nginx/constants.py
kuba added 2 commits June 20, 2015 20:04
…fig-fixes

Conflicts:
	letsencrypt_apache/tests/util.py
	letsencrypt_nginx/tests/util.py
…fig-fixes

Conflicts:
	letsencrypt/constants.py
@jdkasten
jdkasten merged commit 8e582df into certbot:master Jun 24, 2015
jdkasten added a commit that referenced this pull request Jun 24, 2015
Dynamic dirs based on --config-dir and --work-dir (#440 without touching CLI)
kuba added a commit to kuba/letsencrypt that referenced this pull request Jun 26, 2015
Additonally:
- remove "-s", it will not be used often
- remove --accountkey (former --authkey), as it is not used
- CLI_DEFAULTS: cert_path -> auth_cert_path, chain_path -> auth_chain_path
- remove remaining "LetsEncrypt" error prefixes (fixes certbot#487).
- HeplfulParser:
  - call add_plugin_args from outside (this makes sure plugins are
    displayed last in --help all)
jdkasten added a commit that referenced this pull request Jun 27, 2015
Null installer, integration tests for install/run, backport #440 CLI changes, fix --help all.
ohemorange pushed a commit that referenced this pull request Oct 21, 2026
certifi 2026.10.19 removes the emSign roots after the eMudhra
intermediate CA compromise (certifi/python-certifi#437, #440).

The pin in `tools/requirements.txt` is still on 2026.7.22, which trusts
those roots. Since `tools/pip_install.py` uses this file as the pip
constraint, the published `certbot/certbot` and `certbot/dns-*` Docker
images ship the old bundle, and ACME requests made through `requests`
still accept chains issued by the compromised intermediates.

This only bumps the certifi line. Happy to run a full repin with
`tools/pinning/current/repin.sh` instead if you prefer.

How to check: inside the current `certbot/certbot:latest` image, `python
-c "import certifi; print(certifi.__version__)"` prints 2026.07.22, and
a TLS connection to `dv-g3b-emudhra.we-have-a-problem.com` (a test site
served by one of the affected intermediates) verifies against
`certifi.where()`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants