1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/243-game_ynh.git synced 2024-09-03 18:06:00 +02:00

Merge pull request #22 from YunoHost-Apps/testing

Testing
This commit is contained in:
yalh76 2022-08-15 23:48:22 +02:00 committed by GitHub
commit b7820dad69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 154 additions and 82 deletions

View file

@ -5,7 +5,7 @@ It shall NOT be edited by hand.
# 243 for YunoHost
[![Integration level](https://dash.yunohost.org/integration/243.svg)](https://dash.yunohost.org/appci/app/243) ![](https://ci-apps.yunohost.org/ci/badges/243.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/243.maintain.svg)
[![Integration level](https://dash.yunohost.org/integration/243.svg)](https://dash.yunohost.org/appci/app/243) ![Working status](https://ci-apps.yunohost.org/ci/badges/243.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/243.maintain.svg)
[![Install 243 with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=243)
*[Lire ce readme en français.](./README_fr.md)*
@ -17,30 +17,33 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/in
2048 game clone
**Shipped version:** 1.0~ynh5
**Shipped version:** 1.0~ynh6
**Demo:** https://hgentry.github.io/81/
## Screenshots
![](./doc/screenshots/Screenshot-243.jpg)
![Screenshot of 243](./doc/screenshots/Screenshot-243.jpg)
## Documentation and resources
* Official app website: https://github.com/hgentry/81/
* Upstream app code repository: https://github.com/hgentry/81
* YunoHost documentation for this app: https://yunohost.org/app_243
* Report a bug: https://github.com/YunoHost-Apps/243_ynh/issues
* Official app website: <https://github.com/hgentry/81/>
* Upstream app code repository: <https://github.com/hgentry/81>
* YunoHost documentation for this app: <https://yunohost.org/app_243>
* Report a bug: <https://github.com/YunoHost-Apps/243_ynh/issues>
## Developer info
Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/243_ynh/tree/testing).
To try the testing branch, please proceed like that.
```
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/243_ynh/tree/testing --debug
or
sudo yunohost app upgrade 243 -u https://github.com/YunoHost-Apps/243_ynh/tree/testing --debug
```
**More info regarding app packaging:** https://yunohost.org/packaging_apps
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>

View file

@ -1,10 +1,14 @@
<!--
N.B.: This README was automatically generated by https://github.com/YunoHost/apps/tree/master/tools/README-generator
It shall NOT be edited by hand.
-->
# 243 pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/243.svg)](https://dash.yunohost.org/appci/app/243) ![](https://ci-apps.yunohost.org/ci/badges/243.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/243.maintain.svg)
[![Niveau d'intégration](https://dash.yunohost.org/integration/243.svg)](https://dash.yunohost.org/appci/app/243) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/243.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/243.maintain.svg)
[![Installer 243 avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=243)
*[Read this readme in english.](./README.md)*
*[Lire ce readme en français.](./README_fr.md)*
> *Ce package vous permet d'installer 243 rapidement et simplement sur un serveur YunoHost.
Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
@ -13,30 +17,33 @@ Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour
Clone du jeu 2048
**Version incluse :** 1.0~ynh5
**Version incluse :** 1.0~ynh6
**Démo :** https://hgentry.github.io/81/
## Captures d'écran
![](./doc/screenshots/Screenshot-243.jpg)
![Capture d'écran de 243](./doc/screenshots/Screenshot-243.jpg)
## Documentations et ressources
* Site officiel de l'app : https://github.com/hgentry/81/
* Dépôt de code officiel de l'app : https://github.com/hgentry/81
* Documentation YunoHost pour cette app : https://yunohost.org/app_243
* Signaler un bug : https://github.com/YunoHost-Apps/243_ynh/issues
* Site officiel de l'app : <https://github.com/hgentry/81/>
* Dépôt de code officiel de l'app : <https://github.com/hgentry/81>
* Documentation YunoHost pour cette app : <https://yunohost.org/app_243>
* Signaler un bug : <https://github.com/YunoHost-Apps/243_ynh/issues>
## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/243_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit.
```
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/243_ynh/tree/testing --debug
ou
sudo yunohost app upgrade 243 -u https://github.com/YunoHost-Apps/243_ynh/tree/testing --debug
```
**Plus d'infos sur le packaging d'applications :** https://yunohost.org/packaging_apps
**Plus d'infos sur le packaging d'applications :** <https://yunohost.org/packaging_apps>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

View file

@ -1,9 +1,8 @@
;; Test complet
auto_remove=1
; Manifest
domain="domain.tld"
path="/path"
is_public="Yes"
is_public=1
; Checks
pkg_linter=1
setup_sub_dir=1
@ -12,7 +11,12 @@
setup_private=1
setup_public=1
upgrade=1
# 1.0~ynh5
upgrade=1 from_commit=c253a238d18ee8a2a589cc8ee3bcfec5aac2e14e
backup_restore=1
multi_instance=1
port_already_use=0
change_url=1
;;; Options
Email=
Notification=none

View file

@ -3,4 +3,5 @@ SOURCE_SUM=c7d2052999ae4d2e0c5fd5ff1dd6bfb794b7f2bc5caa63f4fbc5e195509c00b9
SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=81-gh-pages.tar.gz
SOURCE_FILENAME=
SOURCE_EXTRACT=true

View file

@ -2,13 +2,8 @@
location __PATH__/ {
# Path to source
alias __FINALPATH__/ ;
# Force usage of https
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
alias __FINALPATH__/;
# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
}
}

1
doc/DESCRIPTION.md Normal file
View file

@ -0,0 +1 @@
2048 game clone

1
doc/DESCRIPTION_fr.md Normal file
View file

@ -0,0 +1 @@
Clone du jeu 2048

0
doc/DISCLAIMER.md Normal file
View file

0
doc/DISCLAIMER_fr.md Normal file
View file

View file

@ -6,7 +6,7 @@
"en": "2048 game clone",
"fr": "Clone du jeu 2048"
},
"version": "1.0~ynh5",
"version": "1.0~ynh6",
"url": "https://github.com/hgentry/81/",
"upstream": {
"license": "MIT",
@ -20,18 +20,17 @@
"email": ""
},
"requirements": {
"yunohost": ">= 4.1.7"
"yunohost": ">= 4.3.0"
},
"multi_instance": true,
"services": [
"nginx"
],
"arguments": {
"install" : [
"install": [
{
"name": "domain",
"type": "domain",
"example": "domain.org"
"type": "domain"
},
{
"name": "path",
@ -42,9 +41,9 @@
{
"name": "is_public",
"type": "boolean",
"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."
"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."
},
"default": true
}

20
scripts/_common.sh Normal file
View file

@ -0,0 +1,20 @@
#!/bin/bash
#=================================================
# COMMON VARIABLES
#=================================================
# dependencies used by the app
pkg_dependencies=""
#=================================================
# PERSONAL HELPERS
#=================================================
#=================================================
# EXPERIMENTAL HELPERS
#=================================================
#=================================================
# FUTURE OFFICIAL HELPERS
#=================================================

View file

@ -6,12 +6,15 @@
# IMPORT GENERIC HELPERS
#=================================================
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================

View file

@ -6,6 +6,7 @@
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
@ -29,9 +30,9 @@ ynh_script_progression --message="Loading installation settings..." --weight=1
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
# BACKUP BEFORE CHANGE URL THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up $app before changing its URL (may take a while)..." --weight=2
ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=2
# Backup the current version of the app
ynh_backup_before_upgrade
@ -39,7 +40,7 @@ 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
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script

View file

@ -6,18 +6,19 @@
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST
#=================================================
# Retrieve arguments
domain=$YNH_APP_ARG_DOMAIN
path_url=$YNH_APP_ARG_PATH
@ -30,7 +31,6 @@ app=$YNH_APP_INSTANCE_NAME
#=================================================
ynh_script_progression --message="Validating installation parameters..." --weight=1
# Copy files to the right place
final_path=/var/www/$app
test ! -e "$final_path" || ynh_die --message="This path already contains a folder"
@ -43,20 +43,31 @@ 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=path --value=$path_url
#=================================================
# STANDARD MODIFICATIONS
#=================================================
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Configuring system user..."
# Create a system user
ynh_system_user_create --username=ynh_$app --home_dir="$final_path"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
#=================================================
ynh_script_progression --message="Setting up source files..." --weight=1
ynh_app_setting_set --app=$app --key=final_path --value=$final_path
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path"
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R ynh_$app:www-data "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
@ -67,20 +78,18 @@ ynh_add_nginx_config
#=================================================
# GENERIC FINALIZATION
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
# Set permissions to app files
chown -R root: $final_path
#=================================================
# SETUP SSOWAT
#=================================================
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"
# Make app public if necessary
if [ $is_public -eq 1 ]
then
# Everyone can access the app.
# The "main" permission is automatically created before the install script.
ynh_permission_update --permission="main" --add="visitors"
fi
#=================================================
# RELOAD NGINX

View file

@ -6,6 +6,7 @@
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
@ -23,7 +24,7 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
# REMOVE APP MAIN DIR
#=================================================
ynh_script_progression --message="Removing $app main directory..." --weight=3
ynh_script_progression --message="Removing app main directory..." --weight=3
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
@ -36,6 +37,16 @@ ynh_script_progression --message="Removing NGINX web server configuration..." --
# Remove the dedicated NGINX config
ynh_remove_nginx_config
#=================================================
# GENERIC FINALIZATION
#=================================================
# REMOVE DEDICATED USER
#=================================================
ynh_script_progression --message="Removing the dedicated system user..."
# Delete a system user
ynh_system_user_delete --username=ynh_$app
#=================================================
# END OF SCRIPT
#=================================================

View file

@ -6,18 +6,21 @@
# IMPORT GENERIC HELPERS
#=================================================
# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts
source ../settings/scripts/_common.sh
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
#=================================================
ynh_script_progression --message="Loading settings..." --weight=1
ynh_script_progression --message="Loading installation settings..." --weight=1
app=$YNH_APP_INSTANCE_NAME
@ -30,32 +33,36 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
ynh_script_progression --message="Validating restoration parameters..." --weight=1
ynh_webpath_available --domain=$domain --path_url=$path_url \
|| ynh_die --message="Path not available: ${domain}${path_url}"
test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path "
#=================================================
# STANDARD RESTORATION STEPS
#=================================================
# RESTORE THE NGINX CONFIGURATION
# RECREATE THE DEDICATED USER
#=================================================
ynh_script_progression --message="Recreating the dedicated system user..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
# Create the dedicated user (if not existing)
ynh_system_user_create --username=ynh_$app --home_dir="$final_path"
#=================================================
# RESTORE THE APP MAIN DIR
#=================================================
ynh_script_progression --message="Restoring $app main directory..." --weight=2
ynh_script_progression --message="Restoring the app main directory..." --weight=2
ynh_restore_file --origin_path="$final_path"
#=================================================
# RESTORE USER RIGHTS
#=================================================
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R ynh_$app:www-data "$final_path"
# Restore permissions on app files
chown -R root: $final_path
#=================================================
# RESTORE THE NGINX CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the NGINX web server configuration..."
ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# GENERIC FINALIZATION

View file

@ -6,6 +6,7 @@
# IMPORT GENERIC HELPERS
#=================================================
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
@ -25,6 +26,22 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
upgrade_type=$(ynh_check_app_version_changed)
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#=================================================
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=3
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# Restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# STANDARD UPGRADE STEPS
#=================================================
# ENSURE DOWNWARD COMPATIBILITY
#=================================================
@ -44,18 +61,12 @@ if ynh_legacy_permissions_exists; then
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
# CREATE DEDICATED USER
#=================================================
ynh_script_progression --message="Backing up $app before upgrading (may take a while)..." --weight=3
ynh_script_progression --message="Making sure dedicated system user exists..."
# Backup the current version of the app
ynh_backup_before_upgrade
ynh_clean_setup () {
# restore it if the upgrade fails
ynh_restore_upgradebackup
}
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
# Create a dedicated user (if not existing)
ynh_system_user_create --username=ynh_$app --home_dir="$final_path"
#=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE
@ -69,6 +80,10 @@ then
ynh_setup_source --dest_dir="$final_path"
fi
chmod 750 "$final_path"
chmod -R o-rwx "$final_path"
chown -R ynh_$app:www-data "$final_path"
#=================================================
# NGINX CONFIGURATION
#=================================================
@ -78,12 +93,7 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." -
ynh_add_nginx_config
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================
# Set permissions on app files
chown -R root: $final_path
# GENERIC FINALIZATION
#=================================================
# RELOAD NGINX
#=================================================