mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 02:35:06 +02:00
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>
This commit is contained in:
@@ -808,6 +808,25 @@ def test_revoke_multiple_lineages(context: IntegrationTestsContext) -> None:
|
||||
assert 'Not deleting revoked certificates due to overlapping archive dirs' in f.read()
|
||||
|
||||
|
||||
def test_reconfigure(context: IntegrationTestsContext) -> None:
|
||||
"""Test the reconfigure verb"""
|
||||
certname = context.get_domain()
|
||||
context.certbot(['-d', certname])
|
||||
conf_path = join(context.config_dir, 'renewal', '{}.conf'.format(certname))
|
||||
|
||||
with misc.create_http_server(context.http_01_port) as webroot:
|
||||
context.certbot(['reconfigure', '--cert-name', certname,
|
||||
'-a', 'webroot', '--webroot-path', webroot])
|
||||
with open(conf_path, 'r') as f:
|
||||
file_contents = f.read()
|
||||
# Check changed value
|
||||
assert 'authenticator = webroot' in file_contents, \
|
||||
'Expected authenticator to be changed to webroot in renewal config'
|
||||
# Check added value
|
||||
assert f'webroot_path = {webroot}' in file_contents, \
|
||||
'Expected new webroot path to be added to renewal config'
|
||||
|
||||
|
||||
def test_wildcard_certificates(context: IntegrationTestsContext) -> None:
|
||||
"""Test wildcard certificate issuance."""
|
||||
certname = context.get_domain('wild')
|
||||
|
||||
Reference in New Issue
Block a user