1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hextris_ynh.git synced 2024-09-03 19:16:05 +02:00

Merge pull request #26

Some fixes by @ericgaspar
This commit is contained in:
Aeris One 2021-03-22 13:39:44 +01:00 committed by GitHub
commit 0f16b1f248
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 32 deletions

View file

@ -25,7 +25,7 @@ An addictive puzzle game inspired by Tetris.
## Documentation
* Official documentation: https://github.com/Hextris/Hextris
* YunoHost documentation: https://yunohost.org/#/app_hextris
* YunoHost documentation: https://yunohost.org/en/app_hextris
#### Supported architectures

View file

@ -1,7 +1,7 @@
# Hextris pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/hextris.svg)](https://dash.yunohost.org/appci/app/hextris) ![](https://ci-apps.yunohost.org/ci/badges/hextris.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/hextris.maintain.svg)
[![Installer Hextris avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=hextris)
[![Installer Hextris avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hextris)
*[Read this readme in english.](./README.md)*
@ -25,7 +25,7 @@ Un puzzle addictif inspiré de Tetris.
## Documentation
* Documentation officielle : https://github.com/Hextris/Hextris
* Documentation YunoHost : https://yunohost.org/#/app_hextris
* Documentation YunoHost : https://yunohost.org/fr/app_hextris
#### Architectures supportées

View file

@ -14,7 +14,7 @@
"email": "aeris@e.email"
},
"requirements": {
"yunohost": ">= 3.8.1"
"yunohost": ">= 4.1.7"
},
"multi_instance": true,
"services": [
@ -25,29 +25,17 @@
{
"name": "domain",
"type": "domain",
"ask": {
"en": "Choose a domain for Hextris",
"fr": "Choisissez un domaine pour Hextris"
},
"example": "domain.org"
},
{
"name": "path",
"type": "path",
"ask": {
"en": "Choose a path for Hextris",
"fr": "Choisissez un chemin pour Hextris"
},
"example": "/hextris",
"default": "/hextris"
},
{
"name": "is_public",
"type": "boolean",
"ask": {
"en": "Is it a public application?",
"fr": "Est-ce une application publique ?"
},
"help": {
"en": "If enabled, Hextris will be accessible by people who doesn't have an account. This can be changed later via the webadmin.",
"fr": "Si cette case est cochée, Hextris sera accessible aux personnes n'ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin."

View file

@ -29,6 +29,23 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
# Needed for helper "ynh_add_nginx_config"
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# CHECK WHICH PARTS SHOULD BE CHANGED
#=================================================

View file

@ -44,7 +44,6 @@ 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
#=================================================
# STANDARD MODIFICATIONS
@ -78,12 +77,12 @@ 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
if [ $is_public -eq 1 ]
then
ynh_permission_update --permission "main" --add visitors
ynh_permission_update --permission="main" --add="visitors"
fi
#=================================================

View file

@ -37,23 +37,13 @@ if [ -z "$final_path" ]; then
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi
# Migrate from legacy permission system
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
if [ -n "$is_public" ]; then
# Removing skipped/unprotected_uris under certain conditions, remove the visitors group added during the migration process of 3.7
# Remove skipped_uris. If the app was public, add visitors again to the main permission
if ynh_permission_has_user --permission=main --user=visitors
then
ynh_app_setting_delete --app=$app --key=skipped_uris
ynh_permission_update --permission "main" --add "visitors"
else
ynh_app_setting_delete --app=$app --key=skipped_uris
fi
ynh_app_setting_delete --app=$app --key=is_public
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================