From b0ef76baf051456ce462a3d48c19bae61c245e6f Mon Sep 17 00:00:00 2001 From: Danny Morabito Date: Tue, 5 Aug 2025 23:56:26 +0200 Subject: [PATCH 1/2] fix issue when pubkeys file doesn't exist --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 017cd92..58d89e3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -23,7 +23,7 @@ async function validateAuthEvent(event: Event, challenge: string): boolean { const challengeTag = event.tags.find(tag => tag[0] === 'challange')?.[1]; if (challengeTag !== challenge) return false; const file = Bun.file("./allowed-pubkeys.json"); - if (!file.exists()) return true; + if (!await file.exists()) return true; const allowedPubkeys = JSON.parse(await file.text()); if (!allowedPubkeys.includes(event.pubkey)) return false; return true; From a8fd9eb96bd7cb29d4db2d248e55f86b618f4ac7 Mon Sep 17 00:00:00 2001 From: Danny Morabito Date: Wed, 6 Aug 2025 00:16:35 +0200 Subject: [PATCH 2/2] allow non https relays --- index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ts b/index.ts index c00edb7..2e9d445 100644 --- a/index.ts +++ b/index.ts @@ -1,7 +1,7 @@ import { main } from "./src/main.ts"; let relay = process.env.RELAY_URL ?? Bun.argv[Bun.argv.length - 1]; -if (!relay?.startsWith("wss://")) +if (!relay?.startsWith("wss://") && !relay?.startsWith("ws://")) relay = "wss://relay.arx-ccn.com"; main(relay)