From 7d303ae2158fbda2a039a50d5c515a385115ffd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 25 Feb 2024 12:24:40 +0100 Subject: [PATCH 01/14] Update config.json --- conf/config.json | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/conf/config.json b/conf/config.json index cfc7162..392a834 100644 --- a/conf/config.json +++ b/conf/config.json @@ -1,23 +1,10 @@ { - // IRC server settings. "server": { - // WebSocket URL or path to connect to (string). "url": "/?server=/webirc/websocket/", - // Channel(s) to auto-join (string or array of strings). "autojoin": "#yunohost", - // Controls how the password UI is presented to the user. Set to - // "mandatory" to require a password, "optional" to accept one but not - // require it, "disabled" to never ask for a password, or "external" to - // use SASL EXTERNAL. Defaults to "optional". "auth": "optional", - // Default nickname (string). "nick": "asdf", - // Don't display the login UI, immediately connect to the server - // (boolean). "autoconnect": true, - // Interval in seconds to send PING commands (number). Set to 0 to - // disable. Enabling PINGs can have an impact on client power usage and - // should only be enabled if necessary. "ping": 60 } } \ No newline at end of file From f9362bb33a87e4528fb5dfc1abcc84146c9ce76b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 2 Mar 2024 08:52:38 +0100 Subject: [PATCH 02/14] cleaning --- manifest.toml | 3 +++ scripts/_common.sh | 2 +- scripts/backup | 8 -------- scripts/change_url | 8 ++++---- scripts/install | 5 ++--- scripts/remove | 25 ------------------------- scripts/restore | 26 ++------------------------ scripts/upgrade | 13 ++++--------- 8 files changed, 16 insertions(+), 74 deletions(-) diff --git a/manifest.toml b/manifest.toml index 52c1172..5360338 100644 --- a/manifest.toml +++ b/manifest.toml @@ -19,8 +19,11 @@ code = "https://sr.ht/~emersion/gamja/" yunohost = ">= 11.2" architectures = "all" multi_instance = true + ldap = false + sso = true + disk = "50M" ram.build = "50M" ram.runtime = "50M" diff --git a/scripts/_common.sh b/scripts/_common.sh index 9ecc68b..80c93db 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,8 +4,8 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app nodejs_version=20 + go_version=1.20 #================================================= diff --git a/scripts/backup b/scripts/backup index 0ae9c52..6d2e59e 100755 --- a/scripts/backup +++ b/scripts/backup @@ -27,16 +27,8 @@ ynh_backup --src_path="$install_dir" ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# BACKUP SYSTEMD -#================================================= - ynh_backup --src_path="/etc/systemd/system/$app.service" -#================================================= -# BACKUP VARIOUS FILES -#================================================= - ynh_backup --src_path="$webircgateway_path" #================================================= diff --git a/scripts/change_url b/scripts/change_url index 2c672a1..bac16b2 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -14,14 +14,14 @@ source /usr/share/yunohost/helpers #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --time --weight=1 +ynh_script_progression --message="Stopping a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --time --weight=1 +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 ynh_change_url_nginx_config @@ -30,7 +30,7 @@ ynh_change_url_nginx_config #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --time --weight=1 +ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Using config" @@ -38,4 +38,4 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --l # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --time --last +ynh_script_progression --message="Change of URL completed for $app" --last diff --git a/scripts/install b/scripts/install index 67b0427..f96efee 100755 --- a/scripts/install +++ b/scripts/install @@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers #================================================= # INSTALL DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Installing dependencies..." --weight=7 +ynh_script_progression --message="Installing dependencies..." --weight=7 ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_go --go_version=$go_version @@ -23,7 +23,6 @@ ynh_exec_warn_less ynh_install_go --go_version=$go_version #================================================= ynh_script_progression --message="Setting up source files..." --weight=5 -# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" chmod -R o-rwx "$install_dir" @@ -55,7 +54,7 @@ popd #================================================= ynh_script_progression --message="Adding a configuration file..." --weight=2 -ynh_add_config --template="../conf/config.json" --destination="$install_dir/config.json" +ynh_add_config --template="config.json" --destination="$install_dir/config.json" chmod 744 "$install_dir/config.json" chown $app:www-data "$install_dir/config.json" diff --git a/scripts/remove b/scripts/remove index 187ea4e..65033e5 100755 --- a/scripts/remove +++ b/scripts/remove @@ -22,37 +22,12 @@ then yunohost service remove $app fi -#================================================= -# STOP AND REMOVE SERVICE -#================================================= -ynh_script_progression --message="Stopping and removing the systemd service..." --weight=1 - -# Remove the dedicated systemd config ynh_remove_systemd_config -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - -# Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 - -# Remove metapackage and its dependencies ynh_remove_nodejs -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE VARIOUS FILES -#================================================= -ynh_script_progression --message="Removing various files..." - ynh_secure_remove --file="$webircgateway_path" #================================================= diff --git a/scripts/restore b/scripts/restore index 7c563e0..7ebdba1 100755 --- a/scripts/restore +++ b/scripts/restore @@ -23,7 +23,7 @@ chown -R $app:www-data "$install_dir" #================================================= # REINSTALL DEPENDENCIES #================================================= -#REMOVEME? ynh_script_progression --message="Reinstalling dependencies..." --weight=7 +ynh_script_progression --message="Reinstalling dependencies..." --weight=7 ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version @@ -34,27 +34,12 @@ ynh_script_progression --message="Restoring the NGINX web server configuration.. ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# RESTORE VARIOUS FILES -#================================================= -ynh_script_progression --message="Restoring various files..." - ynh_restore_file --origin_path="$webircgateway_path" -#================================================= -# RESTORE SYSTEMD -#================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=1 - ynh_restore_file --origin_path="/etc/systemd/system/$app.service" systemctl enable $app.service --quiet -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="Simple IRC web client" +yunohost service add $app --description="Simple IRC web client" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE @@ -63,13 +48,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Using config" -#================================================= -# GENERIC FINALIZATION -#================================================= -# RELOAD NGINX AND PHP-FPM -#================================================= -ynh_script_progression --message="Reloading NGINX web server.." --weight=1 - ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 4fff87f..0c640e9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -28,14 +28,9 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression --message="Upgrading source files..." --weight=3 -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=3 - - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep="config.json" -fi +ynh_setup_source --dest_dir="$install_dir" --keep="config.json" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -74,7 +69,7 @@ popd #================================================= ynh_script_progression --message="Updating a configuration file..." --weight=1 -ynh_add_config --template="../conf/config.json" --destination="$install_dir/config.json" +ynh_add_config --template="config.json" --destination="$install_dir/config.json" chmod 744 "$install_dir/config.json" chown $app:www-data "$install_dir/config.json" @@ -105,7 +100,7 @@ chmod -R o-rwx "$webircgateway_path" chown -R $app:www-data "$webircgateway_path" chmod +x "$webircgateway_path/webircgateway" -ynh_add_config --template="../conf/config.conf" --destination="$webircgateway_path/config.conf" +ynh_add_config --template="config.conf" --destination="$webircgateway_path/config.conf" chmod 755 "$webircgateway_path/config.conf" chown $app:www-data "$webircgateway_path/config.conf" From 0e78a69f02291e2e3fcf17e423ede8a4d649930c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 2 Mar 2024 08:52:53 +0100 Subject: [PATCH 03/14] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index f96efee..c7a97fa 100755 --- a/scripts/install +++ b/scripts/install @@ -107,7 +107,7 @@ ynh_add_systemd_config #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description="Simple IRC web client" +yunohost service add $app --description="Simple IRC web client" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE From d722ca662966309279f78a7936a9ca2c793a091a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 2 Mar 2024 08:53:14 +0100 Subject: [PATCH 04/14] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 0c640e9..0653676 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -120,7 +120,7 @@ ynh_add_systemd_config #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description="Simple IRC web client" +yunohost service add $app --description="Simple IRC web client" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE From 2f82390efab385a9554e975903e5d2442900c2f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 2 Mar 2024 16:33:50 +0100 Subject: [PATCH 05/14] fix --- scripts/install | 4 ++-- scripts/upgrade | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index c7a97fa..91f8b3a 100755 --- a/scripts/install +++ b/scripts/install @@ -45,8 +45,8 @@ ynh_script_progression --message="Building app... (this will take some time and pushd "$install_dir" ynh_use_nodejs - ynh_exec_warn_less npm i -g npm - ynh_exec_warn_less npm install --production + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm i -g npm + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm install --production popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 0653676..a9e2a59 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -60,8 +60,8 @@ ynh_script_progression --message="Building app... (this will take some time and pushd "$install_dir" ynh_use_nodejs - ynh_exec_warn_less npm i -g npm - ynh_exec_warn_less npm install --production + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm i -g npm + ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm install --production popd #================================================= From 5726c1fcc1958f7b726e8a9fd0aa7946c22e0080 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Mon, 11 Mar 2024 16:04:48 +0100 Subject: [PATCH 06/14] [autopatch] TEST BEFORE MERGE ynh_setup_source --full_replace=1 --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 4fff87f..b34e21c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -34,7 +34,7 @@ then ynh_script_progression --message="Upgrading source files..." --weight=3 # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep="config.json" + ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="config.json" fi chmod -R o-rwx "$install_dir" @@ -87,7 +87,7 @@ ynh_script_progression --message="Building webircgateway..." --weight=4 mkdir -p $webircgateway_path tempdir="$(mktemp -d)" -ynh_setup_source --dest_dir=$tempdir --source_id="webircgateway" +ynh_setup_source --dest_dir=$tempdir --source_id="webircgateway" --full_replace=1 pushd $tempdir ynh_use_go export GOPATH="$tempdir/go" From f3e90d57df54f6bfc745077e5c437f2cc72d0a04 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Thu, 25 Apr 2024 15:13:08 +0000 Subject: [PATCH 07/14] Auto-update READMEs --- ALL_README.md | 7 +++++++ README.md | 26 ++++++++++++------------- README_eu.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++ README_fr.md | 30 ++++++++++++++--------------- README_gl.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++ README_zh_Hans.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 179 insertions(+), 28 deletions(-) create mode 100644 ALL_README.md create mode 100644 README_eu.md create mode 100644 README_gl.md create mode 100644 README_zh_Hans.md diff --git a/ALL_README.md b/ALL_README.md new file mode 100644 index 0000000..a01b345 --- /dev/null +++ b/ALL_README.md @@ -0,0 +1,7 @@ +# All available README files by language + +- [Read the README in English](README.md) +- [Irakurri README euskaraz](README_eu.md) +- [Lire le README en français](README_fr.md) +- [Le o README en galego](README_gl.md) +- [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README.md b/README.md index abedbd1..1ee460e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ @@ -9,10 +9,10 @@ It shall NOT be edited by hand. [![Install Gamja with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gamja) -*[Lire ce readme en français.](./README_fr.md)* +*[Read this README in other languages.](./ALL_README.md)* -> *This package allows you to install Gamja 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.* +> *This package allows you to install Gamja 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 @@ -20,7 +20,7 @@ A simple IRC web client. **Shipped version:** 1.0.0-beta.9~ynh1 -**Demo:** https://web.libera.chat/gamja/ +**Demo:** ## Screenshots @@ -28,21 +28,21 @@ A simple IRC web client. ## Documentation and resources -* Official app website: -* Upstream app code repository: -* YunoHost Store: -* Report a bug: +- Official app website: +- Upstream app code repository: +- YunoHost Store: +- Report a bug: ## Developer info -Please send your pull request to the [testing branch](https://github.com/YunoHost-Apps/gamja_ynh/tree/testing). +Please send your pull request to the [`testing` branch](https://github.com/YunoHost-Apps/gamja_ynh/tree/testing). -To try the testing branch, please proceed like that. +To try the `testing` branch, please proceed like that: -``` bash +```bash sudo yunohost app install https://github.com/YunoHost-Apps/gamja_ynh/tree/testing --debug or sudo yunohost app upgrade gamja -u https://github.com/YunoHost-Apps/gamja_ynh/tree/testing --debug ``` -**More info regarding app packaging:** \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_eu.md b/README_eu.md new file mode 100644 index 0000000..f08e6bc --- /dev/null +++ b/README_eu.md @@ -0,0 +1,48 @@ + + +# Gamja YunoHost-erako + +[![Integrazio maila](https://dash.yunohost.org/integration/gamja.svg)](https://dash.yunohost.org/appci/app/gamja) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/gamja.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/gamja.maintain.svg) + +[![Instalatu Gamja YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gamja) + +*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)* + +> *Pakete honek Gamja YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.* +> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.* + +## Aurreikuspena + +A simple IRC web client. + +**Paketatutako bertsioa:** 1.0.0-beta.9~ynh1 + +**Demoa:** + +## Pantaila-argazkiak + +![Gamja(r)en pantaila-argazkia](./doc/screenshots/screenshot.png) + +## Dokumentazioa eta baliabideak + +- Aplikazioaren webgune ofiziala: +- Jatorrizko aplikazioaren kode-gordailua: +- YunoHost Denda: +- Eman errore baten berri: + +## Garatzaileentzako informazioa + +Bidali `pull request`a [`testing` abarrera](https://github.com/YunoHost-Apps/gamja_ynh/tree/testing). + +`testing` abarra probatzeko, ondorengoa egin: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/gamja_ynh/tree/testing --debug +edo +sudo yunohost app upgrade gamja -u https://github.com/YunoHost-Apps/gamja_ynh/tree/testing --debug +``` + +**Informazio gehiago aplikazioaren paketatzeari buruz:** diff --git a/README_fr.md b/README_fr.md index 8b7f218..e0d4a8b 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,6 +1,6 @@ # Gamja pour YunoHost @@ -9,18 +9,18 @@ It shall NOT be edited by hand. [![Installer Gamja avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gamja) -*[Read this readme in english.](./README.md)* +*[Lire le README dans d'autres langues.](./ALL_README.md)* -> *Ce package vous permet d’installer Gamja rapidement et simplement sur un serveur YunoHost. -Si vous n’avez pas YunoHost, regardez [ici](https://yunohost.org/#/install) pour savoir comment l’installer et en profiter.* +> *Ce package vous permet d’installer Gamja rapidement et simplement sur un serveur YunoHost.* +> *Si vous n’avez pas YunoHost, consultez [ce guide](https://yunohost.org/install) pour savoir comment l’installer et en profiter.* ## Vue d’ensemble A simple IRC web client. -**Version incluse :** 1.0.0-beta.9~ynh1 +**Version incluse :** 1.0.0-beta.9~ynh1 -**Démo :** https://web.libera.chat/gamja/ +**Démo :** ## Captures d’écran @@ -28,21 +28,21 @@ A simple IRC web client. ## Documentations et ressources -* Site officiel de l’app : -* Dépôt de code officiel de l’app : -* YunoHost Store: -* Signaler un bug : +- Site officiel de l’app : +- Dépôt de code officiel de l’app : +- YunoHost Store : +- Signaler un bug : ## Informations pour les développeurs -Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/gamja_ynh/tree/testing). +Merci de faire vos pull request sur la [branche `testing`](https://github.com/YunoHost-Apps/gamja_ynh/tree/testing). -Pour essayer la branche testing, procédez comme suit. +Pour essayer la branche `testing`, procédez comme suit : -``` bash +```bash sudo yunohost app install https://github.com/YunoHost-Apps/gamja_ynh/tree/testing --debug ou sudo yunohost app upgrade gamja -u https://github.com/YunoHost-Apps/gamja_ynh/tree/testing --debug ``` -**Plus d’infos sur le packaging d’applications :** \ No newline at end of file +**Plus d’infos sur le packaging d’applications :** diff --git a/README_gl.md b/README_gl.md new file mode 100644 index 0000000..9f49eff --- /dev/null +++ b/README_gl.md @@ -0,0 +1,48 @@ + + +# Gamja para YunoHost + +[![Nivel de integración](https://dash.yunohost.org/integration/gamja.svg)](https://dash.yunohost.org/appci/app/gamja) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/gamja.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/gamja.maintain.svg) + +[![Instalar Gamja con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gamja) + +*[Le este README en outros idiomas.](./ALL_README.md)* + +> *Este paquete permíteche instalar Gamja de xeito rápido e doado nun servidor YunoHost.* +> *Se non usas YunoHost, le a [documentación](https://yunohost.org/install) para saber como instalalo.* + +## Vista xeral + +A simple IRC web client. + +**Versión proporcionada:** 1.0.0-beta.9~ynh1 + +**Demo:** + +## Capturas de pantalla + +![Captura de pantalla de Gamja](./doc/screenshots/screenshot.png) + +## Documentación e recursos + +- Web oficial da app: +- Repositorio de orixe do código: +- Tenda YunoHost: +- Informar dun problema: + +## Info de desenvolvemento + +Envía a túa colaboración á [rama `testing`](https://github.com/YunoHost-Apps/gamja_ynh/tree/testing). + +Para probar a rama `testing`, procede deste xeito: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/gamja_ynh/tree/testing --debug +ou +sudo yunohost app upgrade gamja -u https://github.com/YunoHost-Apps/gamja_ynh/tree/testing --debug +``` + +**Máis info sobre o empaquetado da app:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md new file mode 100644 index 0000000..ce1d748 --- /dev/null +++ b/README_zh_Hans.md @@ -0,0 +1,48 @@ + + +# YunoHost 的 Gamja + +[![集成程度](https://dash.yunohost.org/integration/gamja.svg)](https://dash.yunohost.org/appci/app/gamja) ![工作状态](https://ci-apps.yunohost.org/ci/badges/gamja.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/gamja.maintain.svg) + +[![使用 YunoHost 安装 Gamja](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gamja) + +*[阅读此 README 的其它语言版本。](./ALL_README.md)* + +> *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 Gamja。* +> *如果您还没有 YunoHost,请参阅[指南](https://yunohost.org/install)了解如何安装它。* + +## 概况 + +A simple IRC web client. + +**分发版本:** 1.0.0-beta.9~ynh1 + +**演示:** + +## 截图 + +![Gamja 的截图](./doc/screenshots/screenshot.png) + +## 文档与资源 + +- 官方应用网站: +- 上游应用代码库: +- YunoHost 商店: +- 报告 bug: + +## 开发者信息 + +请向 [`testing` 分支](https://github.com/YunoHost-Apps/gamja_ynh/tree/testing) 发送拉取请求。 + +如要尝试 `testing` 分支,请这样操作: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/gamja_ynh/tree/testing --debug +或 +sudo yunohost app upgrade gamja -u https://github.com/YunoHost-Apps/gamja_ynh/tree/testing --debug +``` + +**有关应用打包的更多信息:** From 412585c50091b2beae0862e6afca2a79110d6e96 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Mon, 13 May 2024 19:21:18 +0000 Subject: [PATCH 08/14] Auto-update READMEs --- ALL_README.md | 2 +- README_es.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++ README_zh_Hans.md | 2 +- 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 README_es.md diff --git a/ALL_README.md b/ALL_README.md index 1b646d3..8938aae 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -1,8 +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) - [阅读中文(简体)的 README](README_zh_Hans.md) -- \ No newline at end of file diff --git a/README_es.md b/README_es.md new file mode 100644 index 0000000..551e2b0 --- /dev/null +++ b/README_es.md @@ -0,0 +1,48 @@ + + +# Gamja para Yunohost + +[![Nivel de integración](https://dash.yunohost.org/integration/gamja.svg)](https://dash.yunohost.org/appci/app/gamja) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/gamja.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/gamja.maintain.svg) + +[![Instalar Gamja con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=gamja) + +*[Leer este README en otros idiomas.](./ALL_README.md)* + +> *Este paquete le permite instalarGamja 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 + +A simple IRC web client. + +**Versión actual:** 1.0.0-beta.9~ynh1 + +**Demo:** + +## Capturas + +![Captura de Gamja](./doc/screenshots/screenshot.png) + +## Documentaciones y recursos + +- Sitio web 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/gamja_ynh/tree/testing + +Para probar la rama `testing`, sigue asÍ: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/gamja_ynh/tree/testing --debug +o +sudo yunohost app upgrade gamja -u https://github.com/YunoHost-Apps/gamja_ynh/tree/testing --debug +``` + +**Mas informaciones sobre el empaquetado de aplicaciones:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md index ce1d748..98998bd 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -3,7 +3,7 @@ 请勿手动编辑。 --> -# YunoHost 的 Gamja +# YunoHost 上的 Gamja [![集成程度](https://dash.yunohost.org/integration/gamja.svg)](https://dash.yunohost.org/appci/app/gamja) ![工作状态](https://ci-apps.yunohost.org/ci/badges/gamja.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/gamja.maintain.svg) From f13c95468499e0e74da4e0557cb4ed385a467856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 13 May 2024 21:23:05 +0200 Subject: [PATCH 09/14] Update install --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 91f8b3a..c7a97fa 100755 --- a/scripts/install +++ b/scripts/install @@ -45,8 +45,8 @@ ynh_script_progression --message="Building app... (this will take some time and pushd "$install_dir" ynh_use_nodejs - ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm i -g npm - ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm install --production + ynh_exec_warn_less npm i -g npm + ynh_exec_warn_less npm install --production popd #================================================= From 586a497e6124c6c47f7c6ec72bcb2c89d9c27068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 20 May 2024 07:42:15 +0200 Subject: [PATCH 10/14] remove go helper --- manifest.toml | 2 +- scripts/install | 1 - scripts/upgrade | 1 - scripts/ynh_install_go | 247 ----------------------------------------- 4 files changed, 1 insertion(+), 250 deletions(-) delete mode 100644 scripts/ynh_install_go diff --git a/manifest.toml b/manifest.toml index 5360338..4fcc74b 100644 --- a/manifest.toml +++ b/manifest.toml @@ -16,7 +16,7 @@ demo = "https://web.libera.chat/gamja/" code = "https://sr.ht/~emersion/gamja/" [integration] -yunohost = ">= 11.2" +yunohost = ">= 11.2.12" architectures = "all" multi_instance = true diff --git a/scripts/install b/scripts/install index c7a97fa..4cabc62 100755 --- a/scripts/install +++ b/scripts/install @@ -7,7 +7,6 @@ #================================================= source _common.sh -source ynh_install_go source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 65726c8..a505d87 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,7 +7,6 @@ #================================================= source _common.sh -source ynh_install_go source /usr/share/yunohost/helpers #================================================= diff --git a/scripts/ynh_install_go b/scripts/ynh_install_go deleted file mode 100644 index 1146945..0000000 --- a/scripts/ynh_install_go +++ /dev/null @@ -1,247 +0,0 @@ -#!/bin/bash - -ynh_go_try_bash_extension() { - if [ -x src/configure ]; then - src/configure && make -C src || { - ynh_print_info --message="Optional bash extension failed to build, but things will still work normally." - } - fi -} - -goenv_install_dir="/opt/goenv" -go_version_path="$goenv_install_dir/versions" -# goenv_ROOT is the directory of goenv, it needs to be loaded as a environment variable. -export GOENV_ROOT="$goenv_install_dir" - -# Load the version of Go for an app, and set variables. -# -# ynh_use_go has to be used in any app scripts before using Go for the first time. -# This helper will provide alias and variables to use in your scripts. -# -# To use gem or Go, use the alias `ynh_gem` and `ynh_go` -# Those alias will use the correct version installed for the app -# For example: use `ynh_gem install` instead of `gem install` -# -# With `sudo` or `ynh_exec_as`, use instead the fallback variables `$ynh_gem` and `$ynh_go` -# And propagate $PATH to sudo with $ynh_go_load_path -# Exemple: `ynh_exec_as $app $ynh_go_load_path $ynh_gem install` -# -# $PATH contains the path of the requested version of Go. -# However, $PATH is duplicated into $go_path to outlast any manipulation of $PATH -# You can use the variable `$ynh_go_load_path` to quickly load your Go version -# in $PATH for an usage into a separate script. -# Exemple: $ynh_go_load_path $final_path/script_that_use_gem.sh` -# -# -# Finally, to start a Go service with the correct version, 2 solutions -# Either the app is dependent of Go or gem, but does not called it directly. -# In such situation, you need to load PATH -# `Environment="__YNH_GO_LOAD_PATH__"` -# `ExecStart=__FINALPATH__/my_app` -# You will replace __YNH_GO_LOAD_PATH__ with $ynh_go_load_path -# -# Or Go start the app directly, then you don't need to load the PATH variable -# `ExecStart=__YNH_GO__ my_app run` -# You will replace __YNH_GO__ with $ynh_go -# -# -# one other variable is also available -# - $go_path: The absolute path to Go binaries for the chosen version. -# -# usage: ynh_use_go -# -# Requires YunoHost version 3.2.2 or higher. -ynh_use_go () { - go_version=$(ynh_app_setting_get --app=$app --key=go_version) - - # Get the absolute path of this version of Go - go_path="$go_version_path/$go_version/bin" - - # Allow alias to be used into bash script - shopt -s expand_aliases - - # Create an alias for the specific version of Go and a variable as fallback - ynh_go="$go_path/go" - alias ynh_go="$ynh_go" - - # Load the path of this version of Go in $PATH - if [[ :$PATH: != *":$go_path"* ]]; then - PATH="$go_path:$PATH" - fi - # Create an alias to easily load the PATH - ynh_go_load_path="PATH=$PATH" - - # Sets the local application-specific Go version - pushd $install_dir - $goenv_install_dir/bin/goenv local $go_version - popd -} - -# Install a specific version of Go -# -# ynh_install_go will install the version of Go provided as argument by using goenv. -# -# This helper creates a /etc/profile.d/goenv.sh that configures PATH environment for goenv -# for every LOGIN user, hence your user must have a defined shell (as opposed to /usr/sbin/nologin) -# -# Don't forget to execute go-dependent command in a login environment -# (e.g. sudo --login option) -# When not possible (e.g. in systemd service definition), please use direct path -# to goenv shims (e.g. $goenv_ROOT/shims/bundle) -# -# usage: ynh_install_go --go_version=go_version -# | arg: -v, --go_version= - Version of go to install. -# -# Requires YunoHost version 3.2.2 or higher. -ynh_install_go () { - # Declare an array to define the options of this helper. - local legacy_args=v - local -A args_array=( [v]=go_version= ) - local go_version - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - - # Load goenv path in PATH - local CLEAR_PATH="$goenv_install_dir/bin:$PATH" - - # Remove /usr/local/bin in PATH in case of Go prior installation - PATH=$(echo $CLEAR_PATH | sed 's@/usr/local/bin:@@') - - # Move an existing Go binary, to avoid to block goenv - test -x /usr/bin/go && mv /usr/bin/go /usr/bin/go_goenv - - # Install or update goenv - goenv="$(command -v goenv $goenv_install_dir/bin/goenv | head -1)" - if [ -n "$goenv" ]; then - ynh_print_info --message="goenv already seems installed in \`$goenv'." - pushd "${goenv%/*/*}" - if git remote -v 2>/dev/null | grep "https://github.com/syndbg/goenv.git"; then - echo "Trying to update with git..." - git pull -q --tags origin master - cd .. - ynh_go_try_bash_extension - fi - popd - else - ynh_print_info --message="Installing goenv with git..." - mkdir -p $goenv_install_dir - pushd $goenv_install_dir - git init -q - git remote add -f -t master origin https://github.com/syndbg/goenv.git > /dev/null 2>&1 - git checkout -q -b master origin/master - ynh_go_try_bash_extension - goenv=$goenv_install_dir/bin/goenv - popd - fi - - goenv_latest="$(command -v "$goenv_install_dir"/plugins/*/bin/goenv-latest goenv-latest | head -1)" - if [ -n "$goenv_latest" ]; then - ynh_print_info --message="\`goenv latest' command already available in \`$goenv_latest'." - pushd "${goenv_latest%/*/*}" - if git remote -v 2>/dev/null | grep "https://github.com/momo-lab/xxenv-latest.git"; then - ynh_print_info --message="Trying to update xxenv-latest with git..." - git pull -q origin master - fi - popd - else - ynh_print_info --message="Installing xxenv-latest with git..." - mkdir -p "${goenv_install_dir}/plugins" - git clone -q https://github.com/momo-lab/xxenv-latest.git "${goenv_install_dir}/plugins/xxenv-latest" - fi - - # Enable caching - mkdir -p "${goenv_install_dir}/cache" - - # Create shims directory if needed - mkdir -p "${goenv_install_dir}/shims" - - # Restore /usr/local/bin in PATH - PATH=$CLEAR_PATH - - # And replace the old Go binary - test -x /usr/bin/go_goenv && mv /usr/bin/go_goenv /usr/bin/go - - # Install the requested version of Go - local final_go_version=$(goenv latest --print $go_version) - ynh_print_info --message="Installation of Go-$final_go_version" - goenv install --skip-existing $final_go_version - - # Store go_version into the config of this app - ynh_app_setting_set --app=$YNH_APP_INSTANCE_NAME --key=go_version --value=$final_go_version - - # Cleanup Go versions - ynh_cleanup_go - - # Set environment for Go users - echo "#goenv -export GOENV_ROOT=$goenv_install_dir -export PATH=\"$goenv_install_dir/bin:$PATH\" -eval \"\$(goenv init -)\" -#goenv" > /etc/profile.d/goenv.sh - - # Load the environment - eval "$(goenv init -)" -} - -# Remove the version of Go used by the app. -# -# This helper will also cleanup Go versions -# -# usage: ynh_remove_go -ynh_remove_go () { - local go_version=$(ynh_app_setting_get --app=$YNH_APP_INSTANCE_NAME --key=go_version) - - # Load goenv path in PATH - local CLEAR_PATH="$goenv_install_dir/bin:$PATH" - - # Remove /usr/local/bin in PATH in case of Go prior installation - PATH=$(echo $CLEAR_PATH | sed 's@/usr/local/bin:@@') - - # Remove the line for this app - ynh_app_setting_delete --app=$YNH_APP_INSTANCE_NAME --key=go_version - - # Cleanup Go versions - ynh_cleanup_go -} - -# Remove no more needed versions of Go used by the app. -# -# This helper will check what Go version are no more required, -# and uninstall them -# If no app uses Go, goenv will be also removed. -# -# usage: ynh_cleanup_go -ynh_cleanup_go () { - - # List required Go versions - local installed_apps=$(yunohost app list --output-as json --quiet | jq -r .apps[].id) - local required_go_versions="" - for installed_app in $installed_apps - do - local installed_app_go_version=$(ynh_app_setting_get --app=$installed_app --key="go_version") - if [[ $installed_app_go_version ]] - then - required_go_versions="${installed_app_go_version}\n${required_go_versions}" - fi - done - - # Remove no more needed Go versions - local installed_go_versions=$(goenv versions --bare --skip-aliases | grep -Ev '/') - for installed_go_version in $installed_go_versions - do - if ! `echo ${required_go_versions} | grep "${installed_go_version}" 1>/dev/null 2>&1` - then - ynh_print_info --message="Removing of Go-$installed_go_version" - $goenv_install_dir/bin/goenv uninstall --force $installed_go_version - fi - done - - # If none Go version is required - if [[ ! $required_go_versions ]] - then - # Remove goenv environment configuration - ynh_print_info --message="Removing of goenv" - ynh_secure_remove --file="$goenv_install_dir" - ynh_secure_remove --file="/etc/profile.d/goenv.sh" - fi -} From b0d7d3b950d600c7b76f0ab732b2b0571c331508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 20 May 2024 07:42:33 +0200 Subject: [PATCH 11/14] Update manifest.toml --- manifest.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index 4fcc74b..5f64905 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ description.fr = "Simple IRC web client" version = "1.0.0-beta.9~ynh1" -maintainers = [] +maintainers = ["eric_G"] [upstream] license = "AGPL-3.0-or-later" From da62ca5e7b15d3ecf8972a7a248e5ed9b188a287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 2 Jun 2024 22:32:49 +0200 Subject: [PATCH 12/14] Apply template, stop checking for upgrade_type --- scripts/backup | 2 -- scripts/change_url | 8 +----- scripts/install | 34 +++++++----------------- scripts/remove | 13 +++------- scripts/restore | 10 +++----- scripts/upgrade | 64 ++++++++++++---------------------------------- 6 files changed, 35 insertions(+), 96 deletions(-) diff --git a/scripts/backup b/scripts/backup index 6d2e59e..6be9cdc 100755 --- a/scripts/backup +++ b/scripts/backup @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= diff --git a/scripts/change_url b/scripts/change_url index bac16b2..c50f6db 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC STARTING #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -9,8 +7,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD MODIFICATIONS #================================================= # STOP SYSTEMD SERVICE #================================================= @@ -25,12 +21,10 @@ ynh_script_progression --message="Updating NGINX web server configuration..." -- ynh_change_url_nginx_config -#================================================= -# GENERIC FINALISATION #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +ynh_script_progression --message="Starting $app's systemd service..." --weight=1 ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Using config" diff --git a/scripts/install b/scripts/install index 4cabc62..b2bebe8 100755 --- a/scripts/install +++ b/scripts/install @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -27,16 +25,6 @@ ynh_setup_source --dest_dir="$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=1 - -# Create a dedicated NGINX config -ynh_add_nginx_config - -#================================================= -# SPECIFIC SETUP #================================================= # BUILD APP #================================================= @@ -86,35 +74,31 @@ chmod -R o-rwx "$webircgateway_path" chown -R $app:www-data "$webircgateway_path" chmod +x "$webircgateway_path/webircgateway" -ynh_add_config --template="../conf/config.conf" --destination="$webircgateway_path/config.conf" +ynh_add_config --template="config.conf" --destination="$webircgateway_path/config.conf" chmod 755 "$webircgateway_path/config.conf" chown $app:www-data "$webircgateway_path/config.conf" #================================================= -# SETUP SYSTEMD +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring a systemd service..." --weight=1 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 + +# Create a dedicated NGINX config +ynh_add_nginx_config # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="Simple IRC web client" --log="/var/log/$app/$app.log" +yunohost service add "$app" --description="Simple IRC web client" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +ynh_script_progression --message="Starting $app's systemd service..." --weight=1 # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Using config" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Using config" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 65033e5..39e5f2a 100755 --- a/scripts/remove +++ b/scripts/remove @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -10,16 +8,13 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# STANDARD REMOVE -#================================================= -# REMOVE SERVICE INTEGRATION IN YUNOHOST +# REMOVE SYSTEM CONFIGURATIONS #================================================= +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # 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 -then - ynh_script_progression --message="Removing $app service integration..." --weight=1 - yunohost service remove $app +if ynh_exec_warn_less yunohost service status $app >/dev/null; then + yunohost service remove "$app" fi ynh_remove_systemd_config diff --git a/scripts/restore b/scripts/restore index 7ebdba1..713b637 100755 --- a/scripts/restore +++ b/scripts/restore @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -37,14 +35,14 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_restore_file --origin_path="$webircgateway_path" ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -systemctl enable $app.service --quiet +systemctl enable "$app.service" --quiet -yunohost service add $app --description="Simple IRC web client" --log="/var/log/$app/$app.log" +yunohost service add "$app" --description="Simple IRC web client" --log="/var/log/$app/$app.log" #================================================= -# START SYSTEMD SERVICE +# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +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="Using config" diff --git a/scripts/upgrade b/scripts/upgrade index a505d87..6f32fa8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -9,36 +7,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) - -#================================================= -# STANDARD UPGRADE STEPS #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=1 +ynh_script_progression --message="Stopping $app's systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" - -#================================================= -# DOWNLOAD, CHECK AND UNPACK SOURCE -#================================================= -ynh_script_progression --message="Upgrading source files..." --weight=3 - -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=3 - - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="config.json" -fi - -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd" #================================================= # UPGRADE DEPENDENCIES @@ -49,15 +23,16 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version ynh_exec_warn_less ynh_install_go --go_version=$go_version #================================================= -# NGINX CONFIGURATION +# DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 +ynh_script_progression --message="Upgrading source files..." --weight=3 -# Create a dedicated NGINX config -ynh_add_nginx_config +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep="config.json" + +chmod -R o-rwx "$install_dir" +chown -R "$app:www-data" "$install_dir" -#================================================= -# SPECIFIC UPGRADE #============================================== # BUILD APP #================================================= @@ -111,28 +86,23 @@ chmod 755 "$webircgateway_path/config.conf" chown $app:www-data "$webircgateway_path/config.conf" #================================================= -# SETUP SYSTEMD +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 + +# Create a dedicated NGINX config +ynh_add_nginx_config # Create a dedicated systemd config ynh_add_systemd_config - -#================================================= -# GENERIC FINALIZATION -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="Simple IRC web client" --log="/var/log/$app/$app.log" +yunohost service add "$app" --description="Simple IRC web client" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +ynh_script_progression --message="Starting $app's systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Using config" +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Using config" #================================================= # END OF SCRIPT From 82c708415d615f235605076a54abc6f2aa5a6aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 2 Jun 2024 22:35:19 +0200 Subject: [PATCH 13/14] Fix upgrade: npm i -g requires root permissions --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6f32fa8..077895d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -40,7 +40,7 @@ ynh_script_progression --message="Building app... (this will take some time and pushd "$install_dir" ynh_use_nodejs - ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm i -g npm + ynh_exec_warn_less npm i -g npm ynh_exec_warn_less sudo -u $app env $ynh_node_load_PATH $ynh_npm install --production popd From 1e7e771509a959be06e13cc7606de634fab4ffae Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 2 Jun 2024 20:35:28 +0000 Subject: [PATCH 14/14] Auto-update READMEs --- ALL_README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ALL_README.md b/ALL_README.md index 8938aae..152f2e7 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -1,7 +1,7 @@ # All available README files by language - [Read the README in English](README.md) -- [Lee el README en español](README_es.md) +- [Lea 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)