From eb71df0383b81b74f0932ac11463d743c0107a8a Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Fri, 29 Mar 2024 07:04:44 +0100 Subject: [PATCH 01/10] Auto-update README --- ALL_README.md | 2 ++ README_gl.md | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++ README_it.md | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 168 insertions(+) create mode 100644 README_gl.md create mode 100644 README_it.md diff --git a/ALL_README.md b/ALL_README.md index d6e8f9c..3d6c579 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -2,3 +2,5 @@ - [Read the README in English](README.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) diff --git a/README_gl.md b/README_gl.md new file mode 100644 index 0000000..8b90d69 --- /dev/null +++ b/README_gl.md @@ -0,0 +1,83 @@ + + +# Glitch-Soc para YunoHost + +[![Nivel de integración](https://dash.yunohost.org/integration/glitchsoc.svg)](https://dash.yunohost.org/appci/app/glitchsoc) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/glitchsoc.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/glitchsoc.maintain.svg) + +[![Instalar Glitch-Soc con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=glitchsoc) + +*[Le este README en outros idiomas.](./ALL_README.md)* + +> *Este paquete permíteche instalar Glitch-Soc 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 + +`glitch-soc` is a friendly [fork](https://en.wikipedia.org/wiki/Fork_(software_development)) of the open-source social media software [Mastodon](https://joinmastodon.org/), with the aim of providing additional features at the risk of potentially less stable software. + +### What's different from Mastodon? + +`glitch-soc` adds a number of experimental features to Mastodon, such as: + +- Media improvements + - Images inside the CW spoiler + - fullwidth images + - scaling options +- Formatted toots +- Reply selection in lists +- Filter improvements +- Highlighting of misleading links +- Hiding follower count +- An app settings modal +- Collapsible toots +- Toot visibility icons +- Local-only toots +- Threaded mode +- `data-*` attributes on statuses +- Advanced theming via flavours+skins +- Doodle + +See more [on the documentation](https://glitch-soc.github.io/docs/). + + +**Versión proporcionada:** 2024.03.20~ynh1 +## Avisos / información importante + +⚠️ Glitch-Soc is beta software, and under active development. Use at your own risk! + +### Install + +* This app require a dedicated domain or subdomain. +* The user choosen during the installation is created in Glitch-Soc with admin rights. + +LDAP authentication and SSO are enabled. All YunoHost users can authenticate. + +We invite you to block remote malicious instances from the administration interface. You can also add text on your home page. + +### Known issues + +* When logged in with SSO, log-out from YunoHost's portal don't log-out from Glitch-Soc. See https://github.com/YunoHost/issues/issues/501 + +## 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/glitchsoc_ynh/tree/testing). + +Para probar a rama `testing`, procede deste xeito: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/glitchsoc_ynh/tree/testing --debug +ou +sudo yunohost app upgrade glitchsoc -u https://github.com/YunoHost-Apps/glitchsoc_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..77f32ac --- /dev/null +++ b/README_it.md @@ -0,0 +1,83 @@ + + +# Glitch-Soc per YunoHost + +[![Livello di integrazione](https://dash.yunohost.org/integration/glitchsoc.svg)](https://dash.yunohost.org/appci/app/glitchsoc) ![Stato di funzionamento](https://ci-apps.yunohost.org/ci/badges/glitchsoc.status.svg) ![Stato di manutenzione](https://ci-apps.yunohost.org/ci/badges/glitchsoc.maintain.svg) + +[![Installa Glitch-Soc con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=glitchsoc) + +*[Leggi questo README in altre lingue.](./ALL_README.md)* + +> *Questo pacchetto ti permette di installare Glitch-Soc 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 + +`glitch-soc` is a friendly [fork](https://en.wikipedia.org/wiki/Fork_(software_development)) of the open-source social media software [Mastodon](https://joinmastodon.org/), with the aim of providing additional features at the risk of potentially less stable software. + +### What's different from Mastodon? + +`glitch-soc` adds a number of experimental features to Mastodon, such as: + +- Media improvements + - Images inside the CW spoiler + - fullwidth images + - scaling options +- Formatted toots +- Reply selection in lists +- Filter improvements +- Highlighting of misleading links +- Hiding follower count +- An app settings modal +- Collapsible toots +- Toot visibility icons +- Local-only toots +- Threaded mode +- `data-*` attributes on statuses +- Advanced theming via flavours+skins +- Doodle + +See more [on the documentation](https://glitch-soc.github.io/docs/). + + +**Versione pubblicata:** 2024.03.20~ynh1 +## Attenzione/informazioni importanti + +⚠️ Glitch-Soc is beta software, and under active development. Use at your own risk! + +### Install + +* This app require a dedicated domain or subdomain. +* The user choosen during the installation is created in Glitch-Soc with admin rights. + +LDAP authentication and SSO are enabled. All YunoHost users can authenticate. + +We invite you to block remote malicious instances from the administration interface. You can also add text on your home page. + +### Known issues + +* When logged in with SSO, log-out from YunoHost's portal don't log-out from Glitch-Soc. See https://github.com/YunoHost/issues/issues/501 + +## 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/glitchsoc_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/glitchsoc_ynh/tree/testing --debug +o +sudo yunohost app upgrade glitchsoc -u https://github.com/YunoHost-Apps/glitchsoc_ynh/tree/testing --debug +``` + +**Maggiori informazioni riguardo il pacchetto di quest’app:** From df4eb69a201cffe94b2c1c1832d835c0f2a4300e Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sat, 6 Apr 2024 15:50:44 +0000 Subject: [PATCH 02/10] Auto-update READMEs --- ALL_README.md | 2 +- README.md | 2 +- README_eu.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ README_gl.md | 1 - 4 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 README_eu.md diff --git a/ALL_README.md b/ALL_README.md index 3d6c579..77b7509 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -1,6 +1,6 @@ # All available README files by language - [Read the README in English](README.md) +- [Irakurri README euskaraz](README_eu.md) - [Lire le README en français](README_fr.md) - [Le o README en galego](README_gl.md) -- [Leggi il “README” in italiano](README_it.md) diff --git a/README.md b/README.md index a5decd9..af0ec17 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ It shall NOT be edited by hand. [![Install Glitch-Soc with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=glitchsoc) -*[Read this README is other languages.](./ALL_README.md)* +*[Read this README in other languages.](./ALL_README.md)* > *This package allows you to install Glitch-Soc 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.* diff --git a/README_eu.md b/README_eu.md new file mode 100644 index 0000000..672b60f --- /dev/null +++ b/README_eu.md @@ -0,0 +1,68 @@ + + +# Glitch-Soc YunoHost-erako + +[![Integrazio maila](https://dash.yunohost.org/integration/glitchsoc.svg)](https://dash.yunohost.org/appci/app/glitchsoc) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/glitchsoc.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/glitchsoc.maintain.svg) + +[![Instalatu Glitch-Soc YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=glitchsoc) + +*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)* + +> *Pakete honek Glitch-Soc YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.* +> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.* + +## Aurreikuspena + +`glitch-soc` is a friendly [fork](https://en.wikipedia.org/wiki/Fork_(software_development)) of the open-source social media software [Mastodon](https://joinmastodon.org/), with the aim of providing additional features at the risk of potentially less stable software. + +⚠️ `glitch-soc` is beta software, and under active development. Use at your own risk! + +### What's different from Mastodon? + +`glitch-soc` adds a number of experimental features to Mastodon, such as: + +- Media improvements + - Images inside the CW spoiler + - fullwidth images + - scaling options +- Formatted toots +- Reply selection in lists +- Filter improvements +- Highlighting of misleading links +- Hiding follower count +- An app settings modal +- Collapsible toots +- Toot visibility icons +- Local-only toots +- Threaded mode +- `data-*` attributes on statuses +- Advanced theming via flavours+skins +- Doodle + +See more [on the documentation](https://glitch-soc.github.io/docs/). + + +**Paketatutako bertsioa:** 2024.03.20~ynh1 +## 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/glitchsoc_ynh/tree/testing). + +`testing` abarra probatzeko, ondorengoa egin: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/glitchsoc_ynh/tree/testing --debug +edo +sudo yunohost app upgrade glitchsoc -u https://github.com/YunoHost-Apps/glitchsoc_ynh/tree/testing --debug +``` + +**Informazio gehiago aplikazioaren paketatzeari buruz:** diff --git a/README_gl.md b/README_gl.md index c3f35a9..66f512c 100644 --- a/README_gl.md +++ b/README_gl.md @@ -46,7 +46,6 @@ See more [on the documentation](https://glitch-soc.github.io/docs/). **Versión proporcionada:** 2024.03.20~ynh1 - ## Documentación e recursos - Web oficial da app: From 86bea30a811bd8c1a334d76d503b61da8568be30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Fri, 17 May 2024 23:52:48 +0200 Subject: [PATCH 03/10] Fix corepack install --- scripts/install | 3 ++- scripts/restore | 2 ++ scripts/upgrade | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 71dff90..feb3521 100644 --- a/scripts/install +++ b/scripts/install @@ -130,7 +130,8 @@ pushd "$install_dir/live" # Building assets ynh_use_nodejs corepack enable - yarn install + # This export might be removed in yunohost 12 + COREPACK_ENABLE_DOWNLOAD_PROMPT=0 yarn install echo "SAFETY_ASSURED=1">> "$config" ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production "$ynh_ruby_load_path" "$ld_preload" bin/bundle exec rails db:migrate --quiet ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production "$ynh_ruby_load_path" "$ld_preload" bin/bundle exec rails assets:precompile --quiet diff --git a/scripts/restore b/scripts/restore index 91b2c97..2fe6f1d 100644 --- a/scripts/restore +++ b/scripts/restore @@ -66,6 +66,8 @@ pushd "$install_dir/live" ynh_exec_as "$app" "$ynh_ruby_load_path" "$ld_preload" bin/bundle install --redownload -j"$(nproc)" ynh_use_nodejs + # This export might be removed in yunohost 12 + export COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack enable yarn install popd diff --git a/scripts/upgrade b/scripts/upgrade index e16e80c..6840ba9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -103,6 +103,8 @@ pushd "$install_dir/live" ynh_exec_as "$app" "$ynh_ruby_load_path" "$ld_preload" bin/bundle config set force_ruby_platform true --quiet ynh_exec_as "$app" "$ynh_ruby_load_path" "$ld_preload" bin/bundle install -j$(getconf _NPROCESSORS_ONLN) ynh_use_nodejs + # This export might be removed in yunohost 12 + export COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack enable yarn install if [ -d "$install_dir/live/public/assets" ]; then From e165f55e88861dde4ce8a8acef66a5315fa8c3ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 19 May 2024 12:49:01 +0200 Subject: [PATCH 04/10] Fix install corepack --- scripts/install | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index feb3521..0d65195 100644 --- a/scripts/install +++ b/scripts/install @@ -133,12 +133,12 @@ pushd "$install_dir/live" # This export might be removed in yunohost 12 COREPACK_ENABLE_DOWNLOAD_PROMPT=0 yarn install echo "SAFETY_ASSURED=1">> "$config" - ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production "$ynh_ruby_load_path" "$ld_preload" bin/bundle exec rails db:migrate --quiet - ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production "$ynh_ruby_load_path" "$ld_preload" bin/bundle exec rails assets:precompile --quiet + ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" "$ld_preload" bin/bundle exec rails db:migrate --quiet + ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" "$ld_preload" bin/bundle exec rails assets:precompile --quiet # Generate vapid keys - ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production "$ynh_ruby_load_path" "$ld_preload" bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt + ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" "$ld_preload" bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt # Create the first admin user - ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production "$ynh_ruby_load_path" "$ld_preload" bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role=Owner > /dev/null + ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" "$ld_preload" bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role=Owner > /dev/null popd # Re-generate config with vapid keys From ce6f2a4f88acede1b47563a31497ddb32754fbd6 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 19 May 2024 10:49:08 +0000 Subject: [PATCH 05/10] Auto-update READMEs --- ALL_README.md | 2 ++ README_es.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++ README_zh_Hans.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 138 insertions(+) create mode 100644 README_es.md create mode 100644 README_zh_Hans.md diff --git a/ALL_README.md b/ALL_README.md index 77b7509..8938aae 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -1,6 +1,8 @@ # All available README files by language - [Read the README in English](README.md) +- [Lee el README en español](README_es.md) - [Irakurri README euskaraz](README_eu.md) - [Lire le README en français](README_fr.md) - [Le o README en galego](README_gl.md) +- [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README_es.md b/README_es.md new file mode 100644 index 0000000..aa5b6d0 --- /dev/null +++ b/README_es.md @@ -0,0 +1,68 @@ + + +# Glitch-Soc para Yunohost + +[![Nivel de integración](https://dash.yunohost.org/integration/glitchsoc.svg)](https://dash.yunohost.org/appci/app/glitchsoc) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/glitchsoc.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/glitchsoc.maintain.svg) + +[![Instalar Glitch-Soc con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=glitchsoc) + +*[Leer este README en otros idiomas.](./ALL_README.md)* + +> *Este paquete le permite instalarGlitch-Soc 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 + +`glitch-soc` is a friendly [fork](https://en.wikipedia.org/wiki/Fork_(software_development)) of the open-source social media software [Mastodon](https://joinmastodon.org/), with the aim of providing additional features at the risk of potentially less stable software. + +⚠️ `glitch-soc` is beta software, and under active development. Use at your own risk! + +### What's different from Mastodon? + +`glitch-soc` adds a number of experimental features to Mastodon, such as: + +- Media improvements + - Images inside the CW spoiler + - fullwidth images + - scaling options +- Formatted toots +- Reply selection in lists +- Filter improvements +- Highlighting of misleading links +- Hiding follower count +- An app settings modal +- Collapsible toots +- Toot visibility icons +- Local-only toots +- Threaded mode +- `data-*` attributes on statuses +- Advanced theming via flavours+skins +- Doodle + +See more [on the documentation](https://glitch-soc.github.io/docs/). + + +**Versión actual:** 2024.03.20~ynh1 +## 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/glitchsoc_ynh/tree/testing + +Para probar la rama `testing`, sigue asÍ: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/glitchsoc_ynh/tree/testing --debug +o +sudo yunohost app upgrade glitchsoc -u https://github.com/YunoHost-Apps/glitchsoc_ynh/tree/testing --debug +``` + +**Mas informaciones sobre el empaquetado de aplicaciones:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md new file mode 100644 index 0000000..71dab47 --- /dev/null +++ b/README_zh_Hans.md @@ -0,0 +1,68 @@ + + +# YunoHost 上的 Glitch-Soc + +[![集成程度](https://dash.yunohost.org/integration/glitchsoc.svg)](https://dash.yunohost.org/appci/app/glitchsoc) ![工作状态](https://ci-apps.yunohost.org/ci/badges/glitchsoc.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/glitchsoc.maintain.svg) + +[![使用 YunoHost 安装 Glitch-Soc](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=glitchsoc) + +*[阅读此 README 的其它语言版本。](./ALL_README.md)* + +> *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 Glitch-Soc。* +> *如果您还没有 YunoHost,请参阅[指南](https://yunohost.org/install)了解如何安装它。* + +## 概况 + +`glitch-soc` is a friendly [fork](https://en.wikipedia.org/wiki/Fork_(software_development)) of the open-source social media software [Mastodon](https://joinmastodon.org/), with the aim of providing additional features at the risk of potentially less stable software. + +⚠️ `glitch-soc` is beta software, and under active development. Use at your own risk! + +### What's different from Mastodon? + +`glitch-soc` adds a number of experimental features to Mastodon, such as: + +- Media improvements + - Images inside the CW spoiler + - fullwidth images + - scaling options +- Formatted toots +- Reply selection in lists +- Filter improvements +- Highlighting of misleading links +- Hiding follower count +- An app settings modal +- Collapsible toots +- Toot visibility icons +- Local-only toots +- Threaded mode +- `data-*` attributes on statuses +- Advanced theming via flavours+skins +- Doodle + +See more [on the documentation](https://glitch-soc.github.io/docs/). + + +**分发版本:** 2024.03.20~ynh1 +## 文档与资源 + +- 官方应用网站: +- 上游应用代码库: +- YunoHost 商店: +- 报告 bug: + +## 开发者信息 + +请向 [`testing` 分支](https://github.com/YunoHost-Apps/glitchsoc_ynh/tree/testing) 发送拉取请求。 + +如要尝试 `testing` 分支,请这样操作: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/glitchsoc_ynh/tree/testing --debug +或 +sudo yunohost app upgrade glitchsoc -u https://github.com/YunoHost-Apps/glitchsoc_ynh/tree/testing --debug +``` + +**有关应用打包的更多信息:** From 3a6f96592a0785c40e22e4ef17fdc44c9c7c70f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 19 May 2024 12:49:35 +0200 Subject: [PATCH 06/10] Fix upgrade corepack --- scripts/upgrade | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 6840ba9..fde20b2 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -108,11 +108,11 @@ pushd "$install_dir/live" corepack enable yarn install if [ -d "$install_dir/live/public/assets" ]; then - ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production "$ynh_ruby_load_path" "$ld_preload" bin/bundle exec rails assets:clean + ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" "$ld_preload" bin/bundle exec rails assets:clean fi - ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production "$ynh_ruby_load_path" "$ld_preload" bin/bundle exec rails assets:precompile - ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production "$ynh_ruby_load_path" "$ld_preload" bin/bundle exec rails db:migrate - ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production "$ynh_ruby_load_path" "$ld_preload" bin/tootctl cache clear + ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" "$ld_preload" bin/bundle exec rails assets:precompile + ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" "$ld_preload" bin/bundle exec rails db:migrate + ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" "$ld_preload" bin/tootctl cache clear popd #================================================= @@ -122,8 +122,8 @@ ynh_script_progression --message="Applying migrations..." --weight=1 pushd "$install_dir/live" ynh_use_ruby - ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production "$ynh_ruby_load_path" "$ld_preload" bin/bundle exec rails db:migrate - ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production "$ynh_ruby_load_path" "$ld_preload" bin/tootctl cache clear + ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" "$ld_preload" bin/bundle exec rails db:migrate + ynh_exec_warn_less ynh_exec_as "$app" RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 "$ynh_ruby_load_path" "$ld_preload" bin/tootctl cache clear popd #================================================= From b076e282fef4717933e84786ce1ed45e0540909a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 19 May 2024 20:52:58 +0200 Subject: [PATCH 07/10] Fix install and upgrade stuck on corepack yarn install --- scripts/install | 12 ++++++------ scripts/restore | 2 +- scripts/upgrade | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/install b/scripts/install index a31966d..3635e61 100644 --- a/scripts/install +++ b/scripts/install @@ -228,13 +228,13 @@ pushd "$final_path/live" ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle install -j$(getconf _NPROCESSORS_ONLN) ynh_use_nodejs corepack enable - yarn install + COREPACK_ENABLE_DOWNLOAD_PROMPT=0 yarn install echo "SAFETY_ASSURED=1">> $config - ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails db:setup --quiet - ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:precompile --quiet - ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt - ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role="Owner" > /dev/null - ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/tootctl accounts modify "$admin" --approve + ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 $ynh_ruby_load_path $ld_preload bin/bundle exec rails db:setup --quiet + ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:precompile --quiet + ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 $ynh_ruby_load_path $ld_preload bin/bundle exec rake mastodon:webpush:generate_vapid_key > key.txt + ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 $ynh_ruby_load_path $ld_preload bin/tootctl accounts create "$admin" --email="$admin_mail" --confirmed --role="Owner" > /dev/null + ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 $ynh_ruby_load_path $ld_preload bin/tootctl accounts modify "$admin" --approve popd vapid_private_key=$(grep -oP "VAPID_PRIVATE_KEY=\K.+" "$final_path/live/key.txt") diff --git a/scripts/restore b/scripts/restore index 81931c2..80a43cd 100644 --- a/scripts/restore +++ b/scripts/restore @@ -123,7 +123,7 @@ ynh_script_progression --message="Installing Yarn dependencies..." --weight=10 pushd "$final_path/live" corepack enable - yarn install + COREPACK_ENABLE_DOWNLOAD_PROMPT=0 yarn install popd #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 71bfeb3..ac27aed 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -243,7 +243,7 @@ then fi rsync -a "$config" "$tmpdir/." ynh_secure_remove --file="$final_path/live" - + ynh_setup_source --dest_dir="$final_path/live" if [ -d "$final_path/system.tmp" ]; then @@ -341,13 +341,13 @@ then ynh_exec_as $app $ynh_ruby_load_path $ld_preload bin/bundle install -j$(getconf _NPROCESSORS_ONLN) ynh_use_nodejs corepack enable - yarn install + COREPACK_ENABLE_DOWNLOAD_PROMPT=0 yarn install if [ -d "$final_path/live/public/assets" ]; then - ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:clean + ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:clean fi - ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:precompile - ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/bundle exec rails db:migrate - ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production $ynh_ruby_load_path $ld_preload bin/tootctl cache clear + ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 $ynh_ruby_load_path $ld_preload bin/bundle exec rails assets:precompile + ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 $ynh_ruby_load_path $ld_preload bin/bundle exec rails db:migrate + ynh_exec_warn_less ynh_exec_as $app RAILS_ENV=production COREPACK_ENABLE_DOWNLOAD_PROMPT=0 $ynh_ruby_load_path $ld_preload bin/tootctl cache clear popd fi From 66374406dc8d8de7d6372b95db2c30cebf7a3a47 Mon Sep 17 00:00:00 2001 From: yunohost-bot Date: Sun, 19 May 2024 18:53:06 +0000 Subject: [PATCH 08/10] Auto-update READMEs --- ALL_README.md | 4 ++- README.md | 2 +- README_es.md | 83 +++++++++++++++++++++++++++++++++++++++++++++++ README_eu.md | 83 +++++++++++++++++++++++++++++++++++++++++++++++ README_zh_Hans.md | 83 +++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 253 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..8938aae 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -1,6 +1,8 @@ # All available README files by language - [Read the README in English](README.md) +- [Lee el README en español](README_es.md) +- [Irakurri README euskaraz](README_eu.md) - [Lire le README en français](README_fr.md) - [Le o README en galego](README_gl.md) -- [Leggi il “README” in italiano](README_it.md) +- [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README.md b/README.md index b59852e..a647c1f 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ It shall NOT be edited by hand. [![Install Glitch-Soc with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=glitchsoc) -*[Read this README is other languages.](./ALL_README.md)* +*[Read this README in other languages.](./ALL_README.md)* > *This package allows you to install Glitch-Soc 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.* diff --git a/README_es.md b/README_es.md new file mode 100644 index 0000000..e085187 --- /dev/null +++ b/README_es.md @@ -0,0 +1,83 @@ + + +# Glitch-Soc para Yunohost + +[![Nivel de integración](https://dash.yunohost.org/integration/glitchsoc.svg)](https://dash.yunohost.org/appci/app/glitchsoc) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/glitchsoc.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/glitchsoc.maintain.svg) + +[![Instalar Glitch-Soc con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=glitchsoc) + +*[Leer este README en otros idiomas.](./ALL_README.md)* + +> *Este paquete le permite instalarGlitch-Soc 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 + +`glitch-soc` is a friendly [fork](https://en.wikipedia.org/wiki/Fork_(software_development)) of the open-source social media software [Mastodon](https://joinmastodon.org/), with the aim of providing additional features at the risk of potentially less stable software. + +### What's different from Mastodon? + +`glitch-soc` adds a number of experimental features to Mastodon, such as: + +- Media improvements + - Images inside the CW spoiler + - fullwidth images + - scaling options +- Formatted toots +- Reply selection in lists +- Filter improvements +- Highlighting of misleading links +- Hiding follower count +- An app settings modal +- Collapsible toots +- Toot visibility icons +- Local-only toots +- Threaded mode +- `data-*` attributes on statuses +- Advanced theming via flavours+skins +- Doodle + +See more [on the documentation](https://glitch-soc.github.io/docs/). + + +**Versión actual:** 2024.03.20~ynh1 +## informaciones importantes + +⚠️ Glitch-Soc is beta software, and under active development. Use at your own risk! + +### Install + +* This app require a dedicated domain or subdomain. +* The user choosen during the installation is created in Glitch-Soc with admin rights. + +LDAP authentication and SSO are enabled. All YunoHost users can authenticate. + +We invite you to block remote malicious instances from the administration interface. You can also add text on your home page. + +### Known issues + +* When logged in with SSO, log-out from YunoHost's portal don't log-out from Glitch-Soc. See https://github.com/YunoHost/issues/issues/501 + +## 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/glitchsoc_ynh/tree/testing + +Para probar la rama `testing`, sigue asÍ: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/glitchsoc_ynh/tree/testing --debug +o +sudo yunohost app upgrade glitchsoc -u https://github.com/YunoHost-Apps/glitchsoc_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..3339501 --- /dev/null +++ b/README_eu.md @@ -0,0 +1,83 @@ + + +# Glitch-Soc YunoHost-erako + +[![Integrazio maila](https://dash.yunohost.org/integration/glitchsoc.svg)](https://dash.yunohost.org/appci/app/glitchsoc) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/glitchsoc.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/glitchsoc.maintain.svg) + +[![Instalatu Glitch-Soc YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=glitchsoc) + +*[Irakurri README hau beste hizkuntzatan.](./ALL_README.md)* + +> *Pakete honek Glitch-Soc YunoHost zerbitzari batean azkar eta zailtasunik gabe instalatzea ahalbidetzen dizu.* +> *YunoHost ez baduzu, kontsultatu [gida](https://yunohost.org/install) nola instalatu ikasteko.* + +## Aurreikuspena + +`glitch-soc` is a friendly [fork](https://en.wikipedia.org/wiki/Fork_(software_development)) of the open-source social media software [Mastodon](https://joinmastodon.org/), with the aim of providing additional features at the risk of potentially less stable software. + +### What's different from Mastodon? + +`glitch-soc` adds a number of experimental features to Mastodon, such as: + +- Media improvements + - Images inside the CW spoiler + - fullwidth images + - scaling options +- Formatted toots +- Reply selection in lists +- Filter improvements +- Highlighting of misleading links +- Hiding follower count +- An app settings modal +- Collapsible toots +- Toot visibility icons +- Local-only toots +- Threaded mode +- `data-*` attributes on statuses +- Advanced theming via flavours+skins +- Doodle + +See more [on the documentation](https://glitch-soc.github.io/docs/). + + +**Paketatutako bertsioa:** 2024.03.20~ynh1 +## Ezespena / informazio garrantzitsua + +⚠️ Glitch-Soc is beta software, and under active development. Use at your own risk! + +### Install + +* This app require a dedicated domain or subdomain. +* The user choosen during the installation is created in Glitch-Soc with admin rights. + +LDAP authentication and SSO are enabled. All YunoHost users can authenticate. + +We invite you to block remote malicious instances from the administration interface. You can also add text on your home page. + +### Known issues + +* When logged in with SSO, log-out from YunoHost's portal don't log-out from Glitch-Soc. See https://github.com/YunoHost/issues/issues/501 + +## 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/glitchsoc_ynh/tree/testing). + +`testing` abarra probatzeko, ondorengoa egin: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/glitchsoc_ynh/tree/testing --debug +edo +sudo yunohost app upgrade glitchsoc -u https://github.com/YunoHost-Apps/glitchsoc_ynh/tree/testing --debug +``` + +**Informazio gehiago aplikazioaren paketatzeari buruz:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md new file mode 100644 index 0000000..35d1e8c --- /dev/null +++ b/README_zh_Hans.md @@ -0,0 +1,83 @@ + + +# YunoHost 上的 Glitch-Soc + +[![集成程度](https://dash.yunohost.org/integration/glitchsoc.svg)](https://dash.yunohost.org/appci/app/glitchsoc) ![工作状态](https://ci-apps.yunohost.org/ci/badges/glitchsoc.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/glitchsoc.maintain.svg) + +[![使用 YunoHost 安装 Glitch-Soc](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=glitchsoc) + +*[阅读此 README 的其它语言版本。](./ALL_README.md)* + +> *通过此软件包,您可以在 YunoHost 服务器上快速、简单地安装 Glitch-Soc。* +> *如果您还没有 YunoHost,请参阅[指南](https://yunohost.org/install)了解如何安装它。* + +## 概况 + +`glitch-soc` is a friendly [fork](https://en.wikipedia.org/wiki/Fork_(software_development)) of the open-source social media software [Mastodon](https://joinmastodon.org/), with the aim of providing additional features at the risk of potentially less stable software. + +### What's different from Mastodon? + +`glitch-soc` adds a number of experimental features to Mastodon, such as: + +- Media improvements + - Images inside the CW spoiler + - fullwidth images + - scaling options +- Formatted toots +- Reply selection in lists +- Filter improvements +- Highlighting of misleading links +- Hiding follower count +- An app settings modal +- Collapsible toots +- Toot visibility icons +- Local-only toots +- Threaded mode +- `data-*` attributes on statuses +- Advanced theming via flavours+skins +- Doodle + +See more [on the documentation](https://glitch-soc.github.io/docs/). + + +**分发版本:** 2024.03.20~ynh1 +## 免责声明 / 重要信息 + +⚠️ Glitch-Soc is beta software, and under active development. Use at your own risk! + +### Install + +* This app require a dedicated domain or subdomain. +* The user choosen during the installation is created in Glitch-Soc with admin rights. + +LDAP authentication and SSO are enabled. All YunoHost users can authenticate. + +We invite you to block remote malicious instances from the administration interface. You can also add text on your home page. + +### Known issues + +* When logged in with SSO, log-out from YunoHost's portal don't log-out from Glitch-Soc. See https://github.com/YunoHost/issues/issues/501 + +## 文档与资源 + +- 官方应用网站: +- 上游应用代码库: +- YunoHost 商店: +- 报告 bug: + +## 开发者信息 + +请向 [`testing` 分支](https://github.com/YunoHost-Apps/glitchsoc_ynh/tree/testing) 发送拉取请求。 + +如要尝试 `testing` 分支,请这样操作: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/glitchsoc_ynh/tree/testing --debug +或 +sudo yunohost app upgrade glitchsoc -u https://github.com/YunoHost-Apps/glitchsoc_ynh/tree/testing --debug +``` + +**有关应用打包的更多信息:** From 0f6dcafdb197e6e6cd56fc08fe8aafe55351137e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Sun, 19 May 2024 21:27:16 +0200 Subject: [PATCH 09/10] Update test_upgrade_from to fixed packagingv1 version --- tests.toml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests.toml b/tests.toml index 2a7f5e2..dcee0f5 100644 --- a/tests.toml +++ b/tests.toml @@ -21,8 +21,9 @@ test_format = 1.0 # Commits to test upgrade from # ------------------------------- - test_upgrade_from.e6e04a0.name = "Upgrade from 2024.02.18~ynh1" - test_upgrade_from.e6e04a0.args.domain="domain.tld" - test_upgrade_from.e6e04a0.args.is_public=1 - test_upgrade_from.e6e04a0.args.admin="john" - test_upgrade_from.e6e04a0.args.language="fr_FR" + [default.test_upgrade_from.c965f14cf660fd5c48c7b191c054a1177f42fbf4] + name = "Last packaging v1 version" + args.domain = "domain.tld" + args.is_public = 1 + args.admin = "john" + args.language = "fr_FR" From bf4f7ffd7cda7729df926d679cea650da1d22bd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Mon, 20 May 2024 23:32:37 +0200 Subject: [PATCH 10/10] Use standard ruby helpers --- manifest.toml | 2 +- scripts/install | 1 - scripts/remove | 1 - scripts/restore | 1 - scripts/upgrade | 1 - scripts/ynh_install_ruby__2 | 310 ------------------------------------ 6 files changed, 1 insertion(+), 315 deletions(-) delete mode 100644 scripts/ynh_install_ruby__2 diff --git a/manifest.toml b/manifest.toml index b31f6a9..73d6475 100644 --- a/manifest.toml +++ b/manifest.toml @@ -17,7 +17,7 @@ website = "https://glitch-soc.github.io/docs/" code = "https://github.com/glitch-soc/mastodon" [integration] -yunohost = ">= 11.2" +yunohost = ">= 11.2.12" architectures = "all" multi_instance = true diff --git a/scripts/install b/scripts/install index 0d65195..4bb0e0a 100644 --- a/scripts/install +++ b/scripts/install @@ -5,7 +5,6 @@ #================================================= source _common.sh -source ynh_install_ruby__2 source ynh_add_swap source /usr/share/yunohost/helpers diff --git a/scripts/remove b/scripts/remove index 17c297f..fa276d6 100644 --- a/scripts/remove +++ b/scripts/remove @@ -5,7 +5,6 @@ #================================================= source _common.sh -source ynh_install_ruby__2 source ynh_add_swap source /usr/share/yunohost/helpers diff --git a/scripts/restore b/scripts/restore index 229bd20..d322f36 100644 --- a/scripts/restore +++ b/scripts/restore @@ -6,7 +6,6 @@ # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh -source ../settings/scripts/ynh_install_ruby__2 source ../settings/scripts/ynh_add_swap source /usr/share/yunohost/helpers diff --git a/scripts/upgrade b/scripts/upgrade index fde20b2..7cd5c97 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -5,7 +5,6 @@ #================================================= source _common.sh -source ynh_install_ruby__2 source ynh_add_swap source /usr/share/yunohost/helpers diff --git a/scripts/ynh_install_ruby__2 b/scripts/ynh_install_ruby__2 deleted file mode 100644 index 521a182..0000000 --- a/scripts/ynh_install_ruby__2 +++ /dev/null @@ -1,310 +0,0 @@ -#!/bin/bash - -ynh_ruby_try_bash_extension() { - if [ -x src/configure ]; then - src/configure && make -C src || { - ynh_print_info --message="Optional bash extension failed to build, but things will still work normally." - } - fi -} - -rbenv_install_dir="/opt/rbenv" -ruby_version_path="$rbenv_install_dir/versions" -# RBENV_ROOT is the directory of rbenv, it needs to be loaded as a environment variable. -export RBENV_ROOT="$rbenv_install_dir" -export rbenv_root="$rbenv_install_dir" - -ruby_dependencies="" -build_ruby_dependencies="libjemalloc-dev curl build-essential libreadline-dev zlib1g-dev libsqlite3-dev libssl-dev libxml2-dev libxslt-dev autoconf automake bison libtool" -pkg_dependencies="$pkg_dependencies $ruby_dependencies" -build_pkg_dependencies="$build_pkg_dependencies $build_ruby_dependencies" - -# Load the version of Ruby for an app, and set variables. -# -# ynh_use_ruby has to be used in any app scripts before using Ruby for the first time. -# This helper will provide alias and variables to use in your scripts. -# -# To use gem or Ruby, use the alias `ynh_gem` and `ynh_ruby` -# Those alias will use the correct version installed for the app -# For example: use `ynh_gem install` instead of `gem install` -# -# With `sudo` or `ynh_exec_as`, use instead the fallback variables `$ynh_gem` and `$ynh_ruby` -# And propagate $PATH to sudo with $ynh_ruby_load_path -# Exemple: `ynh_exec_as $app $ynh_ruby_load_path $ynh_gem install` -# -# $PATH contains the path of the requested version of Ruby. -# However, $PATH is duplicated into $ruby_path to outlast any manipulation of $PATH -# You can use the variable `$ynh_ruby_load_path` to quickly load your Ruby version -# in $PATH for an usage into a separate script. -# Exemple: $ynh_ruby_load_path $install_dir/script_that_use_gem.sh` -# -# -# Finally, to start a Ruby service with the correct version, 2 solutions -# Either the app is dependent of Ruby or gem, but does not called it directly. -# In such situation, you need to load PATH -# `Environment="__YNH_RUBY_LOAD_PATH__"` -# `ExecStart=__FINALPATH__/my_app` -# You will replace __YNH_RUBY_LOAD_PATH__ with $ynh_ruby_load_path -# -# Or Ruby start the app directly, then you don't need to load the PATH variable -# `ExecStart=__YNH_RUBY__ my_app run` -# You will replace __YNH_RUBY__ with $ynh_ruby -# -# -# one other variable is also available -# - $ruby_path: The absolute path to Ruby binaries for the chosen version. -# -# usage: ynh_use_ruby -# -# Requires YunoHost version 3.2.2 or higher. -ynh_use_ruby () { - ruby_version=$(ynh_app_setting_get --app=$app --key=ruby_version) - - # Get the absolute path of this version of Ruby - ruby_path="$ruby_version_path/$YNH_APP_INSTANCE_NAME/bin" - - # Allow alias to be used into bash script - shopt -s expand_aliases - - # Create an alias for the specific version of Ruby and a variable as fallback - ynh_ruby="$ruby_path/ruby" - alias ynh_ruby="$ynh_ruby" - # And gem - ynh_gem="$ruby_path/gem" - alias ynh_gem="$ynh_gem" - - # Load the path of this version of Ruby in $PATH - if [[ :$PATH: != *":$ruby_path"* ]]; then - PATH="$ruby_path:$PATH" - fi - # Create an alias to easily load the PATH - ynh_ruby_load_path="PATH=$PATH" - - # Sets the local application-specific Ruby version - pushd $install_dir - $rbenv_install_dir/bin/rbenv local $ruby_version - popd -} - -# Install a specific version of Ruby -# -# ynh_install_ruby will install the version of Ruby provided as argument by using rbenv. -# -# This helper creates a /etc/profile.d/rbenv.sh that configures PATH environment for rbenv -# for every LOGIN user, hence your user must have a defined shell (as opposed to /usr/sbin/nologin) -# -# Don't forget to execute ruby-dependent command in a login environment -# (e.g. sudo --login option) -# When not possible (e.g. in systemd service definition), please use direct path -# to rbenv shims (e.g. $RBENV_ROOT/shims/bundle) -# -# usage: ynh_install_ruby --ruby_version=ruby_version -# | arg: -v, --ruby_version= - Version of ruby to install. -# -# Requires YunoHost version 3.2.2 or higher. -ynh_install_ruby () { - # Declare an array to define the options of this helper. - local legacy_args=v - local -A args_array=( [v]=ruby_version= ) - local ruby_version - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - - # Load rbenv path in PATH - local CLEAR_PATH="$rbenv_install_dir/bin:$PATH" - - # Remove /usr/local/bin in PATH in case of Ruby prior installation - PATH=$(echo $CLEAR_PATH | sed 's@/usr/local/bin:@@') - - # Move an existing Ruby binary, to avoid to block rbenv - test -x /usr/bin/ruby && mv /usr/bin/ruby /usr/bin/ruby_rbenv - - # Install or update rbenv - rbenv="$(command -v rbenv $rbenv_install_dir/bin/rbenv | grep "$rbenv_install_dir/bin/rbenv" | head -1)" - if [ -n "$rbenv" ]; then - ynh_print_info --message="rbenv already seems installed in \`$rbenv'." - pushd "${rbenv%/*/*}" - if git remote -v 2>/dev/null | grep "https://github.com/rbenv/rbenv.git"; then - ynh_print_info --message="Trying to update with git..." - git pull -q --tags origin master - ynh_ruby_try_bash_extension - else - ynh_print_info --message="Reinstalling rbenv with git..." - cd .. - ynh_secure_remove --file=$rbenv_install_dir - mkdir -p $rbenv_install_dir - cd $rbenv_install_dir - git init -q - git remote add -f -t master origin https://github.com/rbenv/rbenv.git > /dev/null 2>&1 - git checkout -q -b master origin/master - ynh_ruby_try_bash_extension - rbenv=$rbenv_install_dir/bin/rbenv - fi - popd - else - ynh_print_info --message="Installing rbenv with git..." - mkdir -p $rbenv_install_dir - pushd $rbenv_install_dir - git init -q - git remote add -f -t master origin https://github.com/rbenv/rbenv.git > /dev/null 2>&1 - git checkout -q -b master origin/master - ynh_ruby_try_bash_extension - rbenv=$rbenv_install_dir/bin/rbenv - popd - fi - - ruby_build="$(command -v "$rbenv_install_dir"/plugins/*/bin/rbenv-install rbenv-install | head -1)" - if [ -n "$ruby_build" ]; then - ynh_print_info --message="\`rbenv install' command already available in \`$ruby_build'." - pushd "${ruby_build%/*/*}" - if git remote -v 2>/dev/null | grep "https://github.com/rbenv/ruby-build.git"; then - ynh_print_info --message="Trying to update rbenv with git..." - git pull -q origin master - fi - popd - else - ynh_print_info --message="Installing ruby-build with git..." - mkdir -p "${rbenv_install_dir}/plugins" - git clone -q https://github.com/rbenv/ruby-build.git "${rbenv_install_dir}/plugins/ruby-build" - fi - - rbenv_alias="$(command -v "$rbenv_install_dir"/plugins/*/bin/rbenv-alias rbenv-alias | head -1)" - if [ -n "$rbenv_alias" ]; then - ynh_print_info --message="\`rbenv alias' command already available in \`$rbenv_alias'." - pushd "${rbenv_alias%/*/*}" - if git remote -v 2>/dev/null | grep "https://github.com/tpope/rbenv-aliases.git"; then - ynh_print_info --message="Trying to update rbenv-aliases with git..." - git pull -q origin master - fi - popd - else - ynh_print_info --message="Installing rbenv-aliases with git..." - mkdir -p "${rbenv_install_dir}/plugins" - git clone -q https://github.com/tpope/rbenv-aliases.git "${rbenv_install_dir}/plugins/rbenv-aliase" - fi - - rbenv_latest="$(command -v "$rbenv_install_dir"/plugins/*/bin/rbenv-latest rbenv-latest | head -1)" - if [ -n "$rbenv_latest" ]; then - ynh_print_info --message="\`rbenv latest' command already available in \`$rbenv_latest'." - pushd "${rbenv_latest%/*/*}" - if git remote -v 2>/dev/null | grep "https://github.com/momo-lab/xxenv-latest.git"; then - ynh_print_info --message="Trying to update xxenv-latest with git..." - git pull -q origin master - fi - popd - else - ynh_print_info --message="Installing xxenv-latest with git..." - mkdir -p "${rbenv_install_dir}/plugins" - git clone -q https://github.com/momo-lab/xxenv-latest.git "${rbenv_install_dir}/plugins/xxenv-latest" - fi - - # Enable caching - mkdir -p "${rbenv_install_dir}/cache" - - # Create shims directory if needed - mkdir -p "${rbenv_install_dir}/shims" - - # Restore /usr/local/bin in PATH - PATH=$CLEAR_PATH - - # And replace the old Ruby binary - test -x /usr/bin/ruby_rbenv && mv /usr/bin/ruby_rbenv /usr/bin/ruby - - # Install the requested version of Ruby - local final_ruby_version=$(rbenv latest --print $ruby_version) - if ! [ -n "$final_ruby_version" ]; then - final_ruby_version=$ruby_version - fi - ynh_print_info --message="Installing Ruby-$final_ruby_version" - CONFIGURE_OPTS="--disable-install-doc --with-jemalloc" MAKE_OPTS="-j2" rbenv install --skip-existing $final_ruby_version > /dev/null 2>&1 - - # Store ruby_version into the config of this app - ynh_app_setting_set --app=$YNH_APP_INSTANCE_NAME --key=ruby_version --value=$final_ruby_version - - # Remove app virtualenv - if `rbenv alias --list | grep --quiet "$YNH_APP_INSTANCE_NAME " 1>/dev/null 2>&1` - then - rbenv alias $YNH_APP_INSTANCE_NAME --remove - fi - - # Create app virtualenv - rbenv alias $YNH_APP_INSTANCE_NAME $final_ruby_version - - # Cleanup Ruby versions - ynh_cleanup_ruby - - # Set environment for Ruby users - echo "#rbenv -export RBENV_ROOT=$rbenv_install_dir -export PATH=\"$rbenv_install_dir/bin:$PATH\" -eval \"\$(rbenv init -)\" -#rbenv" > /etc/profile.d/rbenv.sh - - # Load the environment - eval "$(rbenv init -)" -} - -# Remove the version of Ruby used by the app. -# -# This helper will also cleanup Ruby versions -# -# usage: ynh_remove_ruby -ynh_remove_ruby () { - local ruby_version=$(ynh_app_setting_get --app=$YNH_APP_INSTANCE_NAME --key=ruby_version) - - # Load rbenv path in PATH - local CLEAR_PATH="$rbenv_install_dir/bin:$PATH" - - # Remove /usr/local/bin in PATH in case of Ruby prior installation - PATH=$(echo $CLEAR_PATH | sed 's@/usr/local/bin:@@') - - rbenv alias $YNH_APP_INSTANCE_NAME --remove - - # Remove the line for this app - ynh_app_setting_delete --app=$YNH_APP_INSTANCE_NAME --key=ruby_version - - # Cleanup Ruby versions - ynh_cleanup_ruby -} - -# Remove no more needed versions of Ruby used by the app. -# -# This helper will check what Ruby version are no more required, -# and uninstall them -# If no app uses Ruby, rbenv will be also removed. -# -# usage: ynh_cleanup_ruby -ynh_cleanup_ruby () { - - # List required Ruby versions - local installed_apps=$(yunohost app list | grep -oP 'id: \K.*$') - local required_ruby_versions="" - for installed_app in $installed_apps - do - local installed_app_ruby_version=$(ynh_app_setting_get --app=$installed_app --key="ruby_version") - if [[ $installed_app_ruby_version ]] - then - required_ruby_versions="${installed_app_ruby_version}\n${required_ruby_versions}" - fi - done - - # Remove no more needed Ruby versions - local installed_ruby_versions=$(rbenv versions --bare --skip-aliases | grep -Ev '/') - for installed_ruby_version in $installed_ruby_versions - do - if ! `echo ${required_ruby_versions} | grep "${installed_ruby_version}" 1>/dev/null 2>&1` - then - ynh_print_info --message="Removing of Ruby-$installed_ruby_version" - $rbenv_install_dir/bin/rbenv uninstall --force $installed_ruby_version - fi - done - - # If none Ruby version is required - if [[ ! $required_ruby_versions ]] - then - # Remove rbenv environment configuration - ynh_print_info --message="Removing of rbenv-$rbenv_version" - ynh_secure_remove --file="$rbenv_install_dir" - ynh_secure_remove --file="/etc/profile.d/rbenv.sh" - fi -}