diff --git a/README.md b/README.md index 758e4a4..e7e27d4 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/README_fr.md b/README_fr.md index 2f2a6c6..2b384ab 100644 --- a/README_fr.md +++ b/README_fr.md @@ -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 diff --git a/manifest.json b/manifest.json index 842e874..3b8a531 100644 --- a/manifest.json +++ b/manifest.json @@ -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." diff --git a/scripts/change_url b/scripts/change_url index 8cc1e30..2480b7f 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -8,7 +8,6 @@ source _common.sh source /usr/share/yunohost/helpers -ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS @@ -30,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 #================================================= diff --git a/scripts/install b/scripts/install index c5cfa22..d17e38f 100755 --- a/scripts/install +++ b/scripts/install @@ -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 #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 279396a..93506a0 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -46,14 +46,13 @@ if [ -n "$is_public" ]; then 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" + 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 #=================================================