From 9f1f6dfeb058a3050d16827810e0d75f7cd4333e Mon Sep 17 00:00:00 2001 From: YunoHost Bot Date: Fri, 16 Aug 2024 12:44:50 +0200 Subject: [PATCH 1/2] Upgrade to v5.1.1 (#123) * Upgrade sources - `main` v5.1.1: https://github.com/matomo-org/matomo/releases/tag/5.1.1 * Auto-update READMEs --- ALL_README.md | 2 ++ README.md | 4 ++-- README_es.md | 4 ++-- README_eu.md | 4 ++-- README_fr.md | 4 ++-- README_gl.md | 4 ++-- README_id.md | 52 +++++++++++++++++++++++++++++++++++++++++++++++ README_ru.md | 52 +++++++++++++++++++++++++++++++++++++++++++++++ README_zh_Hans.md | 4 ++-- manifest.toml | 6 +++--- 10 files changed, 121 insertions(+), 15 deletions(-) create mode 100644 README_id.md create mode 100644 README_ru.md diff --git a/ALL_README.md b/ALL_README.md index 152f2e7..e3c80d2 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -5,4 +5,6 @@ - [Irakurri README euskaraz](README_eu.md) - [Lire le README en français](README_fr.md) - [Le o README en galego](README_gl.md) +- [Baca README dalam bahasa bahasa Indonesia](README_id.md) +- [Прочитать README на русский](README_ru.md) - [阅读中文(简体)的 README](README_zh_Hans.md) diff --git a/README.md b/README.md index 887247c..af28a96 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It shall NOT be edited by hand. # Matomo for YunoHost -[![Integration level](https://dash.yunohost.org/integration/matomo.svg)](https://dash.yunohost.org/appci/app/matomo) ![Working status](https://ci-apps.yunohost.org/ci/badges/matomo.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/matomo.maintain.svg) +[![Integration level](https://dash.yunohost.org/integration/matomo.svg)](https://ci-apps.yunohost.org/ci/apps/matomo/) ![Working status](https://ci-apps.yunohost.org/ci/badges/matomo.status.svg) ![Maintenance status](https://ci-apps.yunohost.org/ci/badges/matomo.maintain.svg) [![Install Matomo with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=matomo) @@ -21,7 +21,7 @@ Matomo is the leading Free/Libre open analytics platform. At the end of the five Matomo aims to be a Free software alternative to Google Analytics and is already used on more than 1,400,000 websites. Privacy is built-in! -**Shipped version:** 5.1.0~ynh1 +**Shipped version:** 5.1.1~ynh1 **Demo:** diff --git a/README_es.md b/README_es.md index bca4992..a14b02b 100644 --- a/README_es.md +++ b/README_es.md @@ -5,7 +5,7 @@ No se debe editar a mano. # Matomo para Yunohost -[![Nivel de integración](https://dash.yunohost.org/integration/matomo.svg)](https://dash.yunohost.org/appci/app/matomo) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/matomo.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/matomo.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/matomo.svg)](https://ci-apps.yunohost.org/ci/apps/matomo/) ![Estado funcional](https://ci-apps.yunohost.org/ci/badges/matomo.status.svg) ![Estado En Mantención](https://ci-apps.yunohost.org/ci/badges/matomo.maintain.svg) [![Instalar Matomo con Yunhost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=matomo) @@ -21,7 +21,7 @@ Matomo is the leading Free/Libre open analytics platform. At the end of the five Matomo aims to be a Free software alternative to Google Analytics and is already used on more than 1,400,000 websites. Privacy is built-in! -**Versión actual:** 5.1.0~ynh1 +**Versión actual:** 5.1.1~ynh1 **Demo:** diff --git a/README_eu.md b/README_eu.md index dc417d0..f282a1d 100644 --- a/README_eu.md +++ b/README_eu.md @@ -5,7 +5,7 @@ EZ editatu eskuz. # Matomo YunoHost-erako -[![Integrazio maila](https://dash.yunohost.org/integration/matomo.svg)](https://dash.yunohost.org/appci/app/matomo) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/matomo.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/matomo.maintain.svg) +[![Integrazio maila](https://dash.yunohost.org/integration/matomo.svg)](https://ci-apps.yunohost.org/ci/apps/matomo/) ![Funtzionamendu egoera](https://ci-apps.yunohost.org/ci/badges/matomo.status.svg) ![Mantentze egoera](https://ci-apps.yunohost.org/ci/badges/matomo.maintain.svg) [![Instalatu Matomo YunoHost-ekin](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=matomo) @@ -21,7 +21,7 @@ Matomo is the leading Free/Libre open analytics platform. At the end of the five Matomo aims to be a Free software alternative to Google Analytics and is already used on more than 1,400,000 websites. Privacy is built-in! -**Paketatutako bertsioa:** 5.1.0~ynh1 +**Paketatutako bertsioa:** 5.1.1~ynh1 **Demoa:** diff --git a/README_fr.md b/README_fr.md index a67d564..b2677ea 100644 --- a/README_fr.md +++ b/README_fr.md @@ -5,7 +5,7 @@ Il NE doit PAS être modifié à la main. # Matomo pour YunoHost -[![Niveau d’intégration](https://dash.yunohost.org/integration/matomo.svg)](https://dash.yunohost.org/appci/app/matomo) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/matomo.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/matomo.maintain.svg) +[![Niveau d’intégration](https://dash.yunohost.org/integration/matomo.svg)](https://ci-apps.yunohost.org/ci/apps/matomo/) ![Statut du fonctionnement](https://ci-apps.yunohost.org/ci/badges/matomo.status.svg) ![Statut de maintenance](https://ci-apps.yunohost.org/ci/badges/matomo.maintain.svg) [![Installer Matomo avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=matomo) @@ -20,7 +20,7 @@ Matomo est la principale plateforme d'analyse ouverte Free/Libre. À la fin du p Matomo se veut une alternative logicielle gratuite à Google Analytics et est déjà utilisé sur plus de 1 400 000 sites Web. La confidentialité est intégrée ! -**Version incluse :** 5.1.0~ynh1 +**Version incluse :** 5.1.1~ynh1 **Démo :** diff --git a/README_gl.md b/README_gl.md index 0891ae3..9d534b4 100644 --- a/README_gl.md +++ b/README_gl.md @@ -5,7 +5,7 @@ NON debe editarse manualmente. # Matomo para YunoHost -[![Nivel de integración](https://dash.yunohost.org/integration/matomo.svg)](https://dash.yunohost.org/appci/app/matomo) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/matomo.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/matomo.maintain.svg) +[![Nivel de integración](https://dash.yunohost.org/integration/matomo.svg)](https://ci-apps.yunohost.org/ci/apps/matomo/) ![Estado de funcionamento](https://ci-apps.yunohost.org/ci/badges/matomo.status.svg) ![Estado de mantemento](https://ci-apps.yunohost.org/ci/badges/matomo.maintain.svg) [![Instalar Matomo con YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=matomo) @@ -21,7 +21,7 @@ Matomo is the leading Free/Libre open analytics platform. At the end of the five Matomo aims to be a Free software alternative to Google Analytics and is already used on more than 1,400,000 websites. Privacy is built-in! -**Versión proporcionada:** 5.1.0~ynh1 +**Versión proporcionada:** 5.1.1~ynh1 **Demo:** diff --git a/README_id.md b/README_id.md new file mode 100644 index 0000000..e71770b --- /dev/null +++ b/README_id.md @@ -0,0 +1,52 @@ + + +# Matomo untuk YunoHost + +[![Tingkat integrasi](https://dash.yunohost.org/integration/matomo.svg)](https://ci-apps.yunohost.org/ci/apps/matomo/) ![Status kerja](https://ci-apps.yunohost.org/ci/badges/matomo.status.svg) ![Status pemeliharaan](https://ci-apps.yunohost.org/ci/badges/matomo.maintain.svg) + +[![Pasang Matomo dengan YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=matomo) + +*[Baca README ini dengan bahasa yang lain.](./ALL_README.md)* + +> *Paket ini memperbolehkan Anda untuk memasang Matomo 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 + +Matomo is the leading Free/Libre open analytics platform. At the end of the five-minute installation process, you will be given a JavaScript code. Simply copy and paste this tag on websites you wish to track and access your analytics reports in real-time. + +Matomo aims to be a Free software alternative to Google Analytics and is already used on more than 1,400,000 websites. Privacy is built-in! + + +**Versi terkirim:** 5.1.1~ynh1 + +**Demo:** + +## Tangkapan Layar + +![Tangkapan Layar pada Matomo](./doc/screenshots/screenshot.png) + +## Dokumentasi dan sumber daya + +- Website aplikasi resmi: +- Dokumentasi admin resmi: +- Depot kode aplikasi hulu: +- Gudang YunoHost: +- Laporkan bug: + +## Info developer + +Silakan kirim pull request ke [`testing` branch](https://github.com/YunoHost-Apps/matomo_ynh/tree/testing). + +Untuk mencoba branch `testing`, silakan dilanjutkan seperti: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/matomo_ynh/tree/testing --debug +atau +sudo yunohost app upgrade matomo -u https://github.com/YunoHost-Apps/matomo_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..d1618ec --- /dev/null +++ b/README_ru.md @@ -0,0 +1,52 @@ + + +# Matomo для YunoHost + +[![Уровень интеграции](https://dash.yunohost.org/integration/matomo.svg)](https://ci-apps.yunohost.org/ci/apps/matomo/) ![Состояние работы](https://ci-apps.yunohost.org/ci/badges/matomo.status.svg) ![Состояние сопровождения](https://ci-apps.yunohost.org/ci/badges/matomo.maintain.svg) + +[![Установите Matomo с YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=matomo) + +*[Прочтите этот README на других языках.](./ALL_README.md)* + +> *Этот пакет позволяет Вам установить Matomo быстро и просто на YunoHost-сервер.* +> *Если у Вас нет YunoHost, пожалуйста, посмотрите [инструкцию](https://yunohost.org/install), чтобы узнать, как установить его.* + +## Обзор + +Matomo is the leading Free/Libre open analytics platform. At the end of the five-minute installation process, you will be given a JavaScript code. Simply copy and paste this tag on websites you wish to track and access your analytics reports in real-time. + +Matomo aims to be a Free software alternative to Google Analytics and is already used on more than 1,400,000 websites. Privacy is built-in! + + +**Поставляемая версия:** 5.1.1~ynh1 + +**Демо-версия:** + +## Снимки экрана + +![Снимок экрана Matomo](./doc/screenshots/screenshot.png) + +## Документация и ресурсы + +- Официальный веб-сайт приложения: +- Официальная документация администратора: +- Репозиторий кода главной ветки приложения: +- Магазин YunoHost: +- Сообщите об ошибке: + +## Информация для разработчиков + +Пришлите Ваш запрос на слияние в [ветку `testing`](https://github.com/YunoHost-Apps/matomo_ynh/tree/testing). + +Чтобы попробовать ветку `testing`, пожалуйста, сделайте что-то вроде этого: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/matomo_ynh/tree/testing --debug +или +sudo yunohost app upgrade matomo -u https://github.com/YunoHost-Apps/matomo_ynh/tree/testing --debug +``` + +**Больше информации о пакетировании приложений:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md index 62b4850..326877d 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -5,7 +5,7 @@ # YunoHost 上的 Matomo -[![集成程度](https://dash.yunohost.org/integration/matomo.svg)](https://dash.yunohost.org/appci/app/matomo) ![工作状态](https://ci-apps.yunohost.org/ci/badges/matomo.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/matomo.maintain.svg) +[![集成程度](https://dash.yunohost.org/integration/matomo.svg)](https://ci-apps.yunohost.org/ci/apps/matomo/) ![工作状态](https://ci-apps.yunohost.org/ci/badges/matomo.status.svg) ![维护状态](https://ci-apps.yunohost.org/ci/badges/matomo.maintain.svg) [![使用 YunoHost 安装 Matomo](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=matomo) @@ -21,7 +21,7 @@ Matomo is the leading Free/Libre open analytics platform. At the end of the five Matomo aims to be a Free software alternative to Google Analytics and is already used on more than 1,400,000 websites. Privacy is built-in! -**分发版本:** 5.1.0~ynh1 +**分发版本:** 5.1.1~ynh1 **演示:** diff --git a/manifest.toml b/manifest.toml index 7d1c4d8..e0bae90 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Matomo" description.en = "Analytics platform for measuring Web statistics" description.fr = "Plateforme d'analyse de mesure de statistiques Web" -version = "5.1.0~ynh1" +version = "5.1.1~ynh1" maintainers = [] @@ -51,8 +51,8 @@ ram.runtime = "50M" [resources.sources] [resources.sources.main] - url = "https://github.com/matomo-org/matomo/releases/download/5.1.0/matomo-5.1.0.tar.gz" - sha256 = "0157eea9576c1052f6ba9ffc142c403e57e639797e2921b0cc236b90fb2ca21a" + url = "https://github.com/matomo-org/matomo/releases/download/5.1.1/matomo-5.1.1.tar.gz" + sha256 = "c62e91f4efe93b106081aebec30ab38b00ca2bb43522ca6576fc60fb49a975e4" autoupdate.strategy = "latest_github_release" autoupdate.asset = "^matomo-.*tar.gz$" From b29a32e77df2197c07068e7c4b924370af2a28c9 Mon Sep 17 00:00:00 2001 From: YunoHost Bot Date: Mon, 2 Sep 2024 17:02:53 +0200 Subject: [PATCH 2/2] [autopatch] Automatic patch attempt for helpers 2.1 (#125) * Upgrade to v5.1.1 (#123) (#124) * Upgrade sources - `main` v5.1.1: https://github.com/matomo-org/matomo/releases/tag/5.1.1 * Auto-update READMEs Co-authored-by: YunoHost Bot * [autopatch] Automatic patch attempt for helpers 2.1 * cleaning --------- Co-authored-by: eric_G <46165813+ericgaspar@users.noreply.github.com> Co-authored-by: Yunohost-Bot <> --- conf/cron | 2 +- conf/extra_php-fpm.conf | 4 --- conf/nginx.conf | 2 +- manifest.toml | 4 ++- scripts/_common.sh | 14 +---------- scripts/backup | 36 +++++++-------------------- scripts/change_url | 32 +++++++++--------------- scripts/install | 24 +++++------------- scripts/remove | 19 ++++----------- scripts/restore | 38 +++++++++-------------------- scripts/upgrade | 54 +++++++++++------------------------------ 11 files changed, 64 insertions(+), 165 deletions(-) delete mode 100644 conf/extra_php-fpm.conf diff --git a/conf/cron b/conf/cron index c4274c5..de12624 100644 --- a/conf/cron +++ b/conf/cron @@ -1 +1 @@ -5 * * * * __APP__ /usr/bin/php__PHPVERSION__ __INSTALL_DIR__/console core:archive --url=https://__DOMAIN____PATH__ > /dev/null +5 * * * * __APP__ /usr/bin/php__PHP_VERSION__ __INSTALL_DIR__/console core:archive --url=https://__DOMAIN____PATH__ > /dev/null diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf deleted file mode 100644 index 700c37c..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 diff --git a/conf/nginx.conf b/conf/nginx.conf index bc41c6e..73745cf 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -17,7 +17,7 @@ location __PATH__/ { try_files $uri $uri/ =404; location ~ ^__PATH__/(index|matomo|piwik|js/index|plugins/HeatmapSessionRecording/configs)\.php$ { fastcgi_split_path_info ^(.+?\.php)(/.*)$; - 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; diff --git a/manifest.toml b/manifest.toml index e0bae90..d42be30 100644 --- a/manifest.toml +++ b/manifest.toml @@ -17,7 +17,8 @@ admindoc = "https://matomo.org/docs" code = "https://github.com/matomo-org/matomo" [integration] -yunohost = ">= 11.2" +yunohost = ">= 11.2.29" +helpers_version = "2.1" architectures = "all" multi_instance = true @@ -59,6 +60,7 @@ ram.runtime = "50M" [resources.system_user] [resources.install_dir] + group = "www-data:r-x" [resources.permissions] main.url = "/" diff --git a/scripts/_common.sh b/scripts/_common.sh index 944a65e..3d7f008 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,17 +1,5 @@ #!/bin/bash #================================================= -# COMMON VARIABLES -#================================================= - -#================================================= -# PERSONAL HELPERS -#================================================= - -#================================================= -# EXPERIMENTAL HELPERS -#================================================= - -#================================================= -# FUTURE OFFICIAL HELPERS +# COMMON VARIABLES AND CUSTOM HELPERS #================================================= diff --git a/scripts/backup b/scripts/backup index 35afc88..93e6628 100755 --- a/scripts/backup +++ b/scripts/backup @@ -1,53 +1,35 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - -# Keep this path for calling _common.sh inside the execution's context of backup and restore scripts source ../settings/scripts/_common.sh source /usr/share/yunohost/helpers -#================================================= -# DECLARE DATA AND CONF FILES TO BACKUP -#================================================= -ynh_print_info --message="Declaring files to be backed up..." +ynh_print_info "Declaring files to be backed up..." #================================================= # BACKUP THE APP MAIN DIR #================================================= -ynh_backup --src_path="$install_dir" +ynh_backup "$install_dir" #================================================= -# BACKUP THE NGINX CONFIGURATION +# SYSTEM 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 "/etc/php/$php_version/fpm/pool.d/$app.conf" -ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" - -#================================================= -# BACKUP VARIOUS FILES -#================================================= - -ynh_backup --src_path="/etc/cron.d/$app" +ynh_backup "/etc/cron.d/$app" #================================================= # BACKUP THE MYSQL DATABASE #================================================= -ynh_print_info --message="Backing up the MySQL database..." +ynh_print_info "Backing up 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/change_url b/scripts/change_url index fc21bd7..2975456 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC STARTING -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers @@ -14,40 +8,38 @@ email=$(ynh_user_get_info --username=$admin --key=mail) #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." --weight=3 +ynh_script_progression "Updating NGINX web server configuration..." -ynh_change_url_nginx_config +ynh_config_change_url_nginx #================================================= # SPECIFIC MODIFICATIONS #================================================= # RECONFIGURING MATOMO #================================================= -ynh_script_progression --message="Reconfiguring Matomo..." --weight=2 +ynh_script_progression "Reconfiguring Matomo..." if [[ -f "$install_dir/config/config.ini.php" ]]; then - # config.ini.php is only created during the post-install process... - # it is therefore not present when the CI tests are carried out... - # This condition is only for CI test to go through the upgrade process - - # See https://matomo.org/faq/how-to-install/faq_18/ - ynh_replace_string --match_string="$old_domain" --replace_string="$new_domain" --target_file="$install_dir/config/config.ini.php" + # config.ini.php is only created during the post-install process... + # it is therefore not present when the CI tests are carried out... + # This condition is only for CI test to go through the upgrade process + + # See https://matomo.org/faq/how-to-install/faq_18/ + ynh_replace --match="$old_domain" --replace="$new_domain" --file="$install_dir/config/config.ini.php" fi #================================================= # SETUP A CRON #================================================= -ynh_script_progression --message="Setuping a cron..." --weight=1 +ynh_script_progression "Setuping a cron..." path=$new_path domain=$new_domain -ynh_add_config --template="cron" --destination="/etc/cron.d/$app" -chown root: "/etc/cron.d/$app" -chmod 644 "/etc/cron.d/$app" +ynh_config_add --template="cron" --destination="/etc/cron.d/$app" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" --last +ynh_script_progression "Change of URL completed for $app" diff --git a/scripts/install b/scripts/install index 5e3005d..32450c5 100755 --- a/scripts/install +++ b/scripts/install @@ -1,11 +1,5 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers @@ -18,31 +12,25 @@ email=$(ynh_user_get_info --username=$admin --key=mail) #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." --weight=4 +ynh_script_progression "Setting up source files..." -# Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" - #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring PHP-FPM..." --weight=3 +ynh_script_progression "Configuring PHP-FPM..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config +ynh_config_add_phpfpm # Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add_nginx -ynh_add_config --template="cron" --destination="/etc/cron.d/$app" -chown root: "/etc/cron.d/$app" -chmod 644 "/etc/cron.d/$app" +ynh_config_add --template="cron" --destination="/etc/cron.d/$app" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" --last +ynh_script_progression "Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index a18a484..e4a3496 100755 --- a/scripts/remove +++ b/scripts/remove @@ -1,30 +1,21 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers #================================================= # REMOVE NGINX CONFIGURATION #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 +ynh_script_progression "Removing NGINX web server configuration..." -# Remove the dedicated NGINX config -ynh_remove_nginx_config +ynh_config_remove_nginx -# Remove the dedicated PHP-FPM config -ynh_remove_fpm_config +ynh_config_remove_phpfpm -# Remove a cron file -ynh_secure_remove --file="/etc/cron.d/$app" +ynh_safe_rm "/etc/cron.d/$app" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" --last +ynh_script_progression "Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index d8ff46c..d1dd4c9 100755 --- a/scripts/restore +++ b/scripts/restore @@ -1,57 +1,43 @@ #!/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 #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." --weight=3 +ynh_script_progression "Restoring the app main directory..." -ynh_restore_file --origin_path="$install_dir" - -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" +ynh_restore "$install_dir" #================================================= # RESTORE THE MYSQL DATABASE #================================================= -ynh_script_progression --message="Restoring the MySQL database..." --weight=1 +ynh_script_progression "Restoring the MySQL database..." -ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql +ynh_mysql_db_shell < ./db.sql #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=2 +ynh_script_progression "Restoring the PHP-FPM configuration..." -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +ynh_restore "/etc/php/$php_version/fpm/pool.d/$app.conf" -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_restore "/etc/nginx/conf.d/$domain.d/$app.conf" -ynh_restore_file --origin_path="/etc/cron.d/$app" -chown root: "/etc/cron.d/$app" -chmod 644 "/etc/cron.d/$app" +ynh_restore "/etc/cron.d/$app" -#================================================= -# GENERIC FINALIZATION #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1 +ynh_script_progression "Reloading NGINX web server and PHP-FPM..." -ynh_systemd_action --service_name=php$phpversion-fpm --action=reload -ynh_systemd_action --service_name=nginx --action=reload +ynh_systemctl --service=php$php_version-fpm --action=reload +ynh_systemctl --service=nginx --action=reload #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" --last +ynh_script_progression "Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index 342fa49..27a0d97 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,62 +1,36 @@ #!/bin/bash -#================================================= -# GENERIC START -#================================================= -# IMPORT GENERIC HELPERS -#================================================= - source _common.sh source /usr/share/yunohost/helpers -#================================================= -# CHECK VERSION -#================================================= - -upgrade_type=$(ynh_check_app_version_changed) - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= +ynh_script_progression "Upgrading source files..." -if [ "$upgrade_type" == "UPGRADE_APP" ] -then - ynh_script_progression --message="Upgrading source files..." --weight=3 - - if [[ ! -f "$install_dir/config/config.ini.php" ]]; then - # config.ini.php is only created during the post-install process... - # it is therefore not present when the CI tests are carried out... - # This condition is only for CI test to go through the upgrade process - ynh_setup_source --dest_dir="$install_dir" - else - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$install_dir" --keep="config/config.ini.php" --full_replace=1 - - chown -R $app:www-data "$install_dir" - ynh_exec_as $app php${phpversion} $install_dir/console core:update -n - fi +if [[ ! -f "$install_dir/config/config.ini.php" ]]; then + # config.ini.php is only created during the post-install process... + # it is therefore not present when the CI tests are carried out... + # This condition is only for CI test to go through the upgrade process + ynh_setup_source --dest_dir="$install_dir" +else + ynh_setup_source --dest_dir="$install_dir" --keep="config/config.ini.php" --full_replace + ynh_exec_as_app php${php_version} $install_dir/console core:update -n fi -chmod -R o-rwx "$install_dir" -chown -R $app:www-data "$install_dir" - #================================================= # PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 +ynh_script_progression "Upgrading PHP-FPM configuration..." -# Create a dedicated PHP-FPM config -ynh_add_fpm_config +ynh_config_add_phpfpm -# Create a dedicated NGINX config -ynh_add_nginx_config +ynh_config_add_nginx -ynh_add_config --template="cron" --destination="/etc/cron.d/$app" -chown root: "/etc/cron.d/$app" -chmod 644 "/etc/cron.d/$app" +ynh_config_add --template="cron" --destination="/etc/cron.d/$app" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" --last +ynh_script_progression "Upgrade of $app completed"