From eb54592d2d618c43751a0353c8946f4ba3d15207 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 15 Jan 2021 13:32:05 +0100 Subject: [PATCH] Testing (#20) * Fix linter warning --- README.md | 2 +- README_fr.md | 2 +- check_process | 1 - conf/systemd.service | 2 +- issue_template.md | 2 +- manifest.json | 4 ++-- scripts/install | 27 ++++++++++++++------------- scripts/remove | 9 +++++---- scripts/restore | 11 ++++++----- scripts/upgrade | 25 ++++++++++++------------- 10 files changed, 43 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index cceca2a..1fdec00 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Movim for YunoHost [![Integration level](https://dash.yunohost.org/integration/movim.svg)](https://dash.yunohost.org/appci/app/movim) ![](https://ci-apps.yunohost.org/ci/badges/movim.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/movim.maintain.svg) -[![Install Movim with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=movim) +[![Install Movim with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=movim) *[Lire ce readme en français.](./README_fr.md)* diff --git a/README_fr.md b/README_fr.md index b0ab399..ea6ea5d 100644 --- a/README_fr.md +++ b/README_fr.md @@ -1,7 +1,7 @@ # Movim pour YunoHost [![Integration level](https://dash.yunohost.org/integration/movim.svg)](https://dash.yunohost.org/appci/app/movim) ![](https://ci-apps.yunohost.org/ci/badges/movim.status.svg) ![](https://ci-apps.yunohost.org/ci/badges/movim.maintain.svg) -[![Installer Movim avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=movim) +[![Installer Movim avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=movim) *[Read this readme in english.](./README.md)* diff --git a/check_process b/check_process index ae3a979..7a65692 100644 --- a/check_process +++ b/check_process @@ -22,7 +22,6 @@ upgrade=1 backup_restore=1 multi_instance=0 - incorrect_path=1 port_already_use=1 change_url=0 ;;; Options diff --git a/conf/systemd.service b/conf/systemd.service index 24c5f4e..85b6e6c 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,7 +6,7 @@ After=nginx.service network.target local-fs.target postgresql.service Type=simple User=__APP__ WorkingDirectory=__FINALPATH__ -ExecStart=/usr/bin/php7.3 daemon.php start --interface=127.0.0.1 --url=https://__DOMAIN____PATH__/ --port=__PORT__ +ExecStart=/usr/bin/php__PHP_VERSION__ daemon.php start --interface=127.0.0.1 --url=https://__DOMAIN____PATH__/ --port=__PORT__ StandardOutput=syslog SyslogIdentifier=__APP__ PIDFile=/run/movim.pid diff --git a/issue_template.md b/issue_template.md index 3d5c5d9..c5be5d0 100644 --- a/issue_template.md +++ b/issue_template.md @@ -22,7 +22,7 @@ about: When creating a bug report, please use the following template to provide - Hardware: *VPS bought online / Old laptop or computer / Raspberry Pi at home / Internet Cube with VPN / Other ARM board / ...* - YunoHost version: x.x.x - I have access to my server: *Through SSH | through the webadmin | direct access via keyboard / screen | ...* -- Are you in a special context or did you perform some particular tweaking on your YunoHost instance ?: *no / yes* +- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: *no / yes* - If yes, please explain: - Using, or trying to install package version/branch: - If upgrading, current package version: *can be found in the admin, or with `yunohost app info $app_id`* diff --git a/manifest.json b/manifest.json index cec3fb8..ffa3a9b 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Web-based cross-platform XMPP client", "fr": "Client XMPP multiplateforme basé sur le Web" }, - "version": "0.18~ynh4", + "version": "0.18~ynh5", "url": "https://movim.eu", "license": "AGPL-3.0-or-later", "maintainer": { @@ -19,7 +19,7 @@ "multi_instance": false, "services": [ "nginx", - "php7.0-fpm", + "php7.3-fpm", "postgresql", "metronome" ], diff --git a/scripts/install b/scripts/install index 99ecf5c..1ff4524 100644 --- a/scripts/install +++ b/scripts/install @@ -55,7 +55,7 @@ ynh_app_setting_set --app=$app --key=is_public --value=$is_public #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Configuring firewall..." --weight=2 +ynh_script_progression --message="Finding an available port..." --weight=2 # Find a free port port=$(ynh_find_port --port=9537) @@ -67,7 +67,7 @@ ynh_app_setting_set --app=$app --key=port --value=$port ynh_script_progression --message="Installing dependencies..." --weight=1 # Install packages -ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE A POSTGRESQL DATABASE @@ -139,12 +139,11 @@ ynh_store_file_checksum --file="$final_path/config/db.inc.php" # Install PHP dependencies using composer #================================================= -( - cd "$final_path" +pushd $final_path export COMPOSER_HOME=$final_path - curl -sS https://getcomposer.org/installer | php${phpversion} -- --version="1.10.16" --install-dir="$final_path" \ - && php${phpversion} composer.phar install --no-interaction -) + ynh_exec_warn_less curl -sS https://getcomposer.org/installer | php${phpversion} -- --version="1.10.16" --install-dir="$final_path" \ + && php${phpversion} composer.phar install --no-interaction --quiet +popd #================================================= # SETUP SYSTEMD @@ -153,7 +152,8 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=1 ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file=../conf/systemd.service ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file=../conf/systemd.service -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/systemd.service +ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/systemd.service +ynh_replace_string --match_string="__PHP_VERSION__" --replace_string="$phpversion" --target_file=../conf/systemd.service ynh_add_systemd_config @@ -168,9 +168,10 @@ cache_dir="/home/$app" mkdir -p $cache_dir chown -R $app $cache_dir -cd "$final_path" -ynh_exec_as $app php$phpversion composer.phar $app:migrate -ynh_exec_as $app php$phpversion daemon.php config --username=$admin --password=$password +pushd $final_path + ynh_exec_as $app php$phpversion composer.phar $app:migrate --quiet + ynh_exec_as $app php$phpversion daemon.php config --username=$admin --password=$password --quiet +popd #================================================= # GENERIC FINALIZATION @@ -186,7 +187,7 @@ chown -R $app $final_path/src/Movim/ #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description "Responsive web-based XMPP client" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Responsive web-based XMPP client" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE @@ -194,7 +195,7 @@ yunohost service add $app --description "Responsive web-based XMPP client" --log ynh_script_progression --message="Starting a systemd service..." --weight=2 # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #--line_match="HTTP Server listening" +ynh_systemd_action --service_name=$app --action=start --log_path="systemd" #--line_match="HTTP Server listening" #================================================= # SETUP SSOWAT diff --git a/scripts/remove b/scripts/remove index 6fd9394..693af90 100644 --- a/scripts/remove +++ b/scripts/remove @@ -16,10 +16,10 @@ source /usr/share/yunohost/helpers app=$YNH_APP_INSTANCE_NAME # Retrieve app settings -domain=$(ynh_app_setting_get --app="$app" --key=domain) -final_path=$(ynh_app_setting_get --app="$app" --key=final_path) -port=$(ynh_app_setting_get --app="$app" --key=port) -db_name=$(ynh_app_setting_get --app="$app" --key=db_name) +domain=$(ynh_app_setting_get --app=$app --key=domain) +final_path=$(ynh_app_setting_get --app=$app --key=final_path) +port=$(ynh_app_setting_get --app=$app --key=port) +db_name=$(ynh_app_setting_get --app=$app --key=db_name) db_user=$db_name #================================================= @@ -62,6 +62,7 @@ ynh_remove_nginx_config #================================================= # REMOVE DEPENDENCIES #================================================= +ynh_script_progression --message="Removing dependencies..." --weight=1 # Remove metapackage and its dependencies ynh_remove_app_dependencies diff --git a/scripts/restore b/scripts/restore index 00ef06f..1e83f6b 100644 --- a/scripts/restore +++ b/scripts/restore @@ -80,7 +80,7 @@ chown -R $app $final_path/src/Movim/ # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_restore_file --origin_path="/etc/php/${phpversion}/fpm/pool.d/$app.conf" +ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" #================================================= # SPECIFIC RESTORATION @@ -90,7 +90,7 @@ ynh_restore_file --origin_path="/etc/php/${phpversion}/fpm/pool.d/$app.conf" ynh_script_progression --message="Reinstalling dependencies..." --weight=2 # Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies #================================================= # RESTORE THE POSTGRESQL DATABASE @@ -112,15 +112,16 @@ systemctl enable $app.service --quiet #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description "Responsive web-based XMPP client" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Responsive web-based XMPP client" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=2 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action=start --log_path="/var/log/$app/$app.log" #================================================= # GENERIC FINALIZATION @@ -129,7 +130,7 @@ ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$ap #================================================= ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1 -ynh_systemd_action --service_name=php${phpversion}-fpm --action=reload +ynh_systemd_action --service_name=php$phpversion-fpm --action=reload ynh_systemd_action --service_name=nginx --action=reload #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 8225b90..24b4872 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -107,7 +107,7 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Upgrading dependencies..." --weight=4 -ynh_install_app_dependencies $pkg_dependencies +ynh_exec_warn_less ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER @@ -126,7 +126,6 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 ynh_replace_string --match_string="__TIMEZONE__" --replace_string="$timezone" --target_file=../conf/php-fpm.conf ynh_add_fpm_config --package="$extra_php_dependencies" -phpversion=$(ynh_app_setting_get --app="$app" --key=phpversion) #================================================= # SET PERMISSIONS @@ -140,27 +139,26 @@ chown -R $app $final_path/src/Movim/Bootstrap.php #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add $app --description "Responsive web-based XMPP client" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Responsive web-based XMPP client" --log="/var/log/$app/$app.log" #================================================= -# Install PHP dependencies using composer +# INSTALL PHP DEPENDENCIES USING COMPOSER #================================================= -( - cd "$final_path" - curl -sS https://getcomposer.org/installer | php$phpversion -- --version="1.10.16" --install-dir="$final_path" \ +pushd "$final_path" + ynh_exec_warn_less curl -sS https://getcomposer.org/installer | php$phpversion -- --version="1.10.16" --install-dir="$final_path" \ && php$phpversion composer.phar config --global discard-changes true --quiet \ && php$phpversion composer.phar install --no-interaction --quiet -) +popd #================================================= # Set-up database #================================================= ynh_script_progression --message="Configuring database.." --weight=1 -( - cd "$final_path" - ynh_exec_as $app php$phpversion composer.phar movim:migrate -) + +pushd $final_path + ynh_exec_as $app php$phpversion composer.phar movim:migrate --quiet +popd #================================================= # SETUP SYSTEMD @@ -169,7 +167,8 @@ ynh_script_progression --message="Configuring database.." --weight=1 # Create a dedicated systemd config ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file=../conf/systemd.service ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file=../conf/systemd.service -ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/systemd.service +ynh_replace_string --match_string="__PORT__" --replace_string="$port" --target_file=../conf/systemd.service +ynh_replace_string --match_string="__PHP_VERSION__" --replace_string="$phpversion" --target_file=../conf/systemd.service ynh_add_systemd_config