---
# General 
application_id:                       "web-app-matrix"
database_type:                        "postgres"

# Webserver
location_upload:                      "~ ^/_matrix/media/v3/"
client_max_body_size:                 "{{ applications | get_app_conf(application_id, 'server.client_max_body_size') }}"

# Matrix

## General
MATRIX_SERVER_NAME:                   "{{ applications | get_app_conf(application_id, 'server_name') }}"
MATRIX_ADMINISTRATOR_USERNAME:        "{{ applications | get_app_conf(application_id, 'users.administrator.username') }}"
MATRIX_WELL_KNOWN_DIRECTORY:          "{{ NGINX.DIRECTORIES.DATA.WELL_KNOWN }}/matrix/"
MATRIX_WELL_KNOWN_FILE:               "{{ MATRIX_WELL_KNOWN_DIRECTORY }}server"
MATRIX_PROJECT:                       "{{ application_id | get_entity_name }}"
MATRIX_REGISTRATION_FILE_FOLDER:      "/data/"
MATRIX_REGISTRATION_SHARED_SECRET:    "{{ applications | get_app_conf(application_id, 'credentials.registration_shared_secret') }}"
FEDERATION_PORT:                      "{{ ports.public.federation['web-app-matrix_synapse'] }}"

## Synapse
MATRIX_SYNAPSE_VERSION:               "{{ applications | get_app_conf(application_id, 'docker.services.synapse.version') }}"
MATRIX_SYNAPSE_IMAGE:                 "{{ applications | get_app_conf(application_id, 'docker.services.synapse.image') }}"
MATRIX_SYNAPSE_NAME:                  "{{ applications | get_app_conf(application_id, 'docker.services.synapse.name') }}"
MATRIX_SYNAPSE_VOLUME:                "{{ applications | get_app_conf(application_id, 'docker.volumes.synapse') }}"
MATRIX_SYNAPSE_DOMAIN:                "{{ domains[application_id].synapse }}"
MATRIX_SYNAPSE_PORT:                  "{{ ports.localhost.http['web-app-matrix_synapse'] }}"
MATRIX_SYNAPSE_CONFIG_PATH_HOST:      "{{ docker_compose.directories.config }}homeserver.yaml"   
MATRIX_SYNAPSE_CONFIG_PATH_CONTAINER: "/data/homeserver.yaml"
MATRIX_SYNAPSE_LOG_PATH_HOST:         "{{ docker_compose.directories.config }}{{ MATRIX_SYNAPSE_DOMAIN }}.log.config"    
MATRIX_SYNAPSE_LOG_PATH_CONTAINER:    "/data/{{ MATRIX_SYNAPSE_DOMAIN }}.log.config"
MATRIX_SYNAPSE_URL:                   "{{ WEB_PROTOCOL }}://{{ MATRIX_SYNAPSE_DOMAIN }}"

## Element
MATRIX_ELEMENT_VERSION:               "{{ applications | get_app_conf(application_id, 'docker.services.element.version') }}"
MATRIX_ELEMENT_IMAGE:                 "{{ applications | get_app_conf(application_id, 'docker.services.element.image') }}"
MATRIX_ELEMENT_NAME:                  "{{ applications | get_app_conf(application_id, 'docker.services.element.name') }}"
MATRIX_ELEMENT_DOMAIN:                "{{ domains[application_id].element }}"
MATRIX_ELEMENT_PORT:                  "{{ ports.localhost.http['web-app-matrix_element'] }}"
MATRIX_ELEMENT_CONFIG_PATH_HOST:      "{{ docker_compose.directories.config }}element-config.json"