From 32a467ed4455070fbf6734596f142c6570bd81e2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 4 Dec 2020 18:25:18 +0100 Subject: [PATCH] Set new permissions --- manifest.json | 2 +- scripts/install | 9 +++++---- scripts/upgrade | 12 ------------ 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/manifest.json b/manifest.json index 69cbe6f..2d8f9e8 100644 --- a/manifest.json +++ b/manifest.json @@ -17,7 +17,7 @@ "email": "jean-baptiste@holcroft.fr" }], "requirements": { - "yunohost": ">= 4.0" + "yunohost": ">= 4.0.0" }, "multi_instance": true, "services": [ diff --git a/scripts/install b/scripts/install index 66a3806..38d8193 100644 --- a/scripts/install +++ b/scripts/install @@ -238,11 +238,12 @@ ynh_add_fail2ban_config --logpath="/var/log/nginx/$domain-access.log" --failrege #================================================= ynh_script_progression --message="Configuring SSOwat..." -# Make app public if necessary -if [ "$is_public" -eq 1 ] +# Make app public if necessary or protect it +if [ $is_public -eq 1 ] then - # makes sure no SSO credentials to be passed - ynh_app_setting_set --app="$app" --key=skipped_uris --value="/" + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission "main" --add "visitors" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 890fe04..ba53da0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -254,18 +254,6 @@ yunohost service add "$app-server" --log="/var/log/$app/server.log" yunohost service add "$app-worker" --log="/var/log/$app/worker.log" yunohost service add "$app-beat" --log="/var/log/$app/beat.log" -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." - -# Make app public if necessary -if [ "$is_public" -eq 1 ] -then - # makes sure no SSO credentials to be passed - ynh_app_setting_set --app="$app" --key=skipped_uris --value="/" -fi - #================================================= # START SYSTEMD SERVICE #=================================================