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 #37 from YunoHost-Apps/testing

Upgrade
This commit is contained in:
yalh76 2022-06-23 23:17:23 +02:00 committed by GitHub
commit 09946f6d86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 3509 additions and 302 deletions

View file

@ -1,51 +1,35 @@
<!--
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.
-->
# Minetest for YunoHost # Minetest for YunoHost
[![Integration level](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) [![Integration level](https://dash.yunohost.org/integration/minetest.svg)](https://dash.yunohost.org/appci/app/minetest) ![Working status](https://ci-apps.yunohost.org/ci/badges/minetest.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/minetest.maintain.svg)
[![Install Minetest with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=minetest) [![Install Minetest with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=minetest)
*[Lire ce readme en français.](./README_fr.md)* *[Lire ce readme en français.](./README_fr.md)*
> *This package allow you to install Minetest quickly and simply on a YunoHost server. > *This package allows you to install Minetest quickly and simply on a YunoHost server.
If you dont have YunoHost, please see [here](https://yunohost.org/#/install) to know how to install and enjoy it.* If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.*
## 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.4.1
**Shipped version:** 5.5.1~ynh1
## Screenshots ## Screenshots
![](https://www.minetest.net/media/gallery/1.jpg) ![Screenshot of Minetest](./doc/screenshots/1.jpg)
## Demo ## Disclaimers / important information
No demo but you can test with servers in https://servers.minetest.net/
## Configuration ## Configuration
How to configure this app: by SSH How to configure this app: by SSH
## Documentation
* Official documentation: https://wiki.minetest.net/
* YunoHost documentation: https://yunohost.org/en/app_minetest
## YunoHost specific features
#### Multi-users support
* Are LDAP and HTTP auth supported? **No**
* Can the app be used by multiple users? **Yes**
#### Supported architectures
* 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.svg)](https://ci-apps-arm.yunohost.org/ci/apps/minetest/)
## Limitations
* This app is not compatible with LDAP.
## Additional information ## Additional information
* Migration from old package * Migration from old package
@ -65,23 +49,23 @@ How to configure this app: by SSH
* Restart Minetest with `sudo systemctl restart minetest` * Restart Minetest with `sudo systemctl restart minetest`
* The mod is now installed :) * The mod is now installed :)
## Documentation and resources
## Links * Official app website: <http://www.minetest.net>
* Upstream app code repository: <https://github.com/minetest/minetest>
* YunoHost documentation for this app: <https://yunohost.org/app_minetest>
* Report a bug: <https://github.com/YunoHost-Apps/minetest_ynh/issues>
* Report a bug: https://github.com/YunoHost-Apps/minetest_ynh/issues ## Developer info
* App website: https://www.minetest.net/
* Upstream app repository: https://github.com/minetest/minetest
* YunoHost website: https://yunohost.org/
--- Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/minetest_ynh/tree/testing).
## Developers info
Please do your pull request to the [testing branch](https://github.com/YunoHost-Apps/minetest_ynh/tree/testing).
To try the testing branch, please proceed like that. To try the testing branch, please proceed like that.
```
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/minetest_ynh/tree/testing --debug sudo yunohost app install https://github.com/YunoHost-Apps/minetest_ynh/tree/testing --debug
or or
sudo yunohost app upgrade minetest -u https://github.com/YunoHost-Apps/minetest_ynh/tree/testing --debug sudo yunohost app upgrade minetest -u https://github.com/YunoHost-Apps/minetest_ynh/tree/testing --debug
``` ```
**More info regarding app packaging:** <https://yunohost.org/packaging_apps>

View file

@ -1,51 +1,35 @@
# Minetest for YunoHost <!--
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.
-->
[![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) # Minetest pour YunoHost
[![Niveau d'intégration](https://dash.yunohost.org/integration/minetest.svg)](https://dash.yunohost.org/appci/app/minetest) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/minetest.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/minetest.maintain.svg)
[![Installer Minetest avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](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)*
> *Ce package vous permet dinstaller Minetest rapidement et simplement sur un serveur YunoHost. > *Ce package vous permet d'installer Minetest rapidement et simplement sur un serveur YunoHost.
Si vous navez pas YunoHost, veuillez consulter [ici](https://yunohost.org/#/install) pour savoir comment linstaller et en profiter.* Si vous n'avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l'installer et en profiter.*
## Vue d'ensemble
## 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.4.1
## Captures décran **Version incluse :** 5.5.1~ynh1
![](https://www.minetest.net/media/gallery/1.jpg) ## Captures d'écran
## Démo ![Capture d'écran de Minetest](./doc/screenshots/1.jpg)
Il n'y a pas de démo mais vous pouvez tester avec des serveurs sur https://servers.minetest.net/ ## Avertissements / informations importantes
## Configuration ## Configuration
Comment configurer cette application : par SSH Comment configurer cette application : par SSH
## Documentation
* Documentation officielle : https://wiki.minetest.net/
* Documentation YunoHost : https://yunohost.org/fr/app_minetest
## Caractéristiques spécifiques YunoHost
#### Support multi-utilisateurs
* Les authentifications LDAP et HTTP sont-elles prises en charge ? **Non**
* Lapplication peut-elle être utilisée par plusieurs utilisateurs ? **Oui**
##### Architectures supportées
* 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.svg)](https://ci-apps-arm.yunohost.org/ci/apps/minetest/)
## Limitations
* Cette application nest pas compatible avec LDAP.
## Renseignements supplémentaires ## Renseignements supplémentaires
* Migration de lancien paquet * Migration de lancien paquet
@ -65,22 +49,23 @@ Comment configurer cette application : par SSH
* Redémarrez Minetest avec `sudo systemctl restart minetest` * Redémarrez Minetest avec `sudo systemctl restart minetest`
* Le mod est maintenant installé :) * Le mod est maintenant installé :)
## Liens ## Documentations et ressources
* Signaler un bug : https://github.com/YunoHost-Apps/minetest_ynh/issues * Site officiel de l'app : <http://www.minetest.net>
* Site de lapplication : https://www.minetest.net/ * Dépôt de code officiel de l'app : <https://github.com/minetest/minetest>
* Dépôt de lapplication principale : https://github.com/minetest/minetest * Documentation YunoHost pour cette app : <https://yunohost.org/app_minetest>
* Site web de YunoHost : https://yunohost.org/ * Signaler un bug : <https://github.com/YunoHost-Apps/minetest_ynh/issues>
---
## Informations pour les développeurs ## Informations pour les développeurs
Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/minetest_ynh/tree/testing). Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/minetest_ynh/tree/testing).
Pour essayer la branche testing, procédez comme suit. Pour essayer la branche testing, procédez comme suit.
```
``` bash
sudo yunohost app install https://github.com/YunoHost-Apps/minetest_ynh/tree/testing --debug sudo yunohost app install https://github.com/YunoHost-Apps/minetest_ynh/tree/testing --debug
ou ou
sudo yunohost app upgrade minetest -u https://github.com/YunoHost-Apps/minetest_ynh/tree/testing --debug sudo yunohost app upgrade minetest -u https://github.com/YunoHost-Apps/minetest_ynh/tree/testing --debug
``` ```
**Plus d'infos sur le packaging d'applications :** <https://yunohost.org/packaging_apps>

View file

@ -1,13 +1,12 @@
;; Test complet minetest_game ;; Test complet minetest_game
; Manifest ; Manifest
domain="domain.tld" domain="domain.tld"
pvp=1 is_public=0
servername="packagecheck"
game="minetest_game" game="minetest_game"
servername="packagecheck"
pvp=1
creative=0 creative=0
damage=1 damage=1
is_public=0
password="pass"
port="30000" port="30000"
; Checks ; Checks
pkg_linter=1 pkg_linter=1
@ -27,15 +26,14 @@
;; Test complet capturetheflag ;; Test complet capturetheflag
; Manifest ; Manifest
domain="domain.tld" (DOMAIN) domain="domain.tld"
pvp=1 is_public=0
servername="packagecheck"
game="capturetheflag" game="capturetheflag"
servername="packagecheck"
pvp=1
creative=0 creative=0
damage=1 damage=1
is_public=0 (PUBLIC|public=1|private=0) port="30000"
password="pass"
port="30000" (PORT)
; Checks ; Checks
pkg_linter=1 pkg_linter=1
setup_sub_dir=0 setup_sub_dir=0

View file

@ -1,7 +1,7 @@
SOURCE_URL=https://github.com/minetest/minetest/archive/5.4.1.tar.gz SOURCE_URL=https://github.com/minetest/minetest/archive/5.5.1.tar.gz
SOURCE_SUM=de9e4410583c845c104b4be25f9d0b8743d8573c120149b8910ae2519f9ab14e SOURCE_SUM=dc0ae5188ef351db85c38b27f38f8549b133ed82aa46daea6deee148aa3454f4
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.4.1.tar.gz SOURCE_FILENAME=minetest-5.5.1.tar.gz
SOURCE_EXTRACT=true SOURCE_EXTRACT=true

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,7 @@
SOURCE_URL=https://github.com/minetest/minetest_game/archive/5.4.1.tar.gz SOURCE_URL=https://github.com/minetest/minetest_game/archive/5.5.1.tar.gz
SOURCE_SUM=b4bfa0755b88230cf4bdb6af6a0951dd1248f6cdf87fecc340e43ac12c80b0b2 SOURCE_SUM=5a24fec4ed838744906f020096c35616e7ba76eeec2b93b980a40af011107e7c
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.4.1.tar.gz SOURCE_FILENAME=minetest_game-5.5.1.tar.gz
SOURCE_EXTRACT=true

View file

@ -8,7 +8,7 @@ RequiresMountsFor=/home/yunohost.app/__APP__
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__/__APP__.log ExecStart=__FINALPATH__/bin/minetestserver --config __DATADIR__/.minetest/minetest.conf --logfile /var/log/__APP__/__APP__.log
# Sandboxing options to harden security # Sandboxing options to harden security
# Depending on specificities of your service/app, you may need to tweak these # Depending on specificities of your service/app, you may need to tweak these

View file

@ -6,7 +6,7 @@ How to configure this app: by SSH
* Migration from old package * Migration from old package
* You cant migrate directly with an update. * You cant migrate directly with an update.
* Before installing the new package you need to download this folder from your server `/var/games/minetest-server/.minetest/worlds/world` (this folder contains all world data) * Before installing the new package you need to download this folder from your server `/var/games/minetest-server/.minetest/worlds/world` (this folder contains all world data)
* Uninstall the old package `sudo yunohost app remove minetest` * Uninstall the old package `sudo yunohost app remove minetest`
* Install the new one `sudo yunohost app install https://github.com/YunoHost-Apps/minetest_ynh` * Install the new one `sudo yunohost app install https://github.com/YunoHost-Apps/minetest_ynh`

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.4.1~ynh2", "version": "5.5.1~ynh1",
"url": "http://www.minetest.net/", "url": "http://www.minetest.net/",
"upstream": { "upstream": {
"license": "MIT", "license": "MIT",

View file

@ -5,7 +5,7 @@
#================================================= #=================================================
# dependencies used by the app # dependencies used by the app
pkg_dependencies="build-essential libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev libluajit-5.1-dev" pkg_dependencies="build-essential libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev libluajit-5.1-dev libncurses-dev libzstd-dev"
#================================================= #=================================================
# PERSONAL HELPERS # PERSONAL HELPERS

View file

@ -28,7 +28,7 @@ ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
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) datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#================================================= #=================================================
# DECLARE DATA AND CONF FILES TO BACKUP # DECLARE DATA AND CONF FILES TO BACKUP
@ -41,6 +41,12 @@ ynh_print_info --message="Declaring files to be backed up..."
ynh_backup --src_path="$final_path" ynh_backup --src_path="$final_path"
#=================================================
# BACKUP THE DATA DIR
#=================================================
ynh_backup --src_path="$datadir" --is_big
#================================================= #=================================================
# SPECIFIC BACKUP # SPECIFIC BACKUP
#================================================= #=================================================
@ -55,12 +61,6 @@ ynh_backup --src_path="/etc/logrotate.d/$app"
ynh_backup --src_path="/etc/systemd/system/$app.service" ynh_backup --src_path="/etc/systemd/system/$app.service"
#=================================================
# BACKUP THE HOME DIR
#=================================================
ynh_backup --src_path="$home_path" --is_big
#================================================= #=================================================
# END OF SCRIPT # END OF SCRIPT
#================================================= #=================================================

View file

@ -26,10 +26,10 @@ ynh_abort_if_errors
domain=$YNH_APP_ARG_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
servername=$YNH_APP_ARG_SERVERNAME
pvp=$YNH_APP_ARG_PVP pvp=$YNH_APP_ARG_PVP
creative=$YNH_APP_ARG_CREATIVE creative=$YNH_APP_ARG_CREATIVE
damage=$YNH_APP_ARG_DAMAGE damage=$YNH_APP_ARG_DAMAGE
servername=$YNH_APP_ARG_SERVERNAME
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
@ -48,10 +48,10 @@ ynh_script_progression --message="Storing installation settings..."
ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=domain --value=$domain
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=servername --value=$servername
ynh_app_setting_set --app=$app --key=pvp --value=$pvp ynh_app_setting_set --app=$app --key=pvp --value=$pvp
ynh_app_setting_set --app=$app --key=creative --value=$creative ynh_app_setting_set --app=$app --key=creative --value=$creative
ynh_app_setting_set --app=$app --key=damage --value=$damage ynh_app_setting_set --app=$app --key=damage --value=$damage
ynh_app_setting_set --app=$app --key=servername --value=$servername
#================================================= #=================================================
# STANDARD MODIFICATIONS # STANDARD MODIFICATIONS
@ -63,6 +63,7 @@ ynh_script_progression --message="Finding an available port..."
# Find an available port # Find an available port
port=$(ynh_find_port 30000) port=$(ynh_find_port 30000)
ynh_app_setting_set --app=$app --key=port --value=$port ynh_app_setting_set --app=$app --key=port --value=$port
# Open the port # Open the port
ynh_script_progression --message="Configuring firewall..." ynh_script_progression --message="Configuring firewall..."
ynh_exec_warn_less yunohost firewall allow --no-upnp UDP $port ynh_exec_warn_less yunohost firewall allow --no-upnp UDP $port
@ -79,16 +80,8 @@ ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
ynh_script_progression --message="Configuring system user..." ynh_script_progression --message="Configuring system user..."
home_path=/home/yunohost.app/$app
ynh_app_setting_set --app=$app --key=home_path --value=$home_path
# Create a system user # Create a system user
ynh_system_user_create --username=$app --home_dir=$home_path --use_shell ynh_system_user_create --username=$app --home_dir="$final_path"
mkdir -p "$home_path"
chmod 750 "$home_path"
chmod -R o-rwx "$home_path"
chown -R $app:$app "$home_path"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -106,27 +99,25 @@ chown -R $app:$app "$final_path"
#================================================= #=================================================
# SPECIFIC SETUP # SPECIFIC SETUP
#================================================= #=================================================
# ADD A CONFIGURATION # CREATE DATA DIRECTORY
#================================================= #=================================================
ynh_script_progression --message="Adding a configuration file..." ynh_script_progression --message="Creating a data directory..."
mkdir -p $home_path/.minetest/worlds/ datadir=/home/yunohost.app/$app
cp -a ../conf/minetest.conf $home_path/.minetest/ ynh_app_setting_set --app=$app --key=datadir --value=$datadir
#================================================= mkdir -p $datadir
# SETUP SYSTEMD mkdir -p "$datadir/.minetest/worlds/"
#=================================================
ynh_script_progression --message="Configuring a systemd service..."
# Create a dedicated systemd config chmod 750 "$datadir"
ynh_add_systemd_config chmod -R o-rwx "$datadir"
chown -R $app:www-data "$datadir"
#================================================= #=================================================
# BUILDING # BUILDING
#================================================= #=================================================
ynh_script_progression --message="Building Minetest..." ynh_script_progression --message="Building Minetest..."
# Install the game # Install the game
if [ $game = "capturetheflag" ]; then if [ $game = "capturetheflag" ]; then
pushd $final_path pushd $final_path
@ -144,31 +135,28 @@ pushd $final_path
popd popd
#================================================= #=================================================
# MODIFY A CONFIG FILE # ADD A CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Adding a configuration file..." ynh_script_progression --message="Adding a configuration file..."
### `ynh_replace_string` is used to replace a string in a file.
### (It's compatible with sed regular expressions syntax)
# Install the game
if [ $is_public -eq 1 ]; then if [ $is_public -eq 1 ]; then
announce="true" announce="true"
else else
announce="false" announce="false"
fi fi
ynh_add_config --template="../conf/minetest.conf" --destination="$home_path/.minetest/minetest.conf" ynh_add_config --template="../conf/minetest.conf" --destination="$datadir/.minetest/minetest.conf"
chmod 400 "$datadir/.minetest/minetest.conf"
chown $app:$app "$datadir/.minetest/minetest.conf"
#================================================= #=================================================
# CREATE LOG DIRECTORY # SETUP SYSTEMD
#================================================= #=================================================
ynh_script_progression --message="Creating log directory..." ynh_script_progression --message="Configuring a systemd service..."
mkdir -p /var/log/$app # Create a dedicated systemd config
ynh_add_systemd_config
# Set permissions on logs
chown -R $app:$app /var/log/$app
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
@ -177,6 +165,9 @@ chown -R $app:$app /var/log/$app
#================================================= #=================================================
ynh_script_progression --message="Configuring log rotation..." ynh_script_progression --message="Configuring log rotation..."
mkdir -p /var/log/$app
chown -R $app:$app /var/log/$app
# Use logrotate to manage application logfile(s) # Use logrotate to manage application logfile(s)
ynh_use_logrotate ynh_use_logrotate

View file

@ -18,7 +18,7 @@ app=$YNH_APP_INSTANCE_NAME
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
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) datadir=$(ynh_app_setting_get --app=$app --key=datadir)
#================================================= #=================================================
# STANDARD REMOVE # STANDARD REMOVE
@ -57,6 +57,17 @@ ynh_script_progression --message="Removing app main directory..."
# Remove the app directory securely # Remove the app directory securely
ynh_secure_remove --file="$final_path" ynh_secure_remove --file="$final_path"
#=================================================
# REMOVE DATA DIR
#=================================================
# Remove the data directory if --purge option is used
if [ "${YNH_APP_PURGE:-0}" -eq 1 ]
then
ynh_script_progression --message="Removing app data directory..."
ynh_secure_remove --file="$datadir"
fi
#================================================= #=================================================
# REMOVE DEPENDENCIES # REMOVE DEPENDENCIES
#================================================= #=================================================
@ -82,8 +93,6 @@ fi
#================================================= #=================================================
ynh_script_progression --message="Removing various files..." ynh_script_progression --message="Removing various files..."
ynh_secure_remove --file="$home_path"
# Remove the log files # Remove the log files
ynh_secure_remove --file="/var/log/$app" ynh_secure_remove --file="/var/log/$app"

View file

@ -28,9 +28,17 @@ ynh_script_progression --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
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) datadir=$(ynh_app_setting_get --app=$app --key=datadir)
port=$(ynh_app_setting_get --app=$app --key=port) port=$(ynh_app_setting_get --app=$app --key=port)
#=================================================
# CHECK IF THE APP CAN BE RESTORED
#=================================================
ynh_script_progression --message="Validating restoration parameters..."
test ! -d $final_path \
|| ynh_die --message="There is already a directory: $final_path "
#================================================= #=================================================
# STANDARD RESTORATION STEPS # STANDARD RESTORATION STEPS
#================================================= #=================================================
@ -39,7 +47,7 @@ port=$(ynh_app_setting_get --app=$app --key=port)
ynh_script_progression --message="Recreating the dedicated system user..." ynh_script_progression --message="Recreating the dedicated system user..."
# Create the dedicated user (if not existing) # Create the dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir=$home_path --use_shell ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# RESTORE THE APP MAIN DIR # RESTORE THE APP MAIN DIR
@ -52,6 +60,19 @@ chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:$app "$final_path" chown -R $app:$app "$final_path"
#=================================================
# RESTORE THE DATA DIRECTORY
#=================================================
ynh_script_progression --message="Restoring the data directory..."
ynh_restore_file --origin_path="$datadir" --not_mandatory
mkdir -p $datadir
chmod 750 "$datadir"
chmod -R o-rwx "$datadir"
chown -R $app:$app "$datadir"
#================================================= #=================================================
# SPECIFIC RESTORATION # SPECIFIC RESTORATION
#================================================= #=================================================
@ -67,16 +88,9 @@ ynh_install_app_dependencies $pkg_dependencies
#================================================= #=================================================
ynh_script_progression --message="Restoring various files..." ynh_script_progression --message="Restoring various files..."
# Restore home_path # Open the port
ynh_restore_file --origin_path="$home_path" --not_mandatory ynh_script_progression --message="Configuring firewall..."
ynh_exec_warn_less yunohost firewall allow --no-upnp UDP $port
mkdir -p "$home_path"
chmod 750 "$home_path"
chmod -R o-rwx "$home_path"
chown -R $app:$app "$home_path"
mkdir /var/log/$app -p
chown -R $app: /var/log/$app
#================================================= #=================================================
# RESTORE SYSTEMD # RESTORE SYSTEMD
@ -91,6 +105,9 @@ systemctl enable $app.service --quiet
#================================================= #=================================================
ynh_script_progression --message="Restoring the logrotate configuration..." ynh_script_progression --message="Restoring the logrotate configuration..."
mkdir /var/log/$app -p
chown -R $app: /var/log/$app
ynh_restore_file --origin_path="/etc/logrotate.d/$app" ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#================================================= #=================================================

View file

@ -20,7 +20,7 @@ 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)
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) datadir=$(ynh_app_setting_get --app=$app --key=datadir)
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)
@ -82,6 +82,13 @@ if [ -z "$domain" ]; then
ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=domain --value=$domain
fi fi
# If datadir doesn't exist, create it
if [ -z $datadir ]; then
datadir=$(ynh_app_setting_get --app=$app --key=home_path)
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
ynh_app_setting_delete --app=$app --key=home_path
fi
# Cleaning legacy permissions # Cleaning legacy permissions
if ynh_legacy_permissions_exists; then if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all ynh_legacy_permissions_delete_all
@ -95,7 +102,7 @@ fi
ynh_script_progression --message="Making sure dedicated system user exists..." ynh_script_progression --message="Making sure dedicated system user exists..."
# Create a dedicated user (if not existing) # Create a dedicated user (if not existing)
ynh_system_user_create --username=$app --home_dir=$home_path --use_shell ynh_system_user_create --username=$app --home_dir="$final_path"
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
@ -123,22 +130,12 @@ ynh_script_progression --message="Upgrading dependencies..."
ynh_install_app_dependencies $pkg_dependencies ynh_install_app_dependencies $pkg_dependencies
#=================================================
# COPY CONFIG FILE
#=================================================
if [ -e $home_path ]
then
echo "Nothing to do..."
else
mkdir -p $home_path/.minetest/
mkdir $home_path/.minetest/worlds/
fi
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
#================================================= #=================================================
# Compile Minetest # BUILDING
#=================================================
ynh_script_progression --message="Building Minetest..."
# Install the game # Install the game
if [ $game = "capturetheflag" ]; then if [ $game = "capturetheflag" ]; then
@ -161,6 +158,18 @@ pushd $final_path
ynh_exec_warn_less make -j$(nproc) ynh_exec_warn_less make -j$(nproc)
popd popd
#=================================================
# COPY CONFIG FILE
#=================================================
if [ -e $datadir ]
then
echo "Nothing to do..."
else
mkdir -p $datadir/.minetest/
mkdir $datadir/.minetest/worlds/
fi
#================================================= #=================================================
# UPDATE A CONFIG FILE # UPDATE A CONFIG FILE
#================================================= #=================================================
@ -173,7 +182,10 @@ else
announce="false" announce="false"
fi fi
ynh_add_config --template="../conf/minetest.conf" --destination="$home_path/.minetest/minetest.conf" ynh_add_config --template="../conf/minetest.conf" --destination="$datadir/.minetest/minetest.conf"
chmod 400 "$datadir/.minetest/minetest.conf"
chown $app:$app "$datadir/.minetest/minetest.conf"
#================================================= #=================================================
# SETUP SYSTEMD # SETUP SYSTEMD