From 98163604d4f3cddd00f44ebed827e142acf14076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 17 May 2021 09:47:18 +0200 Subject: [PATCH 1/9] 4.3.0 (#45) * Upgrade to 4.3.0 --- .../ISSUE_TEMPLATE.md | 31 +++++++---- .github/PULL_REQUEST_TEMPLATE.md | 16 ++++++ check_process | 7 ++- conf/app.src | 4 +- manifest.json | 2 +- pull_request_template.md | 16 ------ scripts/_common.sh | 19 ++----- scripts/install | 5 +- scripts/restore | 4 +- scripts/upgrade | 26 ++------- scripts/ynh_composer__2 | 53 ------------------- 11 files changed, 55 insertions(+), 128 deletions(-) rename issue_template.md => .github/ISSUE_TEMPLATE.md (57%) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 pull_request_template.md delete mode 100644 scripts/ynh_composer__2 diff --git a/issue_template.md b/.github/ISSUE_TEMPLATE.md similarity index 57% rename from issue_template.md rename to .github/ISSUE_TEMPLATE.md index 1cad34d..2729a6b 100644 --- a/issue_template.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,6 +1,6 @@ --- name: Bug report -about: Create a report to help us debug, it would be nice to fill the template as much as you can to help us, help you and help us all. +about: When creating a bug report, please use the following template to provide all the relevant information and help debugging efficiently. --- @@ -8,15 +8,17 @@ about: Create a report to help us debug, it would be nice to fill the template a 1. *Read this whole template first.* 2. *Determine if you are on the right place:* - *If you were performing an action on the app from the webadmin or the CLI (install, update, backup, restore, change_url...), you are on the right place!* - - *Otherwise, the issue may be due to Matomo itself. Refer to its documentation or repository for help.* - - *If you have a doubt, post here, we will figure it out together.* + - *Otherwise, the issue may be due to the app itself. Refer to its documentation or repository for help.* + - *When in doubt, post here and we will figure it out together.* 3. *Delete the italic comments as you write over them below, and remove this guide.* --- -**Describe the bug** +### Describe the bug + *A clear and concise description of what the bug is.* -**Versions** +### Context + - 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 | ...* @@ -25,11 +27,11 @@ about: Create a report to help us debug, it would be nice to fill the template a - 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`* -**To Reproduce** -*Steps to reproduce the behavior.* +### Steps to reproduce + - *If you performed a command from the CLI, the command itself is enough. For example:* ```sh - sudo yunohost app install matomo + sudo yunohost app install the_app ``` - *If you used the webadmin, please perform the equivalent command from the CLI first.* - *If the error occurs in your browser, explain what you did:* @@ -38,9 +40,16 @@ about: Create a report to help us debug, it would be nice to fill the template a 3. *Scroll down to '...'* 4. *See error* -**Expected behavior** +### Expected behavior + *A clear and concise description of what you expected to happen. You can remove this section if the command above is enough to understand your intent.* -**Logs** -*After a failed command, YunoHost makes the log available to you, but also to others, thanks to `yunohost log display [log name] --share`. The actual command, with the correct log name, is displayed at the end of the failed attempt in the CLI. Execute it and copy here the share link it outputs.* +### Logs + +*When an operation fails, YunoHost provides a simple way to share the logs.* +- *In the webadmin, the error message contains a link to the relevant log page. On that page, you will be able to 'Share with Yunopaste'. If you missed it, the logs of previous operations are also available under Tools > Logs.* +- *In command line, the command to share the logs is displayed at the end of the operation and looks like `yunohost log display [log name] --share`. If you missed it, you can find the log ID of a previous operation using `yunohost log list`.* + +*After sharing the log, please copypaste directly the link provided by YunoHost (to help readability, no need to copypaste the entire content of the log here, just the link is enough...)* + *If applicable and useful, add screenshots to help explain your problem.* diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..ef70e18 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +## Problem + +- *Description of why you made this PR* + +## Solution + +- *And how do you fix that problem* + +## PR Status + +- [ ] Code finished and ready to be reviewed/tested +- [ ] The fix/enhancement were manually tested (if applicable) + +## Automatic tests + +Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ *after creating the PR*, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization) diff --git a/check_process b/check_process index 4292fa2..883dc13 100644 --- a/check_process +++ b/check_process @@ -5,9 +5,9 @@ ;; Test complet ; Manifest - domain="domain.tld" (DOMAIN) - path="/path" (PATH) - is_public=1 (PUBLIC|public=1|private=0) + domain="domain.tld" + path="/path" + is_public=1 ; Checks pkg_linter=1 setup_sub_dir=1 @@ -19,7 +19,6 @@ upgrade=1 from_commit=1d3e9f3dbf72a6a124c879fa549ab8107367e36a backup_restore=1 multi_instance=1 - port_already_use=0 change_url=1 ;;; Options Email=anmol@datamol.org diff --git a/conf/app.src b/conf/app.src index a854ead..3b6999d 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/matomo-org/matomo/archive/refs/tags/4.3.0-rc1.tar.gz -SOURCE_SUM=af0951e086a4ac0f3fdc63fbe0d809dd202e47f36c735358ab20bc7479d36b87 +SOURCE_URL=https://github.com/matomo-org/matomo/archive/refs/tags/4.3.0.tar.gz +SOURCE_SUM=1e45495e9313c2deaf58ebb608564dfbf6bf05ed13cc823f013335b956556587 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index ad58315..cad6831 100644 --- a/manifest.json +++ b/manifest.json @@ -14,7 +14,7 @@ "email": "anmol@datamol.org" }, "requirements": { - "yunohost": ">= 4.1.7" + "yunohost": ">= 4.2.4" }, "multi_instance": true, "services": [ diff --git a/pull_request_template.md b/pull_request_template.md deleted file mode 100644 index 6c28fc5..0000000 --- a/pull_request_template.md +++ /dev/null @@ -1,16 +0,0 @@ -## Problem -- *Description of why you made this PR* - -## Solution -- *And how do you fix that problem* - -## PR Status -- [ ] Code finished. -- [ ] Tested with Package_check. -- [ ] Fix or enhancement tested. -- [ ] Upgrade from last version tested. -- [ ] Can be reviewed and tested. - -## Package_check results ---- -* An automatic package_check will be launch at https://ci-apps-dev.yunohost.org/, when you add a specific comment to your Pull Request: "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!"* diff --git a/scripts/_common.sh b/scripts/_common.sh index c685199..3b8334d 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -8,6 +8,9 @@ YNH_PHP_VERSION="7.3" extra_php_dependencies="php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mbstring" +# Composer version +composer_version=2.0.13 + #================================================= # PERSONAL HELPERS #================================================= @@ -76,19 +79,3 @@ $(yunohost tools diagnosis | grep -B 100 "services:" | sed '/services:/d')" # Send the email to the recipients echo "$mail_message" | $mail_bin -a "Content-Type: text/plain; charset=UTF-8" -s "$mail_subject" "$recipients" } - - - -# Execute a command as another user -# usage: ynh_exec_as USER COMMAND [ARG ...] -ynh_exec_as() { - local USER=$1 - shift 1 - - if [[ $USER = $(whoami) ]]; then - eval "$@" - else - sudo -u "$USER" "$@" - fi -} - diff --git a/scripts/install b/scripts/install index 37389a7..32fa320 100755 --- a/scripts/install +++ b/scripts/install @@ -7,7 +7,6 @@ #================================================= source _common.sh -source ynh_composer__2 source /usr/share/yunohost/helpers #================================================= @@ -118,7 +117,9 @@ ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" ynh_script_progression --message="Securing files and directories..." # Set permissions to app files -chown -R $app: $final_path +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index 5b97f86..90d6af1 100755 --- a/scripts/restore +++ b/scripts/restore @@ -71,7 +71,9 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Restoring user rights..." # Restore permissions on app files -chown -R $app:$app $final_path +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # RESTORE THE PHP-FPM CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index dc54adc..9b72c98 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -7,7 +7,6 @@ #================================================= source _common.sh -source ynh_composer__2 source /usr/share/yunohost/helpers #================================================= @@ -79,30 +78,11 @@ then ynh_script_progression --message="Upgrading source files..." if [[ ! -f "$final_path/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_secure_remove --file="$final_path" # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" else - # Create a temporary directory - tmpdir="$(mktemp -d)" - - # Backup the config file in the temp dir - cp -a "$final_path/config/config.ini.php" "$tmpdir/config.ini.php" - - # Remove the app directory securely - ynh_secure_remove --file="$final_path" - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" #--keep="foo bar" to integrate when https://github.com/YunoHost/yunohost/pull/1200 is upstream - - # Copy the admin saved settings from tmp directory to final path - cp -a "$tmpdir/config.ini.php" "$final_path/config/config.ini.php" - - # Remove the tmp directory securely - ynh_secure_remove --file="$tmpdir" + ynh_setup_source --dest_dir="$final_path" --keep="$final_path/config/config.ini.php" fi fi @@ -169,7 +149,9 @@ ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" ynh_script_progression --message="Securing files and directories..." # Set permissions on app files -chown -R $app: $final_path +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # RELOAD NGINX diff --git a/scripts/ynh_composer__2 b/scripts/ynh_composer__2 deleted file mode 100644 index 762b7f7..0000000 --- a/scripts/ynh_composer__2 +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash - -# Execute a command with Composer -# -# usage: ynh_composer_exec [--phpversion=phpversion] [--workdir=$final_path] --commands="commands" -# | arg: -v, --phpversion - PHP version to use with composer -# | arg: -w, --workdir - The directory from where the command will be executed. Default $final_path. -# | arg: -c, --commands - Commands to execute. -ynh_composer_exec () { - # Declare an array to define the options of this helper. - local legacy_args=vwc - declare -Ar args_array=( [v]=phpversion= [w]=workdir= [c]=commands= ) - local phpversion - local workdir - local commands - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - workdir="${workdir:-$final_path}" - phpversion="${phpversion:-$YNH_PHP_VERSION}" - - COMPOSER_HOME="$workdir/.composer" \ - php${phpversion} "$workdir/composer.phar" $commands \ - -d "$workdir" --quiet --no-interaction -} - -# Install and initialize Composer in the given directory -# -# usage: ynh_install_composer [--phpversion=phpversion] [--workdir=$final_path] [--install_args="--optimize-autoloader"] -# | arg: -v, --phpversion - PHP version to use with composer -# | arg: -w, --workdir - The directory from where the command will be executed. Default $final_path. -# | arg: -a, --install_args - Additional arguments provided to the composer install. Argument --no-dev already include -ynh_install_composer () { - # Declare an array to define the options of this helper. - local legacy_args=vwa - declare -Ar args_array=( [v]=phpversion= [w]=workdir= [a]=install_args=) - local phpversion - local workdir - local install_args - # Manage arguments with getopts - ynh_handle_getopts_args "$@" - workdir="${workdir:-$final_path}" - phpversion="${phpversion:-$YNH_PHP_VERSION}" - install_args="${install_args:-}" - - curl -sS https://getcomposer.org/installer \ - | COMPOSER_HOME="$workdir/.composer" \ - php${phpversion} -- --quiet --install-dir="$workdir" \ - || ynh_die "Unable to install Composer." - - # update dependencies to create composer.lock - ynh_composer_exec --phpversion="${phpversion}" --workdir="$workdir" --commands="install --no-dev $install_args" \ - || ynh_die "Unable to update core dependencies with Composer." -} From 6ab1bf13aaca8a35b477a15eeb5dd4ba57e1b51e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 17 May 2021 23:39:12 +0200 Subject: [PATCH 2/9] Update nginx.conf --- conf/nginx.conf | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index d16f443..09cca21 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,31 +1,32 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location __PATH__/ { +location ^~ __PATH__/ { - # Path to source - alias __FINALPATH__/ ; + # Path to source + alias __FINALPATH__/; # Force usage of https if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } + more_set_headers "Referrer-Policy: origin always"; + more_set_headers "X-Content-Type-Options: nosniff"; + more_set_headers "X-XSS-Protection: 1; mode=block"; + index index.php; - # Common parameter to increase upload size limit in conjunction with dedicated PHP-FPM file - client_max_body_size 100M; + try_files $uri $uri/ =404; - try_files $uri $uri/ index.php; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; fastcgi_index index.php; include fastcgi_params; - fastcgi_param REMOTE_USER $remote_user; - fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param REMOTE_USER $remote_user; + fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $request_filename; - } - + } ## deny access to all other .php files location ~* ^.+\.php$ { @@ -33,14 +34,18 @@ location __PATH__/ { return 403; } - ## disable all access to the following directories - location ~ ^/(config|tmp|core|lang) { + location ~ ^__PATH__/(config|tmp|core|lang) { deny all; - return 403; # replace with 404 to not show these directories exist + return 404; } - location ~ js/container_.*_preview\.js$ { + location ~ __PATH__/\.ht { + deny all; + return 403; + } + + location ~ js/container_.*_preview\.js$ { expires off; more_set_headers "Cache-Control: private, no-cache, no-store"; } @@ -50,20 +55,20 @@ location __PATH__/ { ## Cache images,CSS,JS and webfonts for an hour ## Increasing the duration may improve the load-time, but may cause old files to show after an Matomo upgrade expires 1h; - more_set_headers "Cache-Control: public"; more_set_headers "Pragma: public"; + more_set_headers "Cache-Control: public"; } - location __PATH__/(libs|vendor|plugins|misc|node_modules) { + location ~ ^__PATH__/(libs|vendor|plugins|misc|node_modules) { deny all; return 403; } ## properly display textfiles in root directory - location ~/(.*\.md|LEGALNOTICE|LICENSE) { + location ~__PATH__/(.*\.md|LEGALNOTICE|LICENSE) { default_type text/plain; } - # Include SSOWAT user panel. - include conf.d/yunohost_panel.conf.inc; + # show YunoHost panel access + include conf.d/yunohost_panel.conf.inc; } From 97d5558ebe8103450e3af0acf9b46f3664c78924 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 17 May 2021 23:52:05 +0200 Subject: [PATCH 3/9] Update nginx.conf --- conf/nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 09cca21..d1c54ad 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -35,9 +35,9 @@ location ^~ __PATH__/ { } ## disable all access to the following directories - location ~ ^__PATH__/(config|tmp|core|lang) { + location ~ ^__PATH__/(config/|tmp/|core/|lang/) { deny all; - return 404; + return 403; } location ~ __PATH__/\.ht { From 041bc3c460bff6f2e9c7065ac15e86d8982814db Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 18 May 2021 00:09:23 +0200 Subject: [PATCH 4/9] Update nginx.conf --- conf/nginx.conf | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index d1c54ad..f1da700 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -35,7 +35,22 @@ location ^~ __PATH__/ { } ## disable all access to the following directories - location ~ ^__PATH__/(config/|tmp/|core/|lang/) { + location ^~ __PATH__/config/ { + deny all; + return 403; + } + + location ^~ __PATH__/tmp/ { + deny all; + return 403; + } + + location ^~ __PATH__/core/ { + deny all; + return 403; + } + + location ^~ __PATH__/lang/ { deny all; return 403; } From ff69449466a2ea566d8500bfc0078d77a8ad1dc5 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 18 May 2021 00:12:54 +0200 Subject: [PATCH 5/9] Update cron --- conf/cron | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/cron b/conf/cron index 02900b9..3450193 100644 --- a/conf/cron +++ b/conf/cron @@ -1,2 +1,2 @@ MAILTO="admin" -5 * * * * __APP__ /usr/bin/php__PHPVERSION__ __FINALPATH__/console core:archive --url=https://__DOMAIN____PATH__ > /dev/null +5 * * * * www-data /usr/bin/php__PHPVERSION__ __FINALPATH__/console core:archive --url=https://__DOMAIN____PATH__ > /dev/null From 9a1833c733eddf157ba28f1cc704eb7a07a4e1ca Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 18 May 2021 10:20:17 +0200 Subject: [PATCH 6/9] Update _common.sh --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 3b8334d..00f941c 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -9,7 +9,7 @@ YNH_PHP_VERSION="7.3" extra_php_dependencies="php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mbstring" # Composer version -composer_version=2.0.13 +YNH_COMPOSER_VERSION="2.0.13" #================================================= # PERSONAL HELPERS From 0e1c832c4aff4b302d992efc838bfbffd952ea65 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 18 May 2021 10:20:47 +0200 Subject: [PATCH 7/9] Update cron --- conf/cron | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/cron b/conf/cron index 3450193..02900b9 100644 --- a/conf/cron +++ b/conf/cron @@ -1,2 +1,2 @@ MAILTO="admin" -5 * * * * www-data /usr/bin/php__PHPVERSION__ __FINALPATH__/console core:archive --url=https://__DOMAIN____PATH__ > /dev/null +5 * * * * __APP__ /usr/bin/php__PHPVERSION__ __FINALPATH__/console core:archive --url=https://__DOMAIN____PATH__ > /dev/null From d8238ba6a1834d672cd25ec7844d3f8151d38a62 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 18 May 2021 10:35:49 +0200 Subject: [PATCH 8/9] Update upgrade --- scripts/upgrade | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 9b72c98..1b07991 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -78,11 +78,31 @@ then ynh_script_progression --message="Upgrading source files..." if [[ ! -f "$final_path/config/config.ini.php" ]]; then - # Download, check integrity, uncompress and patch the source from app.src + # 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="$final_path" else + # Create a temporary directory + tmpdir="$(mktemp -d)" + + # Backup the config file in the temp dir + cp -a "$final_path/config/config.ini.php" "$tmpdir/config.ini.php" + + # Remove the app directory securely + ynh_secure_remove --file="$final_path" + # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" --keep="$final_path/config/config.ini.php" + ynh_setup_source --dest_dir="$final_path" #--keep="foo bar" to integrate when https://github.com/YunoHost/yunohost/pull/1200 is upstream + + # Copy the admin saved settings from tmp directory to final path + cp -a "$tmpdir/config.ini.php" "$final_path/config/config.ini.php" + + # Remove the tmp directory securely + ynh_secure_remove --file="$tmpdir" + + # Download, check integrity, uncompress and patch the source from app.src + #ynh_setup_source --dest_dir="$final_path" --keep="$final_path/config/config.ini.php" fi fi From 881e3736d3b7a2e3ef9fcc0d8c27984c4bc9bfc0 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 18 May 2021 10:41:49 +0200 Subject: [PATCH 9/9] Update upgrade --- scripts/upgrade | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 1b07991..4341ad4 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -100,7 +100,7 @@ then # Remove the tmp directory securely ynh_secure_remove --file="$tmpdir" - + # Download, check integrity, uncompress and patch the source from app.src #ynh_setup_source --dest_dir="$final_path" --keep="$final_path/config/config.ini.php" fi @@ -137,10 +137,17 @@ ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencie #================================================= ynh_script_progression --message="Installating composer and dependencies..." +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" -if [[ -f "$final_path/config/config.ini.php" ]]; then - php$phpversion $final_path/console core:update +# if [[ -f "$final_path/config/config.ini.php" ]]; then +# php$phpversion $final_path/console core:update -n +# fi + + + php$phpversion $final_path/console core:update -n fi #=================================================