From 9aa6cb6ac5c23f1a5385d0bda513629a445bf8ee Mon Sep 17 00:00:00 2001 From: Romuald du Song Date: Thu, 21 Feb 2019 20:46:18 +0100 Subject: [PATCH] add hook to reconfigure nginx or ssh on settings change --- src/yunohost/settings.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/yunohost/settings.py b/src/yunohost/settings.py index 1d60c3a6a..96c73a79d 100644 --- a/src/yunohost/settings.py +++ b/src/yunohost/settings.py @@ -239,3 +239,14 @@ def _save_settings(settings, location=SETTINGS_PATH): settings_fd.write(result) except Exception as e: raise YunohostError('global_settings_cant_write_settings', reason=e) + +@post_change_hook("security.ciphers.compatibility") +def reconfigure_nginx(setting_name, old_value, new_value): + if old_value != new_value: + service_regen_conf("nginx") + +@post_change_hook("service.ssh.ciphers.compatibility") +def reconfigure_ssh(setting_name, old_value, new_value): + if old_value != new_value: + service_regen_conf("ssh") +