diff --git a/README.md b/README.md index 54986b0..44d7d5a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,59 @@ -# Hextris YunoHost package +# Hextris app for YunoHost -Hextris is a fast paced puzzle game. +[![Integration level](https://dash.yunohost.org/integration/hextris.svg)](https://dash.yunohost.org/appci/app/hextris) +[![Install Hextris with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=hextris) -Visit [YunoHost website](https://yunohost.org) for more information. +> *This package allow you to install Hextris quickly and simply on a YunoHost server. +If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* + +## Overview + +An addictive puzzle game inspired by Tetris. + +**Shipped version:** 1.1 + +## Screenshots + +![](https://raw.githubusercontent.com/YunoHost-Apps/hextris_ynh/master/screenshot.jpg) + +## Demo + +* [Official demo](http://hextris.io/) +* [YunoHost demo](https://demo.yunohost.org/hextris/) + +## Configuration + +## Documentation + +## YunoHost specific features + +#### Supported architectures + +* x86-64b - [![Build Status](https://ci-apps.yunohost.org/ci/logs/hextris%20%28Official%29.svg)](https://ci-apps.yunohost.org/ci/apps/hextris/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/hextris%20%28Official%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/hextris/) +* Jessie x86-64b - [![Build Status](https://ci-stretch.nohost.me/ci/logs/hextris%20%28Official%29.svg)](https://ci-stretch.nohost.me/ci/apps/hextris/) + +## Limitations + +## Additional information + +## Links + + * Report a bug: https://github.com/YunoHost-Apps/hextris_ynh/issues + * Hextris website: http://hextris.github.io/ + * YunoHost website: https://yunohost.org/ + +--- + +Developers info +---------------- + +**Only if you want to use a testing branch for coding, instead of merging directly into master.** +Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/hextris_ynh/tree/testing). + +To try the testing branch, please proceed like that. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/hextris_ynh/tree/testing --debug +or +sudo yunohost app upgrade hextris -u https://github.com/YunoHost-Apps/hextris_ynh/tree/testing --debug +``` diff --git a/conf/nginx.conf b/conf/nginx.conf index f3e5977..549ae0e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,7 +1,10 @@ -location __PATH__ { +#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; +location __PATH__/ { + # Path to source alias __FINALPATH__/ ; + # Force usage of https if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } diff --git a/manifest.json b/manifest.json index bad438e..df4aaf7 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": "1.1", + "version": "1.1~ynh1", "url": "http://hextris.github.io/", "license": "GPL-3.0", "maintainer": { diff --git a/scripts/backup b/scripts/backup index 8cb432f..05aa5dc 100755 --- a/scripts/backup +++ b/scripts/backup @@ -2,19 +2,19 @@ #================================================= # GENERIC START -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit on command errors and treat access to unset variables as an error -set -eu - #================================================= # IMPORT GENERIC HELPERS #================================================= source /usr/share/yunohost/helpers +#================================================= +# MANAGE SCRIPT FAILURE +#================================================= + +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # LOAD SETTINGS #================================================= diff --git a/scripts/install b/scripts/install index 7ac9c8e..80f6485 100755 --- a/scripts/install +++ b/scripts/install @@ -35,8 +35,6 @@ test ! -e "$final_path" || ynh_die "This path already contains a folder" # Normalize the url path syntax path_url=$(ynh_normalize_url_path $path_url) -# Check web path availability -ynh_webpath_available $domain $path_url # Register (book) web path ynh_webpath_register $app $domain $path_url @@ -73,7 +71,7 @@ ynh_add_nginx_config #================================================= # Set permissions to app files -chown -R www-data: $final_path +chown -R root: $final_path #================================================= # SETUP SSOWAT diff --git a/scripts/remove b/scripts/remove index c84122f..d57b7a1 100755 --- a/scripts/remove +++ b/scripts/remove @@ -15,6 +15,7 @@ source /usr/share/yunohost/helpers app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get $app domain) +final_path=$(ynh_app_setting_get $app final_path) #================================================= # STANDARD REMOVE @@ -23,7 +24,7 @@ domain=$(ynh_app_setting_get $app domain) #================================================= # Remove the app directory securely -ynh_secure_remove "/var/www/$app" +ynh_secure_remove "$final_path" #================================================= # REMOVE NGINX CONFIGURATION diff --git a/scripts/restore b/scripts/restore index e44d13a..8620ae9 100755 --- a/scripts/restore +++ b/scripts/restore @@ -2,19 +2,19 @@ #================================================= # GENERIC START -#================================================= -# MANAGE SCRIPT FAILURE -#================================================= - -# Exit on command errors and treat access to unset variables as an error -set -eu - #================================================= # IMPORT GENERIC HELPERS #================================================= source /usr/share/yunohost/helpers +#================================================= +# MANAGE SCRIPT FAILURE +#================================================= + +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # LOAD SETTINGS #================================================= @@ -23,8 +23,8 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get $app domain) path_url=$(ynh_app_setting_get $app path) -final_path=$(ynh_app_setting_get $app final_path) is_public=$(ynh_app_setting_get $app is_public) +final_path=$(ynh_app_setting_get $app final_path) #================================================= # CHECK IF THE APP CAN BE RESTORED diff --git a/scripts/upgrade b/scripts/upgrade index e4c6803..f2e8a8e 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -42,11 +42,14 @@ fi # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #================================================= -ynh_backup_before_upgrade # Backup the current version of the app +# Backup the current version of the app +ynh_backup_before_upgrade ynh_clean_setup () { - ynh_restore_upgradebackup # restore it if the upgrade fails + # restore it if the upgrade fails + ynh_restore_upgradebackup } -ynh_abort_if_errors # Exit if an error occurs during the execution of the script +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors #================================================= # CHECK THE PATH @@ -78,7 +81,7 @@ ynh_add_nginx_config #================================================= # Set permissions to app files -chown -R www-data: $final_path +chown -R root: $final_path #================================================= # SETUP SSOWAT