From 60d182d2778752983a4afe428649a43d82b996df Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 7 Dec 2020 15:54:47 +0100 Subject: [PATCH 01/45] Upgrade to v.4.0.4 --- README.md | 2 +- check_process | 3 --- conf/app.src | 4 ++-- manifest.json | 2 +- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9402d4c..76cf0ec 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Matomo is the only analytics platform that gives you full control over your data - Easy to use - No data limits -**Shipped version:** 4.0.1 +**Shipped version:** 4.0.4 ## Screenshots diff --git a/check_process b/check_process index 5fa2ce3..487c4da 100644 --- a/check_process +++ b/check_process @@ -21,9 +21,6 @@ multi_instance=1 port_already_use=0 change_url=0 -;;; Levels - # If the level 5 (Package linter) is forced to 1. Please add justifications here. - Level 5=auto ;;; Options Email=anmol@datamol.org Notification=yes diff --git a/conf/app.src b/conf/app.src index ab5a194..c457864 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/matomo-org/matomo/archive/4.0.1.tar.gz -SOURCE_SUM=ef087588e7e02f8f10b00721a55c4ab4679c604ce299a563502079abc760bc22 +SOURCE_URL=https://github.com/matomo-org/matomo/archive/4.0.4.tar.gz +SOURCE_SUM=a32112400c3fbd6341bfa86e34666d7b348b0528f411e895cd0852810bad8620 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 32fea1b..8fe9efc 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Open source analytics platform for measuring Web statistics", "fr": "Plateforme d'analyse open source de mesure de statistiques Web" }, - "version": "4.0.1~ynh1", + "version": "4.0.4~ynh1", "url": "https://matomo.org", "license": "GPL-3.0-or-later", "maintainer": { From 3e0ef4e309581890e823a8f09ddee77145db3019 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 8 Dec 2020 22:24:05 +0100 Subject: [PATCH 02/45] Upgrade to 4.0.5 --- README.md | 2 +- conf/app.src | 4 ++-- manifest.json | 2 +- scripts/install | 7 ++++--- scripts/upgrade | 18 +++--------------- 5 files changed, 11 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 76cf0ec..513028b 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Matomo is the only analytics platform that gives you full control over your data - Easy to use - No data limits -**Shipped version:** 4.0.4 +**Shipped version:** 4.0.5 ## Screenshots diff --git a/conf/app.src b/conf/app.src index c457864..2f64345 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/matomo-org/matomo/archive/4.0.4.tar.gz -SOURCE_SUM=a32112400c3fbd6341bfa86e34666d7b348b0528f411e895cd0852810bad8620 +SOURCE_URL=https://github.com/matomo-org/matomo/archive/4.0.5.tar.gz +SOURCE_SUM=b201dbcf0ce87433a6509cb83c7e565fed2da9a88f192ab222367e74ee28d55a SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 8fe9efc..35712cc 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Open source analytics platform for measuring Web statistics", "fr": "Plateforme d'analyse open source de mesure de statistiques Web" }, - "version": "4.0.4~ynh1", + "version": "4.0.5~ynh1", "url": "https://matomo.org", "license": "GPL-3.0-or-later", "maintainer": { diff --git a/scripts/install b/scripts/install index 9b6a67b..6f18a0c 100755 --- a/scripts/install +++ b/scripts/install @@ -149,11 +149,12 @@ chown -R $app: $final_path #================================================= ynh_script_progression --message="Configuring SSOwat..." -# Make app public if necessary +# Make app public if necessary or protect it if [ $is_public -eq 1 ] then - # unprotected_uris allows SSO credentials to be passed anyway. - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" + # Everyone can access the app. + # The "main" permission is automatically created before the install script. + ynh_permission_update --permission "main" --add "visitors" fi #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index f929638..6f892f9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -124,9 +124,9 @@ ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" ynh_script_progression --message="Setuping a cron..." ynh_replace_string --match_string="YNH_WWW_PATH" --replace_string="$final_path" --target_file="../conf/cron" -ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="../conf/cron" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/cron" -ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="../conf/cron" +ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="../conf/cron" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/cron" +ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="../conf/cron" cp -f ../conf/cron /etc/cron.d/$app #================================================= @@ -139,18 +139,6 @@ ynh_script_progression --message="Securing files and directories..." # Set permissions on app files chown -R $app: $final_path -#================================================= -# SETUP SSOWAT -#================================================= -ynh_script_progression --message="Upgrading SSOwat configuration..." - -# Make app public if necessary -if [ $is_public -eq 1 ] -then - # unprotected_uris allows SSO credentials to be passed anyway - ynh_app_setting_set --app=$app --key=unprotected_uris --value="/" -fi - #================================================= # RELOAD NGINX #================================================= From b7736718a996e9e8a9f318989c3c0a6e2304dc9a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 9 Dec 2020 09:30:55 +0100 Subject: [PATCH 03/45] Add README_fr --- README.md | 10 +-------- README_fr.md | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 9 deletions(-) create mode 100644 README_fr.md diff --git a/README.md b/README.md index 513028b..da127c8 100644 --- a/README.md +++ b/README.md @@ -7,15 +7,7 @@ If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* ## Overview -Matomo is the only analytics platform that gives you full control over your data and more: - -- Free open-source software -- 100% data ownership -- User privacy protection -- User-centric insights -- Customisable and extensible -- Easy to use -- No data limits +Matomo is the leading Free/Libre open analytics platform. It is a full-featured PHP MySQL software program that you download and install on your own webserver. 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. **Shipped version:** 4.0.5 diff --git a/README_fr.md b/README_fr.md new file mode 100644 index 0000000..3110260 --- /dev/null +++ b/README_fr.md @@ -0,0 +1,58 @@ +# Matomo pour YunoHost + +[![Niveau d'intégration](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) +[![Installer Matomo avec YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=matomo) + +*[Read this readme in english.](./README.md)* + +> *Ce package vous permet d'installer Matomo rapidement et simplement sur un serveur YunoHost. +Si vous n'avez pas YunoHost, consultez [le guide](https://yunohost.org/#/install) pour apprendre comment l'installer.* + +## Vue d'ensemble +Matomo est une plateforme d'analyse open source de mesure de statistiques Web. Il s'agit d'un logiciel PHP MySQL complet que vous téléchargez et installez sur votre propre serveur Web. À la fin du processus d'installation de cinq minutes, vous recevrez un code JavaScript. Copiez et collez simplement cette balise sur les sites Web que vous souhaitez suivre et accédez à vos rapports d'analyse en temps réel. + +**Version incluse :** 4.0.5 + +## Captures d'écran + +![](https://img.matomo.org/spai/w_660+q_lossless+ret_img+to_webp/https://static.matomo.org/wp-content/uploads/2019/03/matomo-analytics-dashboard.png) + +## Démo + +* [Démo officielle](https://demo.matomo.org) + +## Configuration + +1. Une fois l'installation terminée, l'application devra terminer le processus d'enregistrement en **visitant le domaine** sur lequel Matomo est installé. +1. Les informations d'identification de la base de données MySQL seront envoyées à **l'email admin**. Remplissez ces détails lors du processus d'inscription. +1. Le support LDAP n'est pas encore implémenté pour cette l'application. + +## Documentation + + * Documentation officielle : https://matomo.org/docs + * Documentation YunoHost : Si une documentation spécifique est nécessaire, n'hésitez pas à contribuer. + +#### Architectures supportées + +* x86-64 - [![Build Status](https://ci-apps.yunohost.org/ci/logs/matomo%20%28Apps%29.svg)](https://ci-apps.yunohost.org/ci/apps/matomo/) +* ARMv8-A - [![Build Status](https://ci-apps-arm.yunohost.org/ci/logs/matomo%20%28Apps%29.svg)](https://ci-apps-arm.yunohost.org/ci/apps/matomo/) + +## Liens + + * Signaler un bug : https://github.com/YunoHost-Apps/matomo_ynh/issues + * Site de l'application : https://matomo.org/ + * Dépôt de l'application principale : https://github.com/matomo-org/matomo + * Site web YunoHost : https://yunohost.org/ + +--- + +## Informations pour les développeurs + +Merci de faire vos pull request sur la [branche testing](https://github.com/YunoHost-Apps/matomo_ynh/tree/testing). + +Pour essayer la branche testing, procédez comme suit. +``` +sudo yunohost app install https://github.com/YunoHost-Apps/matomo_ynh/tree/testing --debug +ou +sudo yunohost app upgrade matomo -u https://github.com/YunoHost-Apps/matomo_ynh/tree/testing --debug +``` From 39d98e95cb9064504aa616aff212968de881f279 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 9 Dec 2020 09:56:25 +0100 Subject: [PATCH 04/45] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index da127c8..92fd993 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ [![Integration level](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) [![Install Matomo with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=matomo) +*[Lire ce readme en français.](./README_fr.md)* + > *This package allows you to install Matomo quickly and simply on a YunoHost server. If you don't have YunoHost, please consult [the guide](https://yunohost.org/#/install) to learn how to install it.* From 7dd2700fabcf926f1bac6dc45a8fe30ea04b0898 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 9 Dec 2020 10:13:09 +0100 Subject: [PATCH 05/45] Add link --- README.md | 2 +- README_fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 92fd993..c0b4250 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Matomo is the leading Free/Libre open analytics platform. It is a full-featured ## Documentation * Official documentation: https://matomo.org/docs - * YunoHost documentation: If specific documentation is needed, feel free to contribute. + * YunoHost documentation: https://yunohost.org/#/app_matomo #### Supported architectures diff --git a/README_fr.md b/README_fr.md index 3110260..c8c5f56 100644 --- a/README_fr.md +++ b/README_fr.md @@ -30,7 +30,7 @@ Matomo est une plateforme d'analyse open source de mesure de statistiques Web. I ## Documentation * Documentation officielle : https://matomo.org/docs - * Documentation YunoHost : Si une documentation spécifique est nécessaire, n'hésitez pas à contribuer. + * Documentation YunoHost : https://yunohost.org/#/app_matomo_fr #### Architectures supportées From 55b8ef65322270f57b9907324ae7e5e8437bf165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Wed, 9 Dec 2020 11:25:29 +0100 Subject: [PATCH 06/45] Add change_url script (#23) * Add change url * Create php-fpm.conf --- check_process | 2 +- conf/php-fpm.conf | 430 +++++++++++++++++++++++++++++++++++++++++++++ scripts/change_url | 105 +++++++++++ 3 files changed, 536 insertions(+), 1 deletion(-) create mode 100644 conf/php-fpm.conf create mode 100644 scripts/change_url diff --git a/check_process b/check_process index 487c4da..4292fa2 100644 --- a/check_process +++ b/check_process @@ -20,7 +20,7 @@ backup_restore=1 multi_instance=1 port_already_use=0 - change_url=0 + change_url=1 ;;; Options Email=anmol@datamol.org Notification=yes diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf new file mode 100644 index 0000000..9b2ecce --- /dev/null +++ b/conf/php-fpm.conf @@ -0,0 +1,430 @@ +; Start a new pool named 'www'. +; the variable $pool can be used in any directive and will be replaced by the +; pool name ('www' here) +[__NAMETOCHANGE__] + +; Per pool prefix +; It only applies on the following directives: +; - 'access.log' +; - 'slowlog' +; - 'listen' (unixsocket) +; - 'chroot' +; - 'chdir' +; - 'php_values' +; - 'php_admin_values' +; When not set, the global prefix (or /usr) applies instead. +; Note: This directive can also be relative to the global prefix. +; Default Value: none +;prefix = /path/to/pools/$pool + +; Unix user/group of processes +; Note: The user is mandatory. If the group is not set, the default user's group +; will be used. +user = __USER__ +group = __USER__ + +; The address on which to accept FastCGI requests. +; Valid syntaxes are: +; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on +; a specific port; +; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on +; a specific port; +; 'port' - to listen on a TCP socket to all addresses +; (IPv6 and IPv4-mapped) on a specific port; +; '/path/to/unix/socket' - to listen on a unix socket. +; Note: This value is mandatory. +listen = /var/run/php/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock + +; Set listen(2) backlog. +; Default Value: 511 (-1 on FreeBSD and OpenBSD) +;listen.backlog = 511 + +; Set permissions for unix socket, if one is used. In Linux, read/write +; permissions must be set in order to allow connections from a web server. Many +; BSD-derived systems allow connections regardless of permissions. +; Default Values: user and group are set as the running user +; mode is set to 0660 +listen.owner = www-data +listen.group = www-data +;listen.mode = 0660 +; When POSIX Access Control Lists are supported you can set them using +; these options, value is a comma separated list of user/group names. +; When set, listen.owner and listen.group are ignored +;listen.acl_users = +;listen.acl_groups = + +; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. +; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original +; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address +; must be separated by a comma. If this value is left blank, connections will be +; accepted from any ip address. +; Default Value: any +;listen.allowed_clients = 127.0.0.1 + +; Specify the nice(2) priority to apply to the pool processes (only if set) +; The value can vary from -19 (highest priority) to 20 (lower priority) +; Note: - It will only work if the FPM master process is launched as root +; - The pool processes will inherit the master process priority +; unless it specified otherwise +; Default Value: no set +; process.priority = -19 + +; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user +; or group is differrent than the master process user. It allows to create process +; core dump and ptrace the process for the pool user. +; Default Value: no +; process.dumpable = yes + +; Choose how the process manager will control the number of child processes. +; Possible Values: +; static - a fixed number (pm.max_children) of child processes; +; dynamic - the number of child processes are set dynamically based on the +; following directives. With this process management, there will be +; always at least 1 children. +; pm.max_children - the maximum number of children that can +; be alive at the same time. +; pm.start_servers - the number of children created on startup. +; pm.min_spare_servers - the minimum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is less than this +; number then some children will be created. +; pm.max_spare_servers - the maximum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is greater than this +; number then some children will be killed. +; ondemand - no children are created at startup. Children will be forked when +; new requests will connect. The following parameter are used: +; pm.max_children - the maximum number of children that +; can be alive at the same time. +; pm.process_idle_timeout - The number of seconds after which +; an idle process will be killed. +; Note: This value is mandatory. +pm = dynamic + +; The number of child processes to be created when pm is set to 'static' and the +; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. +; This value sets the limit on the number of simultaneous requests that will be +; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. +; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP +; CGI. The below defaults are based on a server without much resources. Don't +; forget to tweak pm.* to fit your needs. +; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' +; Note: This value is mandatory. +pm.max_children = 5 + +; The number of child processes created on startup. +; Note: Used only when pm is set to 'dynamic' +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 +pm.start_servers = 2 + +; The desired minimum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.min_spare_servers = 1 + +; The desired maximum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.max_spare_servers = 3 + +; The number of seconds after which an idle process will be killed. +; Note: Used only when pm is set to 'ondemand' +; Default Value: 10s +;pm.process_idle_timeout = 10s; + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. For +; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default Value: 0 +;pm.max_requests = 500 + +; The URI to view the FPM status page. If this value is not set, no URI will be +; recognized as a status page. It shows the following informations: +; pool - the name of the pool; +; process manager - static, dynamic or ondemand; +; start time - the date and time FPM has started; +; start since - number of seconds since FPM has started; +; accepted conn - the number of request accepted by the pool; +; listen queue - the number of request in the queue of pending +; connections (see backlog in listen(2)); +; max listen queue - the maximum number of requests in the queue +; of pending connections since FPM has started; +; listen queue len - the size of the socket queue of pending connections; +; idle processes - the number of idle processes; +; active processes - the number of active processes; +; total processes - the number of idle + active processes; +; max active processes - the maximum number of active processes since FPM +; has started; +; max children reached - number of times, the process limit has been reached, +; when pm tries to start more children (works only for +; pm 'dynamic' and 'ondemand'); +; Value are updated in real time. +; Example output: +; pool: www +; process manager: static +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 62636 +; accepted conn: 190460 +; listen queue: 0 +; max listen queue: 1 +; listen queue len: 42 +; idle processes: 4 +; active processes: 11 +; total processes: 15 +; max active processes: 12 +; max children reached: 0 +; +; By default the status page output is formatted as text/plain. Passing either +; 'html', 'xml' or 'json' in the query string will return the corresponding +; output syntax. Example: +; http://www.foo.bar/status +; http://www.foo.bar/status?json +; http://www.foo.bar/status?html +; http://www.foo.bar/status?xml +; +; By default the status page only outputs short status. Passing 'full' in the +; query string will also return status for each pool process. +; Example: +; http://www.foo.bar/status?full +; http://www.foo.bar/status?json&full +; http://www.foo.bar/status?html&full +; http://www.foo.bar/status?xml&full +; The Full status returns for each process: +; pid - the PID of the process; +; state - the state of the process (Idle, Running, ...); +; start time - the date and time the process has started; +; start since - the number of seconds since the process has started; +; requests - the number of requests the process has served; +; request duration - the duration in µs of the requests; +; request method - the request method (GET, POST, ...); +; request URI - the request URI with the query string; +; content length - the content length of the request (only with POST); +; user - the user (PHP_AUTH_USER) (or '-' if not set); +; script - the main script called (or '-' if not set); +; last request cpu - the %cpu the last request consumed +; it's always 0 if the process is not in Idle state +; because CPU calculation is done when the request +; processing has terminated; +; last request memory - the max amount of memory the last request consumed +; it's always 0 if the process is not in Idle state +; because memory calculation is done when the request +; processing has terminated; +; If the process is in Idle state, then informations are related to the +; last request the process has served. Otherwise informations are related to +; the current request being served. +; Example output: +; ************************ +; pid: 31330 +; state: Running +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 63087 +; requests: 12808 +; request duration: 1250261 +; request method: GET +; request URI: /test_mem.php?N=10000 +; content length: 0 +; user: - +; script: /home/fat/web/docs/php/test_mem.php +; last request cpu: 0.00 +; last request memory: 0 +; +; Note: There is a real-time FPM status monitoring sample web page available +; It's available in: /usr/share/php/7.0/fpm/status.html +; +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;pm.status_path = /status + +; The ping URI to call the monitoring page of FPM. If this value is not set, no +; URI will be recognized as a ping page. This could be used to test from outside +; that FPM is alive and responding, or to +; - create a graph of FPM availability (rrd or such); +; - remove a server from a group if it is not responding (load balancing); +; - trigger alerts for the operating team (24/7). +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;ping.path = /ping + +; This directive may be used to customize the response of a ping request. The +; response is formatted as text/plain with a 200 response code. +; Default Value: pong +;ping.response = pong + +; The access log file +; Default: not set +;access.log = log/$pool.access.log + +; The access log format. +; The following syntax is allowed +; %%: the '%' character +; %C: %CPU used by the request +; it can accept the following format: +; - %{user}C for user CPU only +; - %{system}C for system CPU only +; - %{total}C for user + system CPU (default) +; %d: time taken to serve the request +; it can accept the following format: +; - %{seconds}d (default) +; - %{miliseconds}d +; - %{mili}d +; - %{microseconds}d +; - %{micro}d +; %e: an environment variable (same as $_ENV or $_SERVER) +; it must be associated with embraces to specify the name of the env +; variable. Some exemples: +; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e +; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e +; %f: script filename +; %l: content-length of the request (for POST request only) +; %m: request method +; %M: peak of memory allocated by PHP +; it can accept the following format: +; - %{bytes}M (default) +; - %{kilobytes}M +; - %{kilo}M +; - %{megabytes}M +; - %{mega}M +; %n: pool name +; %o: output header +; it must be associated with embraces to specify the name of the header: +; - %{Content-Type}o +; - %{X-Powered-By}o +; - %{Transfert-Encoding}o +; - .... +; %p: PID of the child that serviced the request +; %P: PID of the parent of the child that serviced the request +; %q: the query string +; %Q: the '?' character if query string exists +; %r: the request URI (without the query string, see %q and %Q) +; %R: remote IP address +; %s: status (response code) +; %t: server time the request was received +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %T: time the log has been written (the request has finished) +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %u: remote user +; +; Default: "%R - %u %t \"%m %r\" %s" +;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" + +; The log file for slow requests +; Default Value: not set +; Note: slowlog is mandatory if request_slowlog_timeout is set +;slowlog = log/$pool.log.slow + +; The timeout for serving a single request after which a PHP backtrace will be +; dumped to the 'slowlog' file. A value of '0s' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +;request_slowlog_timeout = 0 + +; The timeout for serving a single request after which the worker process will +; be killed. This option should be used when the 'max_execution_time' ini option +; does not stop script execution for some reason. A value of '0' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +request_terminate_timeout = 1d + +; Set open file descriptor rlimit. +; Default Value: system defined value +;rlimit_files = 1024 + +; Set max core size rlimit. +; Possible Values: 'unlimited' or an integer greater or equal to 0 +; Default Value: system defined value +;rlimit_core = 0 + +; Chroot to this directory at the start. This value must be defined as an +; absolute path. When this value is not set, chroot is not used. +; Note: you can prefix with '$prefix' to chroot to the pool prefix or one +; of its subdirectories. If the pool prefix is not set, the global prefix +; will be used instead. +; Note: chrooting is a great security feature and should be used whenever +; possible. However, all PHP paths will be relative to the chroot +; (error_log, sessions.save_path, ...). +; Default Value: not set +;chroot = + +; Chdir to this directory at the start. +; Note: relative path can be used. +; Default Value: current directory or / when chroot +chdir = __FINALPATH__ + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +;catch_workers_output = yes + +; Clear environment in FPM workers +; Prevents arbitrary environment variables from reaching FPM worker processes +; by clearing the environment in workers before env vars specified in this +; pool configuration are added. +; Setting to "no" will make all environment variables available to PHP code +; via getenv(), $_ENV and $_SERVER. +; Default Value: yes +;clear_env = no + +; Limits the extensions of the main script FPM will allow to parse. This can +; prevent configuration mistakes on the web server side. You should only limit +; FPM to .php extensions to prevent malicious users to use other extensions to +; execute php code. +; Note: set an empty value to allow all extensions. +; Default Value: .php +;security.limit_extensions = .php .php3 .php4 .php5 .php7 + +; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from +; the current environment. +; Default Value: clean env +;env[HOSTNAME] = $HOSTNAME +;env[PATH] = /usr/local/bin:/usr/bin:/bin +;env[TMP] = /tmp +;env[TMPDIR] = /tmp +;env[TEMP] = /tmp + +; Additional php.ini defines, specific to this pool of workers. These settings +; overwrite the values previously defined in the php.ini. The directives are the +; same as the PHP SAPI: +; php_value/php_flag - you can set classic ini defines which can +; be overwritten from PHP call 'ini_set'. +; php_admin_value/php_admin_flag - these directives won't be overwritten by +; PHP call 'ini_set' +; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. + +; Defining 'extension' will load the corresponding shared extension from +; extension_dir. Defining 'disable_functions' or 'disable_classes' will not +; overwrite previously defined php.ini values, but will append the new value +; instead. + +; Note: path INI options can be relative and will be expanded with the prefix +; (pool, global or /usr) + +; Default Value: nothing is defined by default except the values in php.ini and +; specified at startup with the -d argument +;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com +;php_flag[display_errors] = off +;php_admin_value[error_log] = /var/log/fpm-php.www.log +;php_admin_flag[log_errors] = on +;php_admin_value[memory_limit] = 32M + +; Common values to change to increase file upload limit +; php_admin_value[upload_max_filesize] = 50M +; php_admin_value[post_max_size] = 50M +; php_admin_flag[mail.add_x_header] = Off + +; Other common parameters +; php_admin_value[max_execution_time] = 600 +; php_admin_value[max_input_time] = 300 +php_admin_value[memory_limit] = 256M +; php_admin_flag[short_open_tag] = On diff --git a/scripts/change_url b/scripts/change_url new file mode 100644 index 0000000..c6cfed0 --- /dev/null +++ b/scripts/change_url @@ -0,0 +1,105 @@ +#!/bin/bash + +#================================================= +# GENERIC STARTING +#================================================= +# IMPORT GENERIC HELPERS +#================================================= + +source _common.sh +source /usr/share/yunohost/helpers + +#================================================= +# RETRIEVE ARGUMENTS +#================================================= + +old_domain=$YNH_APP_OLD_DOMAIN +old_path=$YNH_APP_OLD_PATH + +new_domain=$YNH_APP_NEW_DOMAIN +new_path=$YNH_APP_NEW_PATH + +app=$YNH_APP_INSTANCE_NAME + +#================================================= +# LOAD SETTINGS +#================================================= +ynh_script_progression --message="Loading installation settings..." --weight=1 + +# Needed for helper "ynh_add_nginx_config" +final_path=$(ynh_app_setting_get --app=$app --key=final_path) + +#================================================= +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up the app before changing its URL (may take a while)..." --weight=1 + +# Backup the current version of the app +ynh_backup_before_upgrade +ynh_clean_setup () { + # Remove the new domain config file, the remove script won't do it as it doesn't know yet its location. + ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" + + # Restore it if the upgrade fails + ynh_restore_upgradebackup +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + +#================================================= +# CHECK WHICH PARTS SHOULD BE CHANGED +#================================================= + +change_domain=0 +if [ "$old_domain" != "$new_domain" ] +then + change_domain=1 +fi + +change_path=0 +if [ "$old_path" != "$new_path" ] +then + change_path=1 +fi + +#================================================= +# MODIFY URL IN NGINX CONF +#================================================= +ynh_script_progression --message="Updating NGINX web server configuration..." --weight=3 + +nginx_conf_path=/etc/nginx/conf.d/$old_domain.d/$app.conf + +# Change the path in the NGINX config file +if [ $change_path -eq 1 ] +then + # Make a backup of the original NGINX config file if modified + ynh_backup_if_checksum_is_different --file="$nginx_conf_path" + # Set global variables for NGINX helper + domain="$old_domain" + path_url="$new_path" + # Create a dedicated NGINX config + ynh_add_nginx_config +fi + +# Change the domain for NGINX +if [ $change_domain -eq 1 ] +then + # Delete file checksum for the old conf file location + ynh_delete_file_checksum --file="$nginx_conf_path" + mv $nginx_conf_path /etc/nginx/conf.d/$new_domain.d/$app.conf + # Store file checksum for the new config file location + ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" +fi + +#================================================= +# RELOAD NGINX +#================================================= +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 + +ynh_systemd_action --service_name=nginx --action=reload + +#================================================= +# END OF SCRIPT +#================================================= + +ynh_script_progression --message="Change of URL completed for $app" --last From 48ec38f4ff8a23dc9c53085317faa61b5cc0bf81 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 9 Dec 2020 12:15:22 +0100 Subject: [PATCH 07/45] Update php-fpm.conf --- conf/php-fpm.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf index 9b2ecce..a02d3bb 100644 --- a/conf/php-fpm.conf +++ b/conf/php-fpm.conf @@ -420,7 +420,7 @@ chdir = __FINALPATH__ ; Common values to change to increase file upload limit ; php_admin_value[upload_max_filesize] = 50M -; php_admin_value[post_max_size] = 50M +php_admin_value[post_max_size] = 50M ; php_admin_flag[mail.add_x_header] = Off ; Other common parameters From 2ca13aad4d58fa18ebfce44ccc679bcd15aa1749 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 9 Dec 2020 12:16:01 +0100 Subject: [PATCH 08/45] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 6f18a0c..5c080f8 100755 --- a/scripts/install +++ b/scripts/install @@ -174,7 +174,7 @@ Please open your $app domain: https://$domain$path_url Complete the registration process from the setup page displayed. Details for mysql database to be enterted while registration process: Database login: $app -Database name: $app +Database name: $app Database password: $db_pwd If you are facing any problem or want to improve this app, please open a new issue here: https://github.com/YunoHost-Apps/matomo_ynh/issues" From a9b6294269cd4017dac3f0a2a1625fd215107e67 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 9 Dec 2020 12:57:21 +0100 Subject: [PATCH 09/45] Update install --- scripts/install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 5c080f8..6eb4f78 100755 --- a/scripts/install +++ b/scripts/install @@ -169,12 +169,12 @@ ynh_systemd_action --service_name=nginx --action=reload #================================================= ynh_script_progression --message="Sending a readme for the admin..." -message=" $app was successfully installed :) +message="Matomo was successfully installed :) Please open your $app domain: https://$domain$path_url Complete the registration process from the setup page displayed. Details for mysql database to be enterted while registration process: -Database login: $app -Database name: $app +Database login: $app +Database name: $app Database password: $db_pwd If you are facing any problem or want to improve this app, please open a new issue here: https://github.com/YunoHost-Apps/matomo_ynh/issues" From 3bf27f6e091a4bdd205cf4a660dc25c3c41f519b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 9 Dec 2020 19:12:56 +0100 Subject: [PATCH 10/45] cron --- conf/cron | 2 +- scripts/install | 29 ++++------------------------- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/conf/cron b/conf/cron index 8e8ce50..8d0c5c3 100644 --- a/conf/cron +++ b/conf/cron @@ -1,2 +1,2 @@ MAILTO="admin" -5 * * * * __USER__ /usr/bin/php YNH_WWW_PATH/console core:archive --url=https://__DOMAIN__/__PATH__ > /dev/null +5 * * * * __USER__ /usr/bin/php__PHPVERSION__ __FINALPATH__/console core:archive --url=https://__DOMAIN__/__PATH__ > /dev/null diff --git a/scripts/install b/scripts/install index 6eb4f78..c4061ad 100755 --- a/scripts/install +++ b/scripts/install @@ -96,7 +96,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # INSTALL COMPOSER AND DEPENDENCIES #================================================= -ynh_script_progression --message="Installing composer and dependencies..." +ynh_script_progression --message="Installing Composer and dependencies..." ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" @@ -105,35 +105,14 @@ ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" #================================================= ynh_script_progression --message="Setuping a cron..." -ynh_replace_string --match_string="YNH_WWW_PATH" --replace_string="$final_path" --target_file="../conf/cron" +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="../conf/cron" ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="../conf/cron" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/cron" ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="../conf/cron" +ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="../conf/cron" + cp -f ../conf/cron /etc/cron.d/$app -#================================================= -# MODIFY A CONFIG FILE (TO DO: Automate install) -#================================================= -ynh_script_progression --message="Modifying a config file..." - -### `ynh_replace_string` is used to replace a string in a file. -### (It's compatible with sed regular expressions syntax) -## cp -f ../conf/config.ini.php "$final_path/config/config.ini.php" -## ynh_replace_string "__DB__" "$db_name" "$final_path/config/config.ini.php" -## ynh_replace_string "__DB_PASSWORD__" "$db_pwd" "$final_path/config/config.ini.php" - -#================================================= -# STORE THE CONFIG FILE CHECKSUM -#================================================= -ynh_script_progression --message="Storing the config file checksum..." - -### `ynh_store_file_checksum` is used to store the checksum of a file. -### That way, during the upgrade script, by using `ynh_backup_if_checksum_is_different`, -### you can make a backup of this file before modifying it again if the admin had modified it. - -# Calculate and store the config file checksum into the app settings -## ynh_store_file_checksum --file="$final_path/CONFIG_FILE" - #================================================= # GENERIC FINALIZATION #================================================= From 79265a89c411d9059b2565dceeed40c40ae95d8f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 10 Dec 2020 12:30:54 +0100 Subject: [PATCH 11/45] Update upgrade --- scripts/upgrade | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 6f892f9..16a09d9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -80,8 +80,28 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." + # 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" + + #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" + + pushd "$final_path" + chown -R $app: $final_path/tmp/* + ./console core:update + popd + fi #================================================= From fea14fc6b519adee666276a1366599919a08588c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 10 Dec 2020 12:31:54 +0100 Subject: [PATCH 12/45] Fix --- conf/cron | 2 +- scripts/install | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/cron b/conf/cron index 8d0c5c3..8ac1ec4 100644 --- a/conf/cron +++ b/conf/cron @@ -1,2 +1,2 @@ MAILTO="admin" -5 * * * * __USER__ /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 diff --git a/scripts/install b/scripts/install index c4061ad..e32c5e8 100755 --- a/scripts/install +++ b/scripts/install @@ -106,7 +106,7 @@ ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" ynh_script_progression --message="Setuping a cron..." ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="../conf/cron" -ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="../conf/cron" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/cron" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/cron" ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="../conf/cron" ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="../conf/cron" From 24e4ff178ef7a7c274daa7031ddd6b4fe12275ee Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 10 Dec 2020 12:34:18 +0100 Subject: [PATCH 13/45] Add PHP variable to cron --- conf/cron | 2 +- scripts/install | 2 +- scripts/upgrade | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/conf/cron b/conf/cron index 8d0c5c3..8ac1ec4 100644 --- a/conf/cron +++ b/conf/cron @@ -1,2 +1,2 @@ MAILTO="admin" -5 * * * * __USER__ /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 diff --git a/scripts/install b/scripts/install index c4061ad..e32c5e8 100755 --- a/scripts/install +++ b/scripts/install @@ -106,7 +106,7 @@ ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" ynh_script_progression --message="Setuping a cron..." ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="../conf/cron" -ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="../conf/cron" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/cron" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/cron" ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="../conf/cron" ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="../conf/cron" diff --git a/scripts/upgrade b/scripts/upgrade index 6f892f9..9e5186b 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -123,10 +123,11 @@ ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" #================================================= ynh_script_progression --message="Setuping a cron..." -ynh_replace_string --match_string="YNH_WWW_PATH" --replace_string="$final_path" --target_file="../conf/cron" -ynh_replace_string --match_string="__USER__" --replace_string="$app" --target_file="../conf/cron" +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="../conf/cron" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/cron" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/cron" ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="../conf/cron" +ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="../conf/cron" cp -f ../conf/cron /etc/cron.d/$app #================================================= From e46983358119443cd87f38daa8fb8fc2dd4a3334 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 10 Dec 2020 12:45:17 +0100 Subject: [PATCH 14/45] Update cron --- conf/cron | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/cron b/conf/cron index 8ac1ec4..02900b9 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 * * * * __APP__ /usr/bin/php__PHPVERSION__ __FINALPATH__/console core:archive --url=https://__DOMAIN____PATH__ > /dev/null From 28174b3582a79261918cca9bf0554680bb66b61a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 10 Dec 2020 14:12:24 +0100 Subject: [PATCH 15/45] Add extra_php-fpm.conf --- conf/extra_php-fpm.conf | 5 + conf/php-fpm.conf | 430 ---------------------------------------- scripts/_common.sh | 16 ++ scripts/upgrade | 8 +- 4 files changed, 24 insertions(+), 435 deletions(-) create mode 100644 conf/extra_php-fpm.conf delete mode 100644 conf/php-fpm.conf diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf new file mode 100644 index 0000000..c93210e --- /dev/null +++ b/conf/extra_php-fpm.conf @@ -0,0 +1,5 @@ +; Additional php.ini defines, specific to this pool of workers. + +php_admin_value[upload_max_filesize] = 50M +php_admin_value[memory_limit] = 64M +php_admin_value[post_max_size] = 50M diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf deleted file mode 100644 index a02d3bb..0000000 --- a/conf/php-fpm.conf +++ /dev/null @@ -1,430 +0,0 @@ -; Start a new pool named 'www'. -; the variable $pool can be used in any directive and will be replaced by the -; pool name ('www' here) -[__NAMETOCHANGE__] - -; Per pool prefix -; It only applies on the following directives: -; - 'access.log' -; - 'slowlog' -; - 'listen' (unixsocket) -; - 'chroot' -; - 'chdir' -; - 'php_values' -; - 'php_admin_values' -; When not set, the global prefix (or /usr) applies instead. -; Note: This directive can also be relative to the global prefix. -; Default Value: none -;prefix = /path/to/pools/$pool - -; Unix user/group of processes -; Note: The user is mandatory. If the group is not set, the default user's group -; will be used. -user = __USER__ -group = __USER__ - -; The address on which to accept FastCGI requests. -; Valid syntaxes are: -; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on -; a specific port; -; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on -; a specific port; -; 'port' - to listen on a TCP socket to all addresses -; (IPv6 and IPv4-mapped) on a specific port; -; '/path/to/unix/socket' - to listen on a unix socket. -; Note: This value is mandatory. -listen = /var/run/php/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock - -; Set listen(2) backlog. -; Default Value: 511 (-1 on FreeBSD and OpenBSD) -;listen.backlog = 511 - -; Set permissions for unix socket, if one is used. In Linux, read/write -; permissions must be set in order to allow connections from a web server. Many -; BSD-derived systems allow connections regardless of permissions. -; Default Values: user and group are set as the running user -; mode is set to 0660 -listen.owner = www-data -listen.group = www-data -;listen.mode = 0660 -; When POSIX Access Control Lists are supported you can set them using -; these options, value is a comma separated list of user/group names. -; When set, listen.owner and listen.group are ignored -;listen.acl_users = -;listen.acl_groups = - -; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. -; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original -; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address -; must be separated by a comma. If this value is left blank, connections will be -; accepted from any ip address. -; Default Value: any -;listen.allowed_clients = 127.0.0.1 - -; Specify the nice(2) priority to apply to the pool processes (only if set) -; The value can vary from -19 (highest priority) to 20 (lower priority) -; Note: - It will only work if the FPM master process is launched as root -; - The pool processes will inherit the master process priority -; unless it specified otherwise -; Default Value: no set -; process.priority = -19 - -; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user -; or group is differrent than the master process user. It allows to create process -; core dump and ptrace the process for the pool user. -; Default Value: no -; process.dumpable = yes - -; Choose how the process manager will control the number of child processes. -; Possible Values: -; static - a fixed number (pm.max_children) of child processes; -; dynamic - the number of child processes are set dynamically based on the -; following directives. With this process management, there will be -; always at least 1 children. -; pm.max_children - the maximum number of children that can -; be alive at the same time. -; pm.start_servers - the number of children created on startup. -; pm.min_spare_servers - the minimum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is less than this -; number then some children will be created. -; pm.max_spare_servers - the maximum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is greater than this -; number then some children will be killed. -; ondemand - no children are created at startup. Children will be forked when -; new requests will connect. The following parameter are used: -; pm.max_children - the maximum number of children that -; can be alive at the same time. -; pm.process_idle_timeout - The number of seconds after which -; an idle process will be killed. -; Note: This value is mandatory. -pm = dynamic - -; The number of child processes to be created when pm is set to 'static' and the -; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. -; This value sets the limit on the number of simultaneous requests that will be -; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. -; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP -; CGI. The below defaults are based on a server without much resources. Don't -; forget to tweak pm.* to fit your needs. -; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' -; Note: This value is mandatory. -pm.max_children = 5 - -; The number of child processes created on startup. -; Note: Used only when pm is set to 'dynamic' -; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 -pm.start_servers = 2 - -; The desired minimum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.min_spare_servers = 1 - -; The desired maximum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.max_spare_servers = 3 - -; The number of seconds after which an idle process will be killed. -; Note: Used only when pm is set to 'ondemand' -; Default Value: 10s -;pm.process_idle_timeout = 10s; - -; The number of requests each child process should execute before respawning. -; This can be useful to work around memory leaks in 3rd party libraries. For -; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. -; Default Value: 0 -;pm.max_requests = 500 - -; The URI to view the FPM status page. If this value is not set, no URI will be -; recognized as a status page. It shows the following informations: -; pool - the name of the pool; -; process manager - static, dynamic or ondemand; -; start time - the date and time FPM has started; -; start since - number of seconds since FPM has started; -; accepted conn - the number of request accepted by the pool; -; listen queue - the number of request in the queue of pending -; connections (see backlog in listen(2)); -; max listen queue - the maximum number of requests in the queue -; of pending connections since FPM has started; -; listen queue len - the size of the socket queue of pending connections; -; idle processes - the number of idle processes; -; active processes - the number of active processes; -; total processes - the number of idle + active processes; -; max active processes - the maximum number of active processes since FPM -; has started; -; max children reached - number of times, the process limit has been reached, -; when pm tries to start more children (works only for -; pm 'dynamic' and 'ondemand'); -; Value are updated in real time. -; Example output: -; pool: www -; process manager: static -; start time: 01/Jul/2011:17:53:49 +0200 -; start since: 62636 -; accepted conn: 190460 -; listen queue: 0 -; max listen queue: 1 -; listen queue len: 42 -; idle processes: 4 -; active processes: 11 -; total processes: 15 -; max active processes: 12 -; max children reached: 0 -; -; By default the status page output is formatted as text/plain. Passing either -; 'html', 'xml' or 'json' in the query string will return the corresponding -; output syntax. Example: -; http://www.foo.bar/status -; http://www.foo.bar/status?json -; http://www.foo.bar/status?html -; http://www.foo.bar/status?xml -; -; By default the status page only outputs short status. Passing 'full' in the -; query string will also return status for each pool process. -; Example: -; http://www.foo.bar/status?full -; http://www.foo.bar/status?json&full -; http://www.foo.bar/status?html&full -; http://www.foo.bar/status?xml&full -; The Full status returns for each process: -; pid - the PID of the process; -; state - the state of the process (Idle, Running, ...); -; start time - the date and time the process has started; -; start since - the number of seconds since the process has started; -; requests - the number of requests the process has served; -; request duration - the duration in µs of the requests; -; request method - the request method (GET, POST, ...); -; request URI - the request URI with the query string; -; content length - the content length of the request (only with POST); -; user - the user (PHP_AUTH_USER) (or '-' if not set); -; script - the main script called (or '-' if not set); -; last request cpu - the %cpu the last request consumed -; it's always 0 if the process is not in Idle state -; because CPU calculation is done when the request -; processing has terminated; -; last request memory - the max amount of memory the last request consumed -; it's always 0 if the process is not in Idle state -; because memory calculation is done when the request -; processing has terminated; -; If the process is in Idle state, then informations are related to the -; last request the process has served. Otherwise informations are related to -; the current request being served. -; Example output: -; ************************ -; pid: 31330 -; state: Running -; start time: 01/Jul/2011:17:53:49 +0200 -; start since: 63087 -; requests: 12808 -; request duration: 1250261 -; request method: GET -; request URI: /test_mem.php?N=10000 -; content length: 0 -; user: - -; script: /home/fat/web/docs/php/test_mem.php -; last request cpu: 0.00 -; last request memory: 0 -; -; Note: There is a real-time FPM status monitoring sample web page available -; It's available in: /usr/share/php/7.0/fpm/status.html -; -; Note: The value must start with a leading slash (/). The value can be -; anything, but it may not be a good idea to use the .php extension or it -; may conflict with a real PHP file. -; Default Value: not set -;pm.status_path = /status - -; The ping URI to call the monitoring page of FPM. If this value is not set, no -; URI will be recognized as a ping page. This could be used to test from outside -; that FPM is alive and responding, or to -; - create a graph of FPM availability (rrd or such); -; - remove a server from a group if it is not responding (load balancing); -; - trigger alerts for the operating team (24/7). -; Note: The value must start with a leading slash (/). The value can be -; anything, but it may not be a good idea to use the .php extension or it -; may conflict with a real PHP file. -; Default Value: not set -;ping.path = /ping - -; This directive may be used to customize the response of a ping request. The -; response is formatted as text/plain with a 200 response code. -; Default Value: pong -;ping.response = pong - -; The access log file -; Default: not set -;access.log = log/$pool.access.log - -; The access log format. -; The following syntax is allowed -; %%: the '%' character -; %C: %CPU used by the request -; it can accept the following format: -; - %{user}C for user CPU only -; - %{system}C for system CPU only -; - %{total}C for user + system CPU (default) -; %d: time taken to serve the request -; it can accept the following format: -; - %{seconds}d (default) -; - %{miliseconds}d -; - %{mili}d -; - %{microseconds}d -; - %{micro}d -; %e: an environment variable (same as $_ENV or $_SERVER) -; it must be associated with embraces to specify the name of the env -; variable. Some exemples: -; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e -; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e -; %f: script filename -; %l: content-length of the request (for POST request only) -; %m: request method -; %M: peak of memory allocated by PHP -; it can accept the following format: -; - %{bytes}M (default) -; - %{kilobytes}M -; - %{kilo}M -; - %{megabytes}M -; - %{mega}M -; %n: pool name -; %o: output header -; it must be associated with embraces to specify the name of the header: -; - %{Content-Type}o -; - %{X-Powered-By}o -; - %{Transfert-Encoding}o -; - .... -; %p: PID of the child that serviced the request -; %P: PID of the parent of the child that serviced the request -; %q: the query string -; %Q: the '?' character if query string exists -; %r: the request URI (without the query string, see %q and %Q) -; %R: remote IP address -; %s: status (response code) -; %t: server time the request was received -; it can accept a strftime(3) format: -; %d/%b/%Y:%H:%M:%S %z (default) -; The strftime(3) format must be encapsuled in a %{}t tag -; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t -; %T: time the log has been written (the request has finished) -; it can accept a strftime(3) format: -; %d/%b/%Y:%H:%M:%S %z (default) -; The strftime(3) format must be encapsuled in a %{}t tag -; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t -; %u: remote user -; -; Default: "%R - %u %t \"%m %r\" %s" -;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" - -; The log file for slow requests -; Default Value: not set -; Note: slowlog is mandatory if request_slowlog_timeout is set -;slowlog = log/$pool.log.slow - -; The timeout for serving a single request after which a PHP backtrace will be -; dumped to the 'slowlog' file. A value of '0s' means 'off'. -; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) -; Default Value: 0 -;request_slowlog_timeout = 0 - -; The timeout for serving a single request after which the worker process will -; be killed. This option should be used when the 'max_execution_time' ini option -; does not stop script execution for some reason. A value of '0' means 'off'. -; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) -; Default Value: 0 -request_terminate_timeout = 1d - -; Set open file descriptor rlimit. -; Default Value: system defined value -;rlimit_files = 1024 - -; Set max core size rlimit. -; Possible Values: 'unlimited' or an integer greater or equal to 0 -; Default Value: system defined value -;rlimit_core = 0 - -; Chroot to this directory at the start. This value must be defined as an -; absolute path. When this value is not set, chroot is not used. -; Note: you can prefix with '$prefix' to chroot to the pool prefix or one -; of its subdirectories. If the pool prefix is not set, the global prefix -; will be used instead. -; Note: chrooting is a great security feature and should be used whenever -; possible. However, all PHP paths will be relative to the chroot -; (error_log, sessions.save_path, ...). -; Default Value: not set -;chroot = - -; Chdir to this directory at the start. -; Note: relative path can be used. -; Default Value: current directory or / when chroot -chdir = __FINALPATH__ - -; Redirect worker stdout and stderr into main error log. If not set, stdout and -; stderr will be redirected to /dev/null according to FastCGI specs. -; Note: on highloaded environement, this can cause some delay in the page -; process time (several ms). -; Default Value: no -;catch_workers_output = yes - -; Clear environment in FPM workers -; Prevents arbitrary environment variables from reaching FPM worker processes -; by clearing the environment in workers before env vars specified in this -; pool configuration are added. -; Setting to "no" will make all environment variables available to PHP code -; via getenv(), $_ENV and $_SERVER. -; Default Value: yes -;clear_env = no - -; Limits the extensions of the main script FPM will allow to parse. This can -; prevent configuration mistakes on the web server side. You should only limit -; FPM to .php extensions to prevent malicious users to use other extensions to -; execute php code. -; Note: set an empty value to allow all extensions. -; Default Value: .php -;security.limit_extensions = .php .php3 .php4 .php5 .php7 - -; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from -; the current environment. -; Default Value: clean env -;env[HOSTNAME] = $HOSTNAME -;env[PATH] = /usr/local/bin:/usr/bin:/bin -;env[TMP] = /tmp -;env[TMPDIR] = /tmp -;env[TEMP] = /tmp - -; Additional php.ini defines, specific to this pool of workers. These settings -; overwrite the values previously defined in the php.ini. The directives are the -; same as the PHP SAPI: -; php_value/php_flag - you can set classic ini defines which can -; be overwritten from PHP call 'ini_set'. -; php_admin_value/php_admin_flag - these directives won't be overwritten by -; PHP call 'ini_set' -; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. - -; Defining 'extension' will load the corresponding shared extension from -; extension_dir. Defining 'disable_functions' or 'disable_classes' will not -; overwrite previously defined php.ini values, but will append the new value -; instead. - -; Note: path INI options can be relative and will be expanded with the prefix -; (pool, global or /usr) - -; Default Value: nothing is defined by default except the values in php.ini and -; specified at startup with the -d argument -;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com -;php_flag[display_errors] = off -;php_admin_value[error_log] = /var/log/fpm-php.www.log -;php_admin_flag[log_errors] = on -;php_admin_value[memory_limit] = 32M - -; Common values to change to increase file upload limit -; php_admin_value[upload_max_filesize] = 50M -php_admin_value[post_max_size] = 50M -; php_admin_flag[mail.add_x_header] = Off - -; Other common parameters -; php_admin_value[max_execution_time] = 600 -; php_admin_value[max_input_time] = 300 -php_admin_value[memory_limit] = 256M -; php_admin_flag[short_open_tag] = On diff --git a/scripts/_common.sh b/scripts/_common.sh index e932edf..c685199 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -76,3 +76,19 @@ $(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/upgrade b/scripts/upgrade index 4ac52c8..2c3c24c 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -97,11 +97,9 @@ then # Remove the tmp directory securely ynh_secure_remove --file="$tmpdir" - pushd "$final_path" - chown -R $app: $final_path/tmp/* - ./console core:update + pushd "$final_path/console" + ynh_exec_as $app core:update popd - fi #================================================= @@ -125,7 +123,7 @@ ynh_system_user_create --username=$app #================================================= ynh_script_progression --message="Upgrading PHP-FPM configuration..." -# Create a dedicated php-fpm config +# Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) From 406a21ea8f1a74b68e70d5ba4286ff44e920bd65 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 10 Dec 2020 14:13:28 +0100 Subject: [PATCH 16/45] Add extra_php-fpm.conf --- conf/extra_php-fpm.conf | 5 + conf/php-fpm.conf | 430 ---------------------------------------- 2 files changed, 5 insertions(+), 430 deletions(-) create mode 100644 conf/extra_php-fpm.conf delete mode 100644 conf/php-fpm.conf diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf new file mode 100644 index 0000000..c93210e --- /dev/null +++ b/conf/extra_php-fpm.conf @@ -0,0 +1,5 @@ +; Additional php.ini defines, specific to this pool of workers. + +php_admin_value[upload_max_filesize] = 50M +php_admin_value[memory_limit] = 64M +php_admin_value[post_max_size] = 50M diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf deleted file mode 100644 index a02d3bb..0000000 --- a/conf/php-fpm.conf +++ /dev/null @@ -1,430 +0,0 @@ -; Start a new pool named 'www'. -; the variable $pool can be used in any directive and will be replaced by the -; pool name ('www' here) -[__NAMETOCHANGE__] - -; Per pool prefix -; It only applies on the following directives: -; - 'access.log' -; - 'slowlog' -; - 'listen' (unixsocket) -; - 'chroot' -; - 'chdir' -; - 'php_values' -; - 'php_admin_values' -; When not set, the global prefix (or /usr) applies instead. -; Note: This directive can also be relative to the global prefix. -; Default Value: none -;prefix = /path/to/pools/$pool - -; Unix user/group of processes -; Note: The user is mandatory. If the group is not set, the default user's group -; will be used. -user = __USER__ -group = __USER__ - -; The address on which to accept FastCGI requests. -; Valid syntaxes are: -; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on -; a specific port; -; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on -; a specific port; -; 'port' - to listen on a TCP socket to all addresses -; (IPv6 and IPv4-mapped) on a specific port; -; '/path/to/unix/socket' - to listen on a unix socket. -; Note: This value is mandatory. -listen = /var/run/php/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock - -; Set listen(2) backlog. -; Default Value: 511 (-1 on FreeBSD and OpenBSD) -;listen.backlog = 511 - -; Set permissions for unix socket, if one is used. In Linux, read/write -; permissions must be set in order to allow connections from a web server. Many -; BSD-derived systems allow connections regardless of permissions. -; Default Values: user and group are set as the running user -; mode is set to 0660 -listen.owner = www-data -listen.group = www-data -;listen.mode = 0660 -; When POSIX Access Control Lists are supported you can set them using -; these options, value is a comma separated list of user/group names. -; When set, listen.owner and listen.group are ignored -;listen.acl_users = -;listen.acl_groups = - -; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. -; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original -; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address -; must be separated by a comma. If this value is left blank, connections will be -; accepted from any ip address. -; Default Value: any -;listen.allowed_clients = 127.0.0.1 - -; Specify the nice(2) priority to apply to the pool processes (only if set) -; The value can vary from -19 (highest priority) to 20 (lower priority) -; Note: - It will only work if the FPM master process is launched as root -; - The pool processes will inherit the master process priority -; unless it specified otherwise -; Default Value: no set -; process.priority = -19 - -; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user -; or group is differrent than the master process user. It allows to create process -; core dump and ptrace the process for the pool user. -; Default Value: no -; process.dumpable = yes - -; Choose how the process manager will control the number of child processes. -; Possible Values: -; static - a fixed number (pm.max_children) of child processes; -; dynamic - the number of child processes are set dynamically based on the -; following directives. With this process management, there will be -; always at least 1 children. -; pm.max_children - the maximum number of children that can -; be alive at the same time. -; pm.start_servers - the number of children created on startup. -; pm.min_spare_servers - the minimum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is less than this -; number then some children will be created. -; pm.max_spare_servers - the maximum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is greater than this -; number then some children will be killed. -; ondemand - no children are created at startup. Children will be forked when -; new requests will connect. The following parameter are used: -; pm.max_children - the maximum number of children that -; can be alive at the same time. -; pm.process_idle_timeout - The number of seconds after which -; an idle process will be killed. -; Note: This value is mandatory. -pm = dynamic - -; The number of child processes to be created when pm is set to 'static' and the -; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. -; This value sets the limit on the number of simultaneous requests that will be -; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. -; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP -; CGI. The below defaults are based on a server without much resources. Don't -; forget to tweak pm.* to fit your needs. -; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' -; Note: This value is mandatory. -pm.max_children = 5 - -; The number of child processes created on startup. -; Note: Used only when pm is set to 'dynamic' -; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 -pm.start_servers = 2 - -; The desired minimum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.min_spare_servers = 1 - -; The desired maximum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.max_spare_servers = 3 - -; The number of seconds after which an idle process will be killed. -; Note: Used only when pm is set to 'ondemand' -; Default Value: 10s -;pm.process_idle_timeout = 10s; - -; The number of requests each child process should execute before respawning. -; This can be useful to work around memory leaks in 3rd party libraries. For -; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. -; Default Value: 0 -;pm.max_requests = 500 - -; The URI to view the FPM status page. If this value is not set, no URI will be -; recognized as a status page. It shows the following informations: -; pool - the name of the pool; -; process manager - static, dynamic or ondemand; -; start time - the date and time FPM has started; -; start since - number of seconds since FPM has started; -; accepted conn - the number of request accepted by the pool; -; listen queue - the number of request in the queue of pending -; connections (see backlog in listen(2)); -; max listen queue - the maximum number of requests in the queue -; of pending connections since FPM has started; -; listen queue len - the size of the socket queue of pending connections; -; idle processes - the number of idle processes; -; active processes - the number of active processes; -; total processes - the number of idle + active processes; -; max active processes - the maximum number of active processes since FPM -; has started; -; max children reached - number of times, the process limit has been reached, -; when pm tries to start more children (works only for -; pm 'dynamic' and 'ondemand'); -; Value are updated in real time. -; Example output: -; pool: www -; process manager: static -; start time: 01/Jul/2011:17:53:49 +0200 -; start since: 62636 -; accepted conn: 190460 -; listen queue: 0 -; max listen queue: 1 -; listen queue len: 42 -; idle processes: 4 -; active processes: 11 -; total processes: 15 -; max active processes: 12 -; max children reached: 0 -; -; By default the status page output is formatted as text/plain. Passing either -; 'html', 'xml' or 'json' in the query string will return the corresponding -; output syntax. Example: -; http://www.foo.bar/status -; http://www.foo.bar/status?json -; http://www.foo.bar/status?html -; http://www.foo.bar/status?xml -; -; By default the status page only outputs short status. Passing 'full' in the -; query string will also return status for each pool process. -; Example: -; http://www.foo.bar/status?full -; http://www.foo.bar/status?json&full -; http://www.foo.bar/status?html&full -; http://www.foo.bar/status?xml&full -; The Full status returns for each process: -; pid - the PID of the process; -; state - the state of the process (Idle, Running, ...); -; start time - the date and time the process has started; -; start since - the number of seconds since the process has started; -; requests - the number of requests the process has served; -; request duration - the duration in µs of the requests; -; request method - the request method (GET, POST, ...); -; request URI - the request URI with the query string; -; content length - the content length of the request (only with POST); -; user - the user (PHP_AUTH_USER) (or '-' if not set); -; script - the main script called (or '-' if not set); -; last request cpu - the %cpu the last request consumed -; it's always 0 if the process is not in Idle state -; because CPU calculation is done when the request -; processing has terminated; -; last request memory - the max amount of memory the last request consumed -; it's always 0 if the process is not in Idle state -; because memory calculation is done when the request -; processing has terminated; -; If the process is in Idle state, then informations are related to the -; last request the process has served. Otherwise informations are related to -; the current request being served. -; Example output: -; ************************ -; pid: 31330 -; state: Running -; start time: 01/Jul/2011:17:53:49 +0200 -; start since: 63087 -; requests: 12808 -; request duration: 1250261 -; request method: GET -; request URI: /test_mem.php?N=10000 -; content length: 0 -; user: - -; script: /home/fat/web/docs/php/test_mem.php -; last request cpu: 0.00 -; last request memory: 0 -; -; Note: There is a real-time FPM status monitoring sample web page available -; It's available in: /usr/share/php/7.0/fpm/status.html -; -; Note: The value must start with a leading slash (/). The value can be -; anything, but it may not be a good idea to use the .php extension or it -; may conflict with a real PHP file. -; Default Value: not set -;pm.status_path = /status - -; The ping URI to call the monitoring page of FPM. If this value is not set, no -; URI will be recognized as a ping page. This could be used to test from outside -; that FPM is alive and responding, or to -; - create a graph of FPM availability (rrd or such); -; - remove a server from a group if it is not responding (load balancing); -; - trigger alerts for the operating team (24/7). -; Note: The value must start with a leading slash (/). The value can be -; anything, but it may not be a good idea to use the .php extension or it -; may conflict with a real PHP file. -; Default Value: not set -;ping.path = /ping - -; This directive may be used to customize the response of a ping request. The -; response is formatted as text/plain with a 200 response code. -; Default Value: pong -;ping.response = pong - -; The access log file -; Default: not set -;access.log = log/$pool.access.log - -; The access log format. -; The following syntax is allowed -; %%: the '%' character -; %C: %CPU used by the request -; it can accept the following format: -; - %{user}C for user CPU only -; - %{system}C for system CPU only -; - %{total}C for user + system CPU (default) -; %d: time taken to serve the request -; it can accept the following format: -; - %{seconds}d (default) -; - %{miliseconds}d -; - %{mili}d -; - %{microseconds}d -; - %{micro}d -; %e: an environment variable (same as $_ENV or $_SERVER) -; it must be associated with embraces to specify the name of the env -; variable. Some exemples: -; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e -; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e -; %f: script filename -; %l: content-length of the request (for POST request only) -; %m: request method -; %M: peak of memory allocated by PHP -; it can accept the following format: -; - %{bytes}M (default) -; - %{kilobytes}M -; - %{kilo}M -; - %{megabytes}M -; - %{mega}M -; %n: pool name -; %o: output header -; it must be associated with embraces to specify the name of the header: -; - %{Content-Type}o -; - %{X-Powered-By}o -; - %{Transfert-Encoding}o -; - .... -; %p: PID of the child that serviced the request -; %P: PID of the parent of the child that serviced the request -; %q: the query string -; %Q: the '?' character if query string exists -; %r: the request URI (without the query string, see %q and %Q) -; %R: remote IP address -; %s: status (response code) -; %t: server time the request was received -; it can accept a strftime(3) format: -; %d/%b/%Y:%H:%M:%S %z (default) -; The strftime(3) format must be encapsuled in a %{}t tag -; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t -; %T: time the log has been written (the request has finished) -; it can accept a strftime(3) format: -; %d/%b/%Y:%H:%M:%S %z (default) -; The strftime(3) format must be encapsuled in a %{}t tag -; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t -; %u: remote user -; -; Default: "%R - %u %t \"%m %r\" %s" -;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" - -; The log file for slow requests -; Default Value: not set -; Note: slowlog is mandatory if request_slowlog_timeout is set -;slowlog = log/$pool.log.slow - -; The timeout for serving a single request after which a PHP backtrace will be -; dumped to the 'slowlog' file. A value of '0s' means 'off'. -; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) -; Default Value: 0 -;request_slowlog_timeout = 0 - -; The timeout for serving a single request after which the worker process will -; be killed. This option should be used when the 'max_execution_time' ini option -; does not stop script execution for some reason. A value of '0' means 'off'. -; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) -; Default Value: 0 -request_terminate_timeout = 1d - -; Set open file descriptor rlimit. -; Default Value: system defined value -;rlimit_files = 1024 - -; Set max core size rlimit. -; Possible Values: 'unlimited' or an integer greater or equal to 0 -; Default Value: system defined value -;rlimit_core = 0 - -; Chroot to this directory at the start. This value must be defined as an -; absolute path. When this value is not set, chroot is not used. -; Note: you can prefix with '$prefix' to chroot to the pool prefix or one -; of its subdirectories. If the pool prefix is not set, the global prefix -; will be used instead. -; Note: chrooting is a great security feature and should be used whenever -; possible. However, all PHP paths will be relative to the chroot -; (error_log, sessions.save_path, ...). -; Default Value: not set -;chroot = - -; Chdir to this directory at the start. -; Note: relative path can be used. -; Default Value: current directory or / when chroot -chdir = __FINALPATH__ - -; Redirect worker stdout and stderr into main error log. If not set, stdout and -; stderr will be redirected to /dev/null according to FastCGI specs. -; Note: on highloaded environement, this can cause some delay in the page -; process time (several ms). -; Default Value: no -;catch_workers_output = yes - -; Clear environment in FPM workers -; Prevents arbitrary environment variables from reaching FPM worker processes -; by clearing the environment in workers before env vars specified in this -; pool configuration are added. -; Setting to "no" will make all environment variables available to PHP code -; via getenv(), $_ENV and $_SERVER. -; Default Value: yes -;clear_env = no - -; Limits the extensions of the main script FPM will allow to parse. This can -; prevent configuration mistakes on the web server side. You should only limit -; FPM to .php extensions to prevent malicious users to use other extensions to -; execute php code. -; Note: set an empty value to allow all extensions. -; Default Value: .php -;security.limit_extensions = .php .php3 .php4 .php5 .php7 - -; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from -; the current environment. -; Default Value: clean env -;env[HOSTNAME] = $HOSTNAME -;env[PATH] = /usr/local/bin:/usr/bin:/bin -;env[TMP] = /tmp -;env[TMPDIR] = /tmp -;env[TEMP] = /tmp - -; Additional php.ini defines, specific to this pool of workers. These settings -; overwrite the values previously defined in the php.ini. The directives are the -; same as the PHP SAPI: -; php_value/php_flag - you can set classic ini defines which can -; be overwritten from PHP call 'ini_set'. -; php_admin_value/php_admin_flag - these directives won't be overwritten by -; PHP call 'ini_set' -; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. - -; Defining 'extension' will load the corresponding shared extension from -; extension_dir. Defining 'disable_functions' or 'disable_classes' will not -; overwrite previously defined php.ini values, but will append the new value -; instead. - -; Note: path INI options can be relative and will be expanded with the prefix -; (pool, global or /usr) - -; Default Value: nothing is defined by default except the values in php.ini and -; specified at startup with the -d argument -;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com -;php_flag[display_errors] = off -;php_admin_value[error_log] = /var/log/fpm-php.www.log -;php_admin_flag[log_errors] = on -;php_admin_value[memory_limit] = 32M - -; Common values to change to increase file upload limit -; php_admin_value[upload_max_filesize] = 50M -php_admin_value[post_max_size] = 50M -; php_admin_flag[mail.add_x_header] = Off - -; Other common parameters -; php_admin_value[max_execution_time] = 600 -; php_admin_value[max_input_time] = 300 -php_admin_value[memory_limit] = 256M -; php_admin_flag[short_open_tag] = On From 4dc4201e8920acf9a480034da6125c93796e008a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 10 Dec 2020 14:44:25 +0100 Subject: [PATCH 17/45] Increase memory_limit to 256M --- conf/extra_php-fpm.conf | 2 +- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf index c93210e..00d1fad 100644 --- a/conf/extra_php-fpm.conf +++ b/conf/extra_php-fpm.conf @@ -1,5 +1,5 @@ ; Additional php.ini defines, specific to this pool of workers. php_admin_value[upload_max_filesize] = 50M -php_admin_value[memory_limit] = 64M +php_admin_value[memory_limit] = 256M php_admin_value[post_max_size] = 50M diff --git a/scripts/install b/scripts/install index e32c5e8..8115366 100755 --- a/scripts/install +++ b/scripts/install @@ -88,7 +88,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Configuring PHP-FPM..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=low --footprint=medium --package="$extra_php_dependencies" phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= diff --git a/scripts/restore b/scripts/restore index 4a51b1d..37d0227 100755 --- a/scripts/restore +++ b/scripts/restore @@ -82,7 +82,7 @@ ynh_script_progression --message="Restoring PHP-FPM configuration..." ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" # Recreate a dedicated php-fpm config -ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=low --footprint=medium --package="$extra_php_dependencies" #================================================= # RESTORE THE MYSQL DATABASE diff --git a/scripts/upgrade b/scripts/upgrade index 9e5186b..8099e56 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -106,7 +106,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated php-fpm config -ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=low --footprint=medium --package="$extra_php_dependencies" phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= From b549545b59707ded9cf1286dd38b8fbe9989bbf6 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 10 Dec 2020 14:46:03 +0100 Subject: [PATCH 18/45] Set memory_limit to 256M --- conf/extra_php-fpm.conf | 2 +- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf index c93210e..00d1fad 100644 --- a/conf/extra_php-fpm.conf +++ b/conf/extra_php-fpm.conf @@ -1,5 +1,5 @@ ; Additional php.ini defines, specific to this pool of workers. php_admin_value[upload_max_filesize] = 50M -php_admin_value[memory_limit] = 64M +php_admin_value[memory_limit] = 256M php_admin_value[post_max_size] = 50M diff --git a/scripts/install b/scripts/install index e32c5e8..8115366 100755 --- a/scripts/install +++ b/scripts/install @@ -88,7 +88,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Configuring PHP-FPM..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=low --footprint=medium --package="$extra_php_dependencies" phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= diff --git a/scripts/restore b/scripts/restore index 4a51b1d..37d0227 100755 --- a/scripts/restore +++ b/scripts/restore @@ -82,7 +82,7 @@ ynh_script_progression --message="Restoring PHP-FPM configuration..." ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" # Recreate a dedicated php-fpm config -ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=low --footprint=medium --package="$extra_php_dependencies" #================================================= # RESTORE THE MYSQL DATABASE diff --git a/scripts/upgrade b/scripts/upgrade index 2c3c24c..1c2b90a 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -124,7 +124,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=low --footprint=medium --package="$extra_php_dependencies" phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= From db43bb992e5018e49d9177d714c97d273806289f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Thu, 10 Dec 2020 14:46:26 +0100 Subject: [PATCH 19/45] Update manifest.json --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 35712cc..65b687d 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Open source analytics platform for measuring Web statistics", "fr": "Plateforme d'analyse open source de mesure de statistiques Web" }, - "version": "4.0.5~ynh1", + "version": "4.0.5~ynh2", "url": "https://matomo.org", "license": "GPL-3.0-or-later", "maintainer": { From 32d3cbdec3c5aef214e6ec4def77caae48e1d54a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 10:07:46 +0100 Subject: [PATCH 20/45] Try to fix php7.3 service fail... --- conf/extra_php-fpm.conf | 5 - conf/nginx.conf | 4 +- conf/php-fpm.conf | 430 ++++++++++++++++++++++++++++++++++++++++ issue_template.md | 2 +- manifest.json | 4 + scripts/install | 7 +- scripts/restore | 2 +- scripts/upgrade | 4 +- 8 files changed, 445 insertions(+), 13 deletions(-) delete mode 100644 conf/extra_php-fpm.conf create mode 100644 conf/php-fpm.conf diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf deleted file mode 100644 index 00d1fad..0000000 --- a/conf/extra_php-fpm.conf +++ /dev/null @@ -1,5 +0,0 @@ -; Additional php.ini defines, specific to this pool of workers. - -php_admin_value[upload_max_filesize] = 50M -php_admin_value[memory_limit] = 256M -php_admin_value[post_max_size] = 50M diff --git a/conf/nginx.conf b/conf/nginx.conf index 556b622..b41ead3 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -11,8 +11,8 @@ location __PATH__/ { index index.php; - # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file - #client_max_body_size 50M; + # Common parameter to increase upload size limit in conjunction with dedicated PHP-FPM file + client_max_body_size 100M; try_files $uri $uri/ index.php; location ~ [^/]\.php(/|$) { diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf new file mode 100644 index 0000000..69e3ca7 --- /dev/null +++ b/conf/php-fpm.conf @@ -0,0 +1,430 @@ +; Start a new pool named 'www'. +; the variable $pool can be used in any directive and will be replaced by the +; pool name ('www' here) +[__NAMETOCHANGE__] + +; Per pool prefix +; It only applies on the following directives: +; - 'access.log' +; - 'slowlog' +; - 'listen' (unixsocket) +; - 'chroot' +; - 'chdir' +; - 'php_values' +; - 'php_admin_values' +; When not set, the global prefix (or /usr) applies instead. +; Note: This directive can also be relative to the global prefix. +; Default Value: none +;prefix = /path/to/pools/$pool + +; Unix user/group of processes +; Note: The user is mandatory. If the group is not set, the default user's group +; will be used. +user = __USER__ +group = __USER__ + +; The address on which to accept FastCGI requests. +; Valid syntaxes are: +; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on +; a specific port; +; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on +; a specific port; +; 'port' - to listen on a TCP socket to all addresses +; (IPv6 and IPv4-mapped) on a specific port; +; '/path/to/unix/socket' - to listen on a unix socket. +; Note: This value is mandatory. +listen = /var/run/php/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock + +; Set listen(2) backlog. +; Default Value: 511 (-1 on FreeBSD and OpenBSD) +;listen.backlog = 511 + +; Set permissions for unix socket, if one is used. In Linux, read/write +; permissions must be set in order to allow connections from a web server. Many +; BSD-derived systems allow connections regardless of permissions. +; Default Values: user and group are set as the running user +; mode is set to 0660 +listen.owner = www-data +listen.group = www-data +;listen.mode = 0660 +; When POSIX Access Control Lists are supported you can set them using +; these options, value is a comma separated list of user/group names. +; When set, listen.owner and listen.group are ignored +;listen.acl_users = +;listen.acl_groups = + +; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. +; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original +; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address +; must be separated by a comma. If this value is left blank, connections will be +; accepted from any ip address. +; Default Value: any +;listen.allowed_clients = 127.0.0.1 + +; Specify the nice(2) priority to apply to the pool processes (only if set) +; The value can vary from -19 (highest priority) to 20 (lower priority) +; Note: - It will only work if the FPM master process is launched as root +; - The pool processes will inherit the master process priority +; unless it specified otherwise +; Default Value: no set +; process.priority = -19 + +; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user +; or group is differrent than the master process user. It allows to create process +; core dump and ptrace the process for the pool user. +; Default Value: no +; process.dumpable = yes + +; Choose how the process manager will control the number of child processes. +; Possible Values: +; static - a fixed number (pm.max_children) of child processes; +; dynamic - the number of child processes are set dynamically based on the +; following directives. With this process management, there will be +; always at least 1 children. +; pm.max_children - the maximum number of children that can +; be alive at the same time. +; pm.start_servers - the number of children created on startup. +; pm.min_spare_servers - the minimum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is less than this +; number then some children will be created. +; pm.max_spare_servers - the maximum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is greater than this +; number then some children will be killed. +; ondemand - no children are created at startup. Children will be forked when +; new requests will connect. The following parameter are used: +; pm.max_children - the maximum number of children that +; can be alive at the same time. +; pm.process_idle_timeout - The number of seconds after which +; an idle process will be killed. +; Note: This value is mandatory. +pm = dynamic + +; The number of child processes to be created when pm is set to 'static' and the +; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. +; This value sets the limit on the number of simultaneous requests that will be +; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. +; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP +; CGI. The below defaults are based on a server without much resources. Don't +; forget to tweak pm.* to fit your needs. +; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' +; Note: This value is mandatory. +pm.max_children = 5 + +; The number of child processes created on startup. +; Note: Used only when pm is set to 'dynamic' +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 +pm.start_servers = 2 + +; The desired minimum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.min_spare_servers = 1 + +; The desired maximum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.max_spare_servers = 3 + +; The number of seconds after which an idle process will be killed. +; Note: Used only when pm is set to 'ondemand' +; Default Value: 10s +;pm.process_idle_timeout = 10s; + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. For +; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default Value: 0 +;pm.max_requests = 500 + +; The URI to view the FPM status page. If this value is not set, no URI will be +; recognized as a status page. It shows the following informations: +; pool - the name of the pool; +; process manager - static, dynamic or ondemand; +; start time - the date and time FPM has started; +; start since - number of seconds since FPM has started; +; accepted conn - the number of request accepted by the pool; +; listen queue - the number of request in the queue of pending +; connections (see backlog in listen(2)); +; max listen queue - the maximum number of requests in the queue +; of pending connections since FPM has started; +; listen queue len - the size of the socket queue of pending connections; +; idle processes - the number of idle processes; +; active processes - the number of active processes; +; total processes - the number of idle + active processes; +; max active processes - the maximum number of active processes since FPM +; has started; +; max children reached - number of times, the process limit has been reached, +; when pm tries to start more children (works only for +; pm 'dynamic' and 'ondemand'); +; Value are updated in real time. +; Example output: +; pool: www +; process manager: static +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 62636 +; accepted conn: 190460 +; listen queue: 0 +; max listen queue: 1 +; listen queue len: 42 +; idle processes: 4 +; active processes: 11 +; total processes: 15 +; max active processes: 12 +; max children reached: 0 +; +; By default the status page output is formatted as text/plain. Passing either +; 'html', 'xml' or 'json' in the query string will return the corresponding +; output syntax. Example: +; http://www.foo.bar/status +; http://www.foo.bar/status?json +; http://www.foo.bar/status?html +; http://www.foo.bar/status?xml +; +; By default the status page only outputs short status. Passing 'full' in the +; query string will also return status for each pool process. +; Example: +; http://www.foo.bar/status?full +; http://www.foo.bar/status?json&full +; http://www.foo.bar/status?html&full +; http://www.foo.bar/status?xml&full +; The Full status returns for each process: +; pid - the PID of the process; +; state - the state of the process (Idle, Running, ...); +; start time - the date and time the process has started; +; start since - the number of seconds since the process has started; +; requests - the number of requests the process has served; +; request duration - the duration in µs of the requests; +; request method - the request method (GET, POST, ...); +; request URI - the request URI with the query string; +; content length - the content length of the request (only with POST); +; user - the user (PHP_AUTH_USER) (or '-' if not set); +; script - the main script called (or '-' if not set); +; last request cpu - the %cpu the last request consumed +; it's always 0 if the process is not in Idle state +; because CPU calculation is done when the request +; processing has terminated; +; last request memory - the max amount of memory the last request consumed +; it's always 0 if the process is not in Idle state +; because memory calculation is done when the request +; processing has terminated; +; If the process is in Idle state, then informations are related to the +; last request the process has served. Otherwise informations are related to +; the current request being served. +; Example output: +; ************************ +; pid: 31330 +; state: Running +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 63087 +; requests: 12808 +; request duration: 1250261 +; request method: GET +; request URI: /test_mem.php?N=10000 +; content length: 0 +; user: - +; script: /home/fat/web/docs/php/test_mem.php +; last request cpu: 0.00 +; last request memory: 0 +; +; Note: There is a real-time FPM status monitoring sample web page available +; It's available in: /usr/share/php/7.0/fpm/status.html +; +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;pm.status_path = /status + +; The ping URI to call the monitoring page of FPM. If this value is not set, no +; URI will be recognized as a ping page. This could be used to test from outside +; that FPM is alive and responding, or to +; - create a graph of FPM availability (rrd or such); +; - remove a server from a group if it is not responding (load balancing); +; - trigger alerts for the operating team (24/7). +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;ping.path = /ping + +; This directive may be used to customize the response of a ping request. The +; response is formatted as text/plain with a 200 response code. +; Default Value: pong +;ping.response = pong + +; The access log file +; Default: not set +;access.log = log/$pool.access.log + +; The access log format. +; The following syntax is allowed +; %%: the '%' character +; %C: %CPU used by the request +; it can accept the following format: +; - %{user}C for user CPU only +; - %{system}C for system CPU only +; - %{total}C for user + system CPU (default) +; %d: time taken to serve the request +; it can accept the following format: +; - %{seconds}d (default) +; - %{miliseconds}d +; - %{mili}d +; - %{microseconds}d +; - %{micro}d +; %e: an environment variable (same as $_ENV or $_SERVER) +; it must be associated with embraces to specify the name of the env +; variable. Some exemples: +; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e +; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e +; %f: script filename +; %l: content-length of the request (for POST request only) +; %m: request method +; %M: peak of memory allocated by PHP +; it can accept the following format: +; - %{bytes}M (default) +; - %{kilobytes}M +; - %{kilo}M +; - %{megabytes}M +; - %{mega}M +; %n: pool name +; %o: output header +; it must be associated with embraces to specify the name of the header: +; - %{Content-Type}o +; - %{X-Powered-By}o +; - %{Transfert-Encoding}o +; - .... +; %p: PID of the child that serviced the request +; %P: PID of the parent of the child that serviced the request +; %q: the query string +; %Q: the '?' character if query string exists +; %r: the request URI (without the query string, see %q and %Q) +; %R: remote IP address +; %s: status (response code) +; %t: server time the request was received +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %T: time the log has been written (the request has finished) +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %u: remote user +; +; Default: "%R - %u %t \"%m %r\" %s" +;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" + +; The log file for slow requests +; Default Value: not set +; Note: slowlog is mandatory if request_slowlog_timeout is set +;slowlog = log/$pool.log.slow + +; The timeout for serving a single request after which a PHP backtrace will be +; dumped to the 'slowlog' file. A value of '0s' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +;request_slowlog_timeout = 0 + +; The timeout for serving a single request after which the worker process will +; be killed. This option should be used when the 'max_execution_time' ini option +; does not stop script execution for some reason. A value of '0' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +request_terminate_timeout = 1d + +; Set open file descriptor rlimit. +; Default Value: system defined value +;rlimit_files = 1024 + +; Set max core size rlimit. +; Possible Values: 'unlimited' or an integer greater or equal to 0 +; Default Value: system defined value +;rlimit_core = 0 + +; Chroot to this directory at the start. This value must be defined as an +; absolute path. When this value is not set, chroot is not used. +; Note: you can prefix with '$prefix' to chroot to the pool prefix or one +; of its subdirectories. If the pool prefix is not set, the global prefix +; will be used instead. +; Note: chrooting is a great security feature and should be used whenever +; possible. However, all PHP paths will be relative to the chroot +; (error_log, sessions.save_path, ...). +; Default Value: not set +;chroot = + +; Chdir to this directory at the start. +; Note: relative path can be used. +; Default Value: current directory or / when chroot +chdir = __FINALPATH__ + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +;catch_workers_output = yes + +; Clear environment in FPM workers +; Prevents arbitrary environment variables from reaching FPM worker processes +; by clearing the environment in workers before env vars specified in this +; pool configuration are added. +; Setting to "no" will make all environment variables available to PHP code +; via getenv(), $_ENV and $_SERVER. +; Default Value: yes +;clear_env = no + +; Limits the extensions of the main script FPM will allow to parse. This can +; prevent configuration mistakes on the web server side. You should only limit +; FPM to .php extensions to prevent malicious users to use other extensions to +; execute php code. +; Note: set an empty value to allow all extensions. +; Default Value: .php +;security.limit_extensions = .php .php3 .php4 .php5 .php7 + +; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from +; the current environment. +; Default Value: clean env +;env[HOSTNAME] = $HOSTNAME +;env[PATH] = /usr/local/bin:/usr/bin:/bin +;env[TMP] = /tmp +;env[TMPDIR] = /tmp +;env[TEMP] = /tmp + +; Additional php.ini defines, specific to this pool of workers. These settings +; overwrite the values previously defined in the php.ini. The directives are the +; same as the PHP SAPI: +; php_value/php_flag - you can set classic ini defines which can +; be overwritten from PHP call 'ini_set'. +; php_admin_value/php_admin_flag - these directives won't be overwritten by +; PHP call 'ini_set' +; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. + +; Defining 'extension' will load the corresponding shared extension from +; extension_dir. Defining 'disable_functions' or 'disable_classes' will not +; overwrite previously defined php.ini values, but will append the new value +; instead. + +; Note: path INI options can be relative and will be expanded with the prefix +; (pool, global or /usr) + +; Default Value: nothing is defined by default except the values in php.ini and +; specified at startup with the -d argument +;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com +;php_flag[display_errors] = off +;php_admin_value[error_log] = /var/log/fpm-php.www.log +;php_admin_flag[log_errors] = on +;php_admin_value[memory_limit] = 32M + +; Common values to change to increase file upload limit +php_admin_value[upload_max_filesize] = 100M +; php_admin_value[post_max_size] = 50M +; php_admin_flag[mail.add_x_header] = Off + +; Other common parameters +; php_admin_value[max_execution_time] = 600 +; php_admin_value[max_input_time] = 300 +php_admin_value[memory_limit] = 256M +; php_admin_flag[short_open_tag] = On diff --git a/issue_template.md b/issue_template.md index 0f954a7..1cad34d 100644 --- a/issue_template.md +++ b/issue_template.md @@ -20,7 +20,7 @@ about: Create a report to help us debug, it would be nice to fill the template a - 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 65b687d..7f5a27d 100644 --- a/manifest.json +++ b/manifest.json @@ -50,6 +50,10 @@ "en": "Is it a public application?", "fr": "Est-ce une application publique ?" }, + "help": { + "en": "If enabled, Matomo will be accessible by people who do not have an account. This can be changed later via the webadmin.", + "fr": "Si cette case est cochée, Matomo sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." + }, "default": true } ] diff --git a/scripts/install b/scripts/install index 8115366..d1ed935 100755 --- a/scripts/install +++ b/scripts/install @@ -88,7 +88,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Configuring PHP-FPM..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=medium --package="$extra_php_dependencies" +ynh_add_fpm_config --package="$extra_php_dependencies" phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= @@ -149,9 +149,12 @@ ynh_systemd_action --service_name=nginx --action=reload ynh_script_progression --message="Sending a readme for the admin..." message="Matomo was successfully installed :) + Please open your $app domain: https://$domain$path_url + Complete the registration process from the setup page displayed. -Details for mysql database to be enterted while registration process: +Details for MySQL database to be enterted while registration process: + Database login: $app Database name: $app Database password: $db_pwd diff --git a/scripts/restore b/scripts/restore index 37d0227..4bbe7d7 100755 --- a/scripts/restore +++ b/scripts/restore @@ -82,7 +82,7 @@ ynh_script_progression --message="Restoring PHP-FPM configuration..." ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" # Recreate a dedicated php-fpm config -ynh_add_fpm_config --usage=low --footprint=medium --package="$extra_php_dependencies" +ynh_add_fpm_config --package="$extra_php_dependencies" #================================================= # RESTORE THE MYSQL DATABASE diff --git a/scripts/upgrade b/scripts/upgrade index 1c2b90a..2205d63 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -124,7 +124,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=medium --package="$extra_php_dependencies" +ynh_add_fpm_config --package="$extra_php_dependencies" phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= @@ -141,7 +141,7 @@ ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" #================================================= ynh_script_progression --message="Setuping a cron..." -ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="../conf/cron" +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="../conf/cron" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/cron" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/cron" ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="../conf/cron" From f5bac2036067d3f8f132aed8e1bf7eb803b78f7e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 10:28:59 +0100 Subject: [PATCH 21/45] Fix php... --- conf/config.ini.php | 8 - conf/extra_php-fpm.conf | 5 + conf/php-fpm.conf | 430 ---------------------------------------- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 7 +- 6 files changed, 11 insertions(+), 443 deletions(-) delete mode 100644 conf/config.ini.php create mode 100644 conf/extra_php-fpm.conf delete mode 100644 conf/php-fpm.conf diff --git a/conf/config.ini.php b/conf/config.ini.php deleted file mode 100644 index beda577..0000000 --- a/conf/config.ini.php +++ /dev/null @@ -1,8 +0,0 @@ -; DO NOT REMOVE THIS LINE -; file automatically generated or modified by Matomo; you can manually override the default values in global.ini.php by redefining them in this file. -[database] -host = "127.0.0.1" -username = "__DB__" -password = "__DB_PASSWORD__" -dbname = "__DB__" -tables_prefix = "matomo_" diff --git a/conf/extra_php-fpm.conf b/conf/extra_php-fpm.conf new file mode 100644 index 0000000..a5425fc --- /dev/null +++ b/conf/extra_php-fpm.conf @@ -0,0 +1,5 @@ +; Additional php.ini defines, specific to this pool of workers. + +php_admin_value[upload_max_filesize] = 100M +php_admin_value[memory_limit] = 256M +php_admin_value[post_max_size] = 50M diff --git a/conf/php-fpm.conf b/conf/php-fpm.conf deleted file mode 100644 index 69e3ca7..0000000 --- a/conf/php-fpm.conf +++ /dev/null @@ -1,430 +0,0 @@ -; Start a new pool named 'www'. -; the variable $pool can be used in any directive and will be replaced by the -; pool name ('www' here) -[__NAMETOCHANGE__] - -; Per pool prefix -; It only applies on the following directives: -; - 'access.log' -; - 'slowlog' -; - 'listen' (unixsocket) -; - 'chroot' -; - 'chdir' -; - 'php_values' -; - 'php_admin_values' -; When not set, the global prefix (or /usr) applies instead. -; Note: This directive can also be relative to the global prefix. -; Default Value: none -;prefix = /path/to/pools/$pool - -; Unix user/group of processes -; Note: The user is mandatory. If the group is not set, the default user's group -; will be used. -user = __USER__ -group = __USER__ - -; The address on which to accept FastCGI requests. -; Valid syntaxes are: -; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on -; a specific port; -; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on -; a specific port; -; 'port' - to listen on a TCP socket to all addresses -; (IPv6 and IPv4-mapped) on a specific port; -; '/path/to/unix/socket' - to listen on a unix socket. -; Note: This value is mandatory. -listen = /var/run/php/php__PHPVERSION__-fpm-__NAMETOCHANGE__.sock - -; Set listen(2) backlog. -; Default Value: 511 (-1 on FreeBSD and OpenBSD) -;listen.backlog = 511 - -; Set permissions for unix socket, if one is used. In Linux, read/write -; permissions must be set in order to allow connections from a web server. Many -; BSD-derived systems allow connections regardless of permissions. -; Default Values: user and group are set as the running user -; mode is set to 0660 -listen.owner = www-data -listen.group = www-data -;listen.mode = 0660 -; When POSIX Access Control Lists are supported you can set them using -; these options, value is a comma separated list of user/group names. -; When set, listen.owner and listen.group are ignored -;listen.acl_users = -;listen.acl_groups = - -; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. -; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original -; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address -; must be separated by a comma. If this value is left blank, connections will be -; accepted from any ip address. -; Default Value: any -;listen.allowed_clients = 127.0.0.1 - -; Specify the nice(2) priority to apply to the pool processes (only if set) -; The value can vary from -19 (highest priority) to 20 (lower priority) -; Note: - It will only work if the FPM master process is launched as root -; - The pool processes will inherit the master process priority -; unless it specified otherwise -; Default Value: no set -; process.priority = -19 - -; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user -; or group is differrent than the master process user. It allows to create process -; core dump and ptrace the process for the pool user. -; Default Value: no -; process.dumpable = yes - -; Choose how the process manager will control the number of child processes. -; Possible Values: -; static - a fixed number (pm.max_children) of child processes; -; dynamic - the number of child processes are set dynamically based on the -; following directives. With this process management, there will be -; always at least 1 children. -; pm.max_children - the maximum number of children that can -; be alive at the same time. -; pm.start_servers - the number of children created on startup. -; pm.min_spare_servers - the minimum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is less than this -; number then some children will be created. -; pm.max_spare_servers - the maximum number of children in 'idle' -; state (waiting to process). If the number -; of 'idle' processes is greater than this -; number then some children will be killed. -; ondemand - no children are created at startup. Children will be forked when -; new requests will connect. The following parameter are used: -; pm.max_children - the maximum number of children that -; can be alive at the same time. -; pm.process_idle_timeout - The number of seconds after which -; an idle process will be killed. -; Note: This value is mandatory. -pm = dynamic - -; The number of child processes to be created when pm is set to 'static' and the -; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. -; This value sets the limit on the number of simultaneous requests that will be -; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. -; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP -; CGI. The below defaults are based on a server without much resources. Don't -; forget to tweak pm.* to fit your needs. -; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' -; Note: This value is mandatory. -pm.max_children = 5 - -; The number of child processes created on startup. -; Note: Used only when pm is set to 'dynamic' -; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 -pm.start_servers = 2 - -; The desired minimum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.min_spare_servers = 1 - -; The desired maximum number of idle server processes. -; Note: Used only when pm is set to 'dynamic' -; Note: Mandatory when pm is set to 'dynamic' -pm.max_spare_servers = 3 - -; The number of seconds after which an idle process will be killed. -; Note: Used only when pm is set to 'ondemand' -; Default Value: 10s -;pm.process_idle_timeout = 10s; - -; The number of requests each child process should execute before respawning. -; This can be useful to work around memory leaks in 3rd party libraries. For -; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. -; Default Value: 0 -;pm.max_requests = 500 - -; The URI to view the FPM status page. If this value is not set, no URI will be -; recognized as a status page. It shows the following informations: -; pool - the name of the pool; -; process manager - static, dynamic or ondemand; -; start time - the date and time FPM has started; -; start since - number of seconds since FPM has started; -; accepted conn - the number of request accepted by the pool; -; listen queue - the number of request in the queue of pending -; connections (see backlog in listen(2)); -; max listen queue - the maximum number of requests in the queue -; of pending connections since FPM has started; -; listen queue len - the size of the socket queue of pending connections; -; idle processes - the number of idle processes; -; active processes - the number of active processes; -; total processes - the number of idle + active processes; -; max active processes - the maximum number of active processes since FPM -; has started; -; max children reached - number of times, the process limit has been reached, -; when pm tries to start more children (works only for -; pm 'dynamic' and 'ondemand'); -; Value are updated in real time. -; Example output: -; pool: www -; process manager: static -; start time: 01/Jul/2011:17:53:49 +0200 -; start since: 62636 -; accepted conn: 190460 -; listen queue: 0 -; max listen queue: 1 -; listen queue len: 42 -; idle processes: 4 -; active processes: 11 -; total processes: 15 -; max active processes: 12 -; max children reached: 0 -; -; By default the status page output is formatted as text/plain. Passing either -; 'html', 'xml' or 'json' in the query string will return the corresponding -; output syntax. Example: -; http://www.foo.bar/status -; http://www.foo.bar/status?json -; http://www.foo.bar/status?html -; http://www.foo.bar/status?xml -; -; By default the status page only outputs short status. Passing 'full' in the -; query string will also return status for each pool process. -; Example: -; http://www.foo.bar/status?full -; http://www.foo.bar/status?json&full -; http://www.foo.bar/status?html&full -; http://www.foo.bar/status?xml&full -; The Full status returns for each process: -; pid - the PID of the process; -; state - the state of the process (Idle, Running, ...); -; start time - the date and time the process has started; -; start since - the number of seconds since the process has started; -; requests - the number of requests the process has served; -; request duration - the duration in µs of the requests; -; request method - the request method (GET, POST, ...); -; request URI - the request URI with the query string; -; content length - the content length of the request (only with POST); -; user - the user (PHP_AUTH_USER) (or '-' if not set); -; script - the main script called (or '-' if not set); -; last request cpu - the %cpu the last request consumed -; it's always 0 if the process is not in Idle state -; because CPU calculation is done when the request -; processing has terminated; -; last request memory - the max amount of memory the last request consumed -; it's always 0 if the process is not in Idle state -; because memory calculation is done when the request -; processing has terminated; -; If the process is in Idle state, then informations are related to the -; last request the process has served. Otherwise informations are related to -; the current request being served. -; Example output: -; ************************ -; pid: 31330 -; state: Running -; start time: 01/Jul/2011:17:53:49 +0200 -; start since: 63087 -; requests: 12808 -; request duration: 1250261 -; request method: GET -; request URI: /test_mem.php?N=10000 -; content length: 0 -; user: - -; script: /home/fat/web/docs/php/test_mem.php -; last request cpu: 0.00 -; last request memory: 0 -; -; Note: There is a real-time FPM status monitoring sample web page available -; It's available in: /usr/share/php/7.0/fpm/status.html -; -; Note: The value must start with a leading slash (/). The value can be -; anything, but it may not be a good idea to use the .php extension or it -; may conflict with a real PHP file. -; Default Value: not set -;pm.status_path = /status - -; The ping URI to call the monitoring page of FPM. If this value is not set, no -; URI will be recognized as a ping page. This could be used to test from outside -; that FPM is alive and responding, or to -; - create a graph of FPM availability (rrd or such); -; - remove a server from a group if it is not responding (load balancing); -; - trigger alerts for the operating team (24/7). -; Note: The value must start with a leading slash (/). The value can be -; anything, but it may not be a good idea to use the .php extension or it -; may conflict with a real PHP file. -; Default Value: not set -;ping.path = /ping - -; This directive may be used to customize the response of a ping request. The -; response is formatted as text/plain with a 200 response code. -; Default Value: pong -;ping.response = pong - -; The access log file -; Default: not set -;access.log = log/$pool.access.log - -; The access log format. -; The following syntax is allowed -; %%: the '%' character -; %C: %CPU used by the request -; it can accept the following format: -; - %{user}C for user CPU only -; - %{system}C for system CPU only -; - %{total}C for user + system CPU (default) -; %d: time taken to serve the request -; it can accept the following format: -; - %{seconds}d (default) -; - %{miliseconds}d -; - %{mili}d -; - %{microseconds}d -; - %{micro}d -; %e: an environment variable (same as $_ENV or $_SERVER) -; it must be associated with embraces to specify the name of the env -; variable. Some exemples: -; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e -; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e -; %f: script filename -; %l: content-length of the request (for POST request only) -; %m: request method -; %M: peak of memory allocated by PHP -; it can accept the following format: -; - %{bytes}M (default) -; - %{kilobytes}M -; - %{kilo}M -; - %{megabytes}M -; - %{mega}M -; %n: pool name -; %o: output header -; it must be associated with embraces to specify the name of the header: -; - %{Content-Type}o -; - %{X-Powered-By}o -; - %{Transfert-Encoding}o -; - .... -; %p: PID of the child that serviced the request -; %P: PID of the parent of the child that serviced the request -; %q: the query string -; %Q: the '?' character if query string exists -; %r: the request URI (without the query string, see %q and %Q) -; %R: remote IP address -; %s: status (response code) -; %t: server time the request was received -; it can accept a strftime(3) format: -; %d/%b/%Y:%H:%M:%S %z (default) -; The strftime(3) format must be encapsuled in a %{}t tag -; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t -; %T: time the log has been written (the request has finished) -; it can accept a strftime(3) format: -; %d/%b/%Y:%H:%M:%S %z (default) -; The strftime(3) format must be encapsuled in a %{}t tag -; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t -; %u: remote user -; -; Default: "%R - %u %t \"%m %r\" %s" -;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" - -; The log file for slow requests -; Default Value: not set -; Note: slowlog is mandatory if request_slowlog_timeout is set -;slowlog = log/$pool.log.slow - -; The timeout for serving a single request after which a PHP backtrace will be -; dumped to the 'slowlog' file. A value of '0s' means 'off'. -; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) -; Default Value: 0 -;request_slowlog_timeout = 0 - -; The timeout for serving a single request after which the worker process will -; be killed. This option should be used when the 'max_execution_time' ini option -; does not stop script execution for some reason. A value of '0' means 'off'. -; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) -; Default Value: 0 -request_terminate_timeout = 1d - -; Set open file descriptor rlimit. -; Default Value: system defined value -;rlimit_files = 1024 - -; Set max core size rlimit. -; Possible Values: 'unlimited' or an integer greater or equal to 0 -; Default Value: system defined value -;rlimit_core = 0 - -; Chroot to this directory at the start. This value must be defined as an -; absolute path. When this value is not set, chroot is not used. -; Note: you can prefix with '$prefix' to chroot to the pool prefix or one -; of its subdirectories. If the pool prefix is not set, the global prefix -; will be used instead. -; Note: chrooting is a great security feature and should be used whenever -; possible. However, all PHP paths will be relative to the chroot -; (error_log, sessions.save_path, ...). -; Default Value: not set -;chroot = - -; Chdir to this directory at the start. -; Note: relative path can be used. -; Default Value: current directory or / when chroot -chdir = __FINALPATH__ - -; Redirect worker stdout and stderr into main error log. If not set, stdout and -; stderr will be redirected to /dev/null according to FastCGI specs. -; Note: on highloaded environement, this can cause some delay in the page -; process time (several ms). -; Default Value: no -;catch_workers_output = yes - -; Clear environment in FPM workers -; Prevents arbitrary environment variables from reaching FPM worker processes -; by clearing the environment in workers before env vars specified in this -; pool configuration are added. -; Setting to "no" will make all environment variables available to PHP code -; via getenv(), $_ENV and $_SERVER. -; Default Value: yes -;clear_env = no - -; Limits the extensions of the main script FPM will allow to parse. This can -; prevent configuration mistakes on the web server side. You should only limit -; FPM to .php extensions to prevent malicious users to use other extensions to -; execute php code. -; Note: set an empty value to allow all extensions. -; Default Value: .php -;security.limit_extensions = .php .php3 .php4 .php5 .php7 - -; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from -; the current environment. -; Default Value: clean env -;env[HOSTNAME] = $HOSTNAME -;env[PATH] = /usr/local/bin:/usr/bin:/bin -;env[TMP] = /tmp -;env[TMPDIR] = /tmp -;env[TEMP] = /tmp - -; Additional php.ini defines, specific to this pool of workers. These settings -; overwrite the values previously defined in the php.ini. The directives are the -; same as the PHP SAPI: -; php_value/php_flag - you can set classic ini defines which can -; be overwritten from PHP call 'ini_set'. -; php_admin_value/php_admin_flag - these directives won't be overwritten by -; PHP call 'ini_set' -; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. - -; Defining 'extension' will load the corresponding shared extension from -; extension_dir. Defining 'disable_functions' or 'disable_classes' will not -; overwrite previously defined php.ini values, but will append the new value -; instead. - -; Note: path INI options can be relative and will be expanded with the prefix -; (pool, global or /usr) - -; Default Value: nothing is defined by default except the values in php.ini and -; specified at startup with the -d argument -;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com -;php_flag[display_errors] = off -;php_admin_value[error_log] = /var/log/fpm-php.www.log -;php_admin_flag[log_errors] = on -;php_admin_value[memory_limit] = 32M - -; Common values to change to increase file upload limit -php_admin_value[upload_max_filesize] = 100M -; php_admin_value[post_max_size] = 50M -; php_admin_flag[mail.add_x_header] = Off - -; Other common parameters -; php_admin_value[max_execution_time] = 600 -; php_admin_value[max_input_time] = 300 -php_admin_value[memory_limit] = 256M -; php_admin_flag[short_open_tag] = On diff --git a/scripts/install b/scripts/install index d1ed935..60d4e84 100755 --- a/scripts/install +++ b/scripts/install @@ -88,7 +88,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Configuring PHP-FPM..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= diff --git a/scripts/restore b/scripts/restore index 4bbe7d7..4a51b1d 100755 --- a/scripts/restore +++ b/scripts/restore @@ -82,7 +82,7 @@ ynh_script_progression --message="Restoring PHP-FPM configuration..." ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" # Recreate a dedicated php-fpm config -ynh_add_fpm_config --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" #================================================= # RESTORE THE MYSQL DATABASE diff --git a/scripts/upgrade b/scripts/upgrade index 2205d63..0f3ce37 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,6 +22,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK VERSION @@ -86,7 +87,7 @@ then cp -a "$final_path/config/config.ini.php" "$tmpdir/config.ini.php" # Remove the app directory securely - ynh_secure_remove --file=$final_path + ynh_secure_remove --file="$final_path" # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" @@ -124,8 +125,7 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated PHP-FPM config -ynh_add_fpm_config --package="$extra_php_dependencies" -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" #================================================= # SPECIFIC UPGRADE @@ -146,6 +146,7 @@ ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_fil ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/cron" ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="../conf/cron" ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="../conf/cron" + cp -f ../conf/cron /etc/cron.d/$app #================================================= From 2931b0bf593c8df89c8e1e31eb54680bbb3443d5 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 11:39:52 +0100 Subject: [PATCH 22/45] Fix --- conf/config.ini.php | 5 +++-- scripts/install | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/conf/config.ini.php b/conf/config.ini.php index beda577..0d3b9c6 100644 --- a/conf/config.ini.php +++ b/conf/config.ini.php @@ -2,7 +2,8 @@ ; file automatically generated or modified by Matomo; you can manually override the default values in global.ini.php by redefining them in this file. [database] host = "127.0.0.1" -username = "__DB__" +username = "__DB_NAME__" password = "__DB_PASSWORD__" -dbname = "__DB__" +dbname = "__DB_NAME__" tables_prefix = "matomo_" + diff --git a/scripts/install b/scripts/install index 8115366..7856e1e 100755 --- a/scripts/install +++ b/scripts/install @@ -113,6 +113,11 @@ ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion cp -f ../conf/cron /etc/cron.d/$app +ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="../conf/config.ini.php" +ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$db_pwd" --target_file="../conf/config.ini.php" + +cp -f ../conf/config.ini.php $final_path/config/config.ini.php + #================================================= # GENERIC FINALIZATION #================================================= From 04df2b22dcd03a384d4f44b2839c081e4decd531 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 11:56:48 +0100 Subject: [PATCH 23/45] Fix --- scripts/install | 5 ----- scripts/upgrade | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/scripts/install b/scripts/install index 7856e1e..8115366 100755 --- a/scripts/install +++ b/scripts/install @@ -113,11 +113,6 @@ ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion cp -f ../conf/cron /etc/cron.d/$app -ynh_replace_string --match_string="__DB_NAME__" --replace_string="$db_name" --target_file="../conf/config.ini.php" -ynh_replace_string --match_string="__DB_PASSWORD__" --replace_string="$db_pwd" --target_file="../conf/config.ini.php" - -cp -f ../conf/config.ini.php $final_path/config/config.ini.php - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 1c2b90a..9f0c0e3 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -83,16 +83,16 @@ then # 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" + cp -a "$final_path/config" "$tmpdir" # Remove the app directory securely - ynh_secure_remove --file=$final_path + ynh_secure_remove --file="$final_path" # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" #Copy the admin saved settings from tmp directory to final path - cp -a "$tmpdir/config.ini.php" "$final_path/config/config.ini.php" + cp -a "$tmpdir" "$final_path/config" # Remove the tmp directory securely ynh_secure_remove --file="$tmpdir" From c68d1ef6fb3ad9b2f6a952064c53defcea9b0aab Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 12:20:57 +0100 Subject: [PATCH 24/45] Update upgrade --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 9f0c0e3..629fbc8 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -97,8 +97,8 @@ then # Remove the tmp directory securely ynh_secure_remove --file="$tmpdir" - pushd "$final_path/console" - ynh_exec_as $app core:update + pushd "$final_path" + ynh_exec_as $app ./console core:update popd fi From 3a41a40442a0bbc1bc7b9b70b7dcd5e8fbad713b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 12:34:01 +0100 Subject: [PATCH 25/45] Update upgrade --- scripts/upgrade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 0f3ce37..18104cf 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -98,8 +98,8 @@ then # Remove the tmp directory securely ynh_secure_remove --file="$tmpdir" - pushd "$final_path/console" - ynh_exec_as $app core:update + pushd "$final_path" + ynh_exec_as $app ./console core:update popd fi From 5a214dd784c04253ee4876a838955ba8e0f03dc2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 12:36:49 +0100 Subject: [PATCH 26/45] Update upgrade --- scripts/upgrade | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 629fbc8..54d839d 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -91,6 +91,8 @@ then # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" + ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" + #Copy the admin saved settings from tmp directory to final path cp -a "$tmpdir" "$final_path/config" From ff90496a9fec36d52773d7c221ede5768311f5c4 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 12:45:42 +0100 Subject: [PATCH 27/45] Update upgrade --- scripts/upgrade | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 54d839d..f4630eb 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -22,6 +22,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK VERSION @@ -93,7 +94,7 @@ then ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" - #Copy the admin saved settings from tmp directory to final path + # Copy the admin saved settings from tmp directory to final path cp -a "$tmpdir" "$final_path/config" # Remove the tmp directory securely From af9210cd2f16bc74eeabdc13295d6e314b39f88d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 12:59:10 +0100 Subject: [PATCH 28/45] Update upgrade --- scripts/upgrade | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index f4630eb..a857f7b 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -86,14 +86,9 @@ then # Backup the config file in the temp dir cp -a "$final_path/config" "$tmpdir" - # 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" - ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" - # Copy the admin saved settings from tmp directory to final path cp -a "$tmpdir" "$final_path/config" From 6cc63520f9cb1f4dd17262c81395bfc98a386fa2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 13:30:51 +0100 Subject: [PATCH 29/45] Update upgrade --- scripts/upgrade | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index a857f7b..e108641 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -95,9 +95,6 @@ then # Remove the tmp directory securely ynh_secure_remove --file="$tmpdir" - pushd "$final_path" - ynh_exec_as $app ./console core:update - popd fi #================================================= @@ -134,6 +131,8 @@ ynh_script_progression --message="Installating composer and dependencies..." ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" +cd "$final_path" && ynh_exec_as $app ./console core:update + #================================================= # SETUP A CRON #================================================= @@ -144,6 +143,7 @@ ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_fil ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/cron" ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="../conf/cron" ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="../conf/cron" + cp -f ../conf/cron /etc/cron.d/$app #================================================= From b8f750779f4b62312859890d093ab41c85a9884c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 13:57:04 +0100 Subject: [PATCH 30/45] Fix --- scripts/upgrade | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index e108641..0456b5e 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -81,20 +81,24 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." - # Create a temporary directory - tmpdir="$(mktemp -d)" - # Backup the config file in the temp dir - cp -a "$final_path/config" "$tmpdir" + if [ -z "$final_path/config/config.ini.php" ]; then + ynh_setup_source --dest_dir="$final_path" + else + # Create a temporary directory + tmpdir="$(mktemp -d)" - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir="$final_path" + # Backup the config file in the temp dir + cp -a "$final_path/config/config.ini.php" "$tmpdir/config.ini.php" - # Copy the admin saved settings from tmp directory to final path - cp -a "$tmpdir" "$final_path/config" + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir="$final_path" - # Remove the tmp directory securely - ynh_secure_remove --file="$tmpdir" + # 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" + fi fi #================================================= @@ -131,7 +135,10 @@ ynh_script_progression --message="Installating composer and dependencies..." ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" -cd "$final_path" && ynh_exec_as $app ./console core:update +if [ -z "$final_path/config/config.ini.php" ]; then + cd "$final_path" + ynh_exec_as $app ./console core:update +fi #================================================= # SETUP A CRON From 023c0893541c5a9caaca250fc3c2d02d291ec26d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 14:03:35 +0100 Subject: [PATCH 31/45] Update upgrade --- scripts/upgrade | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 0456b5e..52bbebe 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -81,7 +81,7 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." - if [ -z "$final_path/config/config.ini.php" ]; then + if [[ ! -f "$final_path/config/config.ini.php" ]]; then ynh_setup_source --dest_dir="$final_path" else # Create a temporary directory @@ -124,7 +124,6 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated PHP-FPM config ynh_add_fpm_config --usage=low --footprint=medium --package="$extra_php_dependencies" -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC UPGRADE @@ -135,7 +134,7 @@ ynh_script_progression --message="Installating composer and dependencies..." ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" -if [ -z "$final_path/config/config.ini.php" ]; then +if [[ -f "$final_path/config/config.ini.php" ]]; then cd "$final_path" ynh_exec_as $app ./console core:update fi From 4c97f7956eb8c8a39fd6de32a95254163b6f40fb Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 14:15:02 +0100 Subject: [PATCH 32/45] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 52bbebe..e181be9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -144,7 +144,7 @@ fi #================================================= ynh_script_progression --message="Setuping a cron..." -ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="../conf/cron" +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="../conf/cron" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/cron" ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/cron" ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="../conf/cron" From 6e899aff69686e02bd176ea58f87894757f7d907 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 15:57:16 +0100 Subject: [PATCH 33/45] set up cron --- conf/{cron => matomo.cron} | 0 scripts/install | 15 +++++++++------ scripts/upgrade | 15 +++++++++------ 3 files changed, 18 insertions(+), 12 deletions(-) rename conf/{cron => matomo.cron} (100%) diff --git a/conf/cron b/conf/matomo.cron similarity index 100% rename from conf/cron rename to conf/matomo.cron diff --git a/scripts/install b/scripts/install index 60d4e84..6e4bfe0 100755 --- a/scripts/install +++ b/scripts/install @@ -105,13 +105,16 @@ ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" #================================================= ynh_script_progression --message="Setuping a cron..." -ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="../conf/cron" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/cron" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/cron" -ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="../conf/cron" -ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="../conf/cron" +cron_path="/etc/cron.d/$app" +cp -a ../conf/matomo.cron "$cron_path" +chown root: "$cron_path" +chmod 644 "$cron_path" -cp -f ../conf/cron /etc/cron.d/$app +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$cron_path" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$cron_path" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$cron_path" +ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$cron_path" +ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="$cron_path" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index ae0fa4d..944cf8a 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -144,13 +144,16 @@ fi #================================================= ynh_script_progression --message="Setuping a cron..." -ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="../conf/cron" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="../conf/cron" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="../conf/cron" -ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="../conf/cron" -ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="../conf/cron" +cron_path="/etc/cron.d/$app" +cp -a ../conf/matomo.cron "$cron_path" +chown root: "$cron_path" +chmod 644 "$cron_path" -cp -f ../conf/cron /etc/cron.d/$app +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$cron_path" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$cron_path" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$cron_path" +ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$cron_path" +ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="$cron_path" #================================================= # GENERIC FINALIZATION From da9058b99a944606c49e89d0976a673108c1052c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 16:19:31 +0100 Subject: [PATCH 34/45] Install missing Icons --- scripts/install | 3 +++ scripts/upgrade | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/scripts/install b/scripts/install index 6e4bfe0..753b5a5 100755 --- a/scripts/install +++ b/scripts/install @@ -100,6 +100,9 @@ ynh_script_progression --message="Installing Composer and dependencies..." ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" +# Install missing icons +git clone https://github.com/matomo-org/matomo-icons.git "$final_path/plugins/Morpheus/icons" --quiet + #================================================= # SETUP A CRON #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 944cf8a..1a988b9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -139,6 +139,15 @@ if [[ -f "$final_path/config/config.ini.php" ]]; then ynh_exec_as $app ./console core:update fi +#================================================= +# INSRALL MISSING ICONS +#================================================= + +if [ ! "$(ls -A "$final_path/plugins/Morpheus/icons")" ] +then + git clone https://github.com/matomo-org/matomo-icons.git "$final_path/plugins/Morpheus/icons" --quiet +fi + #================================================= # SETUP A CRON #================================================= From 4dd96debe0ea43b0bc25e8e9c95a186e86489081 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 16:41:59 +0100 Subject: [PATCH 35/45] Update install --- scripts/install | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/install b/scripts/install index 753b5a5..b228530 100755 --- a/scripts/install +++ b/scripts/install @@ -106,18 +106,18 @@ git clone https://github.com/matomo-org/matomo-icons.git "$final_path/plugins/Mo #================================================= # SETUP A CRON #================================================= -ynh_script_progression --message="Setuping a cron..." +# ynh_script_progression --message="Setuping a cron..." -cron_path="/etc/cron.d/$app" -cp -a ../conf/matomo.cron "$cron_path" -chown root: "$cron_path" -chmod 644 "$cron_path" +# cron_path="/etc/cron.d/$app" +# cp -a ../conf/matomo.cron "$cron_path" +# chown root: "$cron_path" +# chmod 644 "$cron_path" -ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$cron_path" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$cron_path" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$cron_path" -ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$cron_path" -ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="$cron_path" +# ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$cron_path" +# ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$cron_path" +# ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$cron_path" +# ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$cron_path" +# ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="$cron_path" #================================================= # GENERIC FINALIZATION From 57c4c35f1d7d413237769d597f8ddabcd09a3e3f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 16:56:53 +0100 Subject: [PATCH 36/45] Update upgrade --- scripts/upgrade | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 1a988b9..c0552f9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -151,18 +151,18 @@ fi #================================================= # SETUP A CRON #================================================= -ynh_script_progression --message="Setuping a cron..." +# ynh_script_progression --message="Setuping a cron..." -cron_path="/etc/cron.d/$app" -cp -a ../conf/matomo.cron "$cron_path" -chown root: "$cron_path" -chmod 644 "$cron_path" +# cron_path="/etc/cron.d/$app" +# cp -a ../conf/matomo.cron "$cron_path" +# chown root: "$cron_path" +# chmod 644 "$cron_path" -ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$cron_path" -ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$cron_path" -ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$cron_path" -ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$cron_path" -ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="$cron_path" +# ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$cron_path" +# ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$cron_path" +# ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$cron_path" +# ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$cron_path" +# ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="$cron_path" #================================================= # GENERIC FINALIZATION From 4f1e347d60068895068f3fe1c03a0aa4967fb4eb Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 17:20:31 +0100 Subject: [PATCH 37/45] setup cron --- scripts/change_url | 14 ++++++++++++++ scripts/upgrade | 17 +++++++---------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index c6cfed0..380353e 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -28,6 +28,7 @@ ynh_script_progression --message="Loading installation settings..." --weight=1 # Needed for helper "ynh_add_nginx_config" final_path=$(ynh_app_setting_get --app=$app --key=final_path) +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP @@ -91,6 +92,19 @@ then ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi +#================================================= +# SETUP A CRON +#================================================= +ynh_script_progression --message="Setuping a cron..." + +cp ../conf/matomo.cron /etc/cron.d/$app + +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="/etc/cron.d/$app" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/etc/cron.d/$app" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$new_domain" --target_file="/etc/cron.d/$app" +ynh_replace_string --match_string="__PATH__" --replace_string="$new_path" --target_file="/etc/cron.d/$app" +ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="/etc/cron.d/$app" + #================================================= # RELOAD NGINX #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index c0552f9..c7faa48 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -151,18 +151,15 @@ fi #================================================= # SETUP A CRON #================================================= -# ynh_script_progression --message="Setuping a cron..." +ynh_script_progression --message="Setuping a cron..." -# cron_path="/etc/cron.d/$app" -# cp -a ../conf/matomo.cron "$cron_path" -# chown root: "$cron_path" -# chmod 644 "$cron_path" +cp ../conf/matomo.cron /etc/cron.d/$app -# ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$cron_path" -# ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$cron_path" -# ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$cron_path" -# ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$cron_path" -# ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="$cron_path" +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="/etc/cron.d/$app" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/etc/cron.d/$app" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="/etc/cron.d/$app" +ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="/etc/cron.d/$app" +ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="/etc/cron.d/$app" #================================================= # GENERIC FINALIZATION From 45ef8a2aa3ec4616815c1a7e58946feaf7c1b9a4 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 17:31:47 +0100 Subject: [PATCH 38/45] Fix cron --- conf/{matomo.cron => cron} | 0 scripts/change_url | 2 +- scripts/install | 17 +++++++---------- scripts/upgrade | 2 +- 4 files changed, 9 insertions(+), 12 deletions(-) rename conf/{matomo.cron => cron} (100%) diff --git a/conf/matomo.cron b/conf/cron similarity index 100% rename from conf/matomo.cron rename to conf/cron diff --git a/scripts/change_url b/scripts/change_url index 380353e..253d54f 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -97,7 +97,7 @@ fi #================================================= ynh_script_progression --message="Setuping a cron..." -cp ../conf/matomo.cron /etc/cron.d/$app +cp ../conf/cron /etc/cron.d/$app ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="/etc/cron.d/$app" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/etc/cron.d/$app" diff --git a/scripts/install b/scripts/install index b228530..147f985 100755 --- a/scripts/install +++ b/scripts/install @@ -106,18 +106,15 @@ git clone https://github.com/matomo-org/matomo-icons.git "$final_path/plugins/Mo #================================================= # SETUP A CRON #================================================= -# ynh_script_progression --message="Setuping a cron..." +ynh_script_progression --message="Setuping a cron..." -# cron_path="/etc/cron.d/$app" -# cp -a ../conf/matomo.cron "$cron_path" -# chown root: "$cron_path" -# chmod 644 "$cron_path" +cp ../conf/cron /etc/cron.d/$app -# ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="$cron_path" -# ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="$cron_path" -# ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="$cron_path" -# ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="$cron_path" -# ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="$cron_path" +ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="/etc/cron.d/$app" +ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/etc/cron.d/$app" +ynh_replace_string --match_string="__DOMAIN__" --replace_string="$domain" --target_file="/etc/cron.d/$app" +ynh_replace_string --match_string="__PATH__" --replace_string="$path_url" --target_file="/etc/cron.d/$app" +ynh_replace_string --match_string="__PHPVERSION__" --replace_string="$phpversion" --target_file="/etc/cron.d/$app" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index c7faa48..a81f194 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -153,7 +153,7 @@ fi #================================================= ynh_script_progression --message="Setuping a cron..." -cp ../conf/matomo.cron /etc/cron.d/$app +cp ../conf/cron /etc/cron.d/$app ynh_replace_string --match_string="__FINALPATH__" --replace_string="$final_path" --target_file="/etc/cron.d/$app" ynh_replace_string --match_string="__APP__" --replace_string="$app" --target_file="/etc/cron.d/$app" From baa581a9117573220545e3cf0030ff034ab09f46 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 18:19:43 +0100 Subject: [PATCH 39/45] Update upgrade --- scripts/upgrade | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index a81f194..47ad794 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -135,8 +135,9 @@ ynh_script_progression --message="Installating composer and dependencies..." ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" if [[ -f "$final_path/config/config.ini.php" ]]; then - cd "$final_path" - ynh_exec_as $app ./console core:update + pushd "$final_path" + ynh_exec_as $app ./console core:update + popd fi #================================================= From 69efd1b3b894dad04fd8afee39a54b8d3ae7baad Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 11 Dec 2020 18:51:06 +0100 Subject: [PATCH 40/45] Small typos --- scripts/install | 2 -- scripts/upgrade | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 147f985..6e913e3 100755 --- a/scripts/install +++ b/scripts/install @@ -134,8 +134,6 @@ ynh_script_progression --message="Configuring SSOwat..." # Make app public if necessary or protect it if [ $is_public -eq 1 ] then - # Everyone can access the app. - # The "main" permission is automatically created before the install script. ynh_permission_update --permission "main" --add "visitors" fi diff --git a/scripts/upgrade b/scripts/upgrade index 47ad794..4ad8279 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -141,7 +141,7 @@ if [[ -f "$final_path/config/config.ini.php" ]]; then fi #================================================= -# INSRALL MISSING ICONS +# INSTALL MISSING ICONS #================================================= if [ ! "$(ls -A "$final_path/plugins/Morpheus/icons")" ] From 63b55c6d6d49c8a4f80bc039eb86e856d4087a43 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 12 Dec 2020 15:32:25 +0100 Subject: [PATCH 41/45] Set permissions to Morpheus folder to auto update --- scripts/install | 1 + scripts/upgrade | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index 6e913e3..8391d17 100755 --- a/scripts/install +++ b/scripts/install @@ -102,6 +102,7 @@ ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" # Install missing icons git clone https://github.com/matomo-org/matomo-icons.git "$final_path/plugins/Morpheus/icons" --quiet +chmod -R 755 "$final_path/plugins/Morpheus" #================================================= # SETUP A CRON diff --git a/scripts/upgrade b/scripts/upgrade index 4ad8279..4672ff4 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -147,6 +147,7 @@ fi if [ ! "$(ls -A "$final_path/plugins/Morpheus/icons")" ] then git clone https://github.com/matomo-org/matomo-icons.git "$final_path/plugins/Morpheus/icons" --quiet + chmod -R 755 "$final_path/plugins/Morpheus" fi #================================================= From 13e02617b479b1eebc5be2d51b463c42e69ed67a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 15 Dec 2020 09:02:37 +0100 Subject: [PATCH 42/45] Add icons repo --- conf/icons.src | 6 ++++++ scripts/install | 3 ++- scripts/upgrade | 11 ++++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 conf/icons.src diff --git a/conf/icons.src b/conf/icons.src new file mode 100644 index 0000000..6ffad8e --- /dev/null +++ b/conf/icons.src @@ -0,0 +1,6 @@ +SOURCE_URL=https://github.com/matomo-org/matomo-icons/archive/e96ef33bf490794829831cbb795fd4ea67259699.tar.gz +SOURCE_SUM=9a6457d8f138216f911621db7a5af5fbce7214e62d6f184730f216986e498b53 +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= diff --git a/scripts/install b/scripts/install index 8391d17..abe70bf 100755 --- a/scripts/install +++ b/scripts/install @@ -101,7 +101,8 @@ ynh_script_progression --message="Installing Composer and dependencies..." ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" # Install missing icons -git clone https://github.com/matomo-org/matomo-icons.git "$final_path/plugins/Morpheus/icons" --quiet +#git clone https://github.com/matomo-org/matomo-icons.git "$final_path/plugins/Morpheus/icons" --quiet +ynh_setup_source --dest_dir="$final_path/plugins/Morpheus/icons" --source_id="icons" chmod -R 755 "$final_path/plugins/Morpheus" #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 4672ff4..3b9c37f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -82,6 +82,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 IC 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 @@ -90,6 +95,9 @@ then # 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" @@ -146,7 +154,8 @@ fi if [ ! "$(ls -A "$final_path/plugins/Morpheus/icons")" ] then - git clone https://github.com/matomo-org/matomo-icons.git "$final_path/plugins/Morpheus/icons" --quiet + #git clone https://github.com/matomo-org/matomo-icons.git "$final_path/plugins/Morpheus/icons" --quiet + ynh_setup_source --dest_dir="$final_path/plugins/Morpheus/icons" --source_id="icons" chmod -R 755 "$final_path/plugins/Morpheus" fi From e4207dce7009aa855af0f55c6b3f107b4a07d8e3 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 15 Dec 2020 09:16:10 +0100 Subject: [PATCH 43/45] Cleaning up --- scripts/install | 1 - scripts/upgrade | 1 - 2 files changed, 2 deletions(-) diff --git a/scripts/install b/scripts/install index abe70bf..9e41513 100755 --- a/scripts/install +++ b/scripts/install @@ -101,7 +101,6 @@ ynh_script_progression --message="Installing Composer and dependencies..." ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" # Install missing icons -#git clone https://github.com/matomo-org/matomo-icons.git "$final_path/plugins/Morpheus/icons" --quiet ynh_setup_source --dest_dir="$final_path/plugins/Morpheus/icons" --source_id="icons" chmod -R 755 "$final_path/plugins/Morpheus" diff --git a/scripts/upgrade b/scripts/upgrade index 3b9c37f..a7facba 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -154,7 +154,6 @@ fi if [ ! "$(ls -A "$final_path/plugins/Morpheus/icons")" ] then - #git clone https://github.com/matomo-org/matomo-icons.git "$final_path/plugins/Morpheus/icons" --quiet ynh_setup_source --dest_dir="$final_path/plugins/Morpheus/icons" --source_id="icons" chmod -R 755 "$final_path/plugins/Morpheus" fi From ea210f2a9e1fbde91c06217328cb1679c4ddb665 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 16 Dec 2020 15:50:09 +0100 Subject: [PATCH 44/45] Fix typo --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index a7facba..bddff85 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -83,7 +83,7 @@ then 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 IC tests are carried out... + # 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 From 075a280bc49af20017a6003c62217cfb8e7d1100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Thu, 17 Dec 2020 21:46:13 +0100 Subject: [PATCH 45/45] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c0b4250..5343f38 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Matomo for YunoHost [![Integration level](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) -[![Install Matomo with YunoHost](https://install-app.yunohost.org/install-with-yunohost.png)](https://install-app.yunohost.org/?app=matomo) +[![Install Matomo with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=matomo) *[Lire ce readme en français.](./README_fr.md)*