From fe932273aa01c8b2bd8814973c9e22ce311ab341 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Thu, 5 Dec 2019 17:32:51 -0600 Subject: [PATCH 1/3] Implement MSC1957: Integration manager discovery https://github.com/matrix-org/matrix-doc/pull/1957 Yay Riot iOS now supports integration manager discovery! --- .../templates/static-files/well-known/matrix-client.j2 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/roles/matrix-base/templates/static-files/well-known/matrix-client.j2 b/roles/matrix-base/templates/static-files/well-known/matrix-client.j2 index 4e93c2d8..1316bbb5 100644 --- a/roles/matrix-base/templates/static-files/well-known/matrix-client.j2 +++ b/roles/matrix-base/templates/static-files/well-known/matrix-client.j2 @@ -8,4 +8,14 @@ "base_url": "{{ matrix_identity_server_url }}" } {% endif %} + {% if matrix_dimension_integrations_rest_url and matrix_dimension_integrations_ui_url %}, + "m.integrations": { + "managers": [ + { + "api_url": "{{ matrix_dimension_integrations_rest_url }}", + "ui_url": "{{ matrix_dimension_integrations_ui_url }}" + } + ] + } + {% endif %} } From 5366aef0da0979ac81c1f3c29c88b68ae89a3990 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Thu, 5 Dec 2019 17:33:08 -0600 Subject: [PATCH 2/3] Fix Caddy example config for Dimension --- examples/caddy/matrix-dimension | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/caddy/matrix-dimension b/examples/caddy/matrix-dimension index 82f12c01..74d08e59 100644 --- a/examples/caddy/matrix-dimension +++ b/examples/caddy/matrix-dimension @@ -3,7 +3,7 @@ https://dimension.DOMAIN { # If you wish to use Caddy's built-in Let's Encrypt support, you can also supply an email address here tls /matrix/ssl/config/live/dimension.DOMAIN/fullchain.pem /matrix/ssl/config/live/dimension.DOMAIN/privkey.pem - proxy / http://127.0.0.1:8134/ { + proxy / http://127.0.0.1:8184/ { transparent } } From 2ea507e2ea2d2dd533e25fba6429e16ab11d4946 Mon Sep 17 00:00:00 2001 From: Aaron Raimist Date: Mon, 9 Dec 2019 22:23:56 -0600 Subject: [PATCH 3/3] Don't make it Dimension specific --- group_vars/matrix_servers | 3 +++ roles/matrix-base/defaults/main.yml | 3 +++ .../templates/static-files/well-known/matrix-client.j2 | 6 +++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index aa2d0b75..24646e77 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -319,6 +319,9 @@ matrix_dimension_enabled: false # the Dimension HTTP port to the local host. matrix_dimension_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:8184' }}" +matrix_integration_manager_rest_url: "{{ matrix_dimension_integrations_rest_url if matrix_dimension_enabled else None }}" +matrix_integration_manager_ui_url: "{{ matrix_dimension_integrations_ui_url if matrix_dimension_enabled else None }}" + ###################################################################### # # /matrix-dimension diff --git a/roles/matrix-base/defaults/main.yml b/roles/matrix-base/defaults/main.yml index 9ffffc2f..b4fef1dd 100644 --- a/roles/matrix-base/defaults/main.yml +++ b/roles/matrix-base/defaults/main.yml @@ -31,6 +31,9 @@ matrix_homeserver_url: "https://{{ matrix_server_fqn_matrix }}" matrix_identity_server_url: ~ +matrix_integration_manager_rest_url: ~ +matrix_integration_manager_ui_url: ~ + # The Docker network that all services would be put into matrix_docker_network: "matrix" diff --git a/roles/matrix-base/templates/static-files/well-known/matrix-client.j2 b/roles/matrix-base/templates/static-files/well-known/matrix-client.j2 index 1316bbb5..719656a4 100644 --- a/roles/matrix-base/templates/static-files/well-known/matrix-client.j2 +++ b/roles/matrix-base/templates/static-files/well-known/matrix-client.j2 @@ -8,12 +8,12 @@ "base_url": "{{ matrix_identity_server_url }}" } {% endif %} - {% if matrix_dimension_integrations_rest_url and matrix_dimension_integrations_ui_url %}, + {% if matrix_integration_manager_rest_url and matrix_integration_manager_ui_url %}, "m.integrations": { "managers": [ { - "api_url": "{{ matrix_dimension_integrations_rest_url }}", - "ui_url": "{{ matrix_dimension_integrations_ui_url }}" + "api_url": "{{ matrix_integration_manager_rest_url }}", + "ui_url": "{{ matrix_integration_manager_ui_url }}" } ] }