desktop: use the Android app's default relays

DesktopSettings.defaultRelays was an ad-hoc list (oxtr.dev, theforest,
relay.primal.net); mirror the Android app's defaultAppRelays instead
(auth.nostr1.com, bucket.coracle.social, nrs.primal.net,
relay.nip46.com, same order) so both signers talk to the same relays
out of the box. Everything on the desktop side already reads the
setting through AmberDesktop.defaultRelays(), so the single default
covers the bunker connection, request routing, connect-response relay
hints and the add-application screen. Fresh installs get the new set;
saved settings.json files keep their relays.

defaultRelaysMatchTheAndroidApp pins the list so the two apps cannot
drift silently.
This commit is contained in:
greenart7c3
2026-09-28 13:58:50 -03:00
parent f31fbe2013
commit 3d3c1b8338
2 changed files with 20 additions and 3 deletions
@@ -166,10 +166,12 @@ data class LogRecord(
)
data class DesktopSettings(
/** Mirrors the Android app's `defaultAppRelays` (see AmberSettings.kt). */
val defaultRelays: List<String> = listOf(
"wss://nostr.oxtr.dev/",
"wss://theforest.nostr1.com/",
"wss://relay.primal.net/",
"wss://auth.nostr1.com/",
"wss://bucket.coracle.social/",
"wss://nrs.primal.net/",
"wss://relay.nip46.com/",
),
val currentAccount: String = "",
val darkTheme: Boolean? = null,
@@ -51,6 +51,21 @@ class DesktopCoreTest {
assertEquals(60, DesktopSettings().autoLockMinutes)
}
@Test
fun defaultRelaysMatchTheAndroidApp() {
// Keep in sync with `defaultAppRelays` in the Android AmberSettings.kt.
assertEquals(
listOf(
"wss://auth.nostr1.com/",
"wss://bucket.coracle.social/",
"wss://nrs.primal.net/",
"wss://relay.nip46.com/",
),
DesktopSettings().defaultRelays,
)
assertEquals(4, DesktopSettings().normalizedDefaultRelays().size)
}
@Test
fun parsesHexAndNsecKeys() {
val hex = generateBunkerPrivKey()