mirror of
https://github.com/github-tijlxyz/khatru-pyramid.git
synced 2025-06-06 18:31:02 +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 (
|
require (
|
||||||
github.com/fiatjaf/eventstore v0.2.9
|
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/kelseyhightower/envconfig v1.4.0
|
||||||
github.com/nbd-wtf/go-nostr v0.25.7
|
github.com/nbd-wtf/go-nostr v0.25.7
|
||||||
github.com/nbd-wtf/nostr-sdk v0.0.2
|
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/eventstore/badger"
|
||||||
"github.com/fiatjaf/khatru"
|
"github.com/fiatjaf/khatru"
|
||||||
"github.com/fiatjaf/khatru/plugins"
|
"github.com/fiatjaf/khatru/policies"
|
||||||
"github.com/kelseyhightower/envconfig"
|
"github.com/kelseyhightower/envconfig"
|
||||||
"github.com/nbd-wtf/go-nostr"
|
"github.com/nbd-wtf/go-nostr"
|
||||||
"github.com/nbd-wtf/go-nostr/nip11"
|
"github.com/nbd-wtf/go-nostr/nip11"
|
||||||
@ -63,19 +63,21 @@ func main() {
|
|||||||
relay.QueryEvents = append(relay.QueryEvents, db.QueryEvents)
|
relay.QueryEvents = append(relay.QueryEvents, db.QueryEvents)
|
||||||
relay.DeleteEvent = append(relay.DeleteEvent, db.DeleteEvent)
|
relay.DeleteEvent = append(relay.DeleteEvent, db.DeleteEvent)
|
||||||
relay.RejectEvent = append(relay.RejectEvent,
|
relay.RejectEvent = append(relay.RejectEvent,
|
||||||
plugins.PreventLargeTags(64),
|
policies.PreventLargeTags(100),
|
||||||
plugins.PreventTooManyIndexableTags(8, []int{3, 10002}, nil),
|
policies.PreventTooManyIndexableTags(8, []int{3, 10002}, nil),
|
||||||
plugins.PreventTooManyIndexableTags(1000, nil, []int{3, 10002}),
|
policies.PreventTooManyIndexableTags(1000, nil, []int{3, 10002}),
|
||||||
plugins.RestrictToSpecifiedKinds(supportedKinds...),
|
policies.RestrictToSpecifiedKinds(supportedKinds...),
|
||||||
rejectEventsFromUsersNotInWhitelist,
|
rejectEventsFromUsersNotInWhitelist,
|
||||||
validateAndFilterReports,
|
validateAndFilterReports,
|
||||||
)
|
)
|
||||||
relay.OverwriteFilter = append(relay.OverwriteFilter,
|
relay.OverwriteFilter = append(relay.OverwriteFilter,
|
||||||
plugins.RemoveAllButKinds(supportedKinds...),
|
policies.RemoveAllButKinds(supportedKinds...),
|
||||||
removeAuthorsNotWhitelisted,
|
removeAuthorsNotWhitelisted,
|
||||||
)
|
)
|
||||||
relay.RejectFilter = append(relay.RejectFilter,
|
relay.RejectFilter = append(relay.RejectFilter,
|
||||||
plugins.NoSearchQueries,
|
policies.NoSearchQueries,
|
||||||
|
policies.NoEmptyFilters,
|
||||||
|
policies.AntiSyncBots,
|
||||||
)
|
)
|
||||||
|
|
||||||
// load users registry
|
// load users registry
|
||||||
|
Loading…
x
Reference in New Issue
Block a user