Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ SLACK_SIGNING_SECRET=""
MASTODON_URL="https://mastodon.social"
MASTODON_CLIENT_ID=""
MASTODON_CLIENT_SECRET=""
# These are the default values, override or extend with your own relays
NOSTR_RELAYS_OVERRIDE="wss://relay.primal.net,wss://relay.damus.io,wss://relay.snort.social,wss://nostr.wine,wss://nos.lol"

# Misc Settings
OPENAI_API_KEY=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,23 @@ import { AuthService } from '@gitroom/helpers/auth/auth.service';
// @ts-ignore
global.WebSocket = WebSocket;

const list = [
const defaultRelays: string[] = [
'wss://relay.primal.net',
'wss://relay.damus.io',
'wss://relay.snort.social',
'wss://nostr.wine',
'wss://nos.lol',
'wss://relay.primal.net',
];

const relaysOverrideEnv = process.env.NOSTR_RELAYS_OVERRIDE;
let list: string[];

if (relaysOverrideEnv) {
list = Array.from(new Set(relaysOverrideEnv.split(',').map((url: string) => url.trim()).filter((url: string) => url)));
} else {
list = Array.from(new Set<string>(defaultRelays)); // Ensure default list is also unique
}

export class NostrProvider extends SocialAbstract implements SocialProvider {
identifier = 'nostr';
name = 'Nostr';
Expand Down
Loading