basic nip86 implmentation
This commit is contained in:
parent
22a4fe069f
commit
df94aed0d0
6 changed files with 370 additions and 56 deletions
25
index.ts
25
index.ts
|
@ -1,8 +1,21 @@
|
|||
import { main } from "./src/main.ts";
|
||||
import { main, type RelayConfig } from "./src/main.ts";
|
||||
|
||||
let allowUnauthedPublish = Boolean(process.env.ALLOW_UNAUTHED_PUBLISH) || false;
|
||||
let relay = process.env.RELAY_URL ?? Bun.argv[Bun.argv.length - 1];
|
||||
if (!relay?.startsWith("wss://") && !relay?.startsWith("ws://"))
|
||||
relay = "wss://relay.arx-ccn.com";
|
||||
let config: RelayConfig = {
|
||||
allowUnauthedPublish: Boolean(process.env.ALLOW_UNAUTHED_PUBLISH) || false,
|
||||
relay: process.env.RELAY_URL!,
|
||||
name: process.env.RELAY_NAME,
|
||||
description: process.env.RELAY_DESCRIPTION,
|
||||
banner: process.env.RELAY_BANNER,
|
||||
icon: process.env.RELAY_ICON,
|
||||
contact: process.env.RELAY_CONTACT,
|
||||
policy: process.env.RELAY_POLICY,
|
||||
adminPubkey: process.env.ADMIN_PUBKEY,
|
||||
};
|
||||
|
||||
main(relay, allowUnauthedPublish)
|
||||
if (
|
||||
!config.relay ||
|
||||
(!config.relay?.startsWith("wss://") && !config.relay?.startsWith("ws://"))
|
||||
)
|
||||
config.relay = "wss://relay.arx-ccn.com";
|
||||
|
||||
main(config);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue