This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Disable federation when using SQLite by default #5078
Closed
Closed
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
c58538d
Add config for disabling/enabling federation when using SQLite
babolivier 6a72d7a
Deny federation traffic if config says so
babolivier 8050fa4
Merge branch 'develop' into babolivier/sqlite_federation
babolivier 56ac502
fix
babolivier 415a3fe
Changelog
babolivier 051e8b5
fix
babolivier 7fd865e
Sample config
babolivier 6629da6
Fix unit tests
babolivier 50c2dd6
Lint
babolivier e751bb0
pop instead of get
babolivier 7911334
i give up
babolivier e44b275
sample conf
babolivier 25de64f
fix
babolivier 48985f9
Update synapse/config/database.py
aaronraimist 4138b06
Update synapse/config/database.py
aaronraimist 288b555
arrrrgh scaaary
babolivier 131df58
sample conf
babolivier c5956d4
Update synapse/config/database.py
richvdh 35e7b60
Merge branch 'develop' into babolivier/sqlite_federation
babolivier 66fee87
review
babolivier 94c4bd3
Merge branch 'babolivier/sqlite_federation' of github.com:matrix-org/…
babolivier 0a8cd10
Merge branch 'develop' into babolivier/sqlite_federation
babolivier 2e04f2c
o no
babolivier a32cd95
config
babolivier 97e27a5
Reverting undeeded change
babolivier 209c777
Fix test config
babolivier 637e82c
Update doc
babolivier 8216106
Add test case
babolivier 72f80c0
Update other doc
babolivier 235136a
lint
babolivier 3a36244
Update synapse/config/server.py
richvdh 1aef88d
Incorporate review
babolivier d1482a8
Merge branch 'babolivier/sqlite_federation' of github.com:matrix-org/…
babolivier 841b644
Use a more sensible way to get database settings
babolivier 972b54a
Sample config
babolivier 13b853a
Merge branch 'develop' into babolivier/sqlite_federation
babolivier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Disable federation when using SQLite by default. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,17 @@ def read_config(self, config): | |
# "disable" federation | ||
self.send_federation = config.get("send_federation", True) | ||
|
||
# Whether to enable federation with SQLite. Can cause bad performance. | ||
# Ignored when not using SQLite (in which case federation is always | ||
# enabled unless federation_domain_whitelist is an empty list). | ||
if config.get("database", {}).get("name", "sqlite3") == "sqlite3": | ||
self.enable_federation = config.get( | ||
"enable_federation_with_sqlite_can_cause_bad_perfs", | ||
False, | ||
) | ||
else: | ||
self.enable_federation = True | ||
|
||
# Whether to enable user presence. | ||
self.use_presence = config.get("use_presence", True) | ||
|
||
|
@@ -497,6 +508,19 @@ def default_config(self, server_name, data_dir_path, **kwargs): | |
# Used by phonehome stats to group together related servers. | ||
#server_context: context | ||
|
||
# Using SQLite with Synapse induces a severe degradation in performance | ||
# compared to using PostgreSQL. SQLite should only be used for personal | ||
# testing. Production instances should use PostgreSQL instead. You can | ||
# find documentation on setting up PostgreSQL with Synapse here: | ||
# https://github.com/matrix-org/synapse/blob/master/docs/postgres.rst | ||
# | ||
# If you want to use federation with SQLite regardless, you can | ||
# uncomment the line below. This option defaults to 'false' when using | ||
# SQLite and 'true' otherwise. It is ignored when using PostgreSQL. | ||
# | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. spare line is spare |
||
# | ||
#enable_federation_with_sqlite_can_cause_bad_perfs = true | ||
|
||
# Whether to require a user to be in the room to add an alias to it. | ||
# Defaults to 'true'. | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it is ignored when using postgresql, surely it doesn't matter what it defaults to? I think you could remove the whole sentence about the default: it's pretty obvious what the default is from the context.