Move all Matrix client apps into the matrix-addons container network

Putting each client into its own network was good for isolation,
but it's quite wasteful in terms of the container network pool.
This commit is contained in:
Slavi Pantaleev 2024-01-05 07:17:11 +02:00
parent 2ec6448cdb
commit b37a02720f
9 changed files with 20 additions and 28 deletions

View File

@ -3607,14 +3607,11 @@ matrix_client_element_enabled: true
matrix_client_element_container_image_self_build: "{{ matrix_architecture not in ['arm64', 'amd64'] }}"
# Normally, matrix-nginx-proxy is enabled and nginx can reach Element over the container network.
# If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
# the Element HTTP port to the local host.
matrix_client_element_container_http_host_bind_port: "{{ (matrix_playbook_service_host_bind_interface_prefix ~ '8765') if matrix_playbook_service_host_bind_interface_prefix else '' }}"
matrix_client_element_container_network: "{{ matrix_nginx_proxy_container_network if matrix_playbook_reverse_proxy_type == 'playbook-managed-nginx' else 'matrix-client-element' }}"
matrix_client_element_container_network: "{{ matrix_addons_container_network }}"
matrix_client_element_container_additional_networks: "{{ [matrix_playbook_reverse_proxyable_services_additional_network] if matrix_playbook_reverse_proxyable_services_additional_network else [] }}"
matrix_client_element_container_additional_networks: "{{ [matrix_playbook_reverse_proxyable_services_additional_network] if (matrix_client_element_container_labels_traefik_enabled and matrix_playbook_reverse_proxyable_services_additional_network) else [] }}"
matrix_client_element_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}"
matrix_client_element_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}"
@ -3661,14 +3658,11 @@ matrix_client_hydrogen_enabled: false
matrix_client_hydrogen_container_image_self_build: "{{ matrix_architecture not in ['amd64'] }}"
# Normally, matrix-nginx-proxy is enabled and nginx can reach Hydrogen over the container network.
# If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
# the HTTP port to the local host.
matrix_client_hydrogen_container_http_host_bind_port: "{{ (matrix_playbook_service_host_bind_interface_prefix ~ '8768') if matrix_playbook_service_host_bind_interface_prefix else '' }}"
matrix_client_hydrogen_container_network: "{{ matrix_nginx_proxy_container_network if matrix_playbook_reverse_proxy_type == 'playbook-managed-nginx' else 'matrix-client-hydrogen' }}"
matrix_client_hydrogen_container_network: "{{ matrix_addons_container_network }}"
matrix_client_hydrogen_container_additional_networks: "{{ [matrix_playbook_reverse_proxyable_services_additional_network] if matrix_playbook_reverse_proxyable_services_additional_network else [] }}"
matrix_client_hydrogen_container_additional_networks: "{{ [matrix_playbook_reverse_proxyable_services_additional_network] if (matrix_client_hydrogen_container_labels_traefik_enabled and matrix_playbook_reverse_proxyable_services_additional_network) else [] }}"
matrix_client_hydrogen_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}"
matrix_client_hydrogen_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}"
@ -3695,14 +3689,11 @@ matrix_client_cinny_enabled: false
matrix_client_cinny_container_image_self_build: "{{ matrix_architecture not in ['arm64', 'amd64'] }}"
# Normally, matrix-nginx-proxy is enabled and nginx can reach Cinny over the container network.
# If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
# the HTTP port to the local host.
matrix_client_cinny_container_http_host_bind_port: "{{ (matrix_playbook_service_host_bind_interface_prefix ~ '8080') if matrix_playbook_service_host_bind_interface_prefix else '' }}"
matrix_client_cinny_container_network: "{{ matrix_nginx_proxy_container_network if matrix_playbook_reverse_proxy_type == 'playbook-managed-nginx' else 'matrix-client-cinny' }}"
matrix_client_cinny_container_network: "{{ matrix_addons_container_network }}"
matrix_client_cinny_container_additional_networks: "{{ [matrix_playbook_reverse_proxyable_services_additional_network] if matrix_playbook_reverse_proxyable_services_additional_network else [] }}"
matrix_client_cinny_container_additional_networks: "{{ [matrix_playbook_reverse_proxyable_services_additional_network] if (matrix_client_cinny_container_labels_traefik_enabled and matrix_playbook_reverse_proxyable_services_additional_network) else [] }}"
matrix_client_cinny_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}"
matrix_client_cinny_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}"
@ -3729,14 +3720,11 @@ matrix_client_schildichat_enabled: false
matrix_client_schildichat_container_image_self_build: "{{ matrix_architecture not in ['arm64', 'amd64'] }}"
# Normally, matrix-nginx-proxy is enabled and nginx can reach schildichat over the container network.
# If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose
# the schildichat HTTP port to the local host.
matrix_client_schildichat_container_http_host_bind_port: "{{ (matrix_playbook_service_host_bind_interface_prefix ~ '8765') if matrix_playbook_service_host_bind_interface_prefix else '' }}"
matrix_client_schildichat_container_network: "{{ matrix_nginx_proxy_container_network if matrix_playbook_reverse_proxy_type == 'playbook-managed-nginx' else 'matrix-client-schildichat' }}"
matrix_client_schildichat_container_network: "{{ matrix_addons_container_network }}"
matrix_client_schildichat_container_additional_networks: "{{ [matrix_playbook_reverse_proxyable_services_additional_network] if matrix_playbook_reverse_proxyable_services_additional_network else [] }}"
matrix_client_schildichat_container_additional_networks: "{{ [matrix_playbook_reverse_proxyable_services_additional_network] if (matrix_client_schildichat_container_labels_traefik_enabled and matrix_playbook_reverse_proxyable_services_additional_network) else [] }}"
matrix_client_schildichat_container_labels_traefik_enabled: "{{ matrix_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}"
matrix_client_schildichat_container_labels_traefik_docker_network: "{{ matrix_playbook_reverse_proxyable_services_additional_network }}"

View File

@ -16,7 +16,7 @@ matrix_client_cinny_data_path: "{{ matrix_base_data_path }}/client-cinny"
matrix_client_cinny_docker_src_files_path: "{{ matrix_client_cinny_data_path }}/docker-src"
# The base container network
matrix_client_cinny_container_network: matrix-client-cinny
matrix_client_cinny_container_network: ''
# A list of additional container networks that the container would be connected to.
# The role does not create these networks, so make sure they already exist.

View File

@ -5,7 +5,8 @@
You need to define a required configuration setting (`{{ item }}`) to use Cinny.
when: "vars[item] == '' or vars[item] is none"
with_items:
- "matrix_client_cinny_default_hs_url"
- matrix_client_cinny_default_hs_url
- matrix_client_cinny_container_network
- when: matrix_client_cinny_container_labels_traefik_enabled | bool
block:

View File

@ -21,7 +21,7 @@ matrix_client_element_data_path: "{{ matrix_base_data_path }}/client-element"
matrix_client_element_docker_src_files_path: "{{ matrix_client_element_data_path }}/docker-src"
# The base container network
matrix_client_element_container_network: matrix-client-element
matrix_client_element_container_network: ''
# A list of additional container networks that the container would be connected to.
# The role does not create these networks, so make sure they already exist.

View File

@ -6,7 +6,8 @@
You need to define a required configuration setting (`{{ item }}`) for using Element.
when: "vars[item] == ''"
with_items:
- "matrix_client_element_default_hs_url"
- matrix_client_element_default_hs_url
- matrix_client_element_container_network
- name: Fail if Element location sharing enabled, but no tile server defined
ansible.builtin.fail:

View File

@ -16,7 +16,7 @@ matrix_client_hydrogen_data_path: "{{ matrix_base_data_path }}/client-hydrogen"
matrix_client_hydrogen_docker_src_files_path: "{{ matrix_client_hydrogen_data_path }}/docker-src"
# The base container network
matrix_client_hydrogen_container_network: matrix-client-hydrogen
matrix_client_hydrogen_container_network: ''
# A list of additional container networks that the container would be connected to.
# The role does not create these networks, so make sure they already exist.

View File

@ -6,7 +6,8 @@
You need to define a required configuration setting (`{{ item }}`) to use Hydrogen.
when: "(vars[item] == '' or vars[item] is none) and matrix_client_hydrogen_container_image_self_build | bool"
with_items:
- "matrix_client_hydrogen_default_hs_url"
- matrix_client_hydrogen_default_hs_url
- matrix_client_hydrogen_container_network
- when: matrix_client_hydrogen_container_labels_traefik_enabled | bool
block:

View File

@ -15,7 +15,7 @@ matrix_client_schildichat_data_path: "{{ matrix_base_data_path }}/client-schildi
matrix_client_schildichat_docker_src_files_path: "{{ matrix_client_schildichat_data_path }}/docker-src"
# The base container network
matrix_client_schildichat_container_network: matrix-client-schildichat
matrix_client_schildichat_container_network: ''
# A list of additional container networks that the container would be connected to.
# The role does not create these networks, so make sure they already exist.

View File

@ -6,7 +6,8 @@
You need to define a required configuration setting (`{{ item }}`) for using schildichat.
when: "vars[item] == ''"
with_items:
- "matrix_client_schildichat_default_hs_url"
- matrix_client_schildichat_default_hs_url
- matrix_client_schildichat_container_network
- name: Fail if schildichat location sharing enabled, but no tile server defined
ansible.builtin.fail: