diff --git a/ALL_README.md b/ALL_README.md new file mode 100644 index 0000000..152f2e7 --- /dev/null +++ b/ALL_README.md @@ -0,0 +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) +- [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README.md b/README.md index b52dec0..b822453 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ @@ -9,25 +9,30 @@ It shall NOT be edited by hand. [![Install Firefish with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=firefish) -*[Lire ce readme en français.](./README_fr.md)* +*[Read this README in other languages.](./ALL_README.md)* -> *This package allows you to install Firefish 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 Firefish 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 -A greatly enhanced fork of Misskey with better UI/UX, security, features, and more! https://joinfirefish.org/ +A greatly enhanced fork of Misskey with better UI/UX, security, features, and more! Firefish is based off of Misskey, a powerful microblogging server on ActivityPub with features such as emoji reactions, a customizable web UI, rich chatting, and much more! Firefish adds many quality of life changes and bug fixes for users and instance admins alike. - +### ⚠️ PLEASE READ CAREFULLY ⚠️ + +**Firefish** requires **redis** version **7**, but YunoHost does not currently support this version. +Some functions will not be available if you install this package. + +I advise you to wait for the release of _Bookworm_ Debian 12. **Shipped version:** 1.0.5rc~ynh1 -**Demo:** https://joinfirefish.org/ +**Demo:** ## Screenshots @@ -35,21 +40,21 @@ A greatly enhanced fork of Misskey with better UI/UX, security, features, and mo ## 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/firefish_ynh/tree/testing). +Please send your pull request to the [`testing` branch](https://github.com/YunoHost-Apps/firefish_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/firefish_ynh/tree/testing --debug or sudo yunohost app upgrade firefish -u https://github.com/YunoHost-Apps/firefish_ynh/tree/testing --debug ``` -**More info regarding app packaging:** \ No newline at end of file +**More info regarding app packaging:** diff --git a/README_es.md b/README_es.md new file mode 100644 index 0000000..b47ad5e --- /dev/null +++ b/README_es.md @@ -0,0 +1,60 @@ + + +# Firefish para Yunohost + +[![Nivel de integración](https://dash.yunohost.org/integration/firefish.svg)](https://dash.yunohost.org/appci/app/firefish) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/firefish.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/firefish.maintain.svg) + +[![Instalar Firefish con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=firefish) + +*[Leer este README en otros idiomas.](./ALL_README.md)* + +> *Este paquete le permite instalarFirefish 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 greatly enhanced fork of Misskey with better UI/UX, security, features, and more! + + + Firefish is based off of Misskey, a powerful microblogging server on ActivityPub with features such as emoji reactions, a customizable web UI, rich chatting, and much more! + Firefish adds many quality of life changes and bug fixes for users and instance admins alike. + +### ⚠️ PLEASE READ CAREFULLY ⚠️ + +**Firefish** requires **redis** version **7**, but YunoHost does not currently support this version. +Some functions will not be available if you install this package. + +I advise you to wait for the release of _Bookworm_ Debian 12. + +**Versión actual:** 1.0.5rc~ynh1 + +**Demo:** + +## Capturas + +![Captura de Firefish](./doc/screenshots/screenshot-firefish.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/firefish_ynh/tree/testing + +Para probar la rama `testing`, sigue asÍ: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/firefish_ynh/tree/testing --debug +o +sudo yunohost app upgrade firefish -u https://github.com/YunoHost-Apps/firefish_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..43184e8 --- /dev/null +++ b/README_eu.md @@ -0,0 +1,60 @@ + + +# Firefish YunoHost-erako + +[![Integrazio maila](https://dash.yunohost.org/integration/firefish.svg)](https://dash.yunohost.org/appci/app/firefish) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/firefish.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/firefish.maintain.svg) + +[![Instalatu Firefish YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=firefish) + +*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)* + +> *Pakete honek Firefish YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.* +> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.* + +## Aurreikuspena + + +A greatly enhanced fork of Misskey with better UI/UX, security, features, and more! + + + Firefish is based off of Misskey, a powerful microblogging server on ActivityPub with features such as emoji reactions, a customizable web UI, rich chatting, and much more! + Firefish adds many quality of life changes and bug fixes for users and instance admins alike. + +### ⚠️ PLEASE READ CAREFULLY ⚠️ + +**Firefish** requires **redis** version **7**, but YunoHost does not currently support this version. +Some functions will not be available if you install this package. + +I advise you to wait for the release of _Bookworm_ Debian 12. + +**Paketatutako bertsioa:** 1.0.5rc~ynh1 + +**Demoa:** + +## Pantaila-argazkiak + +![Firefish(r)en pantaila-argazkia](./doc/screenshots/screenshot-firefish.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/firefish_ynh/tree/testing). + +`testing` abarra probatzeko, ondorengoa egin: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/firefish_ynh/tree/testing --debug +edo +sudo yunohost app upgrade firefish -u https://github.com/YunoHost-Apps/firefish_ynh/tree/testing --debug +``` + +**Informazio gehiago aplikazioaren paketatzeari buruz:** diff --git a/README_fr.md b/README_fr.md index 11891fe..f133774 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,6 +1,6 @@ # Firefish pour YunoHost @@ -9,23 +9,29 @@ It shall NOT be edited by hand. [![Installer Firefish avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=firefish) -*[Read this readme in english.](./README.md)* +*[Lire le README dans d'autres langues.](./ALL_README.md)* -> *Ce package vous permet d’installer Firefish 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 Firefish 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 -Un fork grandement amélioré de Misskey avec une meilleure UI/UX, sécurité, fonctionnalités, et plus encore ! https://joinfirefish.org/ +Un fork grandement amélioré de Misskey avec une meilleure UI/UX, sécurité, fonctionnalités, et plus encore ! Firefish est basé sur Misskey, un puissant serveur de microblogging sur ActivityPub avec des fonctionnalités telles que des réactions emoji, une interface web personnalisable, des discussions riches, et bien plus encore ! Firefish ajoute de nombreux changements de qualité de vie et des corrections de bogues pour les utilisateurs et les administrateurs d'instance. +### ⚠️ A LIRE ATTENTIVEMENT ⚠️ -**Version incluse :** 1.0.5rc~ynh1 +Attention **Firefish** nécessite la version **7** de **redis** hors YunoHost ne permet pas actuellement de bénéficier de cette version. +Certaines fonctions ne seront pas disponible si vous installez ce package. -**Démo :** https://joinfirefish.org/ +Je vous conseille d'attendre la sortie de _Bookworm_ Debian 12. + +**Version incluse :** 1.0.5rc~ynh1 + +**Démo :** ## Captures d’écran @@ -33,21 +39,21 @@ Un fork grandement amélioré de Misskey avec une meilleure UI/UX, sécurité, f ## 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/firefish_ynh/tree/testing). +Merci de faire vos pull request sur la [branche `testing`](https://github.com/YunoHost-Apps/firefish_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/firefish_ynh/tree/testing --debug ou sudo yunohost app upgrade firefish -u https://github.com/YunoHost-Apps/firefish_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..7d28817 --- /dev/null +++ b/README_gl.md @@ -0,0 +1,60 @@ + + +# Firefish para YunoHost + +[![Nivel de integración](https://dash.yunohost.org/integration/firefish.svg)](https://dash.yunohost.org/appci/app/firefish) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/firefish.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/firefish.maintain.svg) + +[![Instalar Firefish con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=firefish) + +*[Le este README en outros idiomas.](./ALL_README.md)* + +> *Este paquete permíteche instalar Firefish 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 greatly enhanced fork of Misskey with better UI/UX, security, features, and more! + + + Firefish is based off of Misskey, a powerful microblogging server on ActivityPub with features such as emoji reactions, a customizable web UI, rich chatting, and much more! + Firefish adds many quality of life changes and bug fixes for users and instance admins alike. + +### ⚠️ PLEASE READ CAREFULLY ⚠️ + +**Firefish** requires **redis** version **7**, but YunoHost does not currently support this version. +Some functions will not be available if you install this package. + +I advise you to wait for the release of _Bookworm_ Debian 12. + +**Versión proporcionada:** 1.0.5rc~ynh1 + +**Demo:** + +## Capturas de pantalla + +![Captura de pantalla de Firefish](./doc/screenshots/screenshot-firefish.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/firefish_ynh/tree/testing). + +Para probar a rama `testing`, procede deste xeito: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/firefish_ynh/tree/testing --debug +ou +sudo yunohost app upgrade firefish -u https://github.com/YunoHost-Apps/firefish_ynh/tree/testing --debug +``` + +**Máis info sobre o empaquetado da app:** diff --git a/README_it.md b/README_it.md new file mode 100644 index 0000000..6b0e12f --- /dev/null +++ b/README_it.md @@ -0,0 +1,55 @@ + + +# Firefish per YunoHost + +[![Livello di integrazione](https://dash.yunohost.org/integration/firefish.svg)](https://dash.yunohost.org/appci/app/firefish) ![Stato di funzionamento](https://ci-apps.yunohost.org/ci/badges/firefish.status.svg) ![Stato di manutenzione](https://ci-apps.yunohost.org/ci/badges/firefish.maintain.svg) + +[![Installa Firefish con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=firefish) + +*[Leggi questo README in altre lingue.](./ALL_README.md)* + +> *Questo pacchetto ti permette di installare Firefish su un server YunoHost in modo semplice e veloce.* +> *Se non hai YunoHost, consulta [la guida](https://yunohost.org/install) per imparare a installarlo.* + +## Panoramica + + +A greatly enhanced fork of Misskey with better UI/UX, security, features, and more! https://joinfirefish.org/ + + + Firefish is based off of Misskey, a powerful microblogging server on ActivityPub with features such as emoji reactions, a customizable web UI, rich chatting, and much more! + Firefish adds many quality of life changes and bug fixes for users and instance admins alike. + + + +**Versione pubblicata:** 1.0.5rc~ynh1 + +**Prova:** + +## Screenshot + +![Screenshot di Firefish](./doc/screenshots/screenshot-firefish.png) + +## Documentazione e risorse + +- Sito web ufficiale dell’app: +- Repository upstream del codice dell’app: +- Store di YunoHost: +- Segnala un problema: + +## Informazioni per sviluppatori + +Si prega di inviare la tua pull request alla [branch di `testing`](https://github.com/YunoHost-Apps/firefish_ynh/tree/testing). + +Per provare la branch di `testing`, si prega di procedere in questo modo: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/firefish_ynh/tree/testing --debug +o +sudo yunohost app upgrade firefish -u https://github.com/YunoHost-Apps/firefish_ynh/tree/testing --debug +``` + +**Maggiori informazioni riguardo il pacchetto di quest’app:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md new file mode 100644 index 0000000..75e2c4d --- /dev/null +++ b/README_zh_Hans.md @@ -0,0 +1,60 @@ + + +# YunoHost 上的 Firefish + +[![集成程度](https://dash.yunohost.org/integration/firefish.svg)](https://dash.yunohost.org/appci/app/firefish) ![工作状态](https://ci-apps.yunohost.org/ci/badges/firefish.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/firefish.maintain.svg) + +[![使用 YunoHost 安装 Firefish](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=firefish) + +*[阅读此 README 的其它语言版本。](./ALL_README.md)* + +> *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 Firefish。* +> *如果您还没有 YunoHost,请参阅[指南](https://yunohost.org/install)了解如何安装它。* + +## 概况 + + +A greatly enhanced fork of Misskey with better UI/UX, security, features, and more! + + + Firefish is based off of Misskey, a powerful microblogging server on ActivityPub with features such as emoji reactions, a customizable web UI, rich chatting, and much more! + Firefish adds many quality of life changes and bug fixes for users and instance admins alike. + +### ⚠️ PLEASE READ CAREFULLY ⚠️ + +**Firefish** requires **redis** version **7**, but YunoHost does not currently support this version. +Some functions will not be available if you install this package. + +I advise you to wait for the release of _Bookworm_ Debian 12. + +**分发版本:** 1.0.5rc~ynh1 + +**演示:** + +## 截图 + +![Firefish 的截图](./doc/screenshots/screenshot-firefish.png) + +## 文档与资源 + +- 官方应用网站: +- 上游应用代码库: +- YunoHost 商店: +- 报告 bug: + +## 开发者信息 + +请向 [`testing` 分支](https://github.com/YunoHost-Apps/firefish_ynh/tree/testing) 发送拉取请求。 + +如要尝试 `testing` 分支,请这样操作: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/firefish_ynh/tree/testing --debug +或 +sudo yunohost app upgrade firefish -u https://github.com/YunoHost-Apps/firefish_ynh/tree/testing --debug +``` + +**有关应用打包的更多信息:** diff --git a/doc/ADMIN.md b/doc/ADMIN.md new file mode 100644 index 0000000..0d92999 --- /dev/null +++ b/doc/ADMIN.md @@ -0,0 +1,3 @@ +### Important points to read before installing ⚠️ + +- The first account created will be an admin user and will have all the admin rights. 👨‍💻 diff --git a/doc/ADMIN_fr.md b/doc/ADMIN_fr.md new file mode 100644 index 0000000..e488485 --- /dev/null +++ b/doc/ADMIN_fr.md @@ -0,0 +1,3 @@ +### Points importants à lire avant l'installation ⚠️ + +- Le premier compte créé sera un utilisateur administrateur et disposera de tous les droits d'administrateur. 👨‍💻 diff --git a/doc/DESCRIPTION.md b/doc/DESCRIPTION.md index 7069104..6429b2b 100644 --- a/doc/DESCRIPTION.md +++ b/doc/DESCRIPTION.md @@ -1,7 +1,13 @@ -A greatly enhanced fork of Misskey with better UI/UX, security, features, and more! https://joinfirefish.org/ +A greatly enhanced fork of Misskey with better UI/UX, security, features, and more! Firefish is based off of Misskey, a powerful microblogging server on ActivityPub with features such as emoji reactions, a customizable web UI, rich chatting, and much more! Firefish adds many quality of life changes and bug fixes for users and instance admins alike. - + +### ⚠️ PLEASE READ CAREFULLY ⚠️ + +**Firefish** requires **redis** version **7**, but YunoHost does not currently support this version. +Some functions will not be available if you install this package. + +I advise you to wait for the release of _Bookworm_ Debian 12. \ No newline at end of file diff --git a/doc/DESCRIPTION_fr.md b/doc/DESCRIPTION_fr.md index 4d5dd74..00720ba 100644 --- a/doc/DESCRIPTION_fr.md +++ b/doc/DESCRIPTION_fr.md @@ -1,5 +1,12 @@ -Un fork grandement amélioré de Misskey avec une meilleure UI/UX, sécurité, fonctionnalités, et plus encore ! https://joinfirefish.org/ +Un fork grandement amélioré de Misskey avec une meilleure UI/UX, sécurité, fonctionnalités, et plus encore ! Firefish est basé sur Misskey, un puissant serveur de microblogging sur ActivityPub avec des fonctionnalités telles que des réactions emoji, une interface web personnalisable, des discussions riches, et bien plus encore ! Firefish ajoute de nombreux changements de qualité de vie et des corrections de bogues pour les utilisateurs et les administrateurs d'instance. + +### ⚠️ A LIRE ATTENTIVEMENT ⚠️ + +Attention **Firefish** nécessite la version **7** de **redis** hors YunoHost ne permet pas actuellement de bénéficier de cette version. +Certaines fonctions ne seront pas disponible si vous installez ce package. + +Je vous conseille d'attendre la sortie de _Bookworm_ Debian 12. \ No newline at end of file diff --git a/manifest.toml b/manifest.toml index 5d2c3fb..03fe20e 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,18 +5,18 @@ name = "Firefish" description.en = "Fork of Misskey with better UI/UX, security, features" description.fr = "Un fork de Misskey avec une meilleure interface utilisateur, la sécurité, les fonctionnalités" -version = "1.0.5rc~ynh1" +version = "20240206~ynh1" maintainers = ["oufmilo"] [upstream] license = "AGPL-3.0" -website = "https://joinfirefish.org/" -demo = "https://joinfirefish.org/" +website = "https://joinfirefish.org" +demo = "https://info.firefish.dev" code = "https://firefish.dev/firefish/firefish" [integration] -yunohost = ">= 11.1.14" +yunohost = ">= 11.2.12" architectures = "all" multi_instance = false ldap = "not_relevant" @@ -39,8 +39,8 @@ ram.runtime = "2G" [resources] [resources.sources.main] - url = "https://git.joinfirefish.org/firefish/firefish/-/archive/v1.0.5-rc/firefish-v1.0.5-rc.tar.gz" - sha256 = "b9b59899eaddcdd94e10974e34af083bd9a9c6228046dc4d4af0f3a669ccb7ef" + url = "https://firefish.dev/firefish/firefish/-/archive/v20240206/firefish-v20240206.tar.gz" + sha256 = "a0160364e49120a7448202ecba1a7cd61ff8c96f29a97bd7de329ce05957a4d0" autoupdate.strategy = "latest_gitlab_release" [resources.system_user] diff --git a/scripts/_common.sh b/scripts/_common.sh index 74f9474..ea76668 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# COMMON VARIABLES #================================================= # PHP APP SPECIFIC #================================================= @@ -15,45 +13,3 @@ NODEJS_VERSION="21" #================================================= # EXPERIMENTAL HELPERS #================================================= - -#================================================= -# REDIS HELPERS -#================================================= - -# get the first available redis database -# -# usage: ynh_redis_get_free_db -# | returns: the database number to use -ynh_redis_get_free_db() { - local result max db - result="$(redis-cli INFO keyspace)" - - # get the num - max=$(cat /etc/redis/redis.conf | grep ^databases | grep -Eow "[0-9]+") - - db=0 - # default Debian setting is 15 databases - for i in $(seq 0 "$max") - do - if ! echo "$result" | grep -q "db$i" - then - db=$i - break 1 - fi - db=-1 - done - - test "$db" -eq -1 && ynh_die --message="No available Redis databases..." - - echo "$db" -} - -# Create a master password and set up global settings -# Please always call this script in install and restore scripts -# -# usage: ynh_redis_remove_db database -# | arg: database - the database to erase -ynh_redis_remove_db() { - local db=$1 - redis-cli -n "$db" flushall -} diff --git a/scripts/backup b/scripts/backup index b88b274..b097ab9 100755 --- a/scripts/backup +++ b/scripts/backup @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -10,7 +8,6 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers - #================================================= # DECLARE DATA AND CONF FILES TO BACKUP #================================================= @@ -23,25 +20,17 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$install_dir" #================================================= -# BACKUP THE NGINX CONFIGURATION +# SYSTEM CONFIGURATION #================================================= ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# SPECIFIC BACKUP -#================================================= -# BACKUP LOGROTATE -#================================================= - ynh_backup --src_path="/etc/logrotate.d/$app" -#================================================= -# BACKUP SYSTEMD -#================================================= - ynh_backup --src_path="/etc/systemd/system/$app.service" +ynh_backup --src_path="/var/log/$app/" + #================================================= # BACKUP THE POSTGRESQL DATABASE #================================================= diff --git a/scripts/install b/scripts/install index bb65544..10f351f 100755 --- a/scripts/install +++ b/scripts/install @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -9,22 +7,12 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST -#================================================= - - - -#================================================= -# STANDARD MODIFICATIONS -#================================================= - #================================================= # INSTALL DEPENDENCIES #================================================= ynh_script_progression --message="Installing dependencies... This might take some time." --weight=3 -ynh_install_nodejs --nodejs_version=$NODEJS_VERSION +ynh_install_nodejs --nodejs_version="$NODEJS_VERSION" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE @@ -34,15 +22,9 @@ ynh_script_progression --message="Setting up source files..." --weight=3 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -chown -R $app:www-data "$install_dir" - -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=3 - -# Create a dedicated NGINX config -ynh_add_nginx_config +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= # ADD A CONFIGURATION @@ -53,13 +35,9 @@ ynh_script_progression --message="Adding a configuration file..." --weight=1 redis_db=$(ynh_redis_get_free_db) ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db" -ynh_add_config --template="../conf/default.yml" --destination="$install_dir/.config/default.yml" - -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +ynh_add_config --template="default.yml" --destination="$install_dir/.config/default.yml" chmod 400 "$install_dir/.config/default.yml" -chown $app:$app "$install_dir/.config/default.yml" +chown "$app:$app" "$install_dir/.config/default.yml" #================================================= # BUILD APP @@ -70,45 +48,36 @@ pushd "$install_dir" curl https://sh.rustup.rs -sSf | ynh_exec_warn_less ynh_exec_as $app sh -s -- -y export PATH="$install_dir/.cargo/bin:$PATH" ynh_use_nodejs - corepack enable - corepack prepare pnpm@latest --activate - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm install + env $ynh_node_load_PATH corepack enable + env $ynh_node_load_PATH COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack prepare pnpm@latest --activate + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH COREPACK_ENABLE_DOWNLOAD_PROMPT=0 pnpm install ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production pnpm build ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production ANTENNA_MIGRATION_SKIP=false ANTENNA_MIGRATION_COPY_LIMIT=0 ANTENNA_MIGRATION_READ_LIMIT=1000 pnpm run migrate popd #================================================= -# 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 env_path="$PATH" # Create a dedicated systemd config ynh_add_systemd_config - -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Configuring log rotation..." --weight=1 +yunohost service add "$app" --description="A interplanetary blogging platform" --log="/var/log/$app/$app.log" # Use logrotate to manage application logfile(s) ynh_use_logrotate -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="A interplanetary blogging platform" --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="All workers started" - +ynh_systemd_action --service_name="$app" --action="start" --log_path=systemd --line_match="All workers started" #================================================= # END OF SCRIPT diff --git a/scripts/remove b/scripts/remove index 1164548..27813a7 100755 --- a/scripts/remove +++ b/scripts/remove @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -9,51 +7,30 @@ 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 -#================================================= -# 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 LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Removing logrotate configuration..." --weight=1 - # Remove the app-specific logrotate config ynh_remove_logrotate -#================================================= -# REMOVE THE REDIS DATABASE -#================================================= -ynh_script_progression --message="Removing the redis database..." --weight=1 - -ynh_redis_remove_db "$redis_db" - -#================================================= -# REMOVE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 - # Remove the dedicated NGINX config ynh_remove_nginx_config +# Remove the log files +ynh_secure_remove --file="/var/log/$app" + +ynh_redis_remove_db "$redis_db" + #================================================= # REMOVE DEPENDENCIES #================================================= @@ -62,19 +39,6 @@ ynh_script_progression --message="Removing dependencies..." --weight=1 # Remove metapackage and its dependencies ynh_remove_nodejs -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE VARIOUS FILES -#================================================= - -# Remove the log files -ynh_secure_remove --file="/var/log/$app" - -#================================================= -# GENERIC FINALIZATION -#================================================= - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 66ab649..e84bb18 100755 --- a/scripts/restore +++ b/scripts/restore @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -11,8 +9,12 @@ source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers #================================================= -# STANDARD RESTORATION STEPS +# REINSTALL DEPENDENCIES #================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=5 + +# Define and install dependencies +ynh_install_nodejs --nodejs_version="$NODEJS_VERSION" #================================================= # RESTORE THE APP MAIN DIR @@ -22,14 +24,11 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$install_dir" #================================================= -# SPECIFIC RESTORATION +# RESTORE THE POSTGRESQL DATABASE #================================================= -# REINSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Reinstalling dependencies..." --weight=5 +ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1 -# Define and install dependencies -ynh_install_nodejs --nodejs_version=$NODEJS_VERSION +ynh_psql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql #================================================= # REINSTALL PNPM @@ -41,69 +40,35 @@ pushd "$install_dir" curl https://sh.rustup.rs -sSf | ynh_exec_warn_less ynh_exec_as $app sh -s -- -y export PATH="$install_dir/.cargo/bin:$PATH" ynh_use_nodejs - corepack enable - corepack prepare pnpm@latest --activate - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm install + env $ynh_node_load_PATH corepack enable + env $ynh_node_load_PATH COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack prepare pnpm@latest --activate + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH COREPACK_ENABLE_DOWNLOAD_PROMPT=0 pnpm install ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production pnpm build popd +# Set permissions to app files +chmod -R o-rwx "$install_dir" +chown -R "$app:www-data" "$install_dir" + #================================================= -# RESTORE THE NGINX CONFIGURATION +# RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# RESTORE THE POSTGRESQL DATABASE -#================================================= -ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=1 - -ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name - -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= - -# Set permissions to app files -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" - -#================================================= -# 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 - -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the logrotate configuration..." --weight=1 +systemctl enable "$app.service" --quiet +yunohost service add "$app" --description="A interplanetary blogging platform" --log="/var/log/$app/$app.log" ynh_restore_file --origin_path="/etc/logrotate.d/$app" #================================================= -# INTEGRATE SERVICE IN YUNOHOST +# RELOAD NGINX AND PHP-FPM OR THE APP SERVICE #================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 -yunohost service add $app --description="A interplanetary blogging platform" --log="/var/log/$app/$app.log" - -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 - -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="All workers started" - -#================================================= -# GENERIC FINALIZATION -#================================================= -# RELOAD NGINX -#================================================= -ynh_script_progression --message="Reloading NGINX web server..." --weight=1 +ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="All workers started" ynh_systemd_action --service_name=nginx --action=reload @@ -111,4 +76,4 @@ ynh_systemd_action --service_name=nginx --action=reload # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --last \ No newline at end of file +ynh_script_progression --message="Restoration completed for $app" --last diff --git a/scripts/upgrade b/scripts/upgrade index 61fd3d5..2f733ba 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,7 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= @@ -9,33 +7,14 @@ source _common.sh source /usr/share/yunohost/helpers - -#================================================= -# CHECK VERSION -#================================================= -ynh_script_progression --message="Checking version..." - -upgrade_type=$(ynh_check_app_version_changed) - -#================================================= -# ENSURE DOWNWARD COMPATIBILITY -#================================================= - #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping a systemd service..." --weight=1 +ynh_script_progression --message="Stopping $app's systemd service..." --weight=1 # Stop service before backup, to not loose message in case of failed upgrade and restore -ynh_systemd_action --service_name=$app --action="stop" --log_path=systemd +ynh_systemd_action --service_name="$app" --action="stop" --log_path=systemd -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=1 - -#================================================= -# STANDARD UPGRADE STEPS #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -43,46 +22,34 @@ ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 # If db_name doesn't exist, create it if [ -z "$db_name" ]; then - db_name=$(ynh_sanitize_dbid --db_name=$app) - ynh_app_setting_set --app=$app --key=db_name --value=$db_name + db_name=$(ynh_sanitize_dbid --db_name="$app") + ynh_app_setting_set --app="$app" --key=db_name --value="$db_name" fi # If install_dir doesn't exist, create it if [ -z "$install_dir" ]; then install_dir=/var/www/$app - ynh_app_setting_set --app=$app --key=install_dir --value=$install_dir + ynh_app_setting_set --app="$app" --key=install_dir --value="$install_dir" fi -#================================================= -# DOWNLOAD, CHECK AND UNPACK SOURCE -#================================================= - -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." - - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep=".config/default.yml" -fi - -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" - #================================================= # UPGRADE DEPENDENCIES #================================================= ynh_script_progression --message="Upgrading dependencies..." --weight=5 -ynh_install_nodejs --nodejs_version=$NODEJS_VERSION +ynh_install_nodejs --nodejs_version="$NODEJS_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..." -# 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" --keep=".config/default.yml" + +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R "$app:www-data" "$install_dir" #================================================= # BUILD APP @@ -93,45 +60,38 @@ pushd "$install_dir" curl https://sh.rustup.rs -sSf | ynh_exec_warn_less ynh_exec_as $app sh -s -- -y export PATH="$install_dir/.cargo/bin:$PATH" ynh_use_nodejs - corepack enable - corepack prepare pnpm@latest --activate - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm install - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production pnpm run build - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm run migrate + env $ynh_node_load_PATH corepack enable + env $ynh_node_load_PATH COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack prepare pnpm@latest --activate + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH COREPACK_ENABLE_DOWNLOAD_PROMPT=0 pnpm install + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH NODE_ENV=production pnpm run build + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH pnpm run migrate popd +chmod 750 "$install_dir" +chmod -R o-rwx "$install_dir" +chown -R "$app:www-data" "$install_dir" + #================================================= -# 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 -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_script_progression --message="Upgrading logrotate configuration..." --weight=1 +yunohost service add "$app" --description="A interplanetary blogging platform" --log="/var/log/$app/$app.log" # Use logrotate to manage app-specific logfile(s) ynh_use_logrotate --non-append -#================================================= -# INTEGRATE SERVICE IN YUNOHOST -#================================================= -ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 - -yunohost service add $app --description="A interplanetary blogging platform" --log="/var/log/$app/$app.log" - #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=1 - -ynh_systemd_action --service_name=$app --action="start" --log_path=systemd +ynh_script_progression --message="Starting $app's systemd service..." --weight=1 +ynh_systemd_action --service_name="$app" --action="start" --log_path=systemd #================================================= # END OF SCRIPT