diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index a928cd083..fd2002ae6 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -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 }}" diff --git a/roles/custom/matrix-synapse-admin/defaults/main.yml b/roles/custom/matrix-synapse-admin/defaults/main.yml index 85c7007c7..bf775bb94 100644 --- a/roles/custom/matrix-synapse-admin/defaults/main.yml +++ b/roles/custom/matrix-synapse-admin/defaults/main.yml @@ -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`). diff --git a/roles/custom/matrix-synapse-admin/templates/config.json.j2 b/roles/custom/matrix-synapse-admin/templates/config.json.j2 deleted file mode 100644 index 672a979c5..000000000 --- a/roles/custom/matrix-synapse-admin/templates/config.json.j2 +++ /dev/null @@ -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 }}, -} diff --git a/roles/custom/matrix-synapse-admin/vars/main.yml b/roles/custom/matrix-synapse-admin/vars/main.yml deleted file mode 100644 index 768390424..000000000 --- a/roles/custom/matrix-synapse-admin/vars/main.yml +++ /dev/null @@ -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 }}"