From 0d248ead04dbd66ab8bc6221757d59141c941b75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Fri, 7 Aug 2026 11:03:31 -0600 Subject: [PATCH] Allow anyone to publish NIP-46 events This turns our relay into a public remote-sign-in relay --- extras/strfry/strfry-policy.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/extras/strfry/strfry-policy.ts b/extras/strfry/strfry-policy.ts index 14913da..73d3fa4 100755 --- a/extras/strfry/strfry-policy.ts +++ b/extras/strfry/strfry-policy.ts @@ -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);