certbot/certbot-nginx/certbot_nginx/_internal
alexzorin 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
..
tls_configs Cite Mozilla ssl-config in Apache/NGINX TLS configs (#8670) (#9295) 2022-05-13 10:59:49 -07:00
__init__.py Make the contents of the nginx plugin private (#7589) 2019-11-25 14:30:24 -08:00
configurator.py Deprecate {csr, keys} dirs & automatically truncate lineages (#9537) 2023-01-19 17:21:26 -08:00
constants.py Cite Mozilla ssl-config in Apache/NGINX TLS configs (#8670) (#9295) 2022-05-13 10:59:49 -07:00
display_ops.py Fully type certbot-nginx module (#9124) 2022-01-12 16:36:51 -08:00
http_01.py Search included files for nginx server_names_hash_bucket_size directive (#9198) 2022-02-11 15:40:14 +11:00
nginxparser.py nginx: on encountering lua directives, produce a better warning (#9475) 2022-11-30 12:03:51 +11:00
obj.py Fully type certbot-nginx module (#9124) 2022-01-12 16:36:51 -08:00
parser.py nginx: on encountering lua directives, produce a better warning (#9475) 2022-11-30 12:03:51 +11:00
parser_obj.py Fully type certbot-nginx module (#9124) 2022-01-12 16:36:51 -08:00