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" "$@"
|
//bin/true; exec deno run --unstable-kv -A "$0" "$@"
|
||||||
import {
|
import {
|
||||||
AntiDuplicationPolicy,
|
AntiDuplicationPolicy,
|
||||||
|
AnyPolicy,
|
||||||
|
FiltersPolicy,
|
||||||
HellthreadPolicy,
|
HellthreadPolicy,
|
||||||
PipePolicy,
|
PipePolicy,
|
||||||
readStdin,
|
readStdin,
|
||||||
@@ -22,10 +24,15 @@ const ldapConfig: LdapConfig = {
|
|||||||
whitelistPubkeys: Deno.env.get("WHITELIST_PUBKEYS")?.split(',')
|
whitelistPubkeys: Deno.env.get("WHITELIST_PUBKEYS")?.split(',')
|
||||||
}
|
}
|
||||||
|
|
||||||
const policy = new PipePolicy([
|
const policy = new AnyPolicy([
|
||||||
new HellthreadPolicy({ limit: 10 }),
|
// Allow NIP-46 (kind 24133) ephemeral events from anyone
|
||||||
new AntiDuplicationPolicy({ kv: await Deno.openKv(), expireIn: 60000, minLength: 50 }),
|
new FiltersPolicy([{ kinds: [24133] }]),
|
||||||
new LdapPolicy(ldapConfig)
|
// 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);
|
await strfry(policy);
|
||||||
|
|||||||
Reference in New Issue
Block a user