Make relays configurable

This commit is contained in:
Jon Staab
2025-04-03 15:35:56 -07:00
parent a3eb6d52c0
commit b6a4b38d14
3 changed files with 11 additions and 13 deletions

2
.env
View File

@@ -8,5 +8,7 @@ VITE_PLATFORM_LOGO=static/flotilla.png
VITE_PLATFORM_RELAY=
VITE_PLATFORM_ACCENT="#7161FF"
VITE_PLATFORM_DESCRIPTION="Flotilla is nostr — for communities."
VITE_INDEXER_RELAYS=wss://purplepag.es/,wss://relay.damus.io/,wss://relay.nostr.band/
VITE_SIGNER_RELAYS=wss://relay.nsec.app/,wss://bucket.coracle.social/
VITE_GLITCHTIP_API_KEY=
GLITCHTIP_AUTH_TOKEN=

View File

@@ -16,6 +16,7 @@ import {
fromPairs,
memoize,
addToMapKey,
identity,
} from "@welshman/lib"
import {
getIdFilters,
@@ -68,6 +69,8 @@ import type {Thunk, Relay} from "@welshman/app"
import type {SubscribeRequestWithHandlers} from "@welshman/net"
import {deriveEvents, deriveEventsMapped, withGetter, synced} from "@welshman/store"
export const fromCsv = (s: string) => (s || "").split(",").filter(identity)
export const ROOM = "h"
export const GENERAL = "_"
@@ -83,13 +86,9 @@ export const NOTIFIER_PUBKEY = "27b7c2ed89ef78322114225ea3ebf5f72c7767c2528d4d0c
// export const NOTIFIER_RELAY = 'wss://notifier.flotilla.social/'
export const NOTIFIER_RELAY = "ws://localhost:4738/"
export const INDEXER_RELAYS = [
"wss://purplepag.es/",
"wss://relay.damus.io/",
"wss://relay.nostr.band/",
]
export const INDEXER_RELAYS = fromCsv(import.meta.env.VITE_INDEXER_RELAYS)
export const SIGNER_RELAYS = ["wss://relay.nsec.app/", "wss://bucket.coracle.social/"]
export const SIGNER_RELAYS = fromCsv(import.meta.env.VITE_SIGNER_RELAYS)
export const PLATFORM_URL = window.location.origin

View File

@@ -6,15 +6,12 @@
import Button from "@lib/components/Button.svelte"
import CardButton from "@lib/components/CardButton.svelte"
import SpaceAdd from "@app/components/SpaceAdd.svelte"
import ChatStart from "@app/components/ChatStart.svelte"
import {pushModal} from "@app/modal"
import {makeSpacePath} from "@app/routes"
import {PLATFORM_NAME, PLATFORM_RELAY} from "@app/state"
const addSpace = () => pushModal(SpaceAdd)
const startChat = () => pushModal(ChatStart)
onMount(() => {
if (PLATFORM_RELAY) {
goto(makeSpacePath(PLATFORM_RELAY))
@@ -42,7 +39,7 @@
{/snippet}
</CardButton>
</Button>
<Link href="/people">
<Link href="/discover">
<CardButton>
{#snippet icon()}
<div><Icon icon="compass" size={7} /></div>
@@ -51,11 +48,11 @@
<div>Browse the network</div>
{/snippet}
{#snippet info()}
<div>Find your people on the nostr network.</div>
<div>Find communities on the nostr network.</div>
{/snippet}
</CardButton>
</Link>
<Button onclick={startChat}>
<Link href="/people">
<CardButton>
{#snippet icon()}
<div><Icon icon="chat-round" size={7} /></div>
@@ -67,7 +64,7 @@
<div>Use nostr's encrypted group chats to stay in touch.</div>
{/snippet}
</CardButton>
</Button>
</Link>
</div>
</div>
</div>