diff --git a/data/hooks/conf_regen/15-nginx b/data/hooks/conf_regen/15-nginx index 1d68bbdf8..8875693c6 100755 --- a/data/hooks/conf_regen/15-nginx +++ b/data/hooks/conf_regen/15-nginx @@ -47,6 +47,12 @@ do_pre_regen() { # install / update plain conf files cp plain/* "$nginx_conf_dir" + # remove the panel overlay if this is specified in settings + panel_overlay=$(yunohost settings get 'ssowat.panel_overlay.enabled') + if [ "$panel_overlay" == "false" ] || [ "$panel_overlay" == "False" ] + then + echo "#" > "${nginx_conf_dir}/yunohost_panel.conf.inc" + fi # retrieve variables main_domain=$(cat /etc/yunohost/current_host) diff --git a/src/yunohost/settings.py b/src/yunohost/settings.py index 9d1a6d11f..e252316bd 100644 --- a/src/yunohost/settings.py +++ b/src/yunohost/settings.py @@ -94,10 +94,10 @@ DEFAULTS = OrderedDict( ("smtp.relay.user", {"type": "string", "default": ""}), ("smtp.relay.password", {"type": "string", "default": ""}), ("backup.compress_tar_archives", {"type": "bool", "default": False}), + ("ssowat.panel_overlay.enabled", {"type": "bool", "default": True}), ] ) - def settings_get(key, full=False): """ Get an entry value in the settings @@ -376,7 +376,7 @@ def trigger_post_change_hook(setting_name, old_value, new_value): # # =========================================== - +@post_change_hook("ssowat.panel_overlay.enabled") @post_change_hook("security.nginx.compatibility") def reconfigure_nginx(setting_name, old_value, new_value): if old_value != new_value: