[buildout]
extends =
  buildout.hash.cfg
  ../../stack/lamp/buildout.cfg
  ../../stack/slapos.cfg
  ../../component/diffutils/buildout.cfg

parts =
  slapos-cookbook
  lamp-instance

[matomo-download]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:filename}

# download matomo
# The specific process of downloading and decompressing is defined in stack lamp
[application]
url = https://builds.matomo.org/matomo-4.15.1.zip
md5sum = d7d2c4f94cb77af859d0cee8e9e0dbdb
archive-root = matomo

[custom-application-deployment]
path = ${template-matomo-instance:output}
part-list = matomo-backup.sh matomo-backup-cron
db-name = matomo
db-user = matomo

[template-matomo-instance]
recipe = slapos.recipe.template:jinja2
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/instance-matomo.cfg
extensions = jinja2.ext.do
context =
          key findutils_location findutils:location
          key diffutils_location diffutils:location
          key php_location apache-php:location
          key matomo_backup_sh template-matomo-backup.sh:target

# download matomo-backup.sh.in
[template-matomo-backup.sh]
<= matomo-download

[partition-info]
recipe = slapos.cookbook:request.serialised
configuration.mariadb-computer-guid = ${slap-connection:computer-id}
configuration.apache-computer-guid = ${slap-connection:computer-id}
