Matomo website analytics
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Max Mehl e904462ac7
use static major version of mariadb
1 week ago
LICENSES make REUSE compliant 10 months ago
.drone.yml make REUSE compliant 10 months ago
.gitignore make REUSE compliant 10 months ago
Dockerfile-mariadb use static major version of mariadb 1 week ago
Dockerfile-matomo set logfile permissions to avoid cron errors 10 months ago
README.md display build status [skip-ci] 10 months ago
clean-matomo-tables.sh make REUSE compliant 10 months ago
cron.txt change run times 6 months ago
cron.txt.license make REUSE compliant 10 months ago
docker-compose.yml make REUSE compliant 10 months ago
get_logs.sh handle gzipped logfiles (e.g. in case of logrotate conf change) 1 month ago
host_options.ini make REUSE compliant 10 months ago
id_rsa.pub change SSH key 11 months ago
id_rsa.pub.license make REUSE compliant 10 months ago
rp_hosts.csv make REUSE compliant 10 months ago

README.md

REUSE status Build Status

FSFE Matomo/Piwik

This service serves as the single point inside the FSFE to gather web statistics for different domains and evaluate them.

Because we do not like JavaScript that much, we import the webserver logs directly into Matomo.

We use the standard Docker image for Matomo but with a few modifications, mostly concerning the automated log import.

Log import

Modes

The normal mode in get_logs.sh connects via SSH to download the most recently rotated Apache log.

The docker mode instead reads the logs of the reverse proxy which is in front of all our Docker containers that run publicly facing web services. For all containers defined in rp_hosts.csv, it scrapes the logs and imports them.

You can run get_logs.sh -h to read more about the script’s usage.

Host options

Because logs for some sites need special treatment before to be more useful or require certain import options, there is the file host_options.ini in which you can define per page a) one shell command to run over the log, and b) options for Matomo’s import_logs.py.

Scheduling

The cron.txt file is appended to /etc/crontab in the matomo container and controls when imports are scheduled for which pages.

Clean Matomo site

In the matomo-mariadb container, you can run clean-matomo-tables.sh to clean the stats for one or all sites. This is useful if the recording went mad during your tests. But remember that this is a complete reset!

Environment variables

Docker-compose wants to have the following environment variables:

  • SSH_KEY: the SSH key used to connect to the individual hosts via SSH
  • MYSQL_DATABASE: the name of the database
  • MYSQL_ROOT_PASSWORD: root password for the DB
  • MYSQL_USER: user for Matomo
  • MYSQL_PASSWORD: password for the Matomo user

The other variables are rather standard for the FSFE’s usual setup.

License

All custom scripts and files in this repo are licensed under GPL-3.0-or-later.