Commit Graph
2125 Commits
Author SHA1 Message Date
ohemorangeandGitHub 1cb48eca58 Remove update symlinks (#9592)
* Add deprecation warning when update_symlinks is run

* Remove information about update_symlinks from help

* ignore our own warning and remove unused imports

* Update changelog
2023-02-22 12:16:28 -08:00
Brad WarrenandGitHub a3c9371dc5 Use pytest assertions (#9585)
* run unittest2pytest

The command used here was `unittest2pytest -nw acme/tests certbot*/tests`.

* fix with pytest.raises

* add parens to fix refactoring

* <= not <
2023-02-16 16:02:02 +11:00
Will Greenberg 941119f05b Bump version to 2.4.0 2023-02-14 12:44:32 -08:00
Will Greenberg 5d34a4d982 Add contents to certbot/CHANGELOG.md for next version 2023-02-14 12:44:32 -08:00
Will Greenberg d4b2d3202b Release 2.3.0 2023-02-14 12:44:31 -08:00
Will Greenberg 1fe2d671cb Update changelog for 2.3.0 release 2023-02-14 12:42:21 -08:00
Brad WarrenandGitHub dc07dfd07b Automatically run test files with pytest (#9576)
* Switch to pytest

git grep -l unittest.main | xargs sed -i 's/unittest.main()/sys.exit(pytest.main([__file__]))/g'
git ls-files -m | xargs -I {} sh -c "echo 'import sys\nimport pytest' >> '{}'"
isort --float-to-top .

* add pytest dep

* use sys.argv
2023-02-14 06:44:42 +11:00
Brad WarrenandGitHub 1bb09da270 Update and run isort (#9573)
I want to use isort as part of https://github.com/certbot/certbot/issues/9572 because I want to do it programmatically, however, I felt like the config needed to be tweaked a bit due to it not understanding what is and is not our own code.

This PR updates the isort config so it recognizes our own modules and runs `isort .` from the root of the repo to update everything.

* update isort config

* run "isort ."
2023-02-10 10:51:20 -08:00
Brad Warren f91d3ca828 remove 1.32.x deps 2023-02-09 18:42:41 -08:00
cbb4c871c2 docs: document reconfigure verb (#9563)
* docs: document reconfigure verb

* expand on the flags relevant to reconfigure

* Update phrasing

Co-authored-by: ohemorange <ebportnoy@gmail.com>

---------

Co-authored-by: ohemorange <ebportnoy@gmail.com>
2023-02-09 13:14:32 +11:00
ohemorangeandGitHub 99956ecab9 Fix typo direcory --> directory in --run-deploy-hooks help (#9568) 2023-02-08 16:16:28 -08:00
Brad WarrenandGitHub d792d39813 reset set_by_cli between each test (#9567) 2023-02-09 09:24:07 +11:00
alexzorinandGitHub 99184daff6 repin cryptography for openssl security update (#9565)
* repin cryptography for openssl security update

https://www.openssl.org/news/secadv/20230207.txt
https://cryptography.io/en/latest/changelog/#v39-0-1

* fix type hints

* remove outdated comments
2023-02-08 11:17:44 -08:00
23090198bf Configuration File Update w/o Certificate Issuance (#9355)
* Add command to update config files without issuing/renewing cert

* toss up a vague untested skeleton

* remove duplicated code

* set certname in config

* consistent name, no zope

* import copy

* reconsitute is in renewal

* import renewal

* import cli

* fix lint errors

* call choose_configurator_plugins for its side effect of writing to config

* Set certonly in choose config plugins as we do for renew

* rewrite by piggybacking on existing side effects of a dry run instead

* do not allow domains to be set while reconfiguring

* remove unused cert_manager.reconfigure

* remove unused imports

* Add comments and messages

* add cli information

* start adding tests

* remove test code

* get certname before setting up plugins

* get plugin from lineage if not set on cli

* import copy

* always reconstitute

* only load cert once

* add error message

* improve comment

* mock everything out for tests

* test functionality is working!

* add tests for adding and modifying hooks

* test that we don't modify the config if the dry run fails

* improve documentation

* add webroot to reconfigure common options

* lint and clean up intermediate artifacts

* mock validate_hooks for windows

* print success message with updated parameters

* Improve success message

* add message for no changes have been made

* improve changed message to show before as well

* syntax

* Add changes will apply at the next renewal message

* lint

* lint really likes dict.items() for some reason

* run the deploy hook

* turn off dry run to test deploy hook

* patch list_hooks call for tests

* factor out reporting results code

* Remove reporting of which values were changed

* add flag to run deploy hook despite doing a dry run, and recommend setting that to yes when running reconfigure and modifying the deploy hook

* missing () around multi-line string

* test if the two dicts are equal instead of finding the actual changes, thus avoiding having to deal with webroot_map being a list

* refer to --deploy-hook instead of deploy hook

* use renewal configuration instead of configuration information

* mention that the deploy hook will use the active cert not the test one

* disable lint and remove new from language asking about running a deploy hook

* pluralize run deploy hook(s)

* Add test for reporting results when there is a webroot map

* update changelog

* Update error message about modifying domains on the certificate

* update changelog

* Add basic integration tests

* Just set -a rather than redoing the whole testing infrastructure

* used webroot in integration test since it's already installed

* file contents are accessed twice now

---------

Co-authored-by: Alex Zorin <alex@zorin.au>
2023-02-04 08:46:08 +11:00
alexzorinandGitHub 724635bbbd docs: generate a man page with a structure (#9561)
If you looked at [the Debian man page for Certbot](https://manpages.debian.org/bullseye/certbot/certbot.1.en.html) or [the FreeBSD one](https://man.freebsd.org/cgi/man.cgi?query=certbot&sektion=1&apropos=0&manpath=FreeBSD+13.1-RELEASE+and+Ports), you will notice that the entire document is in the "NAME" section. It looks weird in particular on the [FreeBSD man page listing](https://man.freebsd.org/cgi/man.cgi?query=certbot&apropos=1&sektion=0&manpath=FreeBSD+13.1-RELEASE+and+Ports&arch=default&format=html).

This PR adds some structure to the man page by adding a new "Synopsis" section (lifted from the Certbot snap's synopsis) and shoving the `certbot --help all` output into a new "Options" section. I think this should be sustainable for us, without having to worry about the man page in particular.

Fixes #9560.
2023-02-03 11:35:15 -08:00
alexzorinandGitHub cea717db3e docs: update -d flag copy to be CA-agnostic (#9542)
Some confusion ensued in [this community thread](https://community.letsencrypt.org/t/connection-between-ios-9-support-and-subject-common-name-or-x509v3-subject-alternative-name-critical/191619) about the Subject CN, which Certbot omits from the CSR, Let's Encrypt includes in the issued certificate, but some other CAs do not. 

It's probably for the best that we do not entomb Let's Encrypt's current issuance practices in Certbot's documentation.
2023-02-01 10:49:37 -08:00
alexzorinandGitHub e75dc1dfd0 show_account: display account thumbprint (#9540)
In #9127, where @osirisinferi added the `show_account` verb, I made a call not to include the thumbprint in the output of `certbot show_account`.

In hindsight, and after a community member asked for this feature, I think it's better to include it. 

It is useful on occasion and `show_account` is fairly specialized anyway. It's only really good for getting your account URL for rate limit increases, checking your contacts, and (now) and doing *magic* with the thumbprint for stateless/distributed HTTP-01 responders.

Without this feature, a clever user might figure out their thumbprint by doing a `certonly --manual --preferred-challenges http` request, but most users would probably be lost.

* show_account: display account thumbprint

* use local key for display
2023-02-01 10:48:13 -08:00
Alex Zorin 08e008ac54 remove unused attributes from test 2023-01-27 10:41:45 +11:00
Alex Zorin 2e3cace739 remove docstring for removed argument 2023-01-27 10:38:00 +11:00
Alex Zorin f3c6f7d46e Merge remote-tracking branch 'origin/master' into remove-legacy-new-authz-support 2023-01-27 09:04:16 +11:00
4ad71ab5ae Fix tox environments (#9547)
* fix cover tox envs

* make test work on all Pythons

* Remove unused import

Co-authored-by: alexzorin <alex@zorin.id.au>

Co-authored-by: alexzorin <alex@zorin.id.au>
2023-01-25 12:00:06 +11:00
Will GreenbergandGitHub 81ff6fcc0d acme.messages.Error: add mutability (#9546)
* acme.messages.Error: add mutability

As of Python 3.11, an exception caught within a `with` statement will
update the __traceback__ attribute. Because acme.messages.Error was
immutable, this was causing a knock-on exception, causing certbot to
exit abnormally. This commit hacks in mutability for acme.messages.Error

Fixes #9539

* Add CHANGELOG entry
2023-01-25 09:06:53 +11:00
Alex Zorin 554143e187 fix lint 2023-01-23 19:43:34 +11:00
Alex Zorin 6505054f62 account: stop storing legacy new_authzr_uri 2023-01-23 18:41:25 +11:00
alexzorinandGitHub be3bf316c0 Deprecate {csr, keys} dirs & automatically truncate lineages (#9537)
Based on my design [here](https://docs.google.com/document/d/1jGh_bZPnrhi96KzuIcyCJfnudl4m3pRPGkiK4fTo8e4/edit?usp=sharing). 

Fixes https://github.com/certbot/certbot/issues/4634 and https://github.com/certbot/certbot/issues/4635.

- [x] Deprecate `NamespaceConfig.csr_dir`,`NamespaceConfig.key_dir`, ~~`constants.CSR_DIR` and `constants.KEY_DIR`~~. (`constants` is `_internal` so we can just delete it eventually).
- [x] Update `certbot.crypto_util.generate_csr` and `.generate_key` to make `csr_dir` and `key_dir` optional, respectively.
- [x] Change `certbot._internal.client.Client.obtain_certificate` to no longer include `csr_dir` and `key_dir` to the `.generate_csr` and `.generate_key` calls, respectively.
- Automatically delete unwanted lineage items:
  - [x] In `certbot._internal.storage.RenewableCert`, add a function to truncate the lineage history according to the criteria (keep the current and the 5 prior certificates). 
      - [x] Add a test suite for `truncate` 
  - [x] In `certbot._internal.renewal.renew_cert`, call the lineage truncation function after the symlinks have been updated for the renewal.


* Stop writing new files to /csr and /keys

* storage: add lineage truncation

* remove unused code

* deprecate keys_dir and csr_dir

* update CHANGELOG

* just keep 5 prior certificates, dont be clever with expiry

* docs: remove reference to /archive and /keys

* filter {csr,key}_dir deprecations directly in tests
2023-01-19 17:21:26 -08:00
alexzorinandGitHub e7fcd0e08d docs: give webroot and standalone better descriptions (#9536) 2023-01-12 08:03:51 -08:00
Brad Warren 32a233d93b Bump version to 2.3.0 2023-01-11 13:21:23 -08:00
Brad Warren a63bf5f88b Add contents to certbot/CHANGELOG.md for next version 2023-01-11 13:21:23 -08:00
Brad Warren 4ab4c9b65d Release 2.2.0 2023-01-11 13:21:22 -08:00
Brad Warren b56df2fdd9 Update changelog for 2.2.0 release 2023-01-11 13:20:17 -08:00
d641f062f2 limit challenge polling to 30 minutes (#9527)
* limit challenge polling to 30 minutes

* Fix docstring typo

Co-authored-by: Brad Warren <bmw@users.noreply.github.com>

Co-authored-by: Brad Warren <bmw@users.noreply.github.com>
2023-01-06 09:24:58 +11:00
Alex BoumaandGitHub b81ef33f33 Add link to dns-dnsmanager third party plugin (#9523) 2022-12-25 09:07:12 +11:00
Brad Warren 74af586f4b Merge branch 'master' into candidate-1.32.2 2022-12-16 14:16:58 -08:00
Brad Warren c3e1d7e560 Bump version to 2.2.0 2022-12-16 12:46:36 -08:00
Brad Warren 8e30f13e57 Add contents to certbot/CHANGELOG.md for next version 2022-12-16 12:46:36 -08:00
Brad Warren 06bba7167d Release 1.32.2 2022-12-16 12:46:34 -08:00
Brad Warren 118fce34d3 Update changelog for 1.32.2 release 2022-12-16 12:45:28 -08:00
Brad WarrenandGitHub 746631351f Prep for 1.32.2 (#9514)
* Update dependencies (#9505)

* upgrade dependencies

* forbid old setuptools

(cherry picked from commit 70a36fdf00)

* fix help output (#9509)

(cherry picked from commit 27af7b5d15)

* add reminder to repin.sh

* write changelog entry

* pin back mypy
2022-12-16 12:43:17 -08:00
Brad Warren ac0f4ba3ee Merge branch 'master' into candidate-2.1.1 2022-12-15 08:21:28 -08:00
Brad Warren d47242296d Bump version to 2.2.0 2022-12-15 07:14:18 -08:00
Brad Warren edfd84fab5 Add contents to certbot/CHANGELOG.md for next version 2022-12-15 07:14:18 -08:00
Brad Warren af503ad836 Release 2.1.1 2022-12-15 07:14:17 -08:00
Brad Warren 06d40ec272 Update changelog for 2.1.1 release 2022-12-15 07:13:22 -08:00
Brad WarrenandGitHub 1615185a14 Prepare for 2.1.1 (#9508)
* Update dependencies (#9505)

* upgrade dependencies

* forbid old setuptools

(cherry picked from commit 70a36fdf00)

* prep changelog

* also mention windows
2022-12-15 11:31:56 +11:00
Brad WarrenandGitHub a807240db7 add 1.32.x/requirements.txt (#9506) 2022-12-13 11:00:30 +11:00
Marcel RobitailleandGitHub 6b7549bf3a Add filename to dns_common.py configuration errors (#9501)
Fixes #9500

Also print the path to the file with errors for the error "Error parsing credentials configuration" of `dns_common.py`. This makes debugging this error much easier.
2022-12-09 14:55:07 -08:00
Brad Warren 7240e06613 Bump version to 2.2.0 2022-12-07 06:51:42 -08:00
Brad Warren 51bf92f353 Add contents to certbot/CHANGELOG.md for next version 2022-12-07 06:51:42 -08:00
Brad Warren 5e193eb12f Release 2.1.0 2022-12-07 06:51:41 -08:00
Brad Warren 63ea7d54e7 Update changelog for 2.1.0 release 2022-12-07 06:50:45 -08:00