From 9ae8ccac36adcd4929dd32bdc3472cb0c5191c5f Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 11 Jan 2024 09:17:13 +0200 Subject: [PATCH] Add matrix_conduit_hostname --- group_vars/matrix_servers | 3 ++- roles/custom/matrix-conduit/defaults/main.yml | 9 +++++---- roles/custom/matrix-conduit/tasks/validate_config.yml | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index 932bf6a77..d45c9de0f 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -4887,6 +4887,8 @@ matrix_dendrite_app_service_config_files_auto: "{{ matrix_homeserver_app_service matrix_conduit_enabled: "{{ matrix_homeserver_implementation == 'conduit' }}" +matrix_conduit_hostname: "{{ matrix_server_fqn_matrix }}" + matrix_conduit_container_network: "{{ matrix_homeserver_container_network }}" matrix_conduit_container_additional_networks_auto: | @@ -4900,7 +4902,6 @@ matrix_conduit_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_pro matrix_conduit_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}" matrix_conduit_container_labels_traefik_entrypoints: "{{ devture_traefik_entrypoint_primary }}" matrix_conduit_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_primary }}" -matrix_conduit_container_labels_traefik_hostname: "{{ matrix_server_fqn_matrix }}" matrix_conduit_container_labels_client_root_redirection_enabled: "{{ matrix_conduit_container_labels_client_root_redirection_url != '' }}" matrix_conduit_container_labels_client_root_redirection_url: "{{ (('https://' if matrix_playbook_ssl_enabled else 'http://') + matrix_server_fqn_element) if matrix_client_element_enabled else '' }}" diff --git a/roles/custom/matrix-conduit/defaults/main.yml b/roles/custom/matrix-conduit/defaults/main.yml index 104965bfa..8ac432bca 100644 --- a/roles/custom/matrix-conduit/defaults/main.yml +++ b/roles/custom/matrix-conduit/defaults/main.yml @@ -5,6 +5,8 @@ matrix_conduit_enabled: true +matrix_conduit_hostname: '' + matrix_conduit_docker_image: "{{ matrix_conduit_docker_image_name_prefix }}matrixconduit/matrix-conduit:{{ matrix_conduit_docker_image_tag }}" matrix_conduit_docker_image_name_prefix: "docker.io/" # renovate: datasource=docker depName=matrixconduit/matrix-conduit @@ -46,11 +48,10 @@ matrix_conduit_container_labels_traefik_enabled: true matrix_conduit_container_labels_traefik_docker_network: "{{ matrix_conduit_container_network }}" matrix_conduit_container_labels_traefik_entrypoints: web-secure matrix_conduit_container_labels_traefik_tls_certResolver: default # noqa var-naming -matrix_conduit_container_labels_traefik_hostname: '' # Controls whether labels will be added for handling the root (/) path matrix_conduit_container_labels_client_root_enabled: true -matrix_conduit_container_labels_client_root_traefik_hostname: "{{ matrix_conduit_container_labels_traefik_hostname }}" +matrix_conduit_container_labels_client_root_traefik_hostname: "{{ matrix_conduit_hostname }}" matrix_conduit_container_labels_client_root_traefik_rule: "Host(`{{ matrix_conduit_container_labels_client_root_traefik_hostname }}`) && Path(`/`)" matrix_conduit_container_labels_client_root_traefik_priority: 0 matrix_conduit_container_labels_client_root_traefik_entrypoints: "{{ matrix_conduit_container_labels_traefik_entrypoints }}" @@ -61,7 +62,7 @@ matrix_conduit_container_labels_client_root_redirection_url: "" # Controls whether labels will be added that expose the Client-Server API. matrix_conduit_container_labels_client_api_enabled: true -matrix_conduit_container_labels_client_api_traefik_hostname: "{{ matrix_conduit_container_labels_traefik_hostname }}" +matrix_conduit_container_labels_client_api_traefik_hostname: "{{ matrix_conduit_hostname }}" matrix_conduit_container_labels_client_api_traefik_path_prefix: /_matrix matrix_conduit_container_labels_client_api_traefik_rule: "Host(`{{ matrix_conduit_container_labels_client_api_traefik_hostname }}`) && PathPrefix(`{{ matrix_conduit_container_labels_client_api_traefik_path_prefix }}`)" matrix_conduit_container_labels_client_api_traefik_priority: 0 @@ -71,7 +72,7 @@ matrix_conduit_container_labels_client_api_traefik_tls_certResolver: "{{ matrix_ # Controls whether labels will be added that expose the Server-Server API (Federation API). matrix_conduit_container_labels_federation_api_enabled: "{{ matrix_conduit_allow_federation }}" -matrix_conduit_container_labels_federation_api_traefik_hostname: "{{ matrix_conduit_container_labels_traefik_hostname }}" +matrix_conduit_container_labels_federation_api_traefik_hostname: "{{ matrix_conduit_hostname }}" matrix_conduit_container_labels_federation_api_traefik_path_prefix: /_matrix matrix_conduit_container_labels_federation_api_traefik_rule: "Host(`{{ matrix_conduit_container_labels_federation_api_traefik_hostname }}`) && PathPrefix(`{{ matrix_conduit_container_labels_federation_api_traefik_path_prefix }}`)" matrix_conduit_container_labels_federation_api_traefik_priority: 0 diff --git a/roles/custom/matrix-conduit/tasks/validate_config.yml b/roles/custom/matrix-conduit/tasks/validate_config.yml index 980fb6d6e..cc2973647 100644 --- a/roles/custom/matrix-conduit/tasks/validate_config.yml +++ b/roles/custom/matrix-conduit/tasks/validate_config.yml @@ -6,4 +6,5 @@ You need to define a required configuration setting (`{{ item.name }}`). when: "item.when | bool and vars[item.name] == ''" with_items: + - {'name': 'matrix_conduit_hostname', when: true} - {'name': 'matrix_conduit_container_network', when: true}