diff --git a/README.md b/README.md index 96cd2bb..ee1a2c8 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,8 @@ How to configure this app: by SSH #### 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/) -* 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/) +* 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 diff --git a/README_fr.md b/README_fr.md index 4177340..393467f 100644 --- a/README_fr.md +++ b/README_fr.md @@ -39,8 +39,8 @@ Comment configurer cette application : par SSH ##### 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/) -* 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/) +* 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 diff --git a/conf/systemd.service b/conf/systemd.service index c9e53e2..8bb9f42 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -3,10 +3,12 @@ Description=Minetest multiplayer server minetest.conf server config Documentation=man:minetestserver(6) After=network.target RequiresMountsFor=/home/yunohost.app/__APP__ + [Service] Restart=on-failure User=__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] WantedBy=multi-user.target diff --git a/manifest.json b/manifest.json index f4526ba..bb47013 100644 --- a/manifest.json +++ b/manifest.json @@ -29,7 +29,7 @@ "arguments": { "install" : [ { - "name": "server_domain", + "name": "domain", "type": "domain", "ask": { "en": "Choose a domain for your Minetest server", diff --git a/scripts/install b/scripts/install index 0f2c388..305ee57 100755 --- a/scripts/install +++ b/scripts/install @@ -24,7 +24,7 @@ ynh_abort_if_errors # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -server_domain=$YNH_APP_ARG_SERVER_DOMAIN +domain=$YNH_APP_ARG_DOMAIN is_public=$YNH_APP_ARG_IS_PUBLIC game=$YNH_APP_ARG_GAME 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_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=game --value=$game 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 #================================================= -ynh_script_progression --message="Configuring firewall..." +ynh_script_progression --message="Finding an available port..." # Find a free port 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="__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="__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="__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" @@ -192,7 +192,7 @@ yunohost service add $app --description="Voxel game engine and game" --log="/var #================================================= # 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" diff --git a/scripts/restore b/scripts/restore index 50123d7..686b6b4 100755 --- a/scripts/restore +++ b/scripts/restore @@ -106,7 +106,7 @@ ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= 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 diff --git a/scripts/upgrade b/scripts/upgrade index 61d0887..be74a02 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -16,7 +16,7 @@ ynh_script_progression --message="Loading installation settings..." 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) game=$(ynh_app_setting_get --app=$app --key=game) 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 #================================================= ynh_script_progression --message="Checking version..." + version=ynh_app_upstream_version if [ "$version" = "0.01" ]; then @@ -40,14 +41,6 @@ fi 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 [ -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 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 #================================================= @@ -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="__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="__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="__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" @@ -192,7 +192,7 @@ yunohost service add $app --description="Voxel game engine and game" --log="/var #================================================= 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