Apply last example_ynh

This commit is contained in:
yalh76 2022-03-13 18:11:28 +01:00
parent bd09fd83cb
commit 5eaee317be
14 changed files with 72 additions and 24 deletions

View File

@ -17,6 +17,8 @@
setup_private=0 setup_private=0
setup_public=0 setup_public=0
upgrade=1 upgrade=1
# 5.4.1~ynh2
upgrade=1 from_commit=bd09fd83cb3f127d242f551786d49202a434c4b2
backup_restore=1 backup_restore=1
multi_instance=1 multi_instance=1
incorrect_path=0 incorrect_path=0

View File

@ -4,3 +4,4 @@ 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.4.1.tar.gz
SOURCE_EXTRACT=true

0
doc/.gitkeep Normal file
View File

1
doc/DESCRIPTION.md Normal file
View File

@ -0,0 +1 @@
Minetest is a free open-source voxel game engine with easy modding and game creation.

9
doc/DESCRIPTION_fr.md Normal file
View File

@ -0,0 +1,9 @@
Some long and extensive description of what the app is and does, lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
### Features
- Ut enim ad minim veniam, quis nostrud exercitation ullamco ;
- Laboris nisi ut aliquip ex ea commodo consequat ;
- Duis aute irure dolor in reprehenderit in voluptate ;
- Velit esse cillum dolore eu fugiat nulla pariatur ;
- Excepteur sint occaecat cupidatat non proident, sunt in culpa."

22
doc/DISCLAIMER.md Normal file
View File

@ -0,0 +1,22 @@
## Configuration
How to configure this app: by SSH
## Additional information
* Migration from old package
* 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)
* Uninstall the old package `sudo yunohost app remove minetest`
* Install the new one `sudo yunohost app install https://github.com/YunoHost-Apps/minetest_ynh`
* Stop Minetest service `sudo systemctl stop minetest`
* Copy the folder you have copied before in `/home/yunohost.app/minetest/.minetest/worlds`
* Start the Minetest service `sudo systemctl start minetest`
* Installing mods
* For installing mods you need to create a `worldmods` folder in `/home/yunohost.app/minetest/.minetest/worlds/world/`
* Clone the repo of the mod in this folder (ex: `git clone https://github.com/minetest-mods/mesecons`)
* Edit `/home/yunohost.app/minetest/.minetest/worlds/world/world.mt` and add at the end `load_mod_mesecons = true`
* Restart Minetest with `sudo systemctl restart minetest`
* The mod is now installed :)

12
doc/DISCLAIMER_fr.md Normal file
View File

@ -0,0 +1,12 @@
* Any known limitations, constrains or stuff not working, such as (but not limited to):
* requiring a full dedicated domain ?
* architectures not supported ?
* not-working single-sign on or LDAP integration ?
* the app requires an important amount of RAM / disk / .. to install or to work properly
* etc...
* Other infos that people should be aware of, such as:
* any specific step to perform after installing (such as manually finishing the install, specific admin credentials, ...)
* how to configure / administrate the application if it ain't obvious
* upgrade process / specificities / things to be aware of ?
* security considerations ?

0
doc/screenshots/.gitkeep Normal file
View File

BIN
doc/screenshots/1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 KiB

View File

@ -8,6 +8,11 @@
}, },
"version": "5.4.1~ynh2", "version": "5.4.1~ynh2",
"url": "http://www.minetest.net/", "url": "http://www.minetest.net/",
"upstream": {
"license": "MIT",
"website": "http://www.minetest.net",
"code": "https://github.com/minetest/minetest"
},
"license": "MIT", "license": "MIT",
"maintainer": { "maintainer": {
"name": "rafi59", "name": "rafi59",
@ -17,10 +22,10 @@
"previous_maintainers": { "previous_maintainers": {
"name": "Luc Didry", "name": "Luc Didry",
"email": "luc@framasoft.org", "email": "luc@framasoft.org",
"url": "https://framasoft.org" "url": "https://framasoft.org"
}, },
"requirements": { "requirements": {
"yunohost": ">= 4.1.7" "yunohost": ">= 4.3.0"
}, },
"multi_instance": true, "multi_instance": true,
"services": [ "services": [
@ -30,8 +35,7 @@
"install" : [ "install" : [
{ {
"name": "domain", "name": "domain",
"type": "domain", "type": "domain"
"example": "domain.org"
}, },
{ {
"name": "is_public", "name": "is_public",

View File

@ -15,7 +15,7 @@ source /usr/share/yunohost/helpers
#================================================= #=================================================
ynh_clean_setup () { ynh_clean_setup () {
ynh_clean_check_starting true
} }
# 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 ynh_abort_if_errors

View File

@ -42,12 +42,12 @@ ynh_script_progression --message="Stopping and removing the systemd service..."
ynh_remove_systemd_config ynh_remove_systemd_config
#================================================= #=================================================
# REMOVE DEPENDENCIES # REMOVE LOGROTATE CONFIGURATION
#================================================= #=================================================
ynh_script_progression --message="Removing dependencies..." ynh_script_progression --message="Removing logrotate configuration..."
# Remove metapackage and its dependencies # Remove the app-specific logrotate config
ynh_remove_app_dependencies ynh_remove_logrotate
#================================================= #=================================================
# REMOVE APP MAIN DIR # REMOVE APP MAIN DIR
@ -58,12 +58,12 @@ ynh_script_progression --message="Removing app main directory..."
ynh_secure_remove --file="$final_path" ynh_secure_remove --file="$final_path"
#================================================= #=================================================
# REMOVE LOGROTATE CONFIGURATION # REMOVE DEPENDENCIES
#================================================= #=================================================
ynh_script_progression --message="Removing logrotate configuration..." ynh_script_progression --message="Removing dependencies..."
# Remove the app-specific logrotate config # Remove metapackage and its dependencies
ynh_remove_logrotate ynh_remove_app_dependencies
#================================================= #=================================================
# CLOSE A PORT # CLOSE A PORT
@ -71,7 +71,7 @@ ynh_remove_logrotate
if yunohost firewall list | grep -q "\- $port$" if yunohost firewall list | grep -q "\- $port$"
then then
ynh_script_progression --message="Closing port $port" ynh_script_progression --message="Closing port $port..."
ynh_exec_warn_less yunohost firewall disallow UDP $port ynh_exec_warn_less yunohost firewall disallow UDP $port
fi fi

View File

@ -86,6 +86,13 @@ ynh_script_progression --message="Restoring the systemd configuration..."
ynh_restore_file --origin_path="/etc/systemd/system/$app.service" ynh_restore_file --origin_path="/etc/systemd/system/$app.service"
systemctl enable $app.service --quiet systemctl enable $app.service --quiet
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the logrotate configuration..."
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#================================================= #=================================================
# INTEGRATE SERVICE IN YUNOHOST # INTEGRATE SERVICE IN YUNOHOST
#================================================= #=================================================
@ -100,13 +107,6 @@ ynh_script_progression --message="Starting a systemd service..."
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"
#=================================================
# RESTORE THE LOGROTATE CONFIGURATION
#=================================================
ynh_script_progression --message="Restoring the logrotate configuration..."
ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION
#================================================= #=================================================

View File

@ -25,7 +25,6 @@ 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 # CHECK VERSION
@ -43,7 +42,6 @@ ynh_script_progression --message="Backing up the app before upgrading (may take
ynh_backup_before_upgrade ynh_backup_before_upgrade
ynh_clean_setup () { ynh_clean_setup () {
ynh_clean_check_starting ynh_clean_check_starting
# Restore it if the upgrade fails # Restore it if the upgrade fails
ynh_restore_upgradebackup ynh_restore_upgradebackup
} }
@ -102,7 +100,6 @@ ynh_system_user_create --username=$app --home_dir=$home_path --use_shell
#================================================= #=================================================
# DOWNLOAD, CHECK AND UNPACK SOURCE # DOWNLOAD, CHECK AND UNPACK SOURCE
#================================================= #=================================================
ynh_script_progression --message="Upgrading source files..."
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then