diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index 108954f77..a928cd083 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -5882,6 +5882,10 @@ matrix_static_files_file_matrix_client_property_org_matrix_msc2965_authenticatio matrix_static_files_file_matrix_client_property_m_tile_server_entries_enabled: "{{ matrix_client_element_location_sharing_enabled }}" matrix_static_files_file_matrix_client_property_m_tile_server_map_style_url: "{{ ('https://' if matrix_playbook_ssl_enabled else 'http://') + matrix_server_fqn_element }}/map_style.json" +# We set this regardless of whether synapse-admin is enabled, because people may wish to use a hosted (externally) synapse-admin installation and still have it auto-configured. +# See: https://github.com/etkecc/synapse-admin/pull/126 +matrix_static_files_file_matrix_client_property_cc_etke_synapse_admin_auto: "{{ matrix_synapse_admin_well_known_client_configuration if matrix_homeserver_implementation == 'synapse' else {} }}" + matrix_static_files_file_matrix_server_property_m_server: "{{ matrix_server_fqn_matrix_federation }}:{{ matrix_federation_public_port }}" matrix_static_files_scheme: "{{ 'https' if matrix_playbook_ssl_enabled else 'http' }}" diff --git a/roles/custom/matrix-static-files/defaults/main.yml b/roles/custom/matrix-static-files/defaults/main.yml index 60d1f555f..7e3abf2f5 100644 --- a/roles/custom/matrix-static-files/defaults/main.yml +++ b/roles/custom/matrix-static-files/defaults/main.yml @@ -193,6 +193,16 @@ matrix_static_files_file_matrix_client_property_io_element_e2ee_secure_backup_se # See: https://github.com/element-hq/element-web/blob/develop/docs/e2ee.md matrix_static_files_file_matrix_client_property_io_element_e2ee_force_disable: false +# Controls whether `cc.etke.synapse-admin`-related entries should be added to the client well-known. +# By default, if there are entries in `matrix_static_files_file_matrix_client_property_cc_etke_synapse_admin`, we show them (by enabling this). +matrix_static_files_file_matrix_client_property_cc_etke_synapse_admin_enabled: "{{ matrix_static_files_file_matrix_client_property_cc_etke_synapse_admin | default({}) | dict2items | length > 0 }}" + +# Controls the cc.etke.synapse-admin property in the /.well-known/matrix/client file. +# See `matrix_static_files_file_matrix_client_property_cc_etke_synapse_admin_entries_enabled` +matrix_static_files_file_matrix_client_property_cc_etke_synapse_admin: "{{ matrix_static_files_file_matrix_client_property_cc_etke_synapse_admin_auto | combine(matrix_static_files_file_matrix_client_property_cc_etke_synapse_admin_custom, recursive=True) }}" +matrix_static_files_file_matrix_client_property_cc_etke_synapse_admin_auto: {} +matrix_static_files_file_matrix_client_property_cc_etke_synapse_admin_custom: {} + # Default /.well-known/matrix/client configuration template which covers the generic use case. # You can customize it by controlling the various variables inside it. # diff --git a/roles/custom/matrix-static-files/templates/public/.well-known/matrix/client.j2 b/roles/custom/matrix-static-files/templates/public/.well-known/matrix/client.j2 index 99ed488fe..86882893a 100644 --- a/roles/custom/matrix-static-files/templates/public/.well-known/matrix/client.j2 +++ b/roles/custom/matrix-static-files/templates/public/.well-known/matrix/client.j2 @@ -54,4 +54,7 @@ "default": {{ matrix_static_files_file_matrix_client_property_io_element_e2ee_default|to_json }} } {% endif %} + {% if matrix_static_files_file_matrix_client_property_cc_etke_synapse_admin_enabled %}, + "cc.etke.synapse-admin": {{ matrix_static_files_file_matrix_client_property_cc_etke_synapse_admin | to_json }} + {% endif %} } diff --git a/roles/custom/matrix-synapse-admin/vars/main.yml b/roles/custom/matrix-synapse-admin/vars/main.yml new file mode 100644 index 000000000..1817a3f21 --- /dev/null +++ b/roles/custom/matrix-synapse-admin/vars/main.yml @@ -0,0 +1,7 @@ +--- + +# Configuration that can be injected into a `/.well-known/matrix/client` file, +# to let synapse-admin users use any synapse-admin instance and still get synapse-admin auto-configured correctly. +# See: https://github.com/etkecc/synapse-admin/pull/126 +matrix_synapse_admin_well_known_client_configuration: + asManagedUsers: "{{ matrix_synapse_admin_config_asManagedUsers }}"