1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ztncui_ynh.git synced 2024-09-03 18:06:05 +02:00

[enh] use permissions system

This commit is contained in:
tituspijean 2020-04-18 13:26:22 +02:00
parent 772480a9af
commit 600ccede11
3 changed files with 4 additions and 14 deletions

View file

@ -14,7 +14,7 @@
"email": "tituspijean@outlook.com" "email": "tituspijean@outlook.com"
}, },
"requirements": { "requirements": {
"yunohost": ">= 3.5" "yunohost": ">= 3.7"
}, },
"services": [], "services": [],
"multi_instance": false, "multi_instance": false,
@ -31,7 +31,7 @@
"en": "REMINDER: ztncui needs the ZeroTier app to be already installed.", "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." "fr": "RAPPEL: ztncui nécessite que l'app ZeroTier soit déjà installée."
}, },
"example": "example.com" "example": "zt.example.com"
}, },
{ {
"name": "is_public", "name": "is_public",

View file

@ -280,13 +280,12 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap
#================================================= #=================================================
# SETUP SSOWAT # SETUP SSOWAT
#================================================= #=================================================
ynh_script_progression --message="Configuring SSOwat..." --time --weight=1 ynh_script_progression --message="Configuring SSOwat..."
# Make app public if necessary # Make app public if necessary
if [ $is_public -eq 1 ] if [ $is_public -eq 1 ]
then then
# unprotected_uris allows SSO credentials to be passed anyway. ynh_permission_update --permission "main" --add visitors
ynh_app_setting_set --app=$app --key=unprotected_uris --value="/"
fi fi
#================================================= #=================================================

View file

@ -39,15 +39,6 @@ upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --time --weight=1 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 db_name doesn't exist, create it
if [ -z "$db_name" ]; then if [ -z "$db_name" ]; then
db_name=$(ynh_sanitize_dbid --db_name=$app) db_name=$(ynh_sanitize_dbid --db_name=$app)