mirror of
https://github.com/github-tijlxyz/khatru-pyramid.git
synced 2025-05-10 16:26:04 +00:00
stop ratelimiting events.
This commit is contained in:
parent
cbc84a2004
commit
c4a241a99f
9
main.go
9
main.go
@ -9,6 +9,7 @@ import (
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/fiatjaf/eventstore/lmdb"
|
||||
"github.com/fiatjaf/khatru"
|
||||
@ -90,7 +91,13 @@ func main() {
|
||||
}
|
||||
relay.Info.Software = "https://github.com/github-tijlxyz/khatru-pyramid"
|
||||
|
||||
policies.ApplySaneDefaults(relay)
|
||||
relay.RejectFilter = append(relay.RejectFilter,
|
||||
policies.NoComplexFilters,
|
||||
policies.FilterIPRateLimiter(20, time.Minute, 100),
|
||||
)
|
||||
relay.RejectConnection = append(relay.RejectConnection,
|
||||
policies.ConnectionRateLimiter(1, time.Minute*5, 100),
|
||||
)
|
||||
|
||||
relay.StoreEvent = append(relay.StoreEvent, db.SaveEvent)
|
||||
relay.QueryEvents = append(relay.QueryEvents, db.QueryEvents)
|
||||
|
Loading…
x
Reference in New Issue
Block a user