Add NIP-46 remote signer support #275

Merged
raucao merged 45 commits from feature/nostr-remote_signing into master 2026-11-28 17:22:22 +00:00
45 Commits
Author SHA1 Message Date
raucao a350c52026 Explain the recommended media server list when setting one up
CI / Test (pull_request) Successful in 1m19s
Release Drafter / Update release notes draft (pull_request) Successful in 2s
Show a short hint above the media server list on first-time setup, mirroring the relay list hint.
2026-11-28 15:25:04 +04:00
raucao d288a69d5e Badge every auto-added relay and the auto-added display name
CI / Test (pull_request) Successful in 1m18s
When no relay list exists, all recommended relays are now marked as added, not just the site relay, with a short note explaining the default list. The profile editor likewise marks the display name as added when it is filled in from the account display name.
2026-11-28 15:14:38 +04:00
raucao c1838d1b9f Animate the Nostr metadata loading state with a relay constellation
CI / Test (pull_request) Successful in 1m19s
Replace the empty placeholder in the Nostr settings loading state with the relay constellation illustration, cropped to trim its own top/bottom whitespace.
2026-11-28 14:46:45 +04:00
raucao 70faa4f329 Update the signer section in place instead of reloading the page
Disconnecting, cancelling and (when a key already exists) connecting now swap the Nostr Connect section via Turbo Streams, so the page's relay/profile/media lookups are not re-fetched. A replace still reloads because it changes the key, and a first-time connect reloads to reveal the pubkey and metadata.
2026-11-28 13:42:38 +04:00
raucao 6a14da2400 Center the Remove label in the pubkey settings button
CI / Test (pull_request) Successful in 1m17s
The button stretches to the input's height in the flex row, which left its label sitting high; center it vertically.
2026-11-28 12:55:26 +04:00
raucao af70167ced Move the bunker option into the connect modal
CI / Test (pull_request) Successful in 1m21s
Show the bunker URI field in the remote signer connect modal instead of the settings page, and drop its waiting-for-signer placeholder text to keep the modal compact.
2026-11-28 12:29:24 +04:00
raucao d2d3b1c54d Offer the browser extension and signer app side by side when connecting a key
Replace the hidden 'No browser extension found' alert with a 50:50 two-column chooser on the Nostr settings page: the browser extension option (same copy as the login modal, enabled and swapped in when a NIP-07 extension is detected) next to Nostr Connect.
2026-11-28 12:09:27 +04:00
raucao 46409de526 Collapse the Nostr Connect section when the account has a key
On the Nostr settings page, fold the Nostr Connect section into a closed details/summary, marked with a green dot while a signer is connected. Without a linked key the section stays expanded so connecting stays prominent.
2026-11-28 11:37:49 +04:00
raucao 0364646d48 Show the browser extension login option disabled instead of hidden
CI / Test (pull_request) Successful in 1m51s
When no NIP-07 extension is detected, keep the option visible, greyed out and disabled, and let its description explain why. Drop the private-key line from the modal and say that Nostr login needs a key already linked to the account.
2026-11-27 20:02:37 +04:00
raucao e099d4c589 Polish the Nostr login options copy and spacing
Give each option's description a clearer gap from its title, and describe the Nostr Connect option as using a mobile or desktop signer app like Amber or Regent.
2026-11-27 18:51:47 +04:00
raucao 92b918a6b0 Fix browser extension login after the login chooser refactor
The nostr-login controller still referenced a loginButton target that was dropped when the login options moved into a modal, so connect() and login() raised "Missing target element" and the extension login did nothing. Target the extension option button instead, and cover the wiring with a component spec.
2026-11-27 18:25:24 +04:00
raucao d64b808b87 Remove Damus relay from defaults
Too unreliable
2026-11-27 18:06:12 +04:00
raucao 612d275b58 Scale nostr_connect workers and isolate nostr_rpc from listeners
NostrConnectListenerJob holds a worker thread for up to CONNECT_TTL (5 min)
waiting on relay websockets, and it shared one 4-thread worker group with
NostrSignEventJob/NostrLogoutJob (nostr_rpc). A handful of concurrent signer
logins could therefore starve signing behind the listeners.

Split the two queues into separate worker groups and make their thread counts
env-tunable (NOSTR_CONNECT_THREADS, default 24; NOSTR_RPC_THREADS, default 4).
The listeners are IO-blocked (async fibers, GVL-free waits), so threads rather
than processes are the cheap way to add capacity.

Production must size DB_POOL to at least NOSTR_CONNECT_THREADS, since each
worker thread holds a database connection for the duration of its job.
2026-11-27 17:06:03 +04:00
raucao d67e6e90dd Never silently change or orphan the account's Nostr key
Connecting a remote signer while a different account key already exists now asks for explicit confirmation instead of overwriting it, and every key change goes through a single LdapManager::SetNostrKey seam so step-up auth can be added in one place later. Removing the account key also disconnects the remote signer, since a signer session is bound to that key; disconnecting a signer still leaves the key intact.
2026-11-27 16:07:32 +04:00
raucao b57e253b72 Keep Nostr Connect listeners alive only while polling
Stop abandoned listeners after 60s without polling, re-enqueue from status polls with a throttle, and add a Start over action for stuck sessions.
2026-11-27 16:07:32 +04:00
raucao 5655390507 Add the Nostr login chooser modal 2026-11-27 16:07:32 +04:00
raucao b82682f2a6 Hide media server settings when no Blossom server is configured 2026-11-27 16:07:32 +04:00
raucao c43e26e035 Make the profile editor banner shorter on desktop 2026-11-27 16:07:32 +04:00
raucao 605ec24cfd Harden the continue-as reauth flow against stale sessions 2026-11-27 16:07:32 +04:00
raucao dc8c184656 Improve the mobile signer connect experience 2026-11-27 16:07:32 +04:00
raucao c1c02f9725 Add an Open with signer app option to the connect dialogs 2026-11-27 16:07:32 +04:00
raucao b419f9de09 Narrow the profile editor modal and use a responsive banner ratio 2026-11-27 16:07:32 +04:00
raucao a0efd34a69 Match the remote signer login screen to the app's normal typography 2026-11-27 16:07:32 +04:00
raucao 39fd823003 Send app name, URL, and icon in NIP-46 client metadata 2026-11-27 16:07:32 +04:00
raucao 8aa302da03 Give the remembered signer login its own screen 2026-11-27 16:07:32 +04:00
raucao 218267a04a Refine the connected remote signer status layout 2026-11-27 16:07:32 +04:00
raucao 3cb54f971f Fix retry visibility and expiry timing in the remote signer modal 2026-11-27 16:07:32 +04:00
raucao f62a95a1f4 Polish the remote signer connection modal 2026-11-27 16:07:32 +04:00
raucao ddd8d2136d Open remote signer connections in a settings modal 2026-11-27 16:07:32 +04:00
raucao fffd13b814 Fix remote signer QR sizing and expiry UI 2026-11-27 16:07:32 +04:00
raucao b8256ec388 Prevent queue buildup and expire abandoned NIP-46 listeners 2026-11-27 16:07:32 +04:00
raucao f0a06ce5e0 Remember NIP-46 connections automatically 2026-11-27 16:07:32 +04:00
raucao fab20954b6 Harden continue-as token rotation and logout revocation 2026-11-27 16:07:32 +04:00
raucao aea75c97ed Add continue-as flow for remembered NIP-46 sessions 2026-11-27 16:07:32 +04:00
raucao f136d8d8b1 Support disconnecting NIP-46 sessions with logout 2026-11-27 16:07:32 +04:00
raucao 0fa9f1d4c7 Add remember tokens and reauth state to Nostr signer records 2026-11-27 16:07:32 +04:00
raucao b873841644 Localize the remote signer connection timestamp 2026-11-27 16:07:32 +04:00
raucao d1b9e68da1 Drop duplicate pubkey from remote signer status 2026-11-27 16:07:32 +04:00
raucao 9789e77f27 Prefer the remote signer over a browser extension 2026-11-27 16:07:32 +04:00
raucao 885f05fc87 Fall back to server-side signing when no extension is available 2026-11-27 16:07:32 +04:00
raucao 961e6d8597 Add remote signer connect and login UI 2026-11-27 16:07:32 +04:00
raucao 0f9f18343e Add NIP-46 remote signer services and jobs 2026-11-27 16:07:32 +04:00
raucao fd0f3d5850 Add models for NIP-46 signer sessions and signing requests 2026-11-27 16:07:32 +04:00
raucao 05b1d950dd Add async relay transport for Nostr WebSockets 2026-11-27 16:07:32 +04:00
raucao 4a28731df9 Add NIP-44 v2 encryption for remote signing 2026-11-27 16:07:32 +04:00