Browse Source

new: [matomo] new charm

boris/matomo
Boris Gallet 1 year ago
parent
commit
3e0f6df89b
  1. 9
      matomo/README.org
  2. 21
      matomo/hooks/mysql_database-relation-joined
  3. 13
      matomo/hooks/web_proxy-relation-joined
  4. 30
      matomo/metadata.yml

9
matomo/README.org

@ -0,0 +1,9 @@
# -*- ispell-local-dictionary: "english" -*-
* Info
From: https://github.com/matomo-org/docker
* Usage
Config info : https://hub.docker.com/_/matomo

21
matomo/hooks/mysql_database-relation-joined

@ -0,0 +1,21 @@
#!/bin/bash
set -e
PASSWORD="$(relation-get password)"
USER="$(relation-get user)"
DBNAME="$(relation-get dbname)"
config-add "\
services:
$MASTER_BASE_SERVICE_NAME:
environment:
MYSQL_USER: \"$USER\"
MYSQL_PASSWORD: \"$PASSWORD\"
MYSQL_DATABASE: \"$DBNAME\"
MATOMO_DATABASE_HOST: \"$TARGET_SERVICE_NAME\"
"
info "Configured $SERVICE_NAME code for $TARGET_SERVICE_NAME access."

13
matomo/hooks/web_proxy-relation-joined

@ -0,0 +1,13 @@
#!/bin/bash
set -e
DOMAIN=$(relation-get domain) || exit 1
# config-add "\
# services:
# $MASTER_BASE_SERVICE_NAME:
# environment:
# "

30
matomo/metadata.yml

@ -0,0 +1,30 @@
docker-image: docker.0k.io/matomo:4.15.1-apache
data-resources:
- /var/www/html/
uses:
mysql-database:
#constraint: required | recommended | optional
#auto: pair | summon | none ## default: pair
constraint: required
auto: summon
solves:
database: "main storage"
web-proxy:
constraint: required
auto: summon
solves:
proxy: "Public access"
default-options:
target: !var-expand ${MASTER_BASE_SERVICE_NAME}:80
log-rotate:
constraint: recommended
auto: pair
solves:
disk-leak: "/matomo/logs"
backup:
constraint: recommended
auto: pair
solves:
backup: "Automatic regular backup"
default-options:
Loading…
Cancel
Save