add hook to reconfigure nginx or ssh on settings change

This commit is contained in:
Romuald du Song 2019-02-21 20:46:18 +01:00
parent 5d48640f3c
commit 9aa6cb6ac5

View file

@ -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")