synapse-admin: get rid of lookup and config duplicate var

This commit is contained in:
Aine 2024-11-08 18:47:37 +02:00
parent 28a4434f55
commit 7a77d84276
No known key found for this signature in database
GPG Key ID: 34969C908CCA2804
4 changed files with 6 additions and 22 deletions

View File

@ -5884,7 +5884,7 @@ matrix_static_files_file_matrix_client_property_m_tile_server_map_style_url: "{{
# 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_client_property_cc_etke_synapse_admin_auto: "{{ matrix_synapse_admin_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 }}"

View File

@ -146,7 +146,11 @@ matrix_synapse_admin_path_prefix: /synapse-admin
#
# The side-effect of this lookup is that Ansible would even parse the JSON for us, returning a dict.
# This is unlike what it does when looking up YAML template files (no automatic parsing there).
matrix_synapse_admin_configuration_default: "{{ lookup('template', 'templates/config.json.j2') }}"
matrix_synapse_admin_configuration_default:
restrictBaseUrl: "{{ matrix_synapse_admin_config_restrictBaseUrl }}"
asManagedUsers: "{{ matrix_synapse_admin_config_asManagedUsers }}"
supportURL: "{{ matrix_synapse_admin_config_supportURL }}"
menu: "{{ matrix_synapse_admin_config_menu }}"
# Your custom JSON configuration for synapse-admin should go to `matrix_synapse_admin_configuration_extension_json`.
# This configuration extends the default starting configuration (`matrix_synapse_admin_configuration_default`).

View File

@ -1,6 +0,0 @@
{
"restrictBaseUrl": {{ matrix_synapse_admin_config_restrictBaseUrl | to_json }},
"asManagedUsers": {{ matrix_synapse_admin_config_asManagedUsers | to_json }},
"supportURL": {{ matrix_synapse_admin_config_supportURL | to_json }},
"menu": {{ matrix_synapse_admin_config_menu | to_json }},
}

View File

@ -1,14 +0,0 @@
---
# 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
#
# This duplicates `roles/custom/matrix-synapse-admin/templates/config.json.j2` and is usable by other roles directly.
# Alternatively, `matrix_synapse_admin_configuration` may have been used instead of this variable, but that one does not work reliably
# when used outside the context of this role, because `lookup('template', 'templates/config.json.j2')` only does the right thing in the context of this role.
matrix_synapse_admin_well_known_client_configuration:
restrictBaseUrl: "{{ matrix_synapse_admin_config_restrictBaseUrl }}"
asManagedUsers: "{{ matrix_synapse_admin_config_asManagedUsers }}"
supportURL: "{{ matrix_synapse_admin_config_supportURL }}"
menu: "{{ matrix_synapse_admin_config_menu }}"