Add an option to disable the 'YunoHost' panel overlay in web apps (#1071)

* Add an option to disable the 'YunoHost' panel overlay in apps

* set default value for overlay as true

* Add a hook to auto-update nginx conf + fix deprecated 'service regen-conf'

* Change name of setting to ssowat.panel_overlay.enabled

* [fix] Duplicate function

* Quote var, just in case the var is empty for some reason

Co-authored-by: ljf (zamentur) <zamentur@users.noreply.github.com>
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
This commit is contained in:
cyxae 2021-04-02 02:21:29 +02:00 committed by GitHub
parent a03b62245d
commit 30421954a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

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

View file

@ -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: