Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
213c98c0
Commit
213c98c0
authored
6 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Add option to disable search room lists
This disables both local and remote room list searching.
parent
11f21258
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
docs/sample_config.yaml
+5
-0
5 additions, 0 deletions
docs/sample_config.yaml
synapse/config/room_directory.py
+9
-0
9 additions, 0 deletions
synapse/config/room_directory.py
synapse/handlers/room_list.py
+13
-0
13 additions, 0 deletions
synapse/handlers/room_list.py
with
27 additions
and
0 deletions
docs/sample_config.yaml
+
5
−
0
View file @
213c98c0
...
...
@@ -1036,6 +1036,11 @@ password_config:
# Wether the public room list can be searched. When disabled blocks
# searching local and remote room list for local and remote users.
#
#enable_room_list_search: true
# The `alias_creation` option controls who's allowed to create aliases
# on this server.
#
...
...
This diff is collapsed.
Click to expand it.
synapse/config/room_directory.py
+
9
−
0
View file @
213c98c0
...
...
@@ -20,6 +20,10 @@ from ._base import Config, ConfigError
class
RoomDirectoryConfig
(
Config
):
def
read_config
(
self
,
config
):
self
.
enable_room_list_search
=
config
.
get
(
"
enable_room_list_search
"
,
True
,
)
alias_creation_rules
=
config
.
get
(
"
alias_creation_rules
"
)
if
alias_creation_rules
is
not
None
:
...
...
@@ -54,6 +58,11 @@ class RoomDirectoryConfig(Config):
def
default_config
(
self
,
config_dir_path
,
server_name
,
**
kwargs
):
return
"""
# Wether the public room list can be searched. When disabled blocks
# searching local and remote room list for local and remote users.
#
#enable_room_list_search: true
# The `alias_creation` option controls who
'
s allowed to create aliases
# on this server.
#
...
...
This diff is collapsed.
Click to expand it.
synapse/handlers/room_list.py
+
13
−
0
View file @
213c98c0
...
...
@@ -44,6 +44,7 @@ EMPTY_THIRD_PARTY_ID = ThirdPartyInstanceID(None, None)
class
RoomListHandler
(
BaseHandler
):
def
__init__
(
self
,
hs
):
super
(
RoomListHandler
,
self
).
__init__
(
hs
)
self
.
config
=
hs
.
config
self
.
response_cache
=
ResponseCache
(
hs
,
"
room_list
"
)
self
.
remote_response_cache
=
ResponseCache
(
hs
,
"
remote_room_list
"
,
timeout_ms
=
30
*
1000
)
...
...
@@ -70,6 +71,12 @@ class RoomListHandler(BaseHandler):
"
Getting public room list: limit=%r, since=%r, search=%r, network=%r
"
,
limit
,
since_token
,
bool
(
search_filter
),
network_tuple
,
)
if
not
self
.
config
.
enable_room_list_search
:
return
defer
.
succeed
({
"
chunk
"
:
[],
"
total_room_count_estimate
"
:
0
,
})
if
search_filter
:
# We explicitly don't bother caching searches or requests for
# appservice specific lists.
...
...
@@ -441,6 +448,12 @@ class RoomListHandler(BaseHandler):
def
get_remote_public_room_list
(
self
,
server_name
,
limit
=
None
,
since_token
=
None
,
search_filter
=
None
,
include_all_networks
=
False
,
third_party_instance_id
=
None
,):
if
not
self
.
config
.
enable_room_list_search
:
defer
.
returnValue
({
"
chunk
"
:
[],
"
total_room_count_estimate
"
:
0
,
})
if
search_filter
:
# We currently don't support searching across federation, so we have
# to do it manually without pagination
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment