Add support for auto-configuring synapse-admin via /.well-known/matrix/client

Related to:
- https://github.com/etkecc/synapse-admin/pull/126
- https://github.com/etkecc/synapse-admin/releases/tag/v0.10.3-etke27

People who wish to disable this and keep their `/.well-known/matrix/client` file tidier
can do it via:

```yml
matrix_static_files_file_matrix_client_property_cc_etke_synapse_admin_enabled: false
```
This commit is contained in:
Slavi Pantaleev
2024-11-08 17:48:37 +02:00
parent 260421beb1
commit 0cb3e530d9
4 changed files with 24 additions and 0 deletions

View File

@ -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.
#

View File

@ -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 %}
}

View File

@ -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 }}"