Persistent federation sender blacklist (#1214)

* Initial persistence of blacklists

* Move statistics folder

* Make MaxFederationRetries configurable

* Set lower failure thresholds for Yggdrasil demos

* Still write events into database for blacklisted hosts (they can be tidied up later)

* Review comments
This commit is contained in:
Neil Alexander 2020-07-22 17:01:29 +01:00 committed by GitHub
parent 470933789b
commit 1e71fd645e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 343 additions and 51 deletions

View file

@ -102,6 +102,11 @@ type Dendrite struct {
// Perspective keyservers, to use as a backup when direct key fetch
// requests don't succeed
KeyPerspectives KeyPerspectives `yaml:"key_perspectives"`
// Federation failure threshold. How many consecutive failures that we should
// tolerate when sending federation requests to a specific server. The backoff
// is 2**x seconds, so 1 = 2 seconds, 2 = 4 seconds, 3 = 8 seconds, etc.
// The default value is 16 if not specified, which is circa 18 hours.
FederationMaxRetries uint32 `yaml:"federation_max_retries"`
} `yaml:"matrix"`
// The configuration specific to the media repostitory.
@ -479,6 +484,10 @@ func (config *Dendrite) SetDefaults() {
config.Matrix.TrustedIDServers = []string{}
}
if config.Matrix.FederationMaxRetries == 0 {
config.Matrix.FederationMaxRetries = 16
}
if config.Media.MaxThumbnailGenerators == 0 {
config.Media.MaxThumbnailGenerators = 10
}