From 600ccede11dcc58c5dbb189567d02462f44cd88d Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sat, 18 Apr 2020 13:26:22 +0200 Subject: [PATCH] [enh] use permissions system --- manifest.json | 4 ++-- scripts/install | 5 ++--- scripts/upgrade | 9 --------- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/manifest.json b/manifest.json index 5edbb51..685567c 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "tituspijean@outlook.com" }, "requirements": { - "yunohost": ">= 3.5" + "yunohost": ">= 3.7" }, "services": [], "multi_instance": false, @@ -31,7 +31,7 @@ "en": "REMINDER: ztncui needs the ZeroTier app to be already installed.", "fr": "RAPPEL: ztncui nécessite que l'app ZeroTier soit déjà installée." }, - "example": "example.com" + "example": "zt.example.com" }, { "name": "is_public", diff --git a/scripts/install b/scripts/install index 1ff3e5c..efccb86 100644 --- a/scripts/install +++ b/scripts/install @@ -280,13 +280,12 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= # SETUP SSOWAT #================================================= -ynh_script_progression --message="Configuring SSOwat..." --time --weight=1 +ynh_script_progression --message="Configuring SSOwat..." # Make app public if necessary if [ $is_public -eq 1 ] then - # unprotected_uris allows SSO credentials to be passed anyway. - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" + ynh_permission_update --permission "main" --add visitors fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 790ef32..282704b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -39,15 +39,6 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --time --weight=1 -# Fix is_public as a boolean value -if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=1 - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=0 - is_public=0 -fi - # If db_name doesn't exist, create it if [ -z "$db_name" ]; then db_name=$(ynh_sanitize_dbid --db_name=$app)