diff --git a/ALL_README.md b/ALL_README.md index 3d6c579..8938aae 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -1,6 +1,8 @@ # All available README files by language - [Read the README in English](README.md) +- [Lee el README en español](README_es.md) +- [Irakurri README euskaraz](README_eu.md) - [Lire le README en français](README_fr.md) - [Le o README en galego](README_gl.md) -- [Leggi il “README” in italiano](README_it.md) +- [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README.md b/README.md index 5b27a04..70f77f0 100644 --- a/README.md +++ b/README.md @@ -9,14 +9,15 @@ It shall NOT be edited by hand. [![Install PufferPanel with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pufferpanel) -*[Read this README is other languages.](./ALL_README.md)* +*[Read this README in other languages.](./ALL_README.md)* > *This package allows you to install PufferPanel quickly and simply on a YunoHost server.* > *If you don't have YunoHost, please consult [the guide](https://yunohost.org/install) to learn how to install it.* ## Overview -PufferPanel is an open source game server management panel designed to be easy to use and easy to install. PufferPanel supports Minecraft, Forge, Spigot, Sponge, Source Dedicated Servers, BungeeCord, PocketMine, Forge, and much more. +PufferPanel is a web-based Game Server Management System created by players for players. PufferPanel allows you to run multiple different game servers all from one central location, and give other users their own servers, or access to your own servers. + **Shipped version:** 2.6.9~ynh2 diff --git a/README_es.md b/README_es.md new file mode 100644 index 0000000..1bc00bd --- /dev/null +++ b/README_es.md @@ -0,0 +1,48 @@ + + +# PufferPanel para Yunohost + +[![Nivel de integración](https://dash.yunohost.org/integration/pufferpanel.svg)](https://dash.yunohost.org/appci/app/pufferpanel) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/pufferpanel.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/pufferpanel.maintain.svg) + +[![Instalar PufferPanel con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pufferpanel) + +*[Leer este README en otros idiomas.](./ALL_README.md)* + +> *Este paquete le permite instalarPufferPanel rapidamente y simplement en un servidor YunoHost.* +> *Si no tiene YunoHost, visita [the guide](https://yunohost.org/install) para aprender como instalarla.* + +## Descripción general + +PufferPanel is a web-based Game Server Management System created by players for players. PufferPanel allows you to run multiple different game servers all from one central location, and give other users their own servers, or access to your own servers. + + +**Versión actual:** 2.6.9~ynh2 + +## Capturas + +![Captura de PufferPanel](./doc/screenshots/serverlist.png) + +## Documentaciones y recursos + +- Sitio web oficial: +- Documentación administrador oficial: +- Repositorio del código fuente oficial de la aplicación : +- Catálogo YunoHost: +- Reportar un error: + +## Información para desarrolladores + +Por favor enviar sus correcciones a la [`branch testing`](https://github.com/YunoHost-Apps/pufferpanel_ynh/tree/testing + +Para probar la rama `testing`, sigue asÍ: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/pufferpanel_ynh/tree/testing --debug +o +sudo yunohost app upgrade pufferpanel -u https://github.com/YunoHost-Apps/pufferpanel_ynh/tree/testing --debug +``` + +**Mas informaciones sobre el empaquetado de aplicaciones:** diff --git a/README_eu.md b/README_eu.md new file mode 100644 index 0000000..f88fc4b --- /dev/null +++ b/README_eu.md @@ -0,0 +1,48 @@ + + +# PufferPanel YunoHost-erako + +[![Integrazio maila](https://dash.yunohost.org/integration/pufferpanel.svg)](https://dash.yunohost.org/appci/app/pufferpanel) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/pufferpanel.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/pufferpanel.maintain.svg) + +[![Instalatu PufferPanel YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pufferpanel) + +*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)* + +> *Pakete honek PufferPanel YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.* +> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.* + +## Aurreikuspena + +PufferPanel is a web-based Game Server Management System created by players for players. PufferPanel allows you to run multiple different game servers all from one central location, and give other users their own servers, or access to your own servers. + + +**Paketatutako bertsioa:** 2.6.9~ynh2 + +## Pantaila-argazkiak + +![PufferPanel(r)en pantaila-argazkia](./doc/screenshots/serverlist.png) + +## Dokumentazioa eta baliabideak + +- Aplikazioaren webgune ofiziala: +- Administratzaileen dokumentazio ofiziala: +- Jatorrizko aplikazioaren kode-gordailua: +- YunoHost Denda: +- Eman errore baten berri: + +## Garatzaileentzako informazioa + +Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/pufferpanel_ynh/tree/testing). + +`testing` abarra probatzeko, ondorengoa egin: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/pufferpanel_ynh/tree/testing --debug +edo +sudo yunohost app upgrade pufferpanel -u https://github.com/YunoHost-Apps/pufferpanel_ynh/tree/testing --debug +``` + +**Informazio gehiago aplikazioaren paketatzeari buruz:** diff --git a/README_fr.md b/README_fr.md index 0079fae..c568eaa 100644 --- a/README_fr.md +++ b/README_fr.md @@ -16,7 +16,8 @@ Il NE doit PAS être modifié à la main. ## Vue d’ensemble -PufferPanel est un panneau de gestion de serveur de jeu open source conçu pour être facile à utiliser et à installer. PufferPanel prend en charge Minecraft, Forge, Spigot, Sponge, Source Dedicated Servers, BungeeCord, PocketMine, Forge et bien plus encore. +PufferPanel est un système de gestion de serveur de jeu basé sur le Web créé par des joueurs pour des joueurs. PufferPanel vous permet d'exécuter plusieurs serveurs de jeu différents à partir d'un emplacement central et de donner aux autres utilisateurs leurs propres serveurs ou un accès à vos propres serveurs. + **Version incluse :** 2.6.9~ynh2 diff --git a/README_gl.md b/README_gl.md index 23514fc..433ffb9 100644 --- a/README_gl.md +++ b/README_gl.md @@ -16,7 +16,8 @@ NON debe editarse manualmente. ## Vista xeral -PufferPanel is an open source game server management panel designed to be easy to use and easy to install. PufferPanel supports Minecraft, Forge, Spigot, Sponge, Source Dedicated Servers, BungeeCord, PocketMine, Forge, and much more. +PufferPanel is a web-based Game Server Management System created by players for players. PufferPanel allows you to run multiple different game servers all from one central location, and give other users their own servers, or access to your own servers. + **Versión proporcionada:** 2.6.9~ynh2 diff --git a/README_zh_Hans.md b/README_zh_Hans.md new file mode 100644 index 0000000..18e072d --- /dev/null +++ b/README_zh_Hans.md @@ -0,0 +1,48 @@ + + +# YunoHost 上的 PufferPanel + +[![集成程度](https://dash.yunohost.org/integration/pufferpanel.svg)](https://dash.yunohost.org/appci/app/pufferpanel) ![工作状态](https://ci-apps.yunohost.org/ci/badges/pufferpanel.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/pufferpanel.maintain.svg) + +[![使用 YunoHost 安装 PufferPanel](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pufferpanel) + +*[阅读此 README 的其它语言版本。](./ALL_README.md)* + +> *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 PufferPanel。* +> *如果您还没有 YunoHost,请参阅[指南](https://yunohost.org/install)了解如何安装它。* + +## 概况 + +PufferPanel is a web-based Game Server Management System created by players for players. PufferPanel allows you to run multiple different game servers all from one central location, and give other users their own servers, or access to your own servers. + + +**分发版本:** 2.6.9~ynh2 + +## 截图 + +![PufferPanel 的截图](./doc/screenshots/serverlist.png) + +## 文档与资源 + +- 官方应用网站: +- 官方管理文档: +- 上游应用代码库: +- YunoHost 商店: +- 报告 bug: + +## 开发者信息 + +请向 [`testing` 分支](https://github.com/YunoHost-Apps/pufferpanel_ynh/tree/testing) 发送拉取请求。 + +如要尝试 `testing` 分支,请这样操作: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/pufferpanel_ynh/tree/testing --debug +或 +sudo yunohost app upgrade pufferpanel -u https://github.com/YunoHost-Apps/pufferpanel_ynh/tree/testing --debug +``` + +**有关应用打包的更多信息:** diff --git a/conf/config.json b/conf/config.json index 3512291..806eaba 100644 --- a/conf/config.json +++ b/conf/config.json @@ -2,20 +2,28 @@ "logs": "/var/log/__APP__", "panel": { "database": { - "dialect": "sqlite3", - "url": "file:/var/lib/__APP__/database.db?cache=shared" + "dialect": "postgresql", + "url": "user=__DB_USER__ password=__DB_PWD__ dbname=__DB_NAME__ port=5432 sslmode=disable" }, "web": { "files": "__INSTALL_DIR__" + }, + "email": { + "provider": "smtp", + "from": "__EMAIL__", + "host": "localhost", + "username": "__APP__", + "password": "__MAIL_PWD__" } }, "daemon": { "data": { - "cache": "/var/lib/__APP__/cache", - "servers": "/var/lib/__APP__/servers" + "binaries": "__DATA_DIR__/binaries", + "cache": "__DATA_DIR__/cache", + "servers": "__DATA_DIR__/servers" } }, "web": { - "host": "127.0.0.1:__PORT__" + "host": "127.0.0.1:__PORT__" } -} +} \ No newline at end of file diff --git a/doc/ADMIN.md b/doc/ADMIN.md new file mode 100644 index 0000000..af60ee3 --- /dev/null +++ b/doc/ADMIN.md @@ -0,0 +1 @@ +Game server files are stored in `__DATA_DIR__` diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index b8bed62..901a473 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1 +1 @@ -PufferPanel is an open source game server management panel designed to be easy to use and easy to install. PufferPanel supports Minecraft, Forge, Spigot, Sponge, Source Dedicated Servers, BungeeCord, PocketMine, Forge, and much more. \ No newline at end of file +PufferPanel is a web-based Game Server Management System created by players for players. PufferPanel allows you to run multiple different game servers all from one central location, and give other users their own servers, or access to your own servers. diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index 816ffab..f3f411d 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -1 +1 @@ -PufferPanel est un panneau de gestion de serveur de jeu open source conçu pour être facile à utiliser et à installer. PufferPanel prend en charge Minecraft, Forge, Spigot, Sponge, Source Dedicated Servers, BungeeCord, PocketMine, Forge et bien plus encore. \ No newline at end of file +PufferPanel est un système de gestion de serveur de jeu basé sur le Web créé par des joueurs pour des joueurs. PufferPanel vous permet d'exécuter plusieurs serveurs de jeu différents à partir d'un emplacement central et de donner aux autres utilisateurs leurs propres serveurs ou un accès à vos propres serveurs. diff --git a/manifest.toml b/manifest.toml index 2efb4a1..5ac6848 100644 --- a/manifest.toml +++ b/manifest.toml @@ -1,3 +1,5 @@ +#:schema https://raw.githubusercontent.com/YunoHost/apps/master/schemas/manifest.v2.schema.json + packaging_format = 2 id = "pufferpanel" @@ -7,7 +9,8 @@ description.fr = "Système de gestion de serveur de jeu" version = "2.6.9~ynh2" -maintainers = [""] +maintainers = [] + [upstream] license = "Apache-2.0" @@ -15,6 +18,7 @@ website = "https://www.pufferpanel.com/" admindoc = "https://docs.pufferpanel.com/en/latest/" code = "https://github.com/PufferPanel/PufferPanel" + [integration] yunohost = ">= 11.2" architectures = "all" @@ -25,6 +29,7 @@ disk = "50M" ram.build = "350M" ram.runtime = "50M" + [install] [install.domain] type = "domain" @@ -41,11 +46,16 @@ ram.runtime = "50M" [install.password] type = "password" + [resources] [resources.system_user] + allow_email = true [resources.install_dir] + [resources.data_dir] + subdirs = [ "binaries", "cache", "servers" ] + [resources.ports] [resources.permissions] @@ -53,9 +63,11 @@ ram.runtime = "50M" main.auth_header = false [resources.apt] - packages = "sqlite3" + packages = "postgresql" extras.pufferpanel.repo = "deb https://packagecloud.io/pufferpanel/pufferpanel/debian/ buster main" extras.pufferpanel.key = "https://packagecloud.io/pufferpanel/pufferpanel/gpgkey" extras.pufferpanel.packages = "pufferpanel" - \ No newline at end of file + + [resources.database] + type = "postgresql" diff --git a/scripts/_common.sh b/scripts/_common.sh index 944a65e..0f1a117 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,6 +4,8 @@ # COMMON VARIABLES #================================================= +main_domain=$(cat /etc/yunohost/current_host) + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index 2356740..b887886 100644 --- a/scripts/backup +++ b/scripts/backup @@ -21,6 +21,12 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$install_dir" +#================================================= +# BACKUP THE DATA DIR +#================================================= + +ynh_backup --src_path="$data_dir" --is_big + #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= @@ -32,7 +38,13 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= ynh_backup --src_path="/etc/$app/" -ynh_backup --src_path="/var/lib/$app/" + +#================================================= +# BACKUP THE POSTGRESQL DATABASE +#================================================= +ynh_print_info --message="Backing up the PostgreSQL database..." + +ynh_psql_dump_db --database="$db_name" > db.sql #================================================= # END OF SCRIPT diff --git a/scripts/change_url b/scripts/change_url index 8c014a5..e84a828 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -16,7 +16,7 @@ source /usr/share/yunohost/helpers #================================================= ynh_script_progression --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" +ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd" #================================================= # MODIFY URL IN NGINX CONF @@ -33,7 +33,7 @@ ynh_change_url_nginx_config ynh_script_progression --message="Starting a systemd service..." # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Listening for" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Listening for" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 7e0c2ca..9a2cce8 100644 --- a/scripts/install +++ b/scripts/install @@ -13,14 +13,14 @@ source /usr/share/yunohost/helpers # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -mail=$(ynh_user_get_info --username=$admin --key=mail) +email=$(ynh_user_get_info --username="$admin" --key=mail) #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= ynh_script_progression --message="Validating installation parameters..." -if [[ $admin < 5 ]]; then +if [[ ${#admin} -lt 5 ]]; then ynh_die --message="Admin username minimum length is 5" fi @@ -30,7 +30,7 @@ fi chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= # NGINX CONFIGURATION @@ -40,9 +40,9 @@ ynh_script_progression --message="Configuring NGINX web server..." # Create a dedicated NGINX config ynh_add_nginx_config -systemctl enable $app.service --quiet +systemctl enable "$app.service" --quiet -yunohost service add $app --description="Web-based Game Server Management System" --log="/var/log/$app/$app.log" +yunohost service add "$app" --description="Web-based Game Server Management System" --log="/var/log/$app/$app.log" #================================================= # SPECIFIC SETUP @@ -54,9 +54,9 @@ ynh_script_progression --message="Adding a configuration file..." ynh_add_config --template="config.json" --destination="/etc/$app/config.json" chmod 650 "/etc/$app/config.json" -chown $app:$app "/etc/$app/config.json" +chown "$app:$app" "/etc/$app/config.json" -pufferpanel user add --admin --email=$mail --name=$admin --password=$password +pufferpanel user add --admin --email="$email" --name="$admin" --password="$password" #================================================= # GENERIC FINALIZATION @@ -66,7 +66,7 @@ pufferpanel user add --admin --email=$mail --name=$admin --password=$password ynh_script_progression --message="Starting a systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Listening for" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Listening for" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 23a0a4c..17e1e31 100644 --- a/scripts/remove +++ b/scripts/remove @@ -16,15 +16,17 @@ source /usr/share/yunohost/helpers #================================================= # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status $app >/dev/null +if ynh_exec_warn_less yunohost service status "$app" >/dev/null then ynh_script_progression --message="Removing $app service integration..." - yunohost service remove $app + yunohost service remove "$app" fi # Remove the dedicated NGINX config ynh_remove_nginx_config +ynh_secure_remove "/etc/$app/" + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index db8e3cc..76ac086 100644 --- a/scripts/restore +++ b/scripts/restore @@ -19,7 +19,23 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +chown -R "$app:www-data" "$install_dir" + +#================================================= +# RESTORE THE POSTGRESQL DATABASE +#================================================= +ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=6 + +ynh_psql_execute_file_as_root --file="./db.sql" --database="$db_name" + +#================================================= +# RESTORE THE DATA DIRECTORY +#================================================= +ynh_script_progression --message="Restoring the data directory..." --weight=1 + +ynh_restore_file --origin_path="$data_dir" --not_mandatory + +chown -R "$app:www-data" "$data_dir" #================================================= # RESTORE VARIOUS FILES @@ -27,13 +43,12 @@ chown -R $app:www-data "$install_dir" ynh_script_progression --message="Restoring various files..." ynh_restore_file --origin_path="/etc/$app/" -ynh_restore_file --origin_path="/var/lib/$app/" ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -systemctl enable $app.service --quiet +systemctl enable "$app.service" --quiet -yunohost service add $app --description="Web-based Game Server Management System" --log="/var/log/$app/$app.log" +yunohost service add "$app" --description="Web-based Game Server Management System" --log="/var/log/$app/$app.log" #================================================= # GENERIC FINALIZATION @@ -42,7 +57,7 @@ yunohost service add $app --description="Web-based Game Server Management System #================================================= ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Listening for" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Listening for" ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index b1618c3..53fc631 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -9,6 +9,12 @@ source _common.sh source /usr/share/yunohost/helpers +#================================================= +# RETRIEVE ARGUMENTS FROM THE MANIFEST +#================================================= + +email=$(ynh_user_get_info --username="$admin" --key=mail) + #================================================= # CHECK VERSION #================================================= @@ -22,7 +28,18 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Stopping a systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" +ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd" + +#================================================= +# ENSURE DOWNWARD COMPATIBILITY +#================================================= +ynh_script_progression --message="Ensuring downward compatibility..." + +# moving the data folder to the standard ynh one +if [ -d "/var/lib/$app" ]; then + ynh_print_info --message="Moving the data folder from '/var/lib/$app' to '$data_dir'" + mv "/var/lib/$app" "$data_dir" +fi #================================================= # UPGRADE DEPENDENCIES @@ -30,7 +47,7 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= # REAPPLY SYSTEM CONFIGURATIONS @@ -40,9 +57,9 @@ ynh_script_progression --message="Upgrading system configurations related to $ap # Create a dedicated NGINX config ynh_add_nginx_config -systemctl enable $app.service --quiet +systemctl enable "$app.service" --quiet -yunohost service add $app --description="Web-based Game Server Management System" --log="/var/log/$app/$app.log" +yunohost service add "$app" --description="Web-based Game Server Management System" --log="/var/log/$app/$app.log" #================================================= # UPDATE A CONFIG FILE @@ -52,14 +69,14 @@ ynh_script_progression --message="Updating a configuration file..." ynh_add_config --template="config.json" --destination="/etc/$app/config.json" chmod 650 "/etc/$app/config.json" -chown $app:$app "/etc/$app/config.json" +chown "$app:$app" "/etc/$app/config.json" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Listening for" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Listening for" #================================================= # END OF SCRIPT