From e644b64d0c1c8f810f5d8cba4613161dd243e41f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 23 Jun 2024 13:30:35 +0200 Subject: [PATCH 1/5] Update READMEs --- ALL_README.md | 4 +++- README.md | 6 +++++- README_es.md | 52 +++++++++++++++++++++++++++++++++++++++++++++++ README_eu.md | 52 +++++++++++++++++++++++++++++++++++++++++++++++ README_fr.md | 4 ++++ README_gl.md | 4 ++++ README_zh_Hans.md | 52 +++++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 172 insertions(+), 2 deletions(-) create mode 100644 README_es.md create mode 100644 README_eu.md create mode 100644 README_zh_Hans.md diff --git a/ALL_README.md b/ALL_README.md index 3d6c579..152f2e7 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) +- [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) -- [Leggi il “README” in italiano](README_it.md) +- [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README.md b/README.md index 9fb3596..85a83ae 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ It shall NOT be edited by hand. [![Install EtherCalc with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=ethercalc) -*[Read this README is other languages.](./ALL_README.md)* +*[Read this README in other languages.](./ALL_README.md)* > *This package allows you to install EtherCalc 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.* @@ -26,6 +26,10 @@ EtherCalc is a collaborative spreadsheet that can be edited in real time. Each s ![Screenshot of EtherCalc](./doc/screenshots/screenshot.png) +## :red_circle: Antifeatures + +- **Upstream not maintained**: This software is not maintained anymore. Expect it to break down over time, be exposed to unfixed security breaches, etc. + ## Documentation and resources - Official app website: diff --git a/README_es.md b/README_es.md new file mode 100644 index 0000000..929613b --- /dev/null +++ b/README_es.md @@ -0,0 +1,52 @@ + + +# EtherCalc para Yunohost + +[![Nivel de integración](https://dash.yunohost.org/integration/ethercalc.svg)](https://dash.yunohost.org/appci/app/ethercalc) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/ethercalc.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/ethercalc.maintain.svg) + +[![Instalar EtherCalc con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=ethercalc) + +*[Leer este README en otros idiomas.](./ALL_README.md)* + +> *Este paquete le permite instalarEtherCalc 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 + +EtherCalc is a collaborative spreadsheet that can be edited in real time. Each spreadsheet has its own URL. It has the basic functionalities: formatting, mathematical functions, graphics, adding comments, version history, export in HTML or in CSV. EtherCalc is a decentralized software: different instances allow the use of the service, they are made available by several organizations (for example the eponymous site or the FramaCalc service). This makes it possible to avoid concentrating all the data in the hands of the same actor. Instances can be personalized (limitation of the duration of hosting of the spreadsheet, modification of the design, etc.). + +**Versión actual:** 20240101~ynh1 + +**Demo:** + +## Capturas + +![Captura de EtherCalc](./doc/screenshots/screenshot.png) + +## :red_circle: Características no deseables + +- **Upstream not maintained**: This software is not maintained anymore. Expect it to break down over time, be exposed to unfixed security breaches, etc. + +## 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/ethercalc_ynh/tree/testing + +Para probar la rama `testing`, sigue asÍ: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/ethercalc_ynh/tree/testing --debug +o +sudo yunohost app upgrade ethercalc -u https://github.com/YunoHost-Apps/ethercalc_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..2f20b6f --- /dev/null +++ b/README_eu.md @@ -0,0 +1,52 @@ + + +# EtherCalc YunoHost-erako + +[![Integrazio maila](https://dash.yunohost.org/integration/ethercalc.svg)](https://dash.yunohost.org/appci/app/ethercalc) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/ethercalc.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/ethercalc.maintain.svg) + +[![Instalatu EtherCalc YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=ethercalc) + +*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)* + +> *Pakete honek EtherCalc YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.* +> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.* + +## Aurreikuspena + +EtherCalc is a collaborative spreadsheet that can be edited in real time. Each spreadsheet has its own URL. It has the basic functionalities: formatting, mathematical functions, graphics, adding comments, version history, export in HTML or in CSV. EtherCalc is a decentralized software: different instances allow the use of the service, they are made available by several organizations (for example the eponymous site or the FramaCalc service). This makes it possible to avoid concentrating all the data in the hands of the same actor. Instances can be personalized (limitation of the duration of hosting of the spreadsheet, modification of the design, etc.). + +**Paketatutako bertsioa:** 20240101~ynh1 + +**Demoa:** + +## Pantaila-argazkiak + +![EtherCalc(r)en pantaila-argazkia](./doc/screenshots/screenshot.png) + +## :red_circle: Ezaugarri zalantzagarriak + +- **Jatorrizko garapena utzita**: Software honek ez du arduradunik. Denborak aurrera egin ahala funtzionatzeari utziko dio, konpondu gabeko segurtasun arazoak izango ditu, etab. + +## 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/ethercalc_ynh/tree/testing). + +`testing` abarra probatzeko, ondorengoa egin: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/ethercalc_ynh/tree/testing --debug +edo +sudo yunohost app upgrade ethercalc -u https://github.com/YunoHost-Apps/ethercalc_ynh/tree/testing --debug +``` + +**Informazio gehiago aplikazioaren paketatzeari buruz:** diff --git a/README_fr.md b/README_fr.md index f378c8d..5119769 100644 --- a/README_fr.md +++ b/README_fr.md @@ -27,6 +27,10 @@ EtherCalc est un tableur collaboratif éditable en temps réel. Chaque tableur p ![Capture d’écran de EtherCalc](./doc/screenshots/screenshot.png) +## :red_circle: Anti-fonctionnalités + +- **Application non maintenue **: Ce logiciel n'est plus maintenu. Attendez-vous à ce qu'il ne fonctionne plus avec le temps, et que l'on découvre des failles de sécurité qui ne seront pas corrigées, etc. + ## Documentations et ressources - Site officiel de l’app : diff --git a/README_gl.md b/README_gl.md index 3553812..cc60b4c 100644 --- a/README_gl.md +++ b/README_gl.md @@ -26,6 +26,10 @@ EtherCalc is a collaborative spreadsheet that can be edited in real time. Each s ![Captura de pantalla de EtherCalc](./doc/screenshots/screenshot.png) +## :red_circle: Debes considerar + +- **Upstream not maintained**: This software is not maintained anymore. Expect it to break down over time, be exposed to unfixed security breaches, etc. + ## Documentación e recursos - Web oficial da app: diff --git a/README_zh_Hans.md b/README_zh_Hans.md new file mode 100644 index 0000000..3b445a5 --- /dev/null +++ b/README_zh_Hans.md @@ -0,0 +1,52 @@ + + +# YunoHost 上的 EtherCalc + +[![集成程度](https://dash.yunohost.org/integration/ethercalc.svg)](https://dash.yunohost.org/appci/app/ethercalc) ![工作状态](https://ci-apps.yunohost.org/ci/badges/ethercalc.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/ethercalc.maintain.svg) + +[![使用 YunoHost 安装 EtherCalc](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=ethercalc) + +*[阅读此 README 的其它语言版本。](./ALL_README.md)* + +> *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 EtherCalc。* +> *如果您还没有 YunoHost,请参阅[指南](https://yunohost.org/install)了解如何安装它。* + +## 概况 + +EtherCalc is a collaborative spreadsheet that can be edited in real time. Each spreadsheet has its own URL. It has the basic functionalities: formatting, mathematical functions, graphics, adding comments, version history, export in HTML or in CSV. EtherCalc is a decentralized software: different instances allow the use of the service, they are made available by several organizations (for example the eponymous site or the FramaCalc service). This makes it possible to avoid concentrating all the data in the hands of the same actor. Instances can be personalized (limitation of the duration of hosting of the spreadsheet, modification of the design, etc.). + +**分发版本:** 20240101~ynh1 + +**演示:** + +## 截图 + +![EtherCalc 的截图](./doc/screenshots/screenshot.png) + +## :red_circle: 负面特征 + +- **Upstream not maintained**: This software is not maintained anymore. Expect it to break down over time, be exposed to unfixed security breaches, etc. + +## 文档与资源 + +- 官方应用网站: +- 上游应用代码库: +- YunoHost 商店: +- 报告 bug: + +## 开发者信息 + +请向 [`testing` 分支](https://github.com/YunoHost-Apps/ethercalc_ynh/tree/testing) 发送拉取请求。 + +如要尝试 `testing` 分支,请这样操作: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/ethercalc_ynh/tree/testing --debug +或 +sudo yunohost app upgrade ethercalc -u https://github.com/YunoHost-Apps/ethercalc_ynh/tree/testing --debug +``` + +**有关应用打包的更多信息:** From d124cf0edd49439b7591c66a878325b845dbba73 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Fri, 30 Aug 2024 22:52:39 +0200 Subject: [PATCH 2/5] [autopatch] Automatic patch attempt for helpers 2.1 --- manifest.toml | 3 ++- scripts/_common.sh | 14 +------------ scripts/backup | 19 +++++------------ scripts/change_url | 24 +++++++--------------- scripts/install | 38 +++++++++++++++------------------- scripts/remove | 23 ++++++++------------- scripts/restore | 32 ++++++++++++----------------- scripts/upgrade | 51 +++++++++++++++++----------------------------- 8 files changed, 72 insertions(+), 132 deletions(-) diff --git a/manifest.toml b/manifest.toml index 12b42f1..cf34740 100644 --- a/manifest.toml +++ b/manifest.toml @@ -16,7 +16,8 @@ demo = "https://ethercalc.net/" code = "https://github.com/audreyt/ethercalc" [integration] -yunohost = ">= 11.2" +yunohost = ">= 11.2.18" +helpers_version = "2.1" architectures = "all" multi_instance = true diff --git a/scripts/_common.sh b/scripts/_common.sh index 9195d57..e3290b0 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,19 +1,7 @@ #!/bin/bash #================================================= -# COMMON VARIABLES +# COMMON VARIABLES AND CUSTOM HELPERS #================================================= nodejs_version=18 - -#================================================= -# PERSONAL HELPERS -#================================================= - -#================================================= -# EXPERIMENTAL HELPERS -#================================================= - -#================================================= -# FUTURE OFFICIAL HELPERS -#================================================= diff --git a/scripts/backup b/scripts/backup index 99b346a..5306f3c 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,31 +1,22 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - #Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# DECLARE DATA AND CONF FILES TO BACKUP -#================================================= -ynh_print_info --message="Declaring files to be backed up..." +ynh_print_info "Declaring files to be backed up..." #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$install_dir" +ynh_backup "$install_dir" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # SPECIFIC BACKUP @@ -33,10 +24,10 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" # BACKUP SYSTEMD #================================================= -ynh_backup --src_path="/etc/systemd/system/$app.service" +ynh_backup "/etc/systemd/system/$app.service" #================================================= # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." +ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/change_url b/scripts/change_url index 2d6e374..84fe976 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -1,41 +1,31 @@ #!/bin/bash -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# STANDARD MODIFICATIONS #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=1 +ynh_script_progression "Stopping $app's systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" +ynh_systemctl --service=$app --action="stop" --log_path="systemd" #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --weight=1 +ynh_script_progression "Updating NGINX web server configuration..." -ynh_change_url_nginx_config +ynh_config_change_url_nginx -#================================================= -# GENERIC FINALISATION #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=3 +ynh_script_progression "Starting $app's systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +ynh_systemctl --service=$app --action="start" --log_path="systemd" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --last +ynh_script_progression "Change of URL completed for $app" diff --git a/scripts/install b/scripts/install index 55e99f0..942ab70 100644 --- a/scripts/install +++ b/scripts/install @@ -1,66 +1,60 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers #================================================= # INSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Installing dependencies..." --weight=20 +ynh_script_progression "Installing dependencies..." -ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +ynh_nodejs_install #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --weight=2 +ynh_script_progression "Setting up source files..." ynh_setup_source --dest_dir=$install_dir -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" chmod +x $install_dir/bin/runSafe.sh #================================================= # SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 +ynh_script_progression "Adding system configurations related to $app..." -ynh_add_nginx_config +ynh_config_add_nginx env_path="$PATH" -ynh_add_systemd_config +ynh_config_add_systemd yunohost service add $app --description "Collaborative spreadsheet editor" --log="/var/log/$app/$app.log" #================================================= # INSTALL ETHERCALC #================================================= -ynh_script_progression --message="Building EtherCalc... (this will take some time and resources!)" --weight=24 +ynh_script_progression "Building EtherCalc... (this will take some time and resources!)" pushd "$install_dir" - ynh_use_nodejs - ynh_secure_remove --file="$install_dir/package-lock.json" - ynh_exec_warn_less npm i -g ethercalc - ynh_exec_warn_less npm i zappajs + + ynh_safe_rm "$install_dir/package-lock.json" + ynh_hide_warnings npm i -g ethercalc + ynh_hide_warnings npm i zappajs popd #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=2 +ynh_script_progression "Starting $app's systemd service..." # Start a systemd service -ynh_systemd_action --service_name=$app --action=start --log_path="systemd" +ynh_systemctl --service=$app --action=start --log_path="systemd" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of EtherCalc completed" --last +ynh_script_progression "Installation of EtherCalc completed" diff --git a/scripts/remove b/scripts/remove index 25e1853..8a953e1 100644 --- a/scripts/remove +++ b/scripts/remove @@ -1,35 +1,30 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers #================================================= # REMOVE SYSTEM CONFIGURATIONS #================================================= -# REMOVE SYSTEMD SERVICE +# REMOVE SYSTEMD SERVICE + #================================================= -ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 +ynh_script_progression "Removing system configurations related to $app..." -if ynh_exec_warn_less yunohost service status $app >/dev/null +if ynh_hide_warnings yunohost service status $app >/dev/null then - ynh_script_progression --message="Removing $app service integration..." --weight=2 + ynh_script_progression "Removing $app service integration..." yunohost service remove $app fi -ynh_remove_systemd_config +ynh_config_remove_systemd -ynh_remove_nodejs +ynh_nodejs_remove -ynh_remove_nginx_config +ynh_config_remove_nginx #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --last +ynh_script_progression "Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index 0b031df..49ddb02 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,23 +1,17 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." --weight=1 +ynh_script_progression "Restoring the app main directory..." -ynh_restore_file --origin_path="$install_dir" +ynh_restore "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" chmod +x $install_dir/bin/runSafe.sh #================================================= @@ -25,20 +19,20 @@ chmod +x $install_dir/bin/runSafe.sh #================================================= # REINSTALL DEPENDENCIES #================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=1 +ynh_script_progression "Reinstalling dependencies..." -ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +ynh_nodejs_install #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 +ynh_script_progression "Restoring system configurations related to $app..." -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" -ynh_restore_file --origin_path="/etc/systemd/system/$app.service" +ynh_restore "/etc/systemd/system/$app.service" systemctl enable $app.service --quiet yunohost service add $app --description "Collaborative spreadsheet editor" --log="/var/log/$app/$app.log" @@ -46,14 +40,14 @@ yunohost service add $app --description "Collaborative spreadsheet editor" --log #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 +ynh_script_progression "Starting $app's systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +ynh_systemctl --service=$app --action="start" --log_path="systemd" -ynh_systemd_action --service_name=nginx --action=reload +ynh_systemctl --service=nginx --action=reload #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --last +ynh_script_progression "Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index cf93efb..7e26448 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,43 +1,30 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - 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=3 +ynh_script_progression "Stopping $app's systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" +ynh_systemctl --service=$app --action="stop" --log_path="systemd" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -if [ "$upgrade_type" == "UPGRADE_APP" ] +# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed +if ynh_app_upstream_version_changed then - ynh_script_progression --message="Upgrading source files..." --weight=2 + ynh_script_progression "Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" fi -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" chmod +x $install_dir/bin/runSafe.sh #================================================= @@ -45,39 +32,39 @@ chmod +x $install_dir/bin/runSafe.sh #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating a configuration file..." --weight=1 +ynh_script_progression "Updating configuration..." -ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +ynh_nodejs_install -ynh_add_nginx_config +ynh_config_add_nginx env_path="$PATH" # Create a dedicated systemd config -ynh_add_systemd_config +ynh_config_add_systemd yunohost service add $app --description "Collaborative spreadsheet editor" --log="/var/log/$app/$app.log" #================================================= # INSTALL ETHERCALC #================================================= -ynh_script_progression --message="Building EtherCalc... (this will take some time and resources!)" --weight=24 +ynh_script_progression "Building EtherCalc... (this will take some time and resources!)" pushd "$install_dir" - ynh_use_nodejs - ynh_secure_remove --file="$install_dir/package-lock.json" - ynh_exec_warn_less npm install -g ethercalc - ynh_exec_warn_less npm i zappajs + + ynh_safe_rm "$install_dir/package-lock.json" + ynh_hide_warnings npm install -g ethercalc + ynh_hide_warnings npm i zappajs popd #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=5 +ynh_script_progression "Starting $app's systemd service..." -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" +ynh_systemctl --service=$app --action="start" --log_path="systemd" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --last +ynh_script_progression "Upgrade of $app completed" From e09d4c80b622b01f79a001e888bb14d91fcdabb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 5 Oct 2024 19:53:11 +0200 Subject: [PATCH 3/5] cleaning --- manifest.toml | 2 +- scripts/backup | 7 ------- scripts/install | 9 ++------- scripts/remove | 7 +------ scripts/restore | 6 ------ scripts/upgrade | 21 ++++----------------- 6 files changed, 8 insertions(+), 44 deletions(-) diff --git a/manifest.toml b/manifest.toml index cf34740..4e0d412 100644 --- a/manifest.toml +++ b/manifest.toml @@ -16,7 +16,7 @@ demo = "https://ethercalc.net/" code = "https://github.com/audreyt/ethercalc" [integration] -yunohost = ">= 11.2.18" +yunohost = ">= 11.2.30" helpers_version = "2.1" architectures = "all" multi_instance = true diff --git a/scripts/backup b/scripts/backup index 5306f3c..4ed49b4 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,6 +1,5 @@ #!/bin/bash -#Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers @@ -18,12 +17,6 @@ ynh_backup "$install_dir" ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# SPECIFIC BACKUP -#================================================= -# BACKUP SYSTEMD -#================================================= - ynh_backup "/etc/systemd/system/$app.service" #================================================= diff --git a/scripts/install b/scripts/install index 942ab70..b2cb28b 100644 --- a/scripts/install +++ b/scripts/install @@ -17,8 +17,6 @@ ynh_script_progression "Setting up source files..." ynh_setup_source --dest_dir=$install_dir -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" chmod +x $install_dir/bin/runSafe.sh #================================================= @@ -28,7 +26,6 @@ ynh_script_progression "Adding system configurations related to $app..." ynh_config_add_nginx -env_path="$PATH" ynh_config_add_systemd yunohost service add $app --description "Collaborative spreadsheet editor" --log="/var/log/$app/$app.log" @@ -39,10 +36,9 @@ yunohost service add $app --description "Collaborative spreadsheet editor" --log ynh_script_progression "Building EtherCalc... (this will take some time and resources!)" pushd "$install_dir" - ynh_safe_rm "$install_dir/package-lock.json" - ynh_hide_warnings npm i -g ethercalc - ynh_hide_warnings npm i zappajs + ynh_hide_warnings ynh_exec_as_app npm i -g ethercalc + ynh_hide_warnings ynh_exec_as_app npm i zappajs popd #================================================= @@ -50,7 +46,6 @@ popd #================================================= ynh_script_progression "Starting $app's systemd service..." -# Start a systemd service ynh_systemctl --service=$app --action=start --log_path="systemd" #================================================= diff --git a/scripts/remove b/scripts/remove index 8a953e1..52f7c9f 100644 --- a/scripts/remove +++ b/scripts/remove @@ -5,15 +5,10 @@ source /usr/share/yunohost/helpers #================================================= # REMOVE SYSTEM CONFIGURATIONS -#================================================= -# REMOVE SYSTEMD SERVICE - #================================================= ynh_script_progression "Removing system configurations related to $app..." -if ynh_hide_warnings yunohost service status $app >/dev/null -then - ynh_script_progression "Removing $app service integration..." +if ynh_hide_warnings yunohost service status $app >/dev/null; then yunohost service remove $app fi diff --git a/scripts/restore b/scripts/restore index 49ddb02..df38e31 100644 --- a/scripts/restore +++ b/scripts/restore @@ -10,12 +10,8 @@ ynh_script_progression "Restoring the app main directory..." ynh_restore "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" chmod +x $install_dir/bin/runSafe.sh -#================================================= -# SPECIFIC RESTORATION #================================================= # REINSTALL DEPENDENCIES #================================================= @@ -26,8 +22,6 @@ ynh_nodejs_install #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= ynh_script_progression "Restoring system configurations related to $app..." ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" diff --git a/scripts/upgrade b/scripts/upgrade index 7e26448..4a0e24a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -13,22 +13,12 @@ ynh_systemctl --service=$app --action="stop" --log_path="systemd" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression "Upgrading source files..." -# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed -if ynh_app_upstream_version_changed -then - ynh_script_progression "Upgrading source files..." +ynh_setup_source --dest_dir="$install_dir" - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" -fi - -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" -#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R $app:www-data "$install_dir" chmod +x $install_dir/bin/runSafe.sh -#================================================= -# RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...) #================================================= # UPDATE A CONFIG FILE #================================================= @@ -38,8 +28,6 @@ ynh_nodejs_install ynh_config_add_nginx -env_path="$PATH" -# Create a dedicated systemd config ynh_config_add_systemd yunohost service add $app --description "Collaborative spreadsheet editor" --log="/var/log/$app/$app.log" @@ -50,10 +38,9 @@ yunohost service add $app --description "Collaborative spreadsheet editor" --log ynh_script_progression "Building EtherCalc... (this will take some time and resources!)" pushd "$install_dir" - ynh_safe_rm "$install_dir/package-lock.json" - ynh_hide_warnings npm install -g ethercalc - ynh_hide_warnings npm i zappajs + ynh_hide_warnings ynh_exec_as_app npm install -g ethercalc + ynh_hide_warnings ynh_exec_as_app npm i zappajs popd #================================================= From 50a5be056652ffec2c440172c2ad2941fa6e42c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 6 Oct 2024 09:28:00 +0200 Subject: [PATCH 4/5] Update systemd.service --- conf/systemd.service | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index aea568a..d5a9f27 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,8 +6,8 @@ After=network.target Type=simple User=__APP__ Group=__APP__ -WorkingDirectory=__INSTALL_DIR__ -Environment="PATH=__ENV_PATH__" +WorkingDirectory=__INSTALL_DIR__/ +Environment="PATH=__PATH_WITH_NODEJS__" Environment="NODE_ENV=production" ExecStart=__INSTALL_DIR__/bin/ethercalc --host 127.0.0.1 --port __PORT__ --expire __EXPIRE__ --polling #--basepath /path/prefix From f8b0d97a698c5875bb2bb04cc1c139f6571a7241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 6 Oct 2024 11:16:57 +0200 Subject: [PATCH 5/5] Update install --- scripts/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index b2cb28b..b773978 100644 --- a/scripts/install +++ b/scripts/install @@ -37,8 +37,8 @@ ynh_script_progression "Building EtherCalc... (this will take some time and reso pushd "$install_dir" ynh_safe_rm "$install_dir/package-lock.json" - ynh_hide_warnings ynh_exec_as_app npm i -g ethercalc - ynh_hide_warnings ynh_exec_as_app npm i zappajs + ynh_hide_warnings npm i -g ethercalc + ynh_hide_warnings npm i zappajs popd #=================================================