From 2e74187050b87d2835e385bf3af245d9767efd2b Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Tue, 14 Feb 2023 11:02:18 +0200 Subject: [PATCH] Add matrix_client_element_hostname and matrix_client_element_path_prefix variables --- .../matrix-client-element/defaults/main.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/roles/custom/matrix-client-element/defaults/main.yml b/roles/custom/matrix-client-element/defaults/main.yml index 041fb033..bacaa786 100644 --- a/roles/custom/matrix-client-element/defaults/main.yml +++ b/roles/custom/matrix-client-element/defaults/main.yml @@ -37,9 +37,9 @@ matrix_client_element_container_http_host_bind_port: '' # To inject your own other container labels, see `matrix_client_element_container_labels_additional_labels`. matrix_client_element_container_labels_traefik_enabled: true matrix_client_element_container_labels_traefik_docker_network: "{{ matrix_client_element_container_network }}" -matrix_client_element_container_labels_traefik_hostname: "{{ matrix_server_fqn_element }}" +matrix_client_element_container_labels_traefik_hostname: "{{ matrix_client_element_hostname }}" # The path prefix must either be `/` or not end with a slash (e.g. `/element`). -matrix_client_element_container_labels_traefik_path_prefix: / +matrix_client_element_container_labels_traefik_path_prefix: "{{ matrix_client_element_path_prefix }}" matrix_client_element_container_labels_traefik_rule: "Host(`{{ matrix_client_element_container_labels_traefik_hostname }}`){% if matrix_client_element_container_labels_traefik_path_prefix != '/' %} && PathPrefix(`{{ matrix_client_element_container_labels_traefik_path_prefix }}`){% endif %}" matrix_client_element_container_labels_traefik_priority: 0 matrix_client_element_container_labels_traefik_entrypoints: web-secure @@ -127,6 +127,18 @@ matrix_client_element_floc_optout_enabled: true # See: `matrix_client_element_http_header_strict_transport_security` matrix_client_element_hsts_preload_enabled: false +# The hostname at which Element is served. +# Only works with with Traefik reverse-proxying. +# For matrix-nginx-proxy, `matrix_server_fqn_element` is used and this variable has no effect. +matrix_client_element_hostname: "{{ matrix_server_fqn_element }}" + +# The path at which Element is exposed. +# When matrix-nginx-proxy is used, setting this to values other than `/` will cause configuration mismatches and trouble. +# +# If Traefik is used, the hostname is also configurable - see `matrix_client_element_container_labels_traefik_hostname`. +# This value must either be `/` or not end with a slash (e.g. `/element`). +matrix_client_element_path_prefix: / + # Element config.json customizations matrix_client_element_default_server_name: "{{ matrix_domain }}" matrix_client_element_default_hs_url: ""