From 8d5c559dc0d86f736f1019a3640baa05f0c0c7ad Mon Sep 17 00:00:00 2001 From: eric_G <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 23 Aug 2024 15:57:10 +0200 Subject: [PATCH 1/2] Testing (#73) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Upgrade to v0.24.1 (#63) * Upgrade to v0.24.1 * Auto-update READMEs * Update manifest.toml * Auto-update READMEs * Update manifest.toml * Update install * Update upgrade * Update upgrade * Update _common.sh --------- Co-authored-by: Éric Gaspar <46165813+ericgaspar@users.noreply.github.com> * Auto-update READMEs * cleaning * cleaning * Update manifest.toml * Update manifest.toml * Auto-update READMEs * Auto-update READMEs * Update manifest.toml * Auto-update READMEs * Upgrade to v0.27.1 (#72) * Upgrade sources - `main` v0.27.1: https://github.com/movim/movim/releases/tag/0.27.1 * Auto-update READMEs --------- Co-authored-by: YunoHost Bot Co-authored-by: yunohost-bot --- ALL_README.md | 1 + README.md | 2 +- README_es.md | 2 +- README_eu.md | 2 +- README_fr.md | 2 +- README_gl.md | 2 +- README_id.md | 2 +- README_ru.md | 50 +++++++++++++++++++++++++++++++++++++++++++++++ README_zh_Hans.md | 2 +- manifest.toml | 6 +++--- 10 files changed, 61 insertions(+), 10 deletions(-) create mode 100644 README_ru.md diff --git a/ALL_README.md b/ALL_README.md index 4ed64dd..e3c80d2 100644 --- a/ALL_README.md +++ b/ALL_README.md @@ -6,4 +6,5 @@ - [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 6fef67d..f9dfbb7 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ It shall NOT be edited by hand. Web-based cross-platform XMPP client -**Shipped version:** 0.26~ynh1 +**Shipped version:** 0.27.1~ynh1 **Demo:** diff --git a/README_es.md b/README_es.md index ffae5c3..0a29d3f 100644 --- a/README_es.md +++ b/README_es.md @@ -19,7 +19,7 @@ No se debe editar a mano. Web-based cross-platform XMPP client -**Versión actual:** 0.26~ynh1 +**Versión actual:** 0.27.1~ynh1 **Demo:** diff --git a/README_eu.md b/README_eu.md index 8009207..2ce1331 100644 --- a/README_eu.md +++ b/README_eu.md @@ -19,7 +19,7 @@ EZ editatu eskuz. Web-based cross-platform XMPP client -**Paketatutako bertsioa:** 0.26~ynh1 +**Paketatutako bertsioa:** 0.27.1~ynh1 **Demoa:** diff --git a/README_fr.md b/README_fr.md index 044d2c5..3b22104 100644 --- a/README_fr.md +++ b/README_fr.md @@ -19,7 +19,7 @@ Il NE doit PAS être modifié à la main. Client XMPP multiplateforme basé sur le Web -**Version incluse :** 0.26~ynh1 +**Version incluse :** 0.27.1~ynh1 **Démo :** diff --git a/README_gl.md b/README_gl.md index 9aab761..b8c6107 100644 --- a/README_gl.md +++ b/README_gl.md @@ -19,7 +19,7 @@ NON debe editarse manualmente. Web-based cross-platform XMPP client -**Versión proporcionada:** 0.26~ynh1 +**Versión proporcionada:** 0.27.1~ynh1 **Demo:** diff --git a/README_id.md b/README_id.md index 7742344..aa3419c 100644 --- a/README_id.md +++ b/README_id.md @@ -19,7 +19,7 @@ Ini TIDAK boleh diedit dengan tangan. Web-based cross-platform XMPP client -**Versi terkirim:** 0.26~ynh1 +**Versi terkirim:** 0.27.1~ynh1 **Demo:** diff --git a/README_ru.md b/README_ru.md new file mode 100644 index 0000000..5439d77 --- /dev/null +++ b/README_ru.md @@ -0,0 +1,50 @@ + + +# Movim для YunoHost + +[![Уровень интеграции](https://dash.yunohost.org/integration/movim.svg)](https://ci-apps.yunohost.org/ci/apps/movim/) ![Состояние работы](https://ci-apps.yunohost.org/ci/badges/movim.status.svg) ![Состояние сопровождения](https://ci-apps.yunohost.org/ci/badges/movim.maintain.svg) + +[![Установите Movim с YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=movim) + +*[Прочтите этот README на других языках.](./ALL_README.md)* + +> *Этот пакет позволяет Вам установить Movim быстро и просто на YunoHost-сервер.* +> *Если у Вас нет YunoHost, пожалуйста, посмотрите [инструкцию](https://yunohost.org/install), чтобы узнать, как установить его.* + +## Обзор + +Web-based cross-platform XMPP client + + +**Поставляемая версия:** 0.27.1~ynh1 + +**Демо-версия:** + +## Снимки экрана + +![Снимок экрана Movim](./doc/screenshots/movim.png) + +## Документация и ресурсы + +- Официальный веб-сайт приложения: +- Официальная документация администратора: +- Репозиторий кода главной ветки приложения: +- Магазин YunoHost: +- Сообщите об ошибке: + +## Информация для разработчиков + +Пришлите Ваш запрос на слияние в [ветку `testing`](https://github.com/YunoHost-Apps/movim_ynh/tree/testing). + +Чтобы попробовать ветку `testing`, пожалуйста, сделайте что-то вроде этого: + +```bash +sudo yunohost app install https://github.com/YunoHost-Apps/movim_ynh/tree/testing --debug +или +sudo yunohost app upgrade movim -u https://github.com/YunoHost-Apps/movim_ynh/tree/testing --debug +``` + +**Больше информации о пакетировании приложений:** diff --git a/README_zh_Hans.md b/README_zh_Hans.md index a6dd7b2..629d462 100644 --- a/README_zh_Hans.md +++ b/README_zh_Hans.md @@ -19,7 +19,7 @@ Web-based cross-platform XMPP client -**分发版本:** 0.26~ynh1 +**分发版本:** 0.27.1~ynh1 **演示:** diff --git a/manifest.toml b/manifest.toml index e3f415b..195c4ff 100644 --- a/manifest.toml +++ b/manifest.toml @@ -7,7 +7,7 @@ name = "Movim" description.en = "Decentralized social platform based on XMPP" description.fr = "Plateforme sociale décentralisée basée sur XMPP" -version = "0.26~ynh1" +version = "0.27.1~ynh1" maintainers = [] @@ -42,8 +42,8 @@ ram.runtime = "50M" [resources] [resources.sources.main] - url = "https://github.com/movim/movim/archive/refs/tags/v0.26.tar.gz" - sha256 = "91a27a32d8f0a77397c55d366b23bf0ca44605f1bee5dff5facae1cef202903f" + url = "https://github.com/movim/movim/archive/refs/tags/v0.27.1.tar.gz" + sha256 = "64be341ba2914ce3ab2ed29c97cdcbfbe72e2b404ae1faeaf78c909c3964be42" autoupdate.strategy = "latest_github_tag" From f37a6226cfee64a62c726f18debbaa267eea56a8 Mon Sep 17 00:00:00 2001 From: Yunohost-Bot <> Date: Sat, 31 Aug 2024 01:08:15 +0200 Subject: [PATCH 2/2] [autopatch] Automatic patch attempt for helpers 2.1 --- conf/extra_php-fpm.conf | 4 -- conf/nginx.conf | 2 +- conf/systemd.service | 2 +- config_panel.toml.example | 30 ------------- manifest.toml | 4 +- scripts/_common.sh | 16 +------ scripts/backup | 19 ++++---- scripts/change_url | 18 ++++---- scripts/config | 95 --------------------------------------- scripts/install | 53 +++++++++++----------- scripts/remove | 12 ++--- scripts/restore | 35 +++++++-------- scripts/upgrade | 58 ++++++++++++------------ 13 files changed, 104 insertions(+), 244 deletions(-) delete mode 100644 conf/extra_php-fpm.conf delete mode 100644 config_panel.toml.example delete mode 100644 scripts/config diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf deleted file mode 100644 index f796032..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] = 100M -php_admin_value[post_max_size] = 100M diff --git a/conf/nginx.conf b/conf/nginx.conf index 6912550..a03f6ec 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -17,7 +17,7 @@ location __PATH__/ { # fastcgi_no_cache $no_cache; 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/conf/systemd.service b/conf/systemd.service index d59a132..278ec4d 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ -ExecStart=/usr/bin/php__PHPVERSION__ daemon.php start +ExecStart=/usr/bin/php__PHP_VERSION__ daemon.php start StandardOutput=syslog SyslogIdentifier=__APP__ PIDFile=/run/movim.pid diff --git a/config_panel.toml.example b/config_panel.toml.example deleted file mode 100644 index 00009c3..0000000 --- a/config_panel.toml.example +++ /dev/null @@ -1,30 +0,0 @@ -version = "1.0" - -[main] -name = "Movim configuration" - - [main.php_fpm_config] - name = "PHP-FPM configuration" - - [main.php_fpm_config.fpm_footprint] - ask = "Memory footprint" - type = "select" - choices.low = "Low, <= 20Mb per pool" - choices.medium = "Medium, between 20Mb and 40Mb per pool" - choices.high = "High, > 40Mb per pool" - choices.specific = "Use specific value" - default = "low" - - [main.php_fpm_config.fpm_free_footprint] - visible = "fpm_footprint == 'specific'" - ask = "Memory footprint of the service?" - type = "number" - default = "0" - help = "Free field to specify exactly the footprint in Mb if you don't want to use one of the three previous values." - - [main.php_fpm_config.fpm_usage] - ask = "Expected usage" - type = "select" - choices = ["low", "medium", "high"] - default = "low" - help = "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." diff --git a/manifest.toml b/manifest.toml index 195c4ff..c6abfda 100644 --- a/manifest.toml +++ b/manifest.toml @@ -20,7 +20,8 @@ code = "https://github.com/movim/movim" cpe = "cpe:2.3:a:movim:movim" [integration] -yunohost = ">= 11.2.20" +yunohost = ">= 11.2.18" +helpers_version = "2.1" architectures = "all" multi_instance = false @@ -52,6 +53,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 7078d8d..452176f 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,19 +1,7 @@ #!/bin/bash #================================================= -# COMMON VARIABLES +# COMMON VARIABLES AND CUSTOM HELPERS #================================================= -YNH_COMPOSER_VERSION="2.7.7" - -#================================================= -# PERSONAL HELPERS -#================================================= - -#================================================= -# EXPERIMENTAL HELPERS -#================================================= - -#================================================= -# FUTURE OFFICIAL HELPERS -#================================================= +composer_version="2.7.7" diff --git a/scripts/backup b/scripts/backup index ecedc29..736cf60 100644 --- a/scripts/backup +++ b/scripts/backup @@ -8,36 +8,33 @@ 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" #================================================= # SYSTEM CONFIGURATION #================================================= -ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" +ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf" -ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +ynh_backup "/etc/php/$php_version/fpm/pool.d/$app.conf" -ynh_backup --src_path="/etc/systemd/system/$app.service" +ynh_backup "/etc/systemd/system/$app.service" #================================================= # BACKUP THE POSTGRESQL DATABASE #================================================= -ynh_print_info --message="Backing up the PostgreSQL database..." +ynh_print_info "Backing up the PostgreSQL database..." -ynh_psql_dump_db --database="$db_name" > db.sql +ynh_psql_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 13ed4d9..147fcad 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -10,33 +10,33 @@ source /usr/share/yunohost/helpers #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping $app's systemd service..." +ynh_script_progression "Stopping $app's systemd service..." -ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" +ynh_systemctl --service=$app --action="stop" --log_path="systemd" #================================================= # MODIFY URL IN NGINX CONF #================================================= -ynh_script_progression --message="Updating NGINX web server configuration..." +ynh_script_progression "Updating NGINX web server configuration..." -ynh_change_url_nginx_config +ynh_config_change_url_nginx #================================================= # SPECIFIC MODIFICATIONS #================================================= -ynh_script_progression --message="Configuring $app's systemd service..." +ynh_script_progression "Configuring $app's systemd service..." -ynh_add_systemd_config +ynh_config_add_systemd #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting $app's systemd service..." --weight=1 +ynh_script_progression "Starting $app's systemd service..." -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Movim daemon launched" +ynh_systemctl --service="$app" --action="start" --log_path="systemd" --wait_until="Movim daemon launched" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Change of URL completed for $app" +ynh_script_progression "Change of URL completed for $app" diff --git a/scripts/config b/scripts/config deleted file mode 100644 index 91c2de7..0000000 --- a/scripts/config +++ /dev/null @@ -1,95 +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_app_setting_get --app=$app --key=phpversion) -current_fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) - -#================================================= -# SPECIFIC GETTERS FOR TOML SHORT KEY -#================================================= - -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__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 dbd60d3..7050901 100644 --- a/scripts/install +++ b/scripts/install @@ -7,79 +7,80 @@ source _common.sh source /usr/share/yunohost/helpers +ynh_app_setting_set --key=php_upload_max_filesize --value=100M + #================================================= # CONFIGURING A POSTGRESQL DATABASE #================================================= -ynh_script_progression --message="Configuring $app's PostgreSQL database..." +ynh_script_progression "Configuring $app's PostgreSQL database..." # FIXME: is it actually required? -ynh_psql_execute_as_root --database="$db_name" --sql="CREATE EXTENSION IF NOT EXISTS unaccent;" -ynh_psql_execute_as_root --database="$db_name" --sql="CREATE EXTENSION IF NOT EXISTS pg_trgm;" +ynh_psql_db_shell <<< "CREATE EXTENSION IF NOT EXISTS unaccent;" +ynh_psql_db_shell <<< "CREATE EXTENSION IF NOT EXISTS pg_trgm;" #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Setting up source files..." +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" # Patch call to php in composer -ynh_replace_string -f "$install_dir/composer.json" --match_string='"vendor/bin/phinx' --replace_string='"@php vendor/bin/phinx' +ynh_replace -f "$install_dir/composer.json" --match='"vendor/bin/phinx' --replace='"@php vendor/bin/phinx' # Patch call to php in daemon code -ynh_replace_string -f "$install_dir/src/Movim/Daemon/Session.php" --match_string="exec php" --replace_string="exec php$phpversion" - -chmod -R o-rwx "$install_dir" -chown -R "$app:www-data" "$install_dir" +ynh_replace -f "$install_dir/src/Movim/Daemon/Session.php" --match="exec php" --replace="exec php$php_version" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:www-data" "$install_dir" #================================================= # ADD A CONFIGURATION #================================================= -ynh_script_progression --message="Adding $app's configuration file..." +ynh_script_progression "Adding $app's configuration file..." -ynh_add_config --template="dot_env" --destination="$install_dir/.env" +ynh_config_add --template="dot_env" --destination="$install_dir/.env" -chmod 400 "$install_dir/.env" -chown "$app:$app" "$install_dir/.env" +#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/.env" +#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown "$app:$app" "$install_dir/.env" #================================================= # BUILD MOVIM #================================================= -ynh_script_progression --message="Building Movim..." +ynh_script_progression "Building Movim..." # Install composer -ynh_install_composer - -COMPOSER_ALLOW_SUPERUSER=1 ynh_exec_warn_less ynh_composer_exec --commands="movim:migrate" -chmod -R o-rwx "$install_dir" -chown -R "$app:www-data" "$install_dir" +ynh_composer_install +ynh_composer_exec install --no-dev +COMPOSER_ALLOW_SUPERUSER=1 ynh_composer_exec movim:migrate +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:www-data" "$install_dir" #================================================= # SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 +ynh_script_progression "Adding system configurations related to $app..." # 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 # Create a dedicated systemd config -ynh_add_systemd_config +ynh_config_add_systemd yunohost service add "$app" --description="Responsive web-based XMPP client" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting $app's systemd service..." +ynh_script_progression "Starting $app's systemd service..." # Start a systemd service -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Movim daemon launched" +ynh_systemctl --service="$app" --action="start" --log_path="systemd" --wait_until="Movim daemon launched" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Installation of $app completed" +ynh_script_progression "Installation of $app completed" diff --git a/scripts/remove b/scripts/remove index 0f607ed..e18e114 100644 --- a/scripts/remove +++ b/scripts/remove @@ -10,24 +10,24 @@ source /usr/share/yunohost/helpers #================================================= # REMOVE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 +ynh_script_progression "Removing system configurations related to $app..." # Remove the service from the list of services known by YunoHost (added from `yunohost service add`) -if ynh_exec_warn_less yunohost service status "$app" >/dev/null; then +if ynh_hide_warnings yunohost service status "$app" >/dev/null; then yunohost service remove "$app" fi # Remove the dedicated systemd config -ynh_remove_systemd_config +ynh_config_remove_systemd # 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 #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Removal of $app completed" +ynh_script_progression "Removal of $app completed" diff --git a/scripts/restore b/scripts/restore index bc38387..f59c9d9 100644 --- a/scripts/restore +++ b/scripts/restore @@ -11,49 +11,48 @@ source /usr/share/yunohost/helpers #================================================= # RESTORE THE APP MAIN DIR #================================================= -ynh_script_progression --message="Restoring the app main directory..." +ynh_script_progression "Restoring the app main directory..." -ynh_restore_file --origin_path="$install_dir" - -chmod 750 "$install_dir" -chmod -R o-rwx "$install_dir" -chown -R "$app:www-data" "$install_dir" +ynh_restore "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 750 "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:www-data" "$install_dir" #================================================= # RESTORE THE POSTGRESQL DATABASE #================================================= -ynh_script_progression --message="Restoring the PostgreSQL database..." +ynh_script_progression "Restoring the PostgreSQL database..." -ynh_psql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < ./db.sql +ynh_psql_db_shell < ./db.sql #================================================= # RESTORE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 +ynh_script_progression "Restoring system configurations related to $app..." -ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +ynh_restore "/etc/php/$php_version/fpm/pool.d/$app.conf" # Recreate a dedicated PHP-FPM config -ynh_add_fpm_config +ynh_config_add_phpfpm -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/systemd/system/$app.service" +ynh_restore "/etc/systemd/system/$app.service" systemctl enable "$app.service" --quiet yunohost service add "$app" --description="Responsive web-based XMPP client" #================================================= # RELOAD NGINX AND PHP-FPM OR THE APP SERVICE #================================================= -ynh_script_progression --message="Reloading NGINX web server and $app's service..." --weight=1 +ynh_script_progression "Reloading NGINX web server and $app's service..." -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Movim daemon launched" -ynh_systemd_action --service_name="php$phpversion-fpm" --action=reload +ynh_systemctl --service="$app" --action="start" --log_path="systemd" --wait_until="Movim daemon launched" +ynh_systemctl --service="php$php_version-fpm" --action=reload -ynh_systemd_action --service_name=nginx --action="reload" +ynh_systemctl --service=nginx --action="reload" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Restoration completed for $app" +ynh_script_progression "Restoration completed for $app" diff --git a/scripts/upgrade b/scripts/upgrade index 04df6c6..8eb4ae9 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,89 +7,91 @@ source _common.sh source /usr/share/yunohost/helpers +ynh_app_setting_set_default --key=php_upload_max_filesize --value=100M + #================================================= # STOP SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Stopping $app's systemd service..." +ynh_script_progression "Stopping $app's systemd service..." -ynh_systemd_action --service_name="$app" --action="stop" --log_path="systemd" +ynh_systemctl --service="$app" --action="stop" --log_path="systemd" #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= -ynh_script_progression --message="Ensuring downward compatibility..." +ynh_script_progression "Ensuring downward compatibility..." if [ -f "$install_dir/config/db.inc.php" ]; then - ynh_secure_remove --file="$install_dir/config/db.inc.php" + ynh_safe_rm "$install_dir/config/db.inc.php" fi if [[ -n "${path:-}" ]] && [[ "${path:-}" != "/" ]]; then - ynh_die --message="Movim can't be installed in a subdir anymore. Please change_url to the root of a domain before upgrading." + ynh_die "Movim can't be installed in a subdir anymore. Please change_url to the root of a domain before upgrading." fi #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= -ynh_script_progression --message="Upgrading source files..." +ynh_script_progression "Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep=".env" +ynh_setup_source --dest_dir="$install_dir" --full_replace --keep=".env" # Patch call to php in composer -ynh_replace_string -f "$install_dir/composer.json" --match_string='"vendor/bin/phinx' --replace_string='"@php vendor/bin/phinx' +ynh_replace -f "$install_dir/composer.json" --match='"vendor/bin/phinx' --replace='"@php vendor/bin/phinx' # Patch call to php in daemon code -ynh_replace_string -f "$install_dir/src/Movim/Daemon/Session.php" --match_string="exec php" --replace_string="exec php$phpversion" - -chmod -R o-rwx "$install_dir" -chown -R "$app:www-data" "$install_dir" +ynh_replace -f "$install_dir/src/Movim/Daemon/Session.php" --match="exec php" --replace="exec php$php_version" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod -R o-rwx "$install_dir" +#REMOVEME? Assuming the install dir is setup using ynh_setup_source, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown -R "$app:www-data" "$install_dir" #================================================= # UPDATE A CONFIG FILE #================================================= -ynh_script_progression --message="Updating $app's configuration file..." +ynh_script_progression "Updating $app's configuration file..." -ynh_add_config --template="dot_env" --destination="$install_dir/.env" +ynh_config_add --template="dot_env" --destination="$install_dir/.env" -chmod 400 "$install_dir/.env" -chown "$app:$app" "$install_dir/.env" +#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chmod 400 "$install_dir/.env" +#REMOVEME? Assuming the file is setup using ynh_config_add, the proper chmod/chowns are now already applied and it shouldn't be necessary to tweak perms | chown "$app:$app" "$install_dir/.env" #================================================= # BUILD MOVIM #================================================= -ynh_script_progression --message="Building $app..." +ynh_script_progression "Building $app..." -ynh_exec_warn_less ynh_install_composer +ynh_composer_install +ynh_composer_exec install --no-dev -COMPOSER_ALLOW_SUPERUSER=1 ynh_exec_warn_less ynh_composer_exec --commands="config --global discard-changes true --quiet" -COMPOSER_ALLOW_SUPERUSER=1 ynh_exec_warn_less ynh_composer_exec --commands="update --no-interaction --quiet" -COMPOSER_ALLOW_SUPERUSER=1 ynh_exec_warn_less ynh_composer_exec --commands="movim:migrate --quiet" +COMPOSER_ALLOW_SUPERUSER=1 ynh_composer_exec config --global discard-changes true --quiet +COMPOSER_ALLOW_SUPERUSER=1 ynh_composer_exec update --no-interaction --quiet +COMPOSER_ALLOW_SUPERUSER=1 ynh_composer_exec movim:migrate --quiet #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 +ynh_script_progression "Upgrading system configurations related to $app..." # 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 # Create a dedicated systemd config -ynh_add_systemd_config +ynh_config_add_systemd yunohost service add "$app" --description="Responsive web-based XMPP client" #================================================= # START SYSTEMD SERVICE #================================================= -ynh_script_progression --message="Starting $app's systemd service..." +ynh_script_progression "Starting $app's systemd service..." # Start a systemd service -ynh_systemd_action --service_name="$app" --action="start" --log_path="systemd" --line_match="Movim daemon launched" +ynh_systemctl --service="$app" --action="start" --log_path="systemd" --wait_until="Movim daemon launched" #================================================= # END OF SCRIPT #================================================= -ynh_script_progression --message="Upgrade of $app completed" +ynh_script_progression "Upgrade of $app completed"