1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/243-game_ynh.git synced 2024-09-03 18:06:00 +02:00
* remove is_public
This commit is contained in:
Éric Gaspar 2021-03-15 23:51:50 +01:00 committed by GitHub
parent 01b295aaa1
commit 52f0638a46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 28 deletions

View file

@ -6,7 +6,7 @@
"en": "2048 game clone",
"fr": "Clone du jeu 2048"
},
"version": "1.0~ynh4",
"version": "1.0~ynh5",
"url": "https://github.com/hgentry/81/",
"license": "MIT",
"maintainer": {
@ -14,7 +14,7 @@
"email": ""
},
"requirements": {
"yunohost": ">= 4.0.0"
"yunohost": ">= 4.1.7"
},
"multi_instance": true,
"services": [
@ -25,29 +25,17 @@
{
"name": "domain",
"type": "domain",
"ask": {
"en": "Choose a domain for 243",
"fr": "Choisissez un nom de domaine pour 243"
},
"example": "domain.org"
},
{
"name": "path",
"type": "path",
"ask": {
"en": "Choose a path for 243",
"fr": "Choisissez un chemin pour 243"
},
"example": "/243",
"default": "/243"
},
{
"name": "is_public",
"type": "boolean",
"ask": {
"en": "Is it a public application?",
"fr": "Est-ce une application publique ?"
},
"help": {
"en": "If enabled, 243 will be accessible by people who doesnt have an account. This can be changed later via the webadmin.",
"fr": "Si cette case est cochée, 243 sera accessible aux personnes nayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin."

View file

@ -42,9 +42,8 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url
#=================================================
ynh_script_progression --message="Storing installation settings..." --weight=2
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
ynh_app_setting_set --app=$app --key=is_public --value=$is_public
ynh_app_setting_set --app=$app --key=domain --value=$domain
ynh_app_setting_set --app=$app --key=path --value=$path_url
#=================================================
# STANDARD MODIFICATIONS
@ -78,7 +77,7 @@ chown -R root: $final_path
#=================================================
# SETUP SSOWAT
#=================================================
ynh_script_progression --message="Configuring SSOwat..." --weight=1
ynh_script_progression --message="Configuring permissions..." --weight=1
# Make app public if necessary or protect it
[ $is_public -eq 0 ] || ynh_permission_update --permission="main" --add="visitors"

View file

@ -17,7 +17,6 @@ app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
@ -31,21 +30,19 @@ upgrade_type=$(ynh_check_app_version_changed)
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --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 final_path doesn't exist, create it
if [ -z "$final_path" ]; then
final_path=/var/www/$app
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================