From 1f0da9f744156eb36070e301842806046e93b62b Mon Sep 17 00:00:00 2001 From: Luke D Iremadze Date: Fri, 2 Jun 2023 12:50:46 -0600 Subject: [PATCH 1/4] Create hooks for user search ability --- roles/custom/matrix-synapse/defaults/main.yml | 5 +++++ .../matrix-synapse/templates/synapse/homeserver.yaml.j2 | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/roles/custom/matrix-synapse/defaults/main.yml b/roles/custom/matrix-synapse/defaults/main.yml index a0169eb0c..df2f7bf8c 100644 --- a/roles/custom/matrix-synapse/defaults/main.yml +++ b/roles/custom/matrix-synapse/defaults/main.yml @@ -334,6 +334,11 @@ matrix_synapse_limit_profile_requests_to_users_who_share_rooms: false # Defaults to 'true'. matrix_synapse_include_profile_data_on_invite: true + +# User search behaviour +matrix_synapse_search_all_users: false +matrix_synapse_prefer_local_users: false + # Controls whether people with access to the homeserver can register by themselves. matrix_synapse_enable_registration: false # Controls whether people with access to the homeserver can register by themselves without verification (email/msisdn/token) diff --git a/roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 b/roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 index a36df6fc0..ebfc2711c 100644 --- a/roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 +++ b/roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 @@ -2630,7 +2630,7 @@ user_directory: # Uncomment to return search results containing all known users, even if that # user does not share a room with the requester. # - #search_all_users: true + search_all_users: {{ matrix_synapse_search_all_users|to_json }} # Defines whether to prefer local users in search query results. # If True, local users are more likely to appear above remote users @@ -2639,7 +2639,7 @@ user_directory: # Uncomment to prefer local over remote users in user directory search # results. # - #prefer_local_users: true + prefer_local_users: {{ matrix_synapse_prefer_local_users|to_json }} # User Consent configuration From 130c278a3c42b4ba601d6eff830cf7c34fee2b7a Mon Sep 17 00:00:00 2001 From: Luke D Iremadze Date: Fri, 2 Jun 2023 23:38:57 -0600 Subject: [PATCH 2/4] Update roles/custom/matrix-synapse/defaults/main.yml Co-authored-by: Slavi Pantaleev --- roles/custom/matrix-synapse/defaults/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/custom/matrix-synapse/defaults/main.yml b/roles/custom/matrix-synapse/defaults/main.yml index df2f7bf8c..4376a960e 100644 --- a/roles/custom/matrix-synapse/defaults/main.yml +++ b/roles/custom/matrix-synapse/defaults/main.yml @@ -336,8 +336,8 @@ matrix_synapse_include_profile_data_on_invite: true # User search behaviour -matrix_synapse_search_all_users: false -matrix_synapse_prefer_local_users: false +matrix_synapse_user_directory_search_all_users: false +matrix_synapse_user_directory_prefer_local_users: false # Controls whether people with access to the homeserver can register by themselves. matrix_synapse_enable_registration: false From 2f4428bf5b4c1f6658d33236f824748db455b2f9 Mon Sep 17 00:00:00 2001 From: Luke D Iremadze Date: Fri, 2 Jun 2023 23:39:17 -0600 Subject: [PATCH 3/4] Update roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 Co-authored-by: Slavi Pantaleev --- .../custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 b/roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 index ebfc2711c..05700c9b5 100644 --- a/roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 +++ b/roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 @@ -2639,7 +2639,7 @@ user_directory: # Uncomment to prefer local over remote users in user directory search # results. # - prefer_local_users: {{ matrix_synapse_prefer_local_users|to_json }} + prefer_local_users: {{ matrix_synapse_user_directory_prefer_local_users | to_json }} # User Consent configuration From 5c0279f0c962b29ab6cf75c7bb7ff94d8e5e3e7e Mon Sep 17 00:00:00 2001 From: Luke D Iremadze Date: Fri, 2 Jun 2023 23:39:55 -0600 Subject: [PATCH 4/4] Update roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 Co-authored-by: Slavi Pantaleev --- .../custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 b/roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 index 05700c9b5..f42f6e309 100644 --- a/roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 +++ b/roles/custom/matrix-synapse/templates/synapse/homeserver.yaml.j2 @@ -2630,7 +2630,7 @@ user_directory: # Uncomment to return search results containing all known users, even if that # user does not share a room with the requester. # - search_all_users: {{ matrix_synapse_search_all_users|to_json }} + search_all_users: {{ matrix_synapse_user_directory_search_all_users | to_json }} # Defines whether to prefer local users in search query results. # If True, local users are more likely to appear above remote users