1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/minetest_ynh.git synced 2024-09-03 20:36:00 +02:00

Merge pull request #21 from YunoHost-Apps/testing

Testing
This commit is contained in:
Rafi59 2021-04-20 10:17:00 +02:00 committed by GitHub
commit c572b58787
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 78 additions and 83 deletions

View file

@ -11,7 +11,7 @@ If you dont have YunoHost, please see [here](https://yunohost.org/#/install)
## Overview ## Overview
Minetest is a free open-source voxel game engine with easy modding and game creation. Minetest is a free open-source voxel game engine with easy modding and game creation.
**Shipped version:** 5.3.0 **Shipped version:** 5.4.1
## Screenshots ## Screenshots
@ -28,7 +28,7 @@ How to configure this app: by SSH
## Documentation ## Documentation
* Official documentation: https://wiki.minetest.net/ * Official documentation: https://wiki.minetest.net/
* YunoHost documentation: https://yunohost.org/#/app_minetest * YunoHost documentation: https://yunohost.org/en/app_minetest
## YunoHost specific features ## YunoHost specific features
@ -39,8 +39,8 @@ How to configure this app: by SSH
#### Supported architectures #### Supported architectures
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/minetest%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/minetest/) * x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/minetest.svg)](https://ci-apps.yunohost.org/ci/apps/minetest/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/minetest%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/minetest/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/minetest.svg)](https://ci-apps-arm.yunohost.org/ci/apps/minetest/)
## Limitations ## Limitations

View file

@ -1,7 +1,7 @@
# Minetest for YunoHost # Minetest for YunoHost
[![Niveau dintégration](https://dash.yunohost.org/integration/minetest.svg)](https://dash.yunohost.org/appci/app/minetest) ![](https://ci-apps.yunohost.org/ci/badges/minetest.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/minetest.maintain.svg) [![Niveau dintégration](https://dash.yunohost.org/integration/minetest.svg)](https://dash.yunohost.org/appci/app/minetest) ![](https://ci-apps.yunohost.org/ci/badges/minetest.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/minetest.maintain.svg)
[![Installer Minetest avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=minetest) [![Installer Minetest avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=minetest)
*[Read this readme in English.](./README.md)* *[Read this readme in English.](./README.md)*
@ -11,7 +11,7 @@ Si vous navez pas YunoHost, veuillez consulter [ici](https://yunohost.org/#/i
## Aperçu ## Aperçu
Minetest est un moteur de jeu voxel open-source avec modding et création de jeux faciles. Minetest est un moteur de jeu voxel open-source avec modding et création de jeux faciles.
**Version incluse:** 5.3.0 **Version incluse:** 5.4.1
## Captures décran ## Captures décran
@ -28,7 +28,7 @@ Comment configurer cette application : par SSH
## Documentation ## Documentation
* Documentation officielle : https://wiki.minetest.net/ * Documentation officielle : https://wiki.minetest.net/
* Documentation YunoHost : https://yunohost.org/#/app_minetest_fr * Documentation YunoHost : https://yunohost.org/fr/app_minetest
## Caractéristiques spécifiques YunoHost ## Caractéristiques spécifiques YunoHost
@ -39,8 +39,8 @@ Comment configurer cette application : par SSH
##### Architectures supportées ##### Architectures supportées
* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/minetest%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/minetest/) * x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/minetest.svg)](https://ci-apps.yunohost.org/ci/apps/minetest/)
* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/minetest%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/minetest/) * ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/minetest.svg)](https://ci-apps-arm.yunohost.org/ci/apps/minetest/)
## Limitations ## Limitations

View file

@ -52,6 +52,3 @@
incorrect_path=0 incorrect_path=0
port_already_use=1 port_already_use=1
change_url=0 change_url=0
;;; Options
Email=
Notification=none

View file

@ -1,6 +1,6 @@
SOURCE_URL=https://github.com/minetest/minetest/archive/5.3.0.tar.gz SOURCE_URL=https://github.com/minetest/minetest/archive/5.4.1.tar.gz
SOURCE_SUM=65dc2049f24c93fa544500f310a61e289c1b8fa47bf60877b746a2c27a7238d6 SOURCE_SUM=de9e4410583c845c104b4be25f9d0b8743d8573c120149b8910ae2519f9ab14e
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=minetest-5.3.0.tar.gz SOURCE_FILENAME=minetest-5.4.1.tar.gz

View file

@ -1,6 +1,6 @@
SOURCE_URL=https://github.com/minetest/minetest_game/archive/5.3.0.tar.gz SOURCE_URL=https://github.com/minetest/minetest_game/archive/5.4.1.tar.gz
SOURCE_SUM=06c6c1d4b97af211dd0fa518a3e68a205f594e9816a4b2477e48d4d21d278e2d SOURCE_SUM=b4bfa0755b88230cf4bdb6af6a0951dd1248f6cdf87fecc340e43ac12c80b0b2
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=tar.gz SOURCE_FORMAT=tar.gz
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true
SOURCE_FILENAME=minetest_game-5.3.0.tar.gz SOURCE_FILENAME=minetest_game-5.4.1.tar.gz

View file

@ -3,10 +3,12 @@ Description=Minetest multiplayer server minetest.conf server config
Documentation=man:minetestserver(6) Documentation=man:minetestserver(6)
After=network.target After=network.target
RequiresMountsFor=/home/yunohost.app/__APP__ RequiresMountsFor=/home/yunohost.app/__APP__
[Service] [Service]
Restart=on-failure Restart=on-failure
User=__APP__ User=__APP__
Group=__APP__ Group=__APP__
ExecStart=__FINALPATH__/bin/minetestserver --config /home/yunohost.app/__APP__/.minetest/minetest.conf --logfile /var/log/__APP__/minetest.log ExecStart=__FINALPATH__/bin/minetestserver --config /home/yunohost.app/__APP__/.minetest/minetest.conf --logfile /var/log/__APP__/__APP__.log
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View file

@ -6,7 +6,7 @@
"en": "Free, open source voxel game engine and game. Need a client to connect to the server.", "en": "Free, open source voxel game engine and game. Need a client to connect to the server.",
"fr": "Moteur de jeu de type « bac à sable » gratuit et open source. Nécessite un client pour se connecter au serveur." "fr": "Moteur de jeu de type « bac à sable » gratuit et open source. Nécessite un client pour se connecter au serveur."
}, },
"version": "5.3.0~ynh1", "version": "5.4.1~ynh1",
"url": "http://www.minetest.net/", "url": "http://www.minetest.net/",
"license": "MIT", "license": "MIT",
"maintainer": { "maintainer": {
@ -20,7 +20,7 @@
"url": "https://framasoft.org" "url": "https://framasoft.org"
}, },
"requirements": { "requirements": {
"yunohost": ">= 3.8.1" "yunohost": ">= 4.1.7"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
@ -29,21 +29,13 @@
"arguments": { "arguments": {
"install" : [ "install" : [
{ {
"name": "server_domain", "name": "domain",
"type": "domain", "type": "domain",
"ask": {
"en": "Choose a domain for your Minetest server",
"fr": "Choisissez un domaine pour votre serveur Minetest"
},
"example": "domain.org" "example": "domain.org"
}, },
{ {
"name": "is_public", "name": "is_public",
"type": "boolean", "type": "boolean",
"ask": {
"en": "Is it a public server? (should we announce it?)",
"fr": "Est-ce un serveur public ? (devons-nous l'annoncer ?)"
},
"default": false "default": false
}, },
{ {

View file

@ -13,6 +13,4 @@
## Package_check results ## Package_check results
--- ---
*If you have access to [App Continuous Integration for packagers](https://yunohost.org/#/packaging_apps_ci) you can provide a link to the package_check results like below, replacing '-NUM-' in this link by the PR number and USERNAME by your username on the ci-apps-dev. Or you provide a screenshot or a pastebin of the results* * 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!"*
[![Build Status](https://ci-apps-dev.yunohost.org/jenkins/job/minetest_ynh%20PR-NUM-%20(USERNAME)/badge/icon)](https://ci-apps-dev.yunohost.org/jenkins/job/minetest_ynh%20PR-NUM-%20(USERNAME)/)

View file

@ -24,7 +24,7 @@ ynh_abort_if_errors
# RETRIEVE ARGUMENTS FROM THE MANIFEST # RETRIEVE ARGUMENTS FROM THE MANIFEST
#================================================= #=================================================
server_domain=$YNH_APP_ARG_SERVER_DOMAIN domain=$YNH_APP_ARG_DOMAIN
is_public=$YNH_APP_ARG_IS_PUBLIC is_public=$YNH_APP_ARG_IS_PUBLIC
game=$YNH_APP_ARG_GAME game=$YNH_APP_ARG_GAME
pvp=$YNH_APP_ARG_PVP pvp=$YNH_APP_ARG_PVP
@ -48,7 +48,7 @@ test ! -e "$final_path" || ynh_die "This path already contains a folder"
#================================================= #=================================================
ynh_script_progression --message="Storing installation settings..." ynh_script_progression --message="Storing installation settings..."
ynh_app_setting_set --app=$app --key=server_domain --value=$server_domain 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
ynh_app_setting_set --app=$app --key=game --value=$game ynh_app_setting_set --app=$app --key=game --value=$game
ynh_app_setting_set --app=$app --key=is_public --value=$is_public ynh_app_setting_set --app=$app --key=is_public --value=$is_public
@ -62,7 +62,7 @@ ynh_app_setting_set --app=$app --key=servername --value=$servername
#================================================= #=================================================
# FIND AND OPEN A PORT # FIND AND OPEN A PORT
#================================================= #=================================================
ynh_script_progression --message="Configuring firewall..." ynh_script_progression --message="Finding an available port..."
# Find a free port # Find a free port
port=$(ynh_find_port 30000) port=$(ynh_find_port 30000)
@ -138,16 +138,15 @@ popd
### `ynh_replace_string` is used to replace a string in a file. ### `ynh_replace_string` is used to replace a string in a file.
### (It's compatible with sed regular expressions syntax) ### (It's compatible with sed regular expressions syntax)
# Install the game
ynh_replace_string --match_string="__GAME__" --replace_string="$game" --target_file="$home_path/.minetest/minetest.conf" if [ $is_public -eq 1 ]; then
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$home_path/.minetest/minetest.conf" announce="true"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$home_path/.minetest/minetest.conf" else
ynh_replace_string --match_string="__SERVERNAME__" --replace_string="$servername" --target_file="$home_path/.minetest/minetest.conf" announce="fase"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$server_domain" --target_file="$home_path/.minetest/minetest.conf" fi
ynh_replace_string --match_string="__ANNOUNCE__" --replace_string="$is_public" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__PVP__" --replace_string="$pvp" --target_file="$home_path/.minetest/minetest.conf" ynh_add_config --template="../conf/minetest.conf" --destination="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__CREATIVE__" --replace_string="$creative" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__DAMAGE__" --replace_string="$damage" --target_file="$home_path/.minetest/minetest.conf"
#================================================= #=================================================
# CREATE WORLD # CREATE WORLD
@ -192,7 +191,7 @@ yunohost service add $app --description="Voxel game engine and game" --log="/var
#================================================= #=================================================
# RELOAD MINETEST # RELOAD MINETEST
#================================================= #=================================================
ynh_print_info --message="Reloading minetest..." ynh_print_info --message="Reloading Minetest..."
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/minetest.log" --line_match="listening on" ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/minetest.log" --line_match="listening on"

View file

@ -106,7 +106,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#================================================= #=================================================
ynh_script_progression --message="Reloading minetest..." ynh_script_progression --message="Reloading minetest..."
ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/minetest.log" --line_match="listening on" ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" --line_match="listening on"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT

View file

@ -16,45 +16,55 @@ ynh_script_progression --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
server_domain=$(ynh_app_setting_get --app=$app --key=server_domain) domain=$(ynh_app_setting_get --app=$app --key=domain)
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
game=$(ynh_app_setting_get --app=$app --key=game) game=$(ynh_app_setting_get --app=$app --key=game)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
final_path=$(ynh_app_setting_get --app=$app --key=final_path) final_path=$(ynh_app_setting_get --app=$app --key=final_path)
home_path=$(ynh_app_setting_get --app=$app --key=home_path) home_path=$(ynh_app_setting_get --app=$app --key=home_path)
pvp=$(ynh_app_setting_get --app=$app --key=pvp) pvp=$(ynh_app_setting_get --app=$app --key=pvp)
creative=$(ynh_app_setting_get --app=$app --key=creative) creative=$(ynh_app_setting_get --app=$app --key=creative)
damage=$(ynh_app_setting_get --app=$app --key=damage) damage=$(ynh_app_setting_get --app=$app --key=damage)
servername=$(ynh_app_setting_get --app=$app --key=servername) servername=$(ynh_app_setting_get --app=$app --key=servername)
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
#=================================================
# CHECK VERSION
#=================================================
upgrade_type=$(ynh_check_app_version_changed)
#================================================= #=================================================
# ENSURE DOWNWARD COMPATIBILITY # ENSURE DOWNWARD COMPATIBILITY
#================================================= #=================================================
ynh_script_progression --message="Checking version..." ynh_script_progression --message="Checking version..."
version=ynh_app_upstream_version version=ynh_app_upstream_version
if [ "$version" = "0.01" ]; then if [ "$version" = "0.01" ]; then
ynh_die --message="You can't upgrade to this version with simple upgrade. Please read the readme for upgrading https://github.com/YunoHost-Apps/minetest_ynh#additional-information ..." ynh_die --message="You can't upgrade to this version with simple upgrade. Please read the readme for upgrading https://github.com/YunoHost-Apps/minetest_ynh#additional-information ..."
fi fi
ynh_script_progression --message="Ensuring downward compatibility..." ynh_script_progression --message="Ensuring downward compatibility..."
# Fix is_public as a boolean value
if [ "$is_public" = "Yes" ]; then
ynh_app_setting_set --app=$app --key=is_public --value=1
is_public=1
elif [ "$is_public" = "No" ]; then
ynh_app_setting_set --app=$app --key=is_public --value=0
is_public=0
fi
# If final_path doesn't exist, create it # If final_path doesn't exist, create it
if [ -z $final_path ]; then if [ -z $final_path ]; then
final_path=/opt/yunohost/$app final_path=/opt/yunohost/$app
ynh_app_setting_set --app=$app --key=final_path --value=$final_path ynh_app_setting_set --app=$app --key=final_path --value=$final_path
fi fi
# If domain doesn't exist, create it
if [ -z "$domain" ]; then
domain=$(ynh_app_setting_get --app=$app --key=server_domain)
ynh_app_setting_set --app=$app --key=domain --value=$domain
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all
ynh_app_setting_delete --app=$app --key=is_public
fi
#================================================= #=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
#================================================= #=================================================
@ -78,11 +88,16 @@ ynh_abort_if_errors
#================================================= #=================================================
ynh_script_progression --message="Upgrading source files..." ynh_script_progression --message="Upgrading source files..."
# Remove old install if [ "$upgrade_type" == "UPGRADE_APP" ]
ynh_secure_remove --file="$final_path" then
ynh_script_progression --message="Upgrading source files..." --weight=1
# Download, check integrity, uncompress and patch the source from app.src # Remove old install
ynh_setup_source --dest_dir="$final_path" ynh_secure_remove --file="$final_path"
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path"
fi
#================================================= #=================================================
# UPGRADE DEPENDENCIES # UPGRADE DEPENDENCIES
@ -112,11 +127,11 @@ ynh_add_systemd_config
#================================================= #=================================================
if [ -e $home_path ] if [ -e $home_path ]
then then
echo "Nothing to do..." echo "Nothing to do..."
else else
mkdir -p $home_path/.minetest/ mkdir -p $home_path/.minetest/
mkdir $home_path/.minetest/worlds/ mkdir $home_path/.minetest/worlds/
fi fi
#================================================= #=================================================
@ -147,21 +162,13 @@ popd
# MODIFY A CONFIG FILE # MODIFY A CONFIG FILE
#================================================= #=================================================
ynh_backup_if_checksum_is_different --file="$home_path/.minetest/minetest.conf" if [ $is_public -eq 1 ]; then
announce="true"
else
announce="fase"
fi
cp ../conf/minetest.conf $home_path/.minetest/minetest.conf ynh_add_config --template="../conf/minetest.conf" --destination="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__GAME__" --replace_string="$game" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__SERVERNAME__" --replace_string="$servername" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__DOMAIN__" --replace_string="$server_domain" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__ANNOUNCE__" --replace_string="$is_public" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__PVP__" --replace_string="$pvp" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__CREATIVE__" --replace_string="$creative" --target_file="$home_path/.minetest/minetest.conf"
ynh_replace_string --match_string="__DAMAGE__" --replace_string="$damage" --target_file="$home_path/.minetest/minetest.conf"
ynh_store_file_checksum --file="$home_path/.minetest/minetest.conf"
#================================================= #=================================================
# SETUP LOGROTATE # SETUP LOGROTATE
@ -192,7 +199,7 @@ yunohost service add $app --description="Voxel game engine and game" --log="/var
#================================================= #=================================================
ynh_script_progression --message="Restarting Minetest..." ynh_script_progression --message="Restarting Minetest..."
ynh_systemd_action --service_name=$app --action="restart" --log_path="/var/log/$app/minetest.log" --line_match="listening on" ynh_systemd_action --service_name=$app --action="restart" --log_path="/var/log/$app/$app.log" --line_match="listening on"
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT