mirror of
https://github.com/YunoHost-Apps/minetest_ynh.git
synced 2024-09-03 20:36:00 +02:00
server_domain -> domain
This commit is contained in:
parent
ff5d43556a
commit
5b582b17d8
7 changed files with 25 additions and 23 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
"arguments": {
|
"arguments": {
|
||||||
"install" : [
|
"install" : [
|
||||||
{
|
{
|
||||||
"name": "server_domain",
|
"name": "domain",
|
||||||
"type": "domain",
|
"type": "domain",
|
||||||
"ask": {
|
"ask": {
|
||||||
"en": "Choose a domain for your Minetest server",
|
"en": "Choose a domain for your Minetest server",
|
||||||
|
|
|
@ -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)
|
||||||
|
@ -143,7 +143,7 @@ ynh_replace_string --match_string="__GAME__" --replace_string="$game" --target_f
|
||||||
ynh_replace_string --match_string="__APP__" --replace_string="$app" --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="__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="__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="__DOMAIN__" --replace_string="$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="__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="__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="__CREATIVE__" --replace_string="$creative" --target_file="$home_path/.minetest/minetest.conf"
|
||||||
|
@ -192,7 +192,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"
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -16,7 +16,7 @@ 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)
|
is_public=$(ynh_app_setting_get --app=$app --key=is_public)
|
||||||
|
@ -31,6 +31,7 @@ servername=$(ynh_app_setting_get --app=$app --key=servername)
|
||||||
# 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
|
||||||
|
@ -40,14 +41,6 @@ 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
|
||||||
|
@ -55,6 +48,13 @@ if [ -z $final_path ]; then
|
||||||
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
|
||||||
|
|
||||||
|
# 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
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -155,7 +155,7 @@ ynh_replace_string --match_string="__GAME__" --replace_string="$game" --target_f
|
||||||
ynh_replace_string --match_string="__APP__" --replace_string="$app" --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="__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="__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="__DOMAIN__" --replace_string="$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="__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="__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="__CREATIVE__" --replace_string="$creative" --target_file="$home_path/.minetest/minetest.conf"
|
||||||
|
@ -192,7 +192,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
|
||||||
|
|
Loading…
Reference in a new issue