# parameters required by the configuration instance
[instance-parameter]
matomo = ${:document-root}
dir-backup = ${directory:backup}

#php.ini parameters
php.memory_limit = 512M
php.date.timezone = Europe/Paris
php.upload_max_filesize = 10240M
php.post_max_size = 10240M
php.session.cookie_secure = True
php.max_execution_time = 1800
php.max_input_time = 3600
php.output_buffering = 'Off'
php.max_file_uploads = 100

[php-bin]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:bin}/php
command-line = ${instance-parameter:php-bin} -c ${php.ini-conf:rendered} 

[matomo-backup-cron]
recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries}
name = matomo-backup
frequency = 0 0 * * *
command = ${matomo-backup.sh:rendered}

[matomo-apache-httpd]
recipe = slapos.recipe.template:jinja2
template = {{ matomo_apache_httpd }}
rendered = ${directory:apache.d}/matomo.conf
context =
  section parameter_dict apache-php-configuration

[matomo-backup.sh]
recipe = slapos.recipe.template:jinja2
template = {{ matomo_backup_sh }}
rendered = ${directory:scripts}/matomo-backup
context =
  section parameter_dict instance-parameter
  key php_bin php-bin:wrapper-path
depends =
  ${matomo-apache-httpd:recipe}
  ${matomo-backup-cron:recipe}

[slap-parameter]
instance.cli-url = ${apache-php-configuration:url}



