Allow anyone to publish NIP-46 events
Release Drafter / Update release notes draft (pull_request) Failing after 3s
Release Drafter / Update release notes draft (pull_request) Failing after 3s
This turns our relay into a public remote-sign-in relay
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
//bin/true; exec deno run --unstable-kv -A "$0" "$@"
|
||||
import {
|
||||
AntiDuplicationPolicy,
|
||||
AnyPolicy,
|
||||
FiltersPolicy,
|
||||
HellthreadPolicy,
|
||||
PipePolicy,
|
||||
readStdin,
|
||||
@@ -22,10 +24,15 @@ const ldapConfig: LdapConfig = {
|
||||
whitelistPubkeys: Deno.env.get("WHITELIST_PUBKEYS")?.split(',')
|
||||
}
|
||||
|
||||
const policy = new PipePolicy([
|
||||
new HellthreadPolicy({ limit: 10 }),
|
||||
new AntiDuplicationPolicy({ kv: await Deno.openKv(), expireIn: 60000, minLength: 50 }),
|
||||
new LdapPolicy(ldapConfig)
|
||||
const policy = new AnyPolicy([
|
||||
// Allow NIP-46 (kind 24133) ephemeral events from anyone
|
||||
new FiltersPolicy([{ kinds: [24133] }]),
|
||||
// All other events go through this pipeline
|
||||
new PipePolicy([
|
||||
new HellthreadPolicy({ limit: 10 }),
|
||||
new AntiDuplicationPolicy({ kv: await Deno.openKv(), expireIn: 60000, minLength: 50 }),
|
||||
new LdapPolicy(ldapConfig)
|
||||
])
|
||||
]);
|
||||
|
||||
await strfry(policy);
|
||||
|
||||
Reference in New Issue
Block a user