mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
letsencrypt: Remove unnecessary processing of the error messages
- This allows the certbot command output to be shown accurately in the HTML error message. Tests: - Edit the code to show all the action buttons in the UI. Set domain to mydomain.example. Run all four actions. Notice that HTML error message are shown and certbot output is shown properly in stdout/stderr sections. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
969d9311ab
commit
598d7570ff
@ -142,12 +142,7 @@ def revoke(domain: str):
|
||||
if TEST_MODE:
|
||||
command.append('--staging')
|
||||
|
||||
process = subprocess.Popen(command, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
_, stderr = process.communicate()
|
||||
if process.returncode:
|
||||
raise RuntimeError('Error revoking certificate: {error}'.format(
|
||||
error=stderr.decode()))
|
||||
subprocess.run(command, check=True)
|
||||
|
||||
action_utils.webserver_disable(domain, kind='site')
|
||||
|
||||
@ -164,12 +159,7 @@ def obtain(domain: str):
|
||||
if TEST_MODE:
|
||||
command.append('--staging')
|
||||
|
||||
process = subprocess.Popen(command, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
_, stderr = process.communicate()
|
||||
if process.returncode:
|
||||
raise RuntimeError('Error obtaining certificate: {error}'.format(
|
||||
error=stderr.decode()))
|
||||
subprocess.run(command, check=True)
|
||||
|
||||
with action_utils.WebserverChange() as webserver_change:
|
||||
_setup_webserver_config(domain, webserver_change)
|
||||
@ -330,13 +320,7 @@ def _assert_managed_path(module, path):
|
||||
def delete(domain: str):
|
||||
"""Disable a domain and delete the certificate."""
|
||||
command = ['certbot', 'delete', '--non-interactive', '--cert-name', domain]
|
||||
process = subprocess.Popen(command, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
_, stderr = process.communicate()
|
||||
if process.returncode:
|
||||
raise RuntimeError('Error deleting certificate: {error}'.format(
|
||||
error=stderr.decode()))
|
||||
|
||||
subprocess.run(command, check=True)
|
||||
action_utils.webserver_disable(domain, kind='site')
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user