diff --git a/README.md b/README.md index ef7c7e6..4a0cc6a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # Hextris for YunoHost [![Integration level](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) -[![Install Hextris with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=hextris) +[![Install Hextris with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hextris) + +*[Lire ce readme en français.](./README_fr.md)* *[Lire ce readme en français.](./README_fr.md)* @@ -22,10 +24,16 @@ An addictive puzzle game inspired by Tetris. * [Official demo](http://hextris.io/) * [YunoHost demo](https://demo.yunohost.org/hextris/) +## Documentation + + * Official documentation: https://github.com/Hextris/Hextris + * YunoHost documentation: https://yunohost.org/en/app_hextris + + #### Supported architectures -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/hextris%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/hextris/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/hextris%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/hextris/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/hextris.svg)](https://ci-apps.yunohost.org/ci/apps/hextris/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/hextris.svg)](https://ci-apps-arm.yunohost.org/ci/apps/hextris/) ## Links diff --git a/README_fr.md b/README_fr.md index 15b3e0a..4767895 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)* @@ -22,10 +22,16 @@ Un puzzle addictif inspiré de Tetris. * [Démo officielle](http://hextris.io/) * [Démo YunoHost](https://demo.yunohost.org/hextris/) +## Documentation + + * Documentation officielle : https://github.com/Hextris/Hextris + * Documentation YunoHost : https://yunohost.org/fr/app_hextris + + #### Architectures supportées -* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/hextris%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/hextris/) -* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/hextris%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/hextris/) +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/hextris.svg)](https://ci-apps.yunohost.org/ci/apps/hextris/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/hextris.svg)](https://ci-apps-arm.yunohost.org/ci/apps/hextris/) ## Liens diff --git a/manifest.json b/manifest.json index 842e874..8986440 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "A fast paced puzzle game.", "fr": "Un jeu de puzzle très rapide" }, - "version": "2020-05-05~ynh2", + "version": "2020-05-05~ynh3", "url": "http://hextris.github.io/", "license": "GPL-3.0", "maintainer": { @@ -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/pull_request_template.md b/pull_request_template.md index 64b71a8..6c28fc5 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -11,12 +11,6 @@ - [ ] Upgrade from last version tested. - [ ] Can be reviewed and tested. -## Validation +## Package_check results --- -- [ ] **Code review** : -- [ ] **Approval (LGTM)** : -*Code review and approval have to be from a member of @YunoHost-Apps/apps-group* -- **CI succeeded** : -[![Build Status](https://ci-apps-hq.yunohost.org/jenkins/job/hextris_ynh%20PR-NUM-/badge/icon)](https://ci-apps-hq.yunohost.org/jenkins/job/hextris_ynh%20PR-NUM-/) -*Please replace '-NUM-' in this link by the PR number.* -When the PR is marked as ready to merge, you have to wait for 3 days before really merging it. +* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* diff --git a/scripts/change_url b/scripts/change_url index 1160e7e..2480b7f 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -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 #================================================= 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..8e535ce 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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 #=================================================