Move Dimension to the addons network and connect to Homeserver via matrix_addons_homeserver_client_api_url

This commit is contained in:
Slavi Pantaleev 2024-01-13 17:56:53 +02:00
parent 49066d41a9
commit c79f354dce
2 changed files with 22 additions and 14 deletions

View File

@ -2815,19 +2815,22 @@ matrix_dimension_enabled: false
matrix_dimension_container_image_self_build: "{{ matrix_architecture != 'amd64' }}"
matrix_dimension_scheme: "{{ 'https' if matrix_playbook_ssl_enabled else 'http' }}"
matrix_dimension_hostname: "{{ matrix_server_fqn_dimension }}"
matrix_dimension_container_network: "{{ matrix_nginx_proxy_container_network if matrix_playbook_reverse_proxy_type == 'playbook-managed-nginx' else 'matrix-dimension' }}"
matrix_dimension_container_network: "{{ matrix_addons_container_network }}"
# Dimension is connected both to `matrix_addons_homeserver_container_network` and `matrix_homeserver_container_network`,
# because these may be different networks on which `matrix_addons_homeserver_client_api_url` and `matrix_homeserver_container_federation_url` live.
matrix_dimension_container_additional_networks: |
{{
(
([matrix_playbook_reverse_proxyable_services_additional_network] if matrix_playbook_reverse_proxyable_services_additional_network else [])
([] if matrix_addons_homeserver_container_network == '' else [matrix_addons_homeserver_container_network])
+
([matrix_homeserver_container_network] if matrix_homeserver_container_network != matrix_dimension_container_network else [])
+
([devture_postgres_container_network] if devture_postgres_enabled and devture_postgres_container_network != matrix_dimension_container_network else [])
([devture_postgres_container_network] if (devture_postgres_enabled and matrix_dimension_database_hostname == devture_postgres_connection_hostname and devture_postgres_container_network != matrix_dimension_container_network) else [])
+
([matrix_playbook_reverse_proxyable_services_additional_network] if matrix_playbook_reverse_proxyable_services_additional_network else [])
) | unique
}}
@ -2838,19 +2841,21 @@ matrix_dimension_container_labels_traefik_docker_network: "{{ matrix_playbook_re
matrix_dimension_container_labels_traefik_entrypoints: "{{ devture_traefik_entrypoint_primary }}"
matrix_dimension_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_primary }}"
matrix_dimension_homeserver_clientServerUrl: "{{ matrix_homeserver_container_url }}"
matrix_dimension_homeserver_clientServerUrl: "{{ matrix_addons_homeserver_client_api_url }}"
matrix_dimension_homeserver_federationUrl: "{{ matrix_homeserver_container_federation_url }}"
matrix_dimension_homeserver_mediaUrl: "https://{{ matrix_server_fqn_matrix }}"
matrix_dimension_systemd_required_services_list: |
# Dimension depends both on `matrix_addons_homeserver_systemd_services_list` and on the homeserver service,
# because these are potentially different, depending on whether matrix-homeserver-proxy is enabled, etc.
matrix_dimension_systemd_required_services_list_auto: |
{{
['docker.service']
+
['matrix-' + matrix_homeserver_implementation + '.service']
+
([devture_postgres_identifier ~ '.service'] if devture_postgres_enabled else [])
+
(['matrix-nginx-proxy.service'] if matrix_nginx_proxy_enabled else [])
(
matrix_addons_homeserver_systemd_services_list
+
['matrix-' + matrix_homeserver_implementation + '.service']
+
([devture_postgres_identifier ~ '.service'] if (devture_postgres_enabled and matrix_dimension_database_hostname == devture_postgres_connection_hostname) else [])
) | unique
}}
# Postgres is the default, except if not using internal Postgres server

View File

@ -36,7 +36,10 @@ matrix_dimension_docker_image_name_prefix: "{{ 'localhost/' if matrix_dimension_
matrix_dimension_docker_image_force_pull: "{{ matrix_dimension_docker_image.endswith(':latest') }}"
# List of systemd services that matrix-dimension.service depends on.
matrix_dimension_systemd_required_services_list: ['docker.service']
matrix_dimension_systemd_required_services_list: "{{ matrix_dimension_systemd_required_services_list_default + matrix_dimension_systemd_required_services_list_auto + matrix_dimension_systemd_required_services_list_custom }}"
matrix_dimension_systemd_required_services_list_default: ['docker.service']
matrix_dimension_systemd_required_services_list_auto: []
matrix_dimension_systemd_required_services_list_custom: []
# List of systemd services that matrix-dimension.service wants
matrix_dimension_systemd_wanted_services_list: []