From 7035af87d8d96c9381b47ed65a39e05ead1dc3b5 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 9 Apr 2020 09:58:35 +0300 Subject: [PATCH] Add support for Jitsi discovery for Riot via /.well-known/matrix/client This will not work yet, as no version of Riot currently supports it. It's expected to land in riot-web v1.5.16 via matrix-org/matrix-react-sdk#4348. --- group_vars/matrix_servers | 2 ++ roles/matrix-base/defaults/main.yml | 5 +++++ .../templates/static-files/well-known/matrix-client.j2 | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index 474ef960..864cd7d4 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -18,6 +18,8 @@ matrix_identity_server_url: "{{ 'https://' + matrix_synapse_trusted_third_party_id_servers[0] if matrix_synapse_trusted_third_party_id_servers|length > 0 else None }}" +matrix_riot_jitsi_preferredDomain: "{{ matrix_server_fqn_jitsi if matrix_jitsi_enabled else '' }}" + ###################################################################### # # /matrix-base diff --git a/roles/matrix-base/defaults/main.yml b/roles/matrix-base/defaults/main.yml index c6ed430b..7f4c6ace 100644 --- a/roles/matrix-base/defaults/main.yml +++ b/roles/matrix-base/defaults/main.yml @@ -43,6 +43,11 @@ matrix_identity_server_url: ~ matrix_integration_manager_rest_url: ~ matrix_integration_manager_ui_url: ~ +# The domain name where a Jitsi server is self-hosted. +# If set, `/.well-known/matrix/client` will suggest Riot clients to use that Jitsi server. +# See: https://github.com/vector-im/riot-web/blob/develop/docs/jitsi.md#configuring-riot-to-use-your-self-hosted-jitsi-server +matrix_riot_jitsi_preferredDomain: '' + # 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 719656a4..edbaa62e 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 @@ -18,4 +18,9 @@ ] } {% endif %} + {% if matrix_riot_jitsi_preferredDomain %}, + "im.vector.riot.jitsi": { + "preferredDomain": {{ matrix_riot_jitsi_preferredDomain|to_json }} + } + {% endif %} }