aboutsummaryrefslogtreecommitdiff
path: root/cmd/generate-config
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2020-09-03 10:12:11 +0100
committerGitHub <noreply@github.com>2020-09-03 10:12:11 +0100
commit74743ac8ae3cc439862acd15d13ba4123d745598 (patch)
tree879ff4fca4ae2025b3e57cce8ba060c0fd1b0f73 /cmd/generate-config
parentd64d0c4be2ab33185b6dd837944dea3268b62c24 (diff)
Rate limiting (#1385)
* Initial rate limiting * Move rate limiting to client API * Update rate limits to hopefully be self-cleaning * Use X-Forwarded-For, add comments * Reduce rate limit threshold * Tweak interval * Configurable backoff * Review comments, set cleanup interval to 30 seconds * Allow generate-config to produce sane CI config * Fix Complement dockerfile
Diffstat (limited to 'cmd/generate-config')
-rw-r--r--cmd/generate-config/main.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmd/generate-config/main.go b/cmd/generate-config/main.go
index cff376d8..78ed3af6 100644
--- a/cmd/generate-config/main.go
+++ b/cmd/generate-config/main.go
@@ -1,6 +1,7 @@
package main
import (
+ "flag"
"fmt"
"github.com/matrix-org/dendrite/internal/config"
@@ -8,6 +9,9 @@ import (
)
func main() {
+ defaultsForCI := flag.Bool("ci", false, "sane defaults for CI testing")
+ flag.Parse()
+
cfg := &config.Dendrite{}
cfg.Defaults()
cfg.Global.TrustedIDServers = []string{
@@ -56,6 +60,11 @@ func main() {
},
}
+ if *defaultsForCI {
+ cfg.ClientAPI.RateLimiting.Enabled = false
+ cfg.FederationSender.DisableTLSValidation = true
+ }
+
j, err := yaml.Marshal(cfg)
if err != nil {
panic(err)