From 014c33311302b0528514fe0beabbf4eb5d1edf64 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Mon, 11 Mar 2024 16:05:25 +0100 Subject: [PATCH 1/5] [autopatch] TEST BEFORE MERGE ynh_setup_source --full_replace=1 --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6c8234e..304d560 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -44,7 +44,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" + ynh_setup_source --dest_dir="$install_dir" --full_replace=1 fi chmod -R o-rwx "$install_dir" From 1697a08c237f5b4c98804403aa9e8f3a6786c03c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 20 Aug 2024 22:17:03 +0200 Subject: [PATCH 2/5] Update manifest.toml --- manifest.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manifest.toml b/manifest.toml index 426177d..b60d15e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Hydrogen" description.en = "Web client for Matrix" description.fr = "Client web pour Matrix" -version = "0.4.1~ynh1" +version = "0.5.0~ynh1" maintainers = [] @@ -16,7 +16,7 @@ demo = "https://hydrogen.element.io/" code = "https://github.com/vector-im/hydrogen-web" [integration] -yunohost = ">= 11.2" +yunohost = ">= 11.2.27" architectures = "all" multi_instance = true @@ -48,8 +48,8 @@ ram.runtime = "50M" [resources.sources] [resources.sources.main] - url = "https://github.com/vector-im/hydrogen-web/releases/download/v0.4.1/hydrogen-web-0.4.1.tar.gz" - sha256 = "b4ba42a13b5cec1e447408959f2f9dc00df431a68b3e457c569fd1d0bad8042d" + url = "https://github.com/vector-im/hydrogen-web/releases/download/v0.5.0/hydrogen-web-0.5.0.tar.gz" + sha256 = "ab6cc8481666fbc9c123d48d42be5216799c13246805be74ec1b4e11693390b1" autoupdate.strategy = "latest_github_tag" [resources.ports] From 9e74d0e6bc8abeaf31ec2f25ea8967a0611fddd8 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Tue, 20 Aug 2024 20:17:08 +0000 Subject: [PATCH 3/5] Auto-update READMEs --- ALL_README.md | 2 ++ README.md | 4 ++-- README_es.md | 4 ++-- README_eu.md | 4 ++-- README_fr.md | 4 ++-- README_gl.md | 4 ++-- README_id.md | 56 +++++++++++++++++++++++++++++++++++++++++++++++ README_ru.md | 56 +++++++++++++++++++++++++++++++++++++++++++++++ README_zh_Hans.md | 4 ++-- 9 files changed, 126 insertions(+), 12 deletions(-) create mode 100644 README_id.md create mode 100644 README_ru.md diff --git a/ALL_README.md b/ALL_README.md index 152f2e7..e3c80d2 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -5,4 +5,6 @@ - [Irakurri README euskaraz](README_eu.md) - [Lire le README en français](README_fr.md) - [Le o README en galego](README_gl.md) +- [Baca README dalam bahasa bahasa Indonesia](README_id.md) +- [Прочитать README на русский](README_ru.md) - [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README.md b/README.md index ae87c93..7084a47 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Hydrogen for YunoHost -[![Integration level](https://dash.yunohost.org/integration/hydrogen.svg)](https://dash.yunohost.org/appci/app/hydrogen) ![Working status](https://ci-apps.yunohost.org/ci/badges/hydrogen.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/hydrogen.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/hydrogen.svg)](https://ci-apps.yunohost.org/ci/apps/hydrogen/) ![Working status](https://ci-apps.yunohost.org/ci/badges/hydrogen.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/hydrogen.maintain.svg) [![Install Hydrogen with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hydrogen) @@ -26,7 +26,7 @@ A minimal Matrix chat client, focused on performance, offline functionality, and - Loading (unused) parts of the application after initial page load should be supported -**Shipped version:** 0.4.1~ynh1 +**Shipped version:** 0.5.0~ynh1 **Demo:** diff --git a/README_es.md b/README_es.md index 866503a..a065477 100644 --- a/README_es.md +++ b/README_es.md @@ -5,7 +5,7 @@ No se debe editar a mano. # Hydrogen para Yunohost -[![Nivel de integración](https://dash.yunohost.org/integration/hydrogen.svg)](https://dash.yunohost.org/appci/app/hydrogen) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/hydrogen.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/hydrogen.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/hydrogen.svg)](https://ci-apps.yunohost.org/ci/apps/hydrogen/) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/hydrogen.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/hydrogen.maintain.svg) [![Instalar Hydrogen con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hydrogen) @@ -26,7 +26,7 @@ A minimal Matrix chat client, focused on performance, offline functionality, and - Loading (unused) parts of the application after initial page load should be supported -**Versión actual:** 0.4.1~ynh1 +**Versión actual:** 0.5.0~ynh1 **Demo:** diff --git a/README_eu.md b/README_eu.md index 577af99..4f46f87 100644 --- a/README_eu.md +++ b/README_eu.md @@ -5,7 +5,7 @@ EZ editatu eskuz. # Hydrogen YunoHost-erako -[![Integrazio maila](https://dash.yunohost.org/integration/hydrogen.svg)](https://dash.yunohost.org/appci/app/hydrogen) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/hydrogen.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/hydrogen.maintain.svg) +[![Integrazio maila](https://dash.yunohost.org/integration/hydrogen.svg)](https://ci-apps.yunohost.org/ci/apps/hydrogen/) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/hydrogen.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/hydrogen.maintain.svg) [![Instalatu Hydrogen YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hydrogen) @@ -26,7 +26,7 @@ A minimal Matrix chat client, focused on performance, offline functionality, and - Loading (unused) parts of the application after initial page load should be supported -**Paketatutako bertsioa:** 0.4.1~ynh1 +**Paketatutako bertsioa:** 0.5.0~ynh1 **Demoa:** diff --git a/README_fr.md b/README_fr.md index 55884c0..4c72337 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,7 +5,7 @@ Il NE doit PAS être modifié à la main. # Hydrogen pour YunoHost -[![Niveau d’intégration](https://dash.yunohost.org/integration/hydrogen.svg)](https://dash.yunohost.org/appci/app/hydrogen) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/hydrogen.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/hydrogen.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/hydrogen.svg)](https://ci-apps.yunohost.org/ci/apps/hydrogen/) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/hydrogen.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/hydrogen.maintain.svg) [![Installer Hydrogen avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hydrogen) @@ -25,7 +25,7 @@ Un client de chat Matrix minimal, axé sur les performances, les fonctionnalité - Il s'agit d'une application Web autonome, mais elle peut également être facilement intégrée à un site Web/une application Web existante pour ajouter des fonctionnalités de chat. - Le chargement de parties (inutilisées) de l'application après le chargement initial de la page doit être pris en charge -**Version incluse :** 0.4.1~ynh1 +**Version incluse :** 0.5.0~ynh1 **Démo :** diff --git a/README_gl.md b/README_gl.md index 0d4c361..f9910ea 100644 --- a/README_gl.md +++ b/README_gl.md @@ -5,7 +5,7 @@ NON debe editarse manualmente. # Hydrogen para YunoHost -[![Nivel de integración](https://dash.yunohost.org/integration/hydrogen.svg)](https://dash.yunohost.org/appci/app/hydrogen) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/hydrogen.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/hydrogen.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/hydrogen.svg)](https://ci-apps.yunohost.org/ci/apps/hydrogen/) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/hydrogen.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/hydrogen.maintain.svg) [![Instalar Hydrogen con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hydrogen) @@ -26,7 +26,7 @@ A minimal Matrix chat client, focused on performance, offline functionality, and - Loading (unused) parts of the application after initial page load should be supported -**Versión proporcionada:** 0.4.1~ynh1 +**Versión proporcionada:** 0.5.0~ynh1 **Demo:** diff --git a/README_id.md b/README_id.md new file mode 100644 index 0000000..963f987 --- /dev/null +++ b/README_id.md @@ -0,0 +1,56 @@ + + +# Hydrogen untuk YunoHost + +[![Tingkat integrasi](https://dash.yunohost.org/integration/hydrogen.svg)](https://ci-apps.yunohost.org/ci/apps/hydrogen/) ![Status kerja](https://ci-apps.yunohost.org/ci/badges/hydrogen.status.svg) ![Status pemeliharaan](https://ci-apps.yunohost.org/ci/badges/hydrogen.maintain.svg) + +[![Pasang Hydrogen dengan YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hydrogen) + +*[Baca README ini dengan bahasa yang lain.](./ALL_README.md)* + +> *Paket ini memperbolehkan Anda untuk memasang Hydrogen secara cepat dan mudah pada server YunoHost.* +> *Bila Anda tidak mempunyai YunoHost, silakan berkonsultasi dengan [panduan](https://yunohost.org/install) untuk mempelajari bagaimana untuk memasangnya.* + +## Ringkasan + +A minimal Matrix chat client, focused on performance, offline functionality, and broad browser support. This is work in progress and not yet ready for primetime. + +### Features + +- Work well on desktop as well as mobile browsers +- UI components can be easily used in isolation +- It is a standalone webapp, but can also be easily embedded into an existing website/webapp to add chat capabilities. +- Loading (unused) parts of the application after initial page load should be supported + + +**Versi terkirim:** 0.5.0~ynh1 + +**Demo:** + +## Tangkapan Layar + +![Tangkapan Layar pada Hydrogen](./doc/screenshots/hydrogen-large.png) + +## Dokumentasi dan sumber daya + +- Website aplikasi resmi: +- Depot kode aplikasi hulu: +- Gudang YunoHost: +- Laporkan bug: + +## Info developer + +Silakan kirim pull request ke [`testing` branch](https://github.com/YunoHost-Apps/hydrogen_ynh/tree/testing). + +Untuk mencoba branch `testing`, silakan dilanjutkan seperti: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/hydrogen_ynh/tree/testing --debug +atau +sudo yunohost app upgrade hydrogen -u https://github.com/YunoHost-Apps/hydrogen_ynh/tree/testing --debug +``` + +**Info lebih lanjut mengenai pemaketan aplikasi:** diff --git a/README_ru.md b/README_ru.md new file mode 100644 index 0000000..c207ef9 --- /dev/null +++ b/README_ru.md @@ -0,0 +1,56 @@ + + +# Hydrogen для YunoHost + +[![Уровень интеграции](https://dash.yunohost.org/integration/hydrogen.svg)](https://ci-apps.yunohost.org/ci/apps/hydrogen/) ![Состояние работы](https://ci-apps.yunohost.org/ci/badges/hydrogen.status.svg) ![Состояние сопровождения](https://ci-apps.yunohost.org/ci/badges/hydrogen.maintain.svg) + +[![Установите Hydrogen с YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hydrogen) + +*[Прочтите этот README на других языках.](./ALL_README.md)* + +> *Этот пакет позволяет Вам установить Hydrogen быстро и просто на YunoHost-сервер.* +> *Если у Вас нет YunoHost, пожалуйста, посмотрите [инструкцию](https://yunohost.org/install), чтобы узнать, как установить его.* + +## Обзор + +A minimal Matrix chat client, focused on performance, offline functionality, and broad browser support. This is work in progress and not yet ready for primetime. + +### Features + +- Work well on desktop as well as mobile browsers +- UI components can be easily used in isolation +- It is a standalone webapp, but can also be easily embedded into an existing website/webapp to add chat capabilities. +- Loading (unused) parts of the application after initial page load should be supported + + +**Поставляемая версия:** 0.5.0~ynh1 + +**Демо-версия:** + +## Снимки экрана + +![Снимок экрана Hydrogen](./doc/screenshots/hydrogen-large.png) + +## Документация и ресурсы + +- Официальный веб-сайт приложения: +- Репозиторий кода главной ветки приложения: +- Магазин YunoHost: +- Сообщите об ошибке: + +## Информация для разработчиков + +Пришлите Ваш запрос на слияние в [ветку `testing`](https://github.com/YunoHost-Apps/hydrogen_ynh/tree/testing). + +Чтобы попробовать ветку `testing`, пожалуйста, сделайте что-то вроде этого: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/hydrogen_ynh/tree/testing --debug +или +sudo yunohost app upgrade hydrogen -u https://github.com/YunoHost-Apps/hydrogen_ynh/tree/testing --debug +``` + +**Больше информации о пакетировании приложений:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 5c4ce0b..073b08e 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -5,7 +5,7 @@ # YunoHost 上的 Hydrogen -[![集成程度](https://dash.yunohost.org/integration/hydrogen.svg)](https://dash.yunohost.org/appci/app/hydrogen) ![工作状态](https://ci-apps.yunohost.org/ci/badges/hydrogen.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/hydrogen.maintain.svg) +[![集成程度](https://dash.yunohost.org/integration/hydrogen.svg)](https://ci-apps.yunohost.org/ci/apps/hydrogen/) ![工作状态](https://ci-apps.yunohost.org/ci/badges/hydrogen.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/hydrogen.maintain.svg) [![使用 YunoHost 安装 Hydrogen](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=hydrogen) @@ -26,7 +26,7 @@ A minimal Matrix chat client, focused on performance, offline functionality, and - Loading (unused) parts of the application after initial page load should be supported -**分发版本:** 0.4.1~ynh1 +**分发版本:** 0.5.0~ynh1 **演示:** From 5317ce23d9df28f9264f556ecdd3c859edd4e1c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 20 Aug 2024 22:17:50 +0200 Subject: [PATCH 4/5] helpers_2.1 --- .../extra_files/app/.gitignore => .gitignore | 1 + manifest.toml | 4 +- scripts/_common.sh | 14 +------ scripts/backup | 17 ++------ scripts/change_url | 12 ++---- scripts/config | 21 ++++------ scripts/install | 28 +++++-------- scripts/remove | 12 ++---- scripts/restore | 27 +++++-------- scripts/upgrade | 40 ++++++------------- sources/patches/.gitignore | 2 - 11 files changed, 54 insertions(+), 124 deletions(-) rename sources/extra_files/app/.gitignore => .gitignore (54%) delete mode 100644 sources/patches/.gitignore diff --git a/sources/extra_files/app/.gitignore b/.gitignore similarity index 54% rename from sources/extra_files/app/.gitignore rename to .gitignore index 783a4ae..8f144f3 100644 --- a/sources/extra_files/app/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *~ *.sw[op] +.DS_Store diff --git a/manifest.toml b/manifest.toml index b60d15e..cc513ae 100644 --- a/manifest.toml +++ b/manifest.toml @@ -16,7 +16,8 @@ demo = "https://hydrogen.element.io/" code = "https://github.com/vector-im/hydrogen-web" [integration] -yunohost = ">= 11.2.27" +yunohost = ">= 11.2.18" +helpers_version = "2.1" architectures = "all" multi_instance = true @@ -57,6 +58,7 @@ ram.runtime = "50M" [resources.system_user] [resources.install_dir] + group = "www-data:r-x" [resources.permissions] main.url = "/" diff --git a/scripts/_common.sh b/scripts/_common.sh index 944a65e..3d7f008 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,17 +1,5 @@ #!/bin/bash #================================================= -# COMMON VARIABLES -#================================================= - -#================================================= -# PERSONAL HELPERS -#================================================= - -#================================================= -# EXPERIMENTAL HELPERS -#================================================= - -#================================================= -# FUTURE OFFICIAL HELPERS +# COMMON VARIABLES AND CUSTOM HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index 52eea5b..af443d9 100755 --- a/scripts/backup +++ b/scripts/backup @@ -1,34 +1,25 @@ #!/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" #================================================= # 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 4ba8cf7..39d37fc 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -1,23 +1,17 @@ #!/bin/bash -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers #================================================= # 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 #================================================= # 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/config b/scripts/config index b9e79f8..b32e1fe 100644 --- a/scripts/config +++ b/scripts/config @@ -1,22 +1,18 @@ #!/bin/bash -# In simple cases, you don't need a config script. +# In simple cases, you don't need a config script. + +# With a simple config_panel.toml, you can write in the app settings, in the -# With a simple config_panel.toml, you can write in the app settings, in the # upstream config file or replace complete files (logo ...) and restart services. -# The config scripts allows you to go further, to handle specific cases +# The config scripts allows you to go further, to handle specific cases + # (validation of several interdependent fields, specific getter/setter for a value, # display dynamic informations or choices, pre-loading of config type .cube... ). -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source /usr/share/yunohost/helpers -ynh_abort_if_errors +#REMOVEME? ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS @@ -62,7 +58,6 @@ get__prices() { fi } - #================================================= # SPECIFIC VALIDATORS FOR TOML SHORT KEYS #================================================= @@ -89,14 +84,12 @@ set__prices() { echo "DONATION['$frequency']['$currency'] = '$price_id'" >> "$final_path/settings.py" done - + #--------------------------------------------- # IMPORTANT: to be able to upgrade properly, you have to saved the value in settings too #--------------------------------------------- ynh_app_setting_set $app prices $prices } -#================================================= -# GENERIC FINALIZATION #================================================= ynh_app_config_run $1 diff --git a/scripts/install b/scripts/install index 057b5b3..a256060 100755 --- a/scripts/install +++ b/scripts/install @@ -1,15 +1,8 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers - #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= @@ -19,34 +12,33 @@ default_server=$YNH_APP_ARG_DEFAULT_SERVER #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --weight=3 +ynh_script_progression "Setting up source files..." # Download, check integrity, uncompress and patch the source from app.src 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" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=2 +ynh_script_progression "Configuring NGINX web server..." # Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add_nginx #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 +ynh_script_progression "Adding $app's configuration..." -ynh_add_config --template="config.sample.json" --destination="$install_dir/config.json" +ynh_config_add --template="config.sample.json" --destination="$install_dir/config.json" -chmod 660 "$install_dir/config.json" -chown $app:www-data "$install_dir/config.json" +#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 660 "$install_dir/config.json" +#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:www-data "$install_dir/config.json" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last +ynh_script_progression "Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index e7f44d8..0b0795d 100755 --- a/scripts/remove +++ b/scripts/remove @@ -1,24 +1,18 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 +ynh_script_progression "Removing NGINX web server configuration..." # Remove the dedicated NGINX config -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 a5c61fd..958d9d3 100755 --- a/scripts/restore +++ b/scripts/restore @@ -1,11 +1,5 @@ #!/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 @@ -13,31 +7,28 @@ source /usr/share/yunohost/helpers #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." --weight=3 +ynh_script_progression "Restoring the app main directory..." -ynh_restore_file --origin_path="$install_dir" - -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +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" #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the NGINX configuration..." --weight=1 +ynh_script_progression "Restoring the NGINX configuration..." -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# GENERIC FINALIZATION #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +ynh_script_progression "Reloading NGINX web server..." -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 304d560..5559082 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,65 +1,51 @@ #!/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=1 +ynh_script_progression "Stopping $app's systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemctl --service=$app --action="stop" #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 +ynh_script_progression "Ensuring downward compatibility..." # If default_server doesn't exist, create it if [ -z "$default_server" ]; then default_server="matrix.org" - ynh_app_setting_set --app=$app --key=default_server --value=$default_server + ynh_app_setting_set --key=default_server --value=$default_server fi #================================================= # 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=3 + ynh_script_progression "Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --full_replace=1 + ynh_setup_source --dest_dir="$install_dir" --full_replace 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" #================================================= # NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 +ynh_script_progression "Upgrading NGINX web server configuration..." # Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add_nginx #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --last +ynh_script_progression "Upgrade of $app completed" diff --git a/sources/patches/.gitignore b/sources/patches/.gitignore deleted file mode 100644 index 783a4ae..0000000 --- a/sources/patches/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -*~ -*.sw[op] From d2f5be65bccbd7bcbc95dc828695e36a739436ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 20 Aug 2024 22:19:51 +0200 Subject: [PATCH 5/5] cleaning --- manifest.toml | 4 +--- scripts/install | 6 ------ scripts/restore | 2 -- scripts/upgrade | 20 +++----------------- 4 files changed, 4 insertions(+), 28 deletions(-) diff --git a/manifest.toml b/manifest.toml index cc513ae..6a0bf93 100644 --- a/manifest.toml +++ b/manifest.toml @@ -16,13 +16,11 @@ demo = "https://hydrogen.element.io/" code = "https://github.com/vector-im/hydrogen-web" [integration] -yunohost = ">= 11.2.18" +yunohost = ">= 11.2.27" helpers_version = "2.1" architectures = "all" multi_instance = true - ldap = false - sso = false disk = "50M" diff --git a/scripts/install b/scripts/install index a256060..4338706 100755 --- a/scripts/install +++ b/scripts/install @@ -17,14 +17,11 @@ ynh_script_progression "Setting up source files..." # Download, check integrity, uncompress and patch the source from app.src 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" #================================================= # NGINX CONFIGURATION #================================================= ynh_script_progression "Configuring NGINX web server..." -# Create a dedicated NGINX config ynh_config_add_nginx #================================================= @@ -34,9 +31,6 @@ ynh_script_progression "Adding $app's configuration..." ynh_config_add --template="config.sample.json" --destination="$install_dir/config.json" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 660 "$install_dir/config.json" -#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown $app:www-data "$install_dir/config.json" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 958d9d3..7d7319b 100755 --- a/scripts/restore +++ b/scripts/restore @@ -11,8 +11,6 @@ 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" #================================================= # RESTORE THE NGINX CONFIGURATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 5559082..74e449a 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -3,13 +3,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# STOP SYSTEMD SERVICE -#================================================= -ynh_script_progression "Stopping $app's systemd service..." - -ynh_systemctl --service=$app --action="stop" - #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -24,18 +17,11 @@ fi #================================================= # 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..." +# Download, check integrity, uncompress and patch the source from app.src +ynh_setup_source --dest_dir="$install_dir" --full_replace - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --full_replace -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" #================================================= # NGINX CONFIGURATION #=================================================