mirror of
https://github.com/github-tijlxyz/khatru-pyramid.git
synced 2025-06-05 16:52:06 +00:00
more anti-read policies, authorized kinds and khatru update.
This commit is contained in:
parent
bdc401c4aa
commit
93eb09a24f
2
go.mod
2
go.mod
@ -6,7 +6,7 @@ toolchain go1.21.3
|
||||
|
||||
require (
|
||||
github.com/fiatjaf/eventstore v0.2.9
|
||||
github.com/fiatjaf/khatru v0.0.12
|
||||
github.com/fiatjaf/khatru v0.1.0
|
||||
github.com/kelseyhightower/envconfig v1.4.0
|
||||
github.com/nbd-wtf/go-nostr v0.25.7
|
||||
github.com/nbd-wtf/nostr-sdk v0.0.2
|
||||
|
16
main.go
16
main.go
@ -8,7 +8,7 @@ import (
|
||||
|
||||
"github.com/fiatjaf/eventstore/badger"
|
||||
"github.com/fiatjaf/khatru"
|
||||
"github.com/fiatjaf/khatru/plugins"
|
||||
"github.com/fiatjaf/khatru/policies"
|
||||
"github.com/kelseyhightower/envconfig"
|
||||
"github.com/nbd-wtf/go-nostr"
|
||||
"github.com/nbd-wtf/go-nostr/nip11"
|
||||
@ -63,19 +63,21 @@ func main() {
|
||||
relay.QueryEvents = append(relay.QueryEvents, db.QueryEvents)
|
||||
relay.DeleteEvent = append(relay.DeleteEvent, db.DeleteEvent)
|
||||
relay.RejectEvent = append(relay.RejectEvent,
|
||||
plugins.PreventLargeTags(64),
|
||||
plugins.PreventTooManyIndexableTags(8, []int{3, 10002}, nil),
|
||||
plugins.PreventTooManyIndexableTags(1000, nil, []int{3, 10002}),
|
||||
plugins.RestrictToSpecifiedKinds(supportedKinds...),
|
||||
policies.PreventLargeTags(100),
|
||||
policies.PreventTooManyIndexableTags(8, []int{3, 10002}, nil),
|
||||
policies.PreventTooManyIndexableTags(1000, nil, []int{3, 10002}),
|
||||
policies.RestrictToSpecifiedKinds(supportedKinds...),
|
||||
rejectEventsFromUsersNotInWhitelist,
|
||||
validateAndFilterReports,
|
||||
)
|
||||
relay.OverwriteFilter = append(relay.OverwriteFilter,
|
||||
plugins.RemoveAllButKinds(supportedKinds...),
|
||||
policies.RemoveAllButKinds(supportedKinds...),
|
||||
removeAuthorsNotWhitelisted,
|
||||
)
|
||||
relay.RejectFilter = append(relay.RejectFilter,
|
||||
plugins.NoSearchQueries,
|
||||
policies.NoSearchQueries,
|
||||
policies.NoEmptyFilters,
|
||||
policies.AntiSyncBots,
|
||||
)
|
||||
|
||||
// load users registry
|
||||
|
Loading…
x
Reference in New Issue
Block a user