Skip to content

Commit acb6c81

Browse files
authored
Merge branch '5.x-dev' into fix/icon/vertical-align
2 parents b05d29e + b3939c3 commit acb6c81

4,109 files changed

Lines changed: 188073 additions & 128469 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ddev/.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**/*.example
2+
/.dbimageBuild
3+
/.ddev-docker-*.yaml
4+
/.*downloads
5+
/.homeadditions
6+
/.importdb*
7+
/.sshimageBuild
8+
/.webimageBuild
9+
/apache/apache-static-sites.conf
10+
/commands/.gitattributes
11+
/config.local.y*ml
12+
/config.*.local.y*ml
13+
/db_snapshots
14+
/mutagen/mutagen.yml
15+
/mutagen/.start-synced
16+
/nginx_full/nginx-site.conf
17+
/postgres/postgresql.conf
18+
/providers/acquia.yaml
19+
/providers/lagoon.yaml
20+
/providers/pantheon.yaml
21+
/providers/platform.yaml
22+
/providers/upsun.yaml
23+
/sequelpro.spf
24+
/traefik/config/*.yaml
25+
/traefik/certs/*.crt
26+
/traefik/certs/*.key
27+
/*/**/README.*

.ddev/README.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Matomo DDEV environment
2+
3+
**WARNING**: Matomo DDEV environment can be helpful when developing for Matomo, to be able to create or test new plugins locally, to run unit, integration, system or UI tests, but it is **highly discouraged** to use DDEV environments to run or host publicly accessible production installations of Matomo.
4+
5+
## Prerequisites
6+
7+
Before you begin, make sure you have DDEV installed. If you don't have it yet, follow the installation instructions in the official [DDEV documentation](https://ddev.readthedocs.io/en/stable/).
8+
9+
## Setup steps
10+
11+
### 1. Start the environment
12+
13+
Once DDEV is installed, navigate to your project directory and run:
14+
15+
```
16+
ddev start
17+
```
18+
19+
This command will start the DDEV environment for local development. By default, your local environment will be accessible at [https://matomo.ddev.site](https://matomo.ddev.site).
20+
21+
You can also open this URL directly in your browser by running:
22+
23+
```
24+
ddev launch
25+
```
26+
27+
This will automatically open the default browser and take you to the Matomo setup page.
28+
29+
### 2. Set up Matomo using the UI installer
30+
31+
Follow the on-screen instructions in the UI installer to complete the Matomo setup. This will configure the necessary database and settings for your local instance.
32+
33+
### 3. Set up the development environment
34+
35+
After Matomo is set up, you can initialize the development environment by running:
36+
37+
```
38+
ddev matomo:init:dev
39+
```
40+
41+
This command will set up the environment for development, installing the additional dependencies required.
42+
43+
### 4. Set up the testing environment
44+
45+
After Matomo is set up, you can initialize the testing environment by running:
46+
47+
```
48+
ddev matomo:init:tests
49+
```
50+
51+
This command will set up the environment for running tests, ensuring everything is in place for the UI and other automated tests.
52+
53+
## Usage
54+
55+
The command `ddev matomo:console` provides access to all Matomo console commands. Some useful commands include:
56+
57+
- `core:archive` – Run local archiving
58+
- `generate:plugin` - Generate a new plugin/theme including all needed files
59+
- `tests:run` – Run unit, integration, and system tests
60+
- `tests:run-ui` – Run UI tests
61+
- `tests:run-js` – Run tracker JavaScript tests
62+
- `vue:build` - Builds vue modules for one or more plugins
63+
64+
For more information about Matomo development, check out the official [Matomo Developer Documentation](https://developer.matomo.org/).
65+
66+
## Known issues
67+
68+
Currently, the screenshots generated by UI tests do not match those generated in the CI environment. However, this does not affect the functionality of the tests themselves. The screenshots should still be good enough to verify that your changes or plugin are working correctly.

.ddev/apache/apache-site.conf

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# This file is customised for Matomo, the differences are related to XHProf.
2+
#
3+
# See https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#custom-apache-configuration
4+
<VirtualHost *:80>
5+
RewriteEngine On
6+
RewriteCond %{HTTP:X-Forwarded-Proto} =https
7+
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d
8+
RewriteRule ^(.+[^/])$ https://%{HTTP_HOST}$1/ [redirect,last]
9+
10+
SetEnvIf X-Forwarded-Proto "https" HTTPS=on
11+
12+
ServerAdmin webmaster@localhost
13+
DocumentRoot /var/www/html
14+
<Directory "/var/www/html/">
15+
AllowOverride All
16+
Allow from All
17+
</Directory>
18+
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
19+
# error, crit, alert, emerg.
20+
# It is also possible to configure the loglevel for particular
21+
# modules, e.g.
22+
#LogLevel info ssl:warn
23+
24+
ErrorLog /dev/stdout
25+
CustomLog ${APACHE_LOG_DIR}/access.log combined
26+
27+
# For most configuration files from conf-available/, which are
28+
# enabled or disabled at a global level, it is possible to
29+
# include a line for only one particular virtual host. For example the
30+
# following line enables the CGI configuration for this host only
31+
# after it has been globally disabled with "a2disconf".
32+
#Include conf-available/serve-cgi-bin.conf
33+
34+
# Increase allowed field size for large cookies header.
35+
LimitRequestFieldSize 16380
36+
37+
# Simple ddev technique to get a phpstatus
38+
Alias "/phpstatus" "/var/www/phpstatus.php"
39+
Alias "/xhprof" "/var/xhprof/xhprof_html"
40+
Alias "/vendor/lox/xhprof/xhprof_html" "/var/xhprof/xhprof_html"
41+
<Directory "/var/xhprof">
42+
Options Indexes
43+
AllowOverride None
44+
Require all granted
45+
</Directory>
46+
47+
</VirtualHost>
48+
49+
<VirtualHost *:443>
50+
SSLEngine on
51+
SSLCertificateFile /etc/ssl/certs/master.crt
52+
SSLCertificateKeyFile /etc/ssl/certs/master.key
53+
54+
# Workaround from https://mail-archives.apache.org/mod_mbox/httpd-users/201403.mbox/%3C49404A24C7FAD94BB7B45E86A9305F6214D04652@MSGEXSV21103.ent.wfb.bank.corp%3E
55+
# See also https://gist.github.com/nurtext/b6ac07ac7d8c372bc8eb
56+
57+
RewriteEngine On
58+
RewriteCond %{HTTP:X-Forwarded-Proto} =https
59+
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} -d
60+
RewriteRule ^(.+[^/])$ https://%{HTTP_HOST}$1/ [redirect,last]
61+
62+
SetEnvIf X-Forwarded-Proto "https" HTTPS=on
63+
64+
ServerAdmin webmaster@localhost
65+
DocumentRoot /var/www/html
66+
<Directory "/var/www/html/">
67+
AllowOverride All
68+
Allow from All
69+
</Directory>
70+
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
71+
# error, crit, alert, emerg.
72+
# It is also possible to configure the loglevel for particular
73+
# modules, e.g.
74+
#LogLevel info ssl:warn
75+
76+
ErrorLog /dev/stdout
77+
CustomLog ${APACHE_LOG_DIR}/access.log combined
78+
79+
# Increase allowed field size for large cookies header.
80+
LimitRequestFieldSize 16380
81+
82+
# For most configuration files from conf-available/, which are
83+
# enabled or disabled at a global level, it is possible to
84+
# include a line for only one particular virtual host. For example the
85+
# following line enables the CGI configuration for this host only
86+
# after it has been globally disabled with "a2disconf".
87+
#Include conf-available/serve-cgi-bin.conf
88+
# Simple ddev technique to get a phpstatus
89+
Alias "/phpstatus" "/var/www/phpstatus.php"
90+
Alias "/xhprof" "/var/xhprof/xhprof_html"
91+
Alias "/vendor/lox/xhprof/xhprof_html" "/var/xhprof/xhprof_html"
92+
<Directory "/var/xhprof">
93+
Options Indexes
94+
AllowOverride None
95+
Require all granted
96+
</Directory>
97+
98+
</VirtualHost>
99+
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

.ddev/commands/host/matomo_init

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
## Description: Initialize Matomo basic environment
4+
## Usage: matomo:init
5+
## Example: ddev matomo:init
6+
7+
echo "[git] Update git submodules ..."
8+
git submodule update --init
9+
10+
echo "Run composer install ..."
11+
ddev composer install
12+
13+
echo "Done: Basic Matomo instance initialisation finished."
14+
echo ""
15+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env bash
2+
3+
## Description: Initialize Matomo environment for development
4+
## Usage: matomo:init:dev
5+
## Example: ddev matomo:init:dev
6+
7+
echo "Run npm install ..."
8+
ddev npm install
9+
10+
echo "Enable development mode and disable assets merging ..."
11+
ddev matomo:console development:enable
12+
ddev matomo:console config:set Development.disable_merged_assets=1
13+
14+
echo "Done: Matomo dev setup initialisation finished."
15+
echo ""
16+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
3+
## Description: Initialize Matomo environment for testing
4+
## Usage: matomo:init:tests
5+
## Example: ddev matomo:init:tests
6+
7+
echo "Configure test environment ..."
8+
ddev matomo:console config:set \
9+
'database_tests.host="db"' \
10+
'database_tests.username="db"' \
11+
'database_tests.password="db"' \
12+
'tests.http_host="matomo.ddev.site"' \
13+
'tests.request_uri="/"' \
14+
'tests.port=80'
15+
16+
echo "Copy UI tests config file ..."
17+
echo "@see https://developer.matomo.org/guides/tests-ui#configuring-ui-tests"
18+
ddev exec '\cp .ddev/initial-config/config.js tests/UI/config.js'
19+
20+
echo "Initialise test database: setup OmniFixture ..."
21+
ddev matomo:console tests:setup-fixture OmniFixture
22+
23+
echo "Install the JavaScript dependencies for the UI tests ..."
24+
ddev exec 'cd tests/lib/screenshot-testing && npm install'
25+
26+
echo "TODO: Locally install the git-lfs extension to be able to download and commit UI screenshots."
27+
echo "@see https://github.com/git-lfs/git-lfs#installing"
28+
echo "@see https://git-lfs.com/"
29+
read -n 1 -s -r -p "Press any key when ready to continue ..."
30+
echo ""
31+
32+
echo "[git] Pull screenshots for UI tests ..."
33+
git lfs pull --exclude=
34+
35+
echo "Done: Matomo tests setup initialisation finished."
36+
echo ""
37+

.ddev/commands/web/matomo_console

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
## Description: Run Matomo console
4+
## Usage: matomo:console <parameters>
5+
## Example: "ddev matomo:console development:enable" or "ddev matomo:console config:set Development.disable_merged_assets=1"
6+
## ExecRaw: true
7+
## HostWorkingDir: true
8+
9+
/var/www/html/console "$@"

0 commit comments

Comments
 (0)