Skip to content

Commit 8c2d2df

Browse files
authored
Merge pull request #22 from MITLibraries/INFRA-517
INFRA-517 Part 1: Update Matomo Version
2 parents f0ee3fd + 24f9913 commit 8c2d2df

File tree

3 files changed

+65
-2
lines changed

3 files changed

+65
-2
lines changed

Dockerfile

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
FROM matomo:5.2.2
1+
FROM matomo:5.3.1
2+
# checkov:skip=CKV_DOCKER_2:Skipping HEALTHCHECK configuration for now
3+
# checkov:skip=CKV_DOCKER_3:Intentionally using root for the user
24

35
# Add the EnvironmentVariables plugin
46
COPY ./files/plugin-EnvironmentVariables-5.0.3/ /var/www/html/plugins/EnvironmentVariables
@@ -14,7 +16,6 @@ COPY --chmod=0644 --chown=root:root ./files/lang-htaccess /var/www/html/lang/.ht
1416
COPY --chmod=0644 --chown=root:root ./files/config-htaccess /var/www/html/config/.htaccess
1517
COPY --chmod=0644 --chown=root:root ./files/tmp-htaccess /var/www/html/tmp/.htaccess
1618

17-
1819
# Create mount point for EFS partition
1920
RUN mkdir -p /mnt/efs
2021

docs/HowTos/HOWTO-premium-plugins.md

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Premium Plugins
2+
3+
Premium plugins are those that require a license key. In our docker-ized implementation of Matomo, this gets tricky.
4+
5+
After some initial testing in Dev1, it's not as simple as just dumping the new plugin into the container and redeploying because of the following reasons.
6+
7+
1. The license key is stored in the database, **NOT** in the `config.ini.php` file.
8+
1. Some plugins require changes to the database tables or just new tables. This requires that the plugin installation process is triggered to kick off the script that updates the tables.
9+
1. The *Marketplace* plugin must be active for license keys to work.
10+
11+
## The config.ini.php file
12+
13+
The `config.ini.php` file has two lists of plugins under two different headings.
14+
15+
* One heading, `[PluginsInstalled]` is the list of plugins that are installed (but might be active or inactive) on the server. This should be a 1-1 match for the folders in the `/var/www/html/plugins` folder in the container.
16+
* The other heading, `[Plugins]` is the list of **active** plugins.
17+
* Each plugin might have its own section in the `config.ini.php` file with plugin-specific settings.
18+
19+
In the end, the premium plugin installation is a two-pass process.
20+
21+
## Process
22+
23+
### High level overview
24+
25+
1. Install license key (via UI or CLI) so that it is in the database.
26+
2. Go through a dev -> stage -> prod deployment cycle of the container to install the plugin folder(s) into the container and update the `config.ini.php` file with new line(s) in the `[PluginsInstalled]` section.
27+
3. Activate the new plugin(s) (via UI or CLI) so that any database changes are properly executed.
28+
4. Go through a dev -> stage -> prod deployment cycle of the container to match the updated `config.ini.php` file on the server.
29+
30+
### Details for each step
31+
32+
#### 1. Install the license key
33+
34+
Before installing the license key, the *Marketplace* plugin must be activated. This is a one-time update to the `config.ini.php` file to add the *Marketplace* pluging to the `[Plugins]` section.
35+
36+
According to the support team at Matomo, the premium license key can be installed in two instances of Matomo, "stage" and "prod." So, we can do some initial validation of a license key in Dev1, but the key cannot remain installed in the Dev1 instance. The license key installation can either be done by a user with "superuser" privileges in the Matomo web UI or it can be done by a member of InfraEng who has ssh access to the running container task/service. The CLI command is
37+
38+
```bash
39+
./console marketplace:set-license-key --license-key=LICENSE-KEY "<key>"
40+
```
41+
42+
This needs to be done on each of the stage & prod instances of Matomo.
43+
44+
#### 2. Install plugin
45+
46+
In this phase, the files are installed in the container and the `config.ini.php` is updated to match the installation. This will **not** activate the plugins, it will just make them visible in the UI. The only new lines in the `config.ini.php` should be in the `[PluginsInstalled]` section.
47+
48+
#### 3. Activate plugin
49+
50+
Once the plugin is installed, it's time to activate it. In the UI, it's just a matter of clicking the `Activate` link for the plugin. For the CLI, the command is
51+
52+
```bash
53+
./console plugin:activate [<plugin>...]
54+
```
55+
56+
This will change the `config.ini.php` file on the container. It is **very** important to capture these changes and put them back in the `config.ini.php` in the container (see step 4).
57+
58+
#### 4. Deploy new config.ini.php
59+
60+
After capturing the changes to `config.ini.php`, go through another round of dev -> stage -> prod deploys.

files/config.ini.php

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
; maximum number of rows for sub-tables of the Events tables (eg. for the subtables Categories>Actions or Categories>Names).
3333
datatable_archiving_maximum_rows_subtable_events = 100
3434

35+
3536
[mail]
3637

3738
[Plugins]
@@ -87,6 +88,7 @@
8788
Plugins[] = "Resolution"
8889
Plugins[] = "DevicePlugins"
8990
Plugins[] = "Heartbeat"
91+
Plugins[] = "Marketplace"
9092
Plugins[] = "Intl"
9193
Plugins[] = "Tour"
9294
Plugins[] = "PagePerformance"

0 commit comments

Comments
 (0)