diff --git a/ALL_README.md b/ALL_README.md index 152f2e7..e3c80d2 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -5,4 +5,6 @@ - [Irakurri README euskaraz](README_eu.md) - [Lire le README en français](README_fr.md) - [Le o README en galego](README_gl.md) +- [Baca README dalam bahasa bahasa Indonesia](README_id.md) +- [Прочитать README на русский](README_ru.md) - [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README.md b/README.md index a417337..11444ce 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Streams for YunoHost -[![Integration level](https://dash.yunohost.org/integration/streams.svg)](https://dash.yunohost.org/appci/app/streams) ![Working status](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/streams.svg)](https://ci-apps.yunohost.org/ci/apps/streams/) ![Working status](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) [![Install Streams with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=streams) @@ -21,7 +21,7 @@ The [streams repository](https://codeberg.org/streams/streams/) lets you install Your websites will be compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** and many, many more. -**Shipped version:** 24.05.10~ynh1 +**Shipped version:** 24.8.27~ynh1 ## Screenshots diff --git a/README_es.md b/README_es.md index 4d10180..c1102f7 100644 --- a/README_es.md +++ b/README_es.md @@ -5,7 +5,7 @@ No se debe editar a mano. # Streams para Yunohost -[![Nivel de integración](https://dash.yunohost.org/integration/streams.svg)](https://dash.yunohost.org/appci/app/streams) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/streams.svg)](https://ci-apps.yunohost.org/ci/apps/streams/) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) [![Instalar Streams con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=streams) @@ -21,7 +21,7 @@ The [streams repository](https://codeberg.org/streams/streams/) lets you install Your websites will be compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** and many, many more. -**Versión actual:** 24.05.10~ynh1 +**Versión actual:** 24.8.27~ynh1 ## Capturas diff --git a/README_eu.md b/README_eu.md index ea17769..b8cd40d 100644 --- a/README_eu.md +++ b/README_eu.md @@ -5,7 +5,7 @@ EZ editatu eskuz. # Streams YunoHost-erako -[![Integrazio maila](https://dash.yunohost.org/integration/streams.svg)](https://dash.yunohost.org/appci/app/streams) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) +[![Integrazio maila](https://dash.yunohost.org/integration/streams.svg)](https://ci-apps.yunohost.org/ci/apps/streams/) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) [![Instalatu Streams YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=streams) @@ -21,7 +21,7 @@ The [streams repository](https://codeberg.org/streams/streams/) lets you install Your websites will be compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** and many, many more. -**Paketatutako bertsioa:** 24.05.10~ynh1 +**Paketatutako bertsioa:** 24.8.27~ynh1 ## Pantaila-argazkiak diff --git a/README_fr.md b/README_fr.md index e862d60..a77fd9e 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,7 +5,7 @@ Il NE doit PAS être modifié à la main. # Streams pour YunoHost -[![Niveau d’intégration](https://dash.yunohost.org/integration/streams.svg)](https://dash.yunohost.org/appci/app/streams) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/streams.svg)](https://ci-apps.yunohost.org/ci/apps/streams/) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) [![Installer Streams avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=streams) @@ -21,7 +21,7 @@ Le [dépôt streams](https://codeberg.org/streams/streams/) vous permet d'instal Vos sites web seront compatibles avec **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** et bien d'autres encore. -**Version incluse :** 24.05.10~ynh1 +**Version incluse :** 24.8.27~ynh1 ## Captures d’écran diff --git a/README_gl.md b/README_gl.md index 1a05d66..c5bd64a 100644 --- a/README_gl.md +++ b/README_gl.md @@ -5,7 +5,7 @@ NON debe editarse manualmente. # Streams para YunoHost -[![Nivel de integración](https://dash.yunohost.org/integration/streams.svg)](https://dash.yunohost.org/appci/app/streams) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/streams.svg)](https://ci-apps.yunohost.org/ci/apps/streams/) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) [![Instalar Streams con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=streams) @@ -21,7 +21,7 @@ The [streams repository](https://codeberg.org/streams/streams/) lets you install Your websites will be compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** and many, many more. -**Versión proporcionada:** 24.05.10~ynh1 +**Versión proporcionada:** 24.8.27~ynh1 ## Capturas de pantalla diff --git a/README_id.md b/README_id.md new file mode 100644 index 0000000..0dd0173 --- /dev/null +++ b/README_id.md @@ -0,0 +1,48 @@ + + +# Streams untuk YunoHost + +[![Tingkat integrasi](https://dash.yunohost.org/integration/streams.svg)](https://ci-apps.yunohost.org/ci/apps/streams/) ![Status kerja](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Status pemeliharaan](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) + +[![Pasang Streams dengan YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=streams) + +*[Baca README ini dengan bahasa yang lain.](./ALL_README.md)* + +> *Paket ini memperbolehkan Anda untuk memasang Streams secara cepat dan mudah pada server YunoHost.* +> *Bila Anda tidak mempunyai YunoHost, silakan berkonsultasi dengan [panduan](https://yunohost.org/install) untuk mempelajari bagaimana untuk memasangnya.* + +## Ringkasan + +The [streams repository](https://codeberg.org/streams/streams/) lets you install fediverse-connected websites with powerful and innovative features such as decentralized/nomadic identity, permissions framework, and much more (see [FEATURES](doc/FEATURES.md)). + +Your websites will be compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** and many, many more. + + +**Versi terkirim:** 24.8.27~ynh1 + +## Tangkapan Layar + +![Tangkapan Layar pada Streams](./doc/screenshots/example.png) + +## Dokumentasi dan sumber daya + +- Depot kode aplikasi hulu: +- Gudang YunoHost: +- Laporkan bug: + +## Info developer + +Silakan kirim pull request ke [`testing` branch](https://github.com/YunoHost-Apps/streams_ynh/tree/testing). + +Untuk mencoba branch `testing`, silakan dilanjutkan seperti: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/streams_ynh/tree/testing --debug +atau +sudo yunohost app upgrade streams -u https://github.com/YunoHost-Apps/streams_ynh/tree/testing --debug +``` + +**Info lebih lanjut mengenai pemaketan aplikasi:** diff --git a/README_ru.md b/README_ru.md new file mode 100644 index 0000000..2ba091e --- /dev/null +++ b/README_ru.md @@ -0,0 +1,48 @@ + + +# Streams для YunoHost + +[![Уровень интеграции](https://dash.yunohost.org/integration/streams.svg)](https://ci-apps.yunohost.org/ci/apps/streams/) ![Состояние работы](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![Состояние сопровождения](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) + +[![Установите Streams с YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=streams) + +*[Прочтите этот README на других языках.](./ALL_README.md)* + +> *Этот пакет позволяет Вам установить Streams быстро и просто на YunoHost-сервер.* +> *Если у Вас нет YunoHost, пожалуйста, посмотрите [инструкцию](https://yunohost.org/install), чтобы узнать, как установить его.* + +## Обзор + +The [streams repository](https://codeberg.org/streams/streams/) lets you install fediverse-connected websites with powerful and innovative features such as decentralized/nomadic identity, permissions framework, and much more (see [FEATURES](doc/FEATURES.md)). + +Your websites will be compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** and many, many more. + + +**Поставляемая версия:** 24.8.27~ynh1 + +## Снимки экрана + +![Снимок экрана Streams](./doc/screenshots/example.png) + +## Документация и ресурсы + +- Репозиторий кода главной ветки приложения: +- Магазин YunoHost: +- Сообщите об ошибке: + +## Информация для разработчиков + +Пришлите Ваш запрос на слияние в [ветку `testing`](https://github.com/YunoHost-Apps/streams_ynh/tree/testing). + +Чтобы попробовать ветку `testing`, пожалуйста, сделайте что-то вроде этого: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/streams_ynh/tree/testing --debug +или +sudo yunohost app upgrade streams -u https://github.com/YunoHost-Apps/streams_ynh/tree/testing --debug +``` + +**Больше информации о пакетировании приложений:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 4c4bc27..ceb6e3e 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -5,7 +5,7 @@ # YunoHost 上的 Streams -[![集成程度](https://dash.yunohost.org/integration/streams.svg)](https://dash.yunohost.org/appci/app/streams) ![工作状态](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) +[![集成程度](https://dash.yunohost.org/integration/streams.svg)](https://ci-apps.yunohost.org/ci/apps/streams/) ![工作状态](https://ci-apps.yunohost.org/ci/badges/streams.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/streams.maintain.svg) [![使用 YunoHost 安装 Streams](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=streams) @@ -21,7 +21,7 @@ The [streams repository](https://codeberg.org/streams/streams/) lets you install Your websites will be compatible with **Mastodon**, **Pleroma**, **Pixelfed**, **Friendica**, **Hubzilla**, **Funkwhale**, **Peertube**, **Plume**, **WriteFreely** and many, many more. -**分发版本:** 24.05.10~ynh1 +**分发版本:** 24.8.27~ynh1 ## 截图 diff --git a/conf/cronjobs b/conf/cronjobs index 79d98e2..a41a623 100644 --- a/conf/cronjobs +++ b/conf/cronjobs @@ -1,4 +1,3 @@ # Run poller periodically to update your website -*/10 * * * * __APP__ /usr/bin/php__PHPVERSION__ -f Code/Daemon/Run.php Cron > /dev/null 2>&1 -# Daily software update job -30 05 * * * root /bin/bash __DATA_DIR__/daily-update.sh >> __DATA_DIR__/daily-updates.log 2>&1 +*/10 * * * * __APP__ /usr/bin/php__PHP_VERSION__ -f src/Daemon/Run.php Cron > /dev/null 2>&1 + diff --git a/conf/daily-update.sh b/conf/daily-update.sh deleted file mode 100644 index fff1714..0000000 --- a/conf/daily-update.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -# -echo " " -echo "+++ $(date) +++" -echo " " -git_branch="$(cd /var/www/__APP__ && sudo -u __APP__ \ - git branch --show-current)" 2> /dev/null -if echo $git_branch | grep -q "release" -then - echo "$(date) - Updating website..." - (cd /var/www/__APP__ ; sudo -u __APP__ util/udall) -else - echo "$(date) - Updating release branch code..." - (cd /var/www/__APP__ ; sudo -u __APP__ git fetch origin release:release) -fi -echo "$(date) - Daily update finished." - diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf deleted file mode 100644 index 14c8d27..0000000 --- a/conf/extra_php-fpm.conf +++ /dev/null @@ -1,4 +0,0 @@ -; Additional php.ini defines, specific to this pool of workers. - -php_admin_value[upload_max_filesize] = 50M -php_admin_value[post_max_size] = 50M \ No newline at end of file diff --git a/conf/htconfig.sample.php b/conf/htconfig.sample.php index e2e9ebe..4af080b 100644 --- a/conf/htconfig.sample.php +++ b/conf/htconfig.sample.php @@ -109,7 +109,7 @@ App::$config['system']['max_import_size'] = 200000; // Location of PHP command line processor -App::$config['system']['php_path'] = '/usr/bin/php__PHPVERSION__'; +App::$config['system']['php_path'] = '/usr/bin/php__PHP_VERSION__'; // Configure how we communicate with directory servers. // Deprecated. Please do not change. diff --git a/conf/nginx.conf b/conf/nginx.conf index f5d2b44..1fdac22 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -16,7 +16,7 @@ location __PATH__/ { location ~* \.php$ { try_files $uri =404; - fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; + fastcgi_pass unix:/var/run/php/php__PHP_VERSION__-fpm-__APP__.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; diff --git a/config_panel.toml b/config_panel.toml deleted file mode 100644 index b2b4906..0000000 --- a/config_panel.toml +++ /dev/null @@ -1,48 +0,0 @@ -version = "1.0" - -[main] -name.en = "Streams configuration" -name.fr = "Configuration de Streams" - - [main.php_fpm_config] - name.en = "PHP-FPM configuration" - name.fr = "Configuration de PHP-FPM" - - [main.php_fpm_config.fpm_footprint] - ask.en = "Memory footprint" - ask.fr = "Empreinte mémoire" - type = "select" - choices = ["low", "medium", "high", "specific"] - default = "medium" - help.en = "low: <= 20Mb per pool
medium: Between 20Mb and 40Mb per pool
high: 40Mb per pool
specific : Use specific value" - help.fr = "low: <= 20Mb par pool
medium: Entre 20Mb et 40Mb par pool
high: 40Mb par pool
specific : Utiliser une valeur personnalisée" - - [main.php_fpm_config.fpm_free_footprint] - visible = "fpm_footprint == 'specific'" - ask.en = "Memory footprint of the service?" - ask.fr = "Empreinte mémoire du service?" - type = "number" - default = "0" - help.en = "Free field to specify exactly the footprint in Mb if you don't want to use one of the three previous values." - help.fr = "Champ libre pour spécifier exactement l'empreinte mémoire en Mb si vous ne souhaitez pas utiliser l'une des trois valeurs précédentes." - - [main.php_fpm_config.fpm_usage] - ask.en = "Expected usage" - ask.fr = "Utilisation prévue" - type = "select" - choices = ["low", "medium", "high"] - default = "medium" - help.en = "low: Personal usage, behind the SSO. No RAM footprint when not used, but the impact on the processor can be high if many users are using the service.
medium: Low usage, few people or/and publicly accessible. Low RAM footprint, medium processor footprint when used.
high: High usage, frequently visited website. High RAM footprint, but lower on processor usage and quickly responding." - help.fr = "low : Utilisation personnelle, derrière le SSO. Pas d'empreinte RAM en cas de non-utilisation, mais l'impact sur le processeur peut être élevé si de nombreux utilisateurs utilisent le service.
medium : Faible utilisation, peu d'utilisateurs et/ou service pas nécessairement accessible au public. Faible empreinte RAM, empreinte moyenne sur le processeur en cas d'utilisation.
high : Utilisation soutenue, site web fréquemment visité. L'empreinte RAM est élevée, mais l'utilisation du processeur est moindre et le service répond rapidement." - - [main.git_branch_mode] - name.en = "Developer Mode" - name.fr = "Mode Développeur" - - [main.git_branch_mode.git_branch_mode] - ask.en = "Switch to 'dev' branch" - ask.fr = "Basculer sur la branche 'dev'" - type = "boolean" - default = "0" - help.en = "This option should only be used if you're either a professional software developer or a certified lunatic (or both).

You can only return to the 'release' branch if it is ahead of the 'dev' branch.

If authorised, the switch to the 'release' branch will be immediately followed by a global update of the site - via the util/udall command.

You must be able to use the command line to solve any problems you may encounter after using this option.

If you haven't understood any of the above lines DON'T USE THIS OPTION!!!" - help.fr = "Cette option ne devrait être utilisée que si vous êtes un développeur de logiciels professionnel ou une personne passablement déraisonnable (ou les deux à la fois)

Vous ne pourrez revenir à la branche 'release' que si celle-ci est en avance sur la branche 'dev'.

Si elle est autorisée, la bascule vers la branche 'release' sera immédiatement suivie d'une mise à jour globale du site - via la commande util/udall.

Vous devez impérativement être capable d'utiliser la ligne de commande pour résoudre tout problème que vous pourriez rencontrer après avoir utilisé cette option.

Si vous n'avez rien compris aux lignes ci-dessus N'UTILISEZ PAS CETTE OPTION!!!" diff --git a/manifest.toml b/manifest.toml index 92663b6..ec4ea65 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Streams" description.en = "Open source fediverse server" description.fr = "Serveur fediverse open source" -version = "24.05.10~ynh1" +version = "24.8.27~ynh1" maintainers = ["Papa Dragon"] @@ -14,7 +14,8 @@ license = "Unlicense" code = "https://codeberg.org/streams/streams" [integration] -yunohost = ">= 11.2" +yunohost = ">= 11.2.18" +helpers_version = "2.1" architectures = "all" multi_instance = true ldap = false @@ -46,11 +47,25 @@ ram.runtime = "50M" [resources] + [resources.sources] + [resources.sources.main] + url = "https://codeberg.org/streams/streams/archive/v24.8.27.tar.gz" + sha256 = "61bc0e0cb088c2644bcc4993f41af449d111a394e559eede75204b504b5fcbbb" + autoupdate.strategy = "latest_forgejo_tag" + autoupdate.version_regex = "^v(.*)$" + + [resources.sources.addons] + url = "https://codeberg.org/streams/streams-addons/archive/47ce10d5f6e855186d10f2373dc7bbe385454cce.tar.gz" + sha256 = "ddea62f2c745ccb29f291813e0a8a24b122c9eba67539fd3a792862c6653b134" + autoupdate.strategy = "latest_forgejo_commit" + autoupdate.upstream = "https://codeberg.org/streams/streams-addons" + [resources.ports] [resources.system_user] [resources.install_dir] + group = "www-data:r-x" [resources.data_dir] @@ -58,7 +73,7 @@ ram.runtime = "50M" main.url = "/" [resources.apt] - packages = "php8.2-mbstring, php8.2-cli, php8.2-imagick, php8.2-xml, php8.2-zip, php8.2-curl, php8.2-ldap, php8.2-gd, mariadb-server, php8.2-mysql php8.2-gmp" + packages = "php8.3-mbstring, php8.3-cli, php8.3-imagick, php8.3-xml, php8.3-zip, php8.3-curl, php8.3-ldap, php8.3-gd, mariadb-server, php8.3-mysql php8.3-gmp" [resources.database] type = "mysql" diff --git a/scripts/_common.sh b/scripts/_common.sh index ea5fe64..1134a1b 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,22 +1,10 @@ #!/bin/bash #================================================= -# COMMON VARIABLES +# COMMON VARIABLES AND CUSTOM HELPERS #================================================= # PHP APP SPECIFIC #================================================= -YNH_COMPOSER_VERSION="2.5.8" -YNH_PHP_VERSION="8.2" - -#================================================= -# PERSONAL HELPERS -#================================================= - -#================================================= -# EXPERIMENTAL HELPERS -#================================================= - -#================================================= -# FUTURE OFFICIAL HELPERS -#================================================= +composer_version="2.7.8" +YNH_PHP_VERSION="8.3" diff --git a/scripts/backup b/scripts/backup index b1c66e8..7531796 100644 --- a/scripts/backup +++ b/scripts/backup @@ -1,44 +1,36 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - # Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# DECLARE DATA AND CONF FILES TO BACKUP -#================================================= -ynh_print_info --message="Declaring files to be backed up..." +ynh_print_info "Declaring files to be backed up..." #================================================= -# BACKUP THE APP MAIN DIR +# BACKUP THE APP MAIN DIR & DATA DIR #================================================= -ynh_backup --src_path="$install_dir" +ynh_backup "$install_dir" +ynh_backup "$data_dir" #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= -ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # BACKUP THE PHP-FPM CONFIGURATION #================================================= -ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +ynh_backup "/etc/php/$php_version/fpm/pool.d/$app.conf" #================================================= # BACKUP FAIL2BAN CONFIGURATION #================================================= -ynh_backup --src_path="/etc/fail2ban/jail.d/$app.conf" -ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" +ynh_backup "/etc/fail2ban/jail.d/$app.conf" +ynh_backup "/etc/fail2ban/filter.d/$app.conf" #================================================= # SPECIFIC BACKUP @@ -46,24 +38,23 @@ ynh_backup --src_path="/etc/fail2ban/filter.d/$app.conf" # BACKUP LOGROTATE #================================================= -ynh_backup --src_path="/etc/logrotate.d/$app" +ynh_backup "/etc/logrotate.d/$app" #================================================= # BACKUP CRON JOBS #================================================= -ynh_backup --src_path="/etc/cron.d/$app" -ynh_backup --src_path="$data_dir" +ynh_backup "/etc/cron.d/$app" #================================================= # BACKUP THE DATABASE #================================================= -ynh_print_info --message="Backup of the MySQL database..." +ynh_print_info "Backup of the MySQL database..." -ynh_mysql_dump_db --database="$db_name" > db.sql +ynh_mysql_dump_db > db.sql #================================================= # END OF SCRIPT #================================================= -ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." +ynh_print_info "Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." diff --git a/scripts/config b/scripts/config deleted file mode 100644 index bf78e56..0000000 --- a/scripts/config +++ /dev/null @@ -1,134 +0,0 @@ -#!/bin/bash - -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -source _common.sh -source /usr/share/yunohost/helpers - -ynh_abort_if_errors - -#================================================= -# RETRIEVE ARGUMENTS -#================================================= - -phpversion="$YNH_PHP_VERSION" -current_fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) - -#================================================= -# SPECIFIC GETTERS FOR TOML SHORT KEY -#================================================= - -get__git_branch_mode() { - # Git branch mode status - git_branch_mode_status="$(cd "$install_dir" && sudo -u $app git branch --show-current)" 2> /dev/null - if echo $git_branch_mode_status | grep -q "release" - then - echo "0" - elif echo $git_branch_mode_status | grep -q "dev" - then - echo "1" - else - ynh_print_err --message="Not using \"release\" or \"dev\" branch, please handle this in command line" - exit 0 - fi -} - -get__fpm_footprint() { - # Free footprint value for php-fpm - # Check if current_fpm_footprint is an integer - if [ "$current_fpm_footprint" -eq "$current_fpm_footprint" ] 2> /dev/null - then - echo "specific" - else - echo "$current_fpm_footprint" - fi -} - -get__free_footprint() { - # Free footprint value for php-fpm - # Check if current_fpm_footprint is an integer - if [ "$current_fpm_footprint" -eq "$current_fpm_footprint" ] 2> /dev/null - then - # If current_fpm_footprint is an integer, that's a numeric value for the footprint - echo "$current_fpm_footprint" - else - echo "0" - fi -} - -#================================================= -# SPECIFIC SETTERS FOR TOML SHORT KEYS -#================================================= - - -set__git_branch_mode() { - if [ "$git_branch_mode" -eq "0" ] - then - # We allow switch back to "release" only if the branch is ahead of "dev" - if [ -z "$(cd "$install_dir" && git log --oneline release..dev)" ] - then - # If git_branch was set to 0, switch to "release" branch - ynh_print_info "Switching to \"release\" branch" - (cd "$install_dir" && ynh_exec_as "$app" git checkout release) - ynh_print_info "Full update of the website" - (cd /home/yunohost.app/"$app" && bash daily-update.sh >> daily-updates.log 2>&1) - else - ynh_die --message="\"release\" branch is behind your local \"dev\" branch, rolling back is not allowed here" - exit 1 - fi - elif [ "$git_branch_mode" -eq "1" ]; then - # If git_branch was set to 1, switch to "dev" branch - (cd "$install_dir" && ynh_exec_as "$app" git checkout dev) - ynh_print_info "Switching to \"dev\" branch" - fi - ynh_app_setting_set --app=$app --key=git_branch_mode --value="$git_branch_mode" -} - -set__fpm_footprint() { - if [ "$fpm_footprint" != "specific" ] - then - ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_footprint" - fi -} - -set__fpm_free_footprint() { - if [ "$fpm_footprint" = "specific" ] - then - ynh_app_setting_set --app=$app --key=fpm_footprint --value="$fpm_free_footprint" - fi -} - -#================================================= -# GENERIC FINALIZATION -#================================================= - -ynh_app_config_validate() { - _ynh_app_config_validate - - if [ "${changed[fpm_usage]}" == "true" ] || [ "${changed[fpm_footprint]}" == "true" ] || [ "${changed[fpm_free_footprint]}" == "true" ]; then - # If fpm_footprint is set to 'specific', use $fpm_free_footprint value. - if [ "$fpm_footprint" = "specific" ] - then - fpm_footprint=$fpm_free_footprint - fi - - if [ "$fpm_footprint" == "0" ] - then - ynh_print_err --message="When selecting 'specific', you have to set a footprint value into the field below." - - exit 0 - fi - fi -} - -ynh_app_config_apply() { - _ynh_app_config_apply - - ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint -} - -ynh_app_config_run $1 diff --git a/scripts/install b/scripts/install index 6ad146d..dbca065 100755 --- a/scripts/install +++ b/scripts/install @@ -1,110 +1,71 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers #================================================= -# RETRIEVE ARGUMENTS FROM THE MANIFEST +# INITIALIZE SETTINGS #================================================= +ynh_script_progression "Initialize installation settings..." -email=$(ynh_user_get_info --username=$admin --key=mail) -upload="256M" -random_string="$(ynh_string_random --length=48)" -fpm_footprint="medium" -fpm_free_footprint=0 -fpm_usage="medium" -git_branch_mode="0" - -#================================================= -# STORE SETTINGS FROM MANIFEST -#================================================= -ynh_script_progression --message="Storing installation settings..." --weight=1 - -ynh_app_setting_set --app=$app --key=email --value=$email -ynh_app_setting_set --app=$app --key=upload --value=$upload -ynh_app_setting_set --app=$app --key=random_string --value=$random_string -ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint -ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint -ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage -ynh_app_setting_set --app=$app --key=git_branch_mode --value="$git_branch_mode" +ynh_app_setting_set_default --key=email --value=$(ynh_user_get_info --username=$admin --key=mail) +ynh_app_setting_set_default --key=upload --value="256M" +ynh_app_setting_set_default --key=random_string --value="$(ynh_string_random --length=48)" #================================================= # CREATE A DATABASE #================================================= -ynh_script_progression --message="Creating a database..." --weight=2 +ynh_script_progression "Tweak database character set..." -ynh_mysql_connect_as --user=$db_user --password="$db_pwd" --database=$db_name \ +ynh_mysql_db_shell \ <<< "ALTER DATABASE $db_name CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --weight=1 - -mkdir -p "$install_dir" -chown -R $app:www-data "$install_dir" +ynh_script_progression "Setting up source files..." # Download, check integrity, uncompress and patch the source from GitHub -ynh_exec_as $app git clone https://codeberg.org/streams/streams.git "$install_dir" --quiet -git config --system --add safe.directory $install_dir +ynh_setup_source --dest_dir="$install_dir" +ynh_setup_source --dest_dir="$install_dir/addon" --source_id="addons" -touch "$install_dir/php.log" -mkdir -p "$install_dir/store" -mkdir -p "$install_dir/cache/smarty3" +ynh_exec_as_app mkdir -p "$install_dir/store" +ynh_exec_as_app mkdir -p "$install_dir/cache/smarty3" -chmod -R o-rwx "$install_dir" -chmod -R 775 $install_dir/store $install_dir/cache +ynh_exec_as_app chmod -R 775 $install_dir/store $install_dir/cache #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 +ynh_script_progression "Configuring PHP-FPM..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint +ynh_config_add_phpfpm # Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add_nginx #================================================= # COMPOSER #================================================= -ynh_script_progression --message="Pulling in external libraries with Composer..." +ynh_script_progression "Pulling in external libraries with Composer..." -ynh_install_composer --workdir="$install_dir" -chown -R $app:www-data "$install_dir" - -#================================================= -# ADDONS -#================================================= -ynh_script_progression --message="Installing addons..." - -pushd $install_dir - ynh_exec_as $app git config pull.rebase false - ynh_exec_as $app util/add_addon_repo https://codeberg.org/streams/streams-addons.git zaddons - cd /var/www/$app/extend/addon/zaddons - ynh_exec_as $app git config pull.rebase false -popd +ynh_composer_install +ynh_composer_exec install --no-dev #================================================= # SPECIFIC SETUP #================================================= # PROVISION DATABASE #================================================= -ynh_script_progression --message="Provisionning database..." --weight=1 +ynh_script_progression "Provisionning database..." -ynh_mysql_connect_as --user="$db_name" --password="$db_pwd" --database="$db_name" < $install_dir/install/schema_mysql.sql +ynh_mysql_db_shell < $install_dir/install/schema_mysql.sql #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding a configuration file..." --weight=1 +ynh_script_progression "Adding $app's configuration..." timezone=$( /dev/null -if echo $git_branch_mode_status | grep -q "release" -then - git_branch_mode="0" - ynh_app_setting_set --app=$app --key=git_branch_mode --value="$git_branch_mode" -elif echo $git_branch_mode_status | grep -q "dev" -then - git_branch_mode="1" - ynh_app_setting_set --app=$app --key=git_branch_mode --value="$git_branch_mode" -else - ynh_print_err --message="You need to use \"release\" or \"dev\" branch, please handle this in command line" - exit 0 -fi +ynh_script_progression "Ensuring downward compatibility..." #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -if [ "$upgrade_type" == "UPGRADE_APP" ] +# FIXME: this is still supported but the recommendation is now to *always* re-setup the app sources wether or not the upstream sources changed +if ynh_app_upstream_version_changed then - ynh_script_progression --message="Upgrading source files..." --weight=1 + ynh_script_progression "Upgrading source files..." - # First we save what we need to keep - mv $install_dir/store $data_dir/ - mv $install_dir/cache $data_dir/ - mv $install_dir/php.log $data_dir/ + # Move data to the data_dir if it's still in install_dir + if [ ! -d "$data_dir/store" ] + then + ynh_exec_as_app mv $install_dir/store $data_dir/ + ynh_exec_as_app mv $install_dir/cache $data_dir/ + fi # Then we remove the previous install - ynh_secure_remove $install_dir + ynh_safe_rm $install_dir - # We make the install cloning the repo - mkdir -p "$install_dir" - chown -R $app:www-data "$install_dir" - - ynh_exec_as $app git clone https://codeberg.org/streams/streams.git "$install_dir" --quiet - git config --system --add safe.directory $install_dir - - ynh_app_setting_get --app=$app --key=git_branch_mode - if [[ -n $git_branch_mode ]] && [ "$git_branch_mode" -eq "1" ] - then - ynh_print_info "Switching to \"dev\" branch" - (cd "$install_dir" && ynh_exec_as $app git checkout dev) - fi + ynh_setup_source --dest_dir="$install_dir" + ynh_setup_source --dest_dir="$install_dir/addon" --source_id="addons" # We restore what we previously saved - mv $data_dir/store $install_dir/ - mv $data_dir/cache $install_dir/ - mv $data_dir/php.log $install_dir/ - - chmod -R o-rwx "$install_dir" - chown -R $app:www-data "$install_dir" - chmod -R 775 $install_dir/store $install_dir/cache + ynh_exec_as_app ln -s $data_dir/store $install_dir/ + ynh_exec_as_app ln -s $data_dir/cache $install_dir/ fi #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 +ynh_script_progression "Upgrading PHP-FPM configuration..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint +ynh_config_add_phpfpm # Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add_nginx #================================================= # COMPOSER #================================================= -ynh_script_progression --message="Pulling in external libraries with Composer..." +ynh_script_progression "Pulling in external libraries with Composer..." -ynh_install_composer -chown -R $app:www-data "$install_dir" +ynh_composer_install +ynh_composer_exec install --no-dev -#================================================= -# ADDONS -#================================================= -ynh_script_progression --message="Installing addons..." - -pushd $install_dir - ynh_exec_as $app git config pull.rebase false - ynh_exec_as $app util/add_addon_repo https://codeberg.org/streams/streams-addons.git zaddons - cd /var/www/$app/extend/addon/zaddons - ynh_exec_as $app git config pull.rebase false -popd - -#================================================= -# SPECIFIC UPGRADE #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating a configuration file..." --weight=1 +ynh_script_progression "Updating configuration..." timezone=$(