Implements #248. The account settings page now lets users publish their own Nostr data with their own key: their profile (kind 0, including NIP-05 and Lightning addresses), their relay list (NIP-65, kind 10002) and their media server list (Blossom, kind 10063). Edited profile fields are merged into the existing profile JSON so unknown keys survive; the configured site relay and Blossom server are pre-included in the respective lists.
Events are signed in the browser with a NIP-07 extension and published by the server. The publish endpoint verifies the event (recomputing the event id before checking the signature, since the nostr gem's verify_signature alone does not bind the signature to the body), enforces a kind allow-list plus freshness and size limits, rate-limits per user, and blocks SSRF through user-supplied relay URLs. Reads — discovering an existing profile, relay list or media server list — happen server-side, with a progressive relays → profile → blossom → render fetch chain.
The branch also includes the id-recompute verification fix, which shipped separately to master via #268, and a merge of master (0.13.0).
Known limitations are documented in docs/dev/nostr.md: relays requiring NIP-42 auth are unsupported, a new relay list is not propagated to relays removed from it, the relay URL guard has a DNS-rebinding TOCTOU gap, non-ws/wss relay URLs are rejected, and metadata discovery is sequential. The adjacent remove_nostr_pubkey TODO (deleting a pubkey without re-authentication) is left out of scope here.
Implements #248. The account settings page now lets users publish their own Nostr data with their own key: their profile (kind 0, including NIP-05 and Lightning addresses), their relay list (NIP-65, kind 10002) and their media server list (Blossom, kind 10063). Edited profile fields are merged into the existing profile JSON so unknown keys survive; the configured site relay and Blossom server are pre-included in the respective lists.
Events are signed in the browser with a NIP-07 extension and published by the server. The publish endpoint verifies the event (recomputing the event id before checking the signature, since the `nostr` gem's `verify_signature` alone does not bind the signature to the body), enforces a kind allow-list plus freshness and size limits, rate-limits per user, and blocks SSRF through user-supplied relay URLs. Reads — discovering an existing profile, relay list or media server list — happen server-side, with a progressive `relays → profile → blossom → render` fetch chain.
The branch also includes the id-recompute verification fix, which shipped separately to master via #268, and a merge of master (0.13.0).
Known limitations are documented in `docs/dev/nostr.md`: relays requiring NIP-42 auth are unsupported, a new relay list is not propagated to relays removed from it, the relay URL guard has a DNS-rebinding TOCTOU gap, non-`ws`/`wss` relay URLs are rejected, and metadata discovery is sequential. The adjacent `remove_nostr_pubkey` TODO (deleting a pubkey without re-authentication) is left out of scope here.
FetchEvent wrapped its wait in Timeout.timeout and FetchLatestEvent
wrapped the relay loop in another one. The nesting leaked
Timeout::ExitException, which is neither a Timeout::Error nor a
StandardError, so it escaped the rescue and surfaced as a 500 on the
metadata endpoint.
- FetchEvent waits on the condition variable with a 5s timeout instead
of Timeout.timeout, and wakes immediately when the relay errors
- FetchLatestEvent uses a monotonic deadline instead of Timeout.timeout,
and skips a relay that raises, so one bad relay cannot abort discovery
- PublishEvent uses thread.join(TIMEOUT) instead of Timeout.timeout
- Track EOSE with a done flag so a healthy relay with no matching
events returns immediately instead of waiting out the timeout
- Restore the ensure around the client thread cleanup
- Raise the metadata fetch client timeout to 60s to cover the
worst-case sequential discovery on the server
The profile and the media server list are published to the user's write
relays, so they should be set up after the relay list. This also makes
the page order match the discovery order (relays -> profile -> media
servers) shown while loading.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Implements #248. The account settings page now lets users publish their own Nostr data with their own key: their profile (kind 0, including NIP-05 and Lightning addresses), their relay list (NIP-65, kind 10002) and their media server list (Blossom, kind 10063). Edited profile fields are merged into the existing profile JSON so unknown keys survive; the configured site relay and Blossom server are pre-included in the respective lists.
Events are signed in the browser with a NIP-07 extension and published by the server. The publish endpoint verifies the event (recomputing the event id before checking the signature, since the
nostrgem'sverify_signaturealone does not bind the signature to the body), enforces a kind allow-list plus freshness and size limits, rate-limits per user, and blocks SSRF through user-supplied relay URLs. Reads — discovering an existing profile, relay list or media server list — happen server-side, with a progressiverelays → profile → blossom → renderfetch chain.The branch also includes the id-recompute verification fix, which shipped separately to master via #268, and a merge of master (0.13.0).
Known limitations are documented in
docs/dev/nostr.md: relays requiring NIP-42 auth are unsupported, a new relay list is not propagated to relays removed from it, the relay URL guard has a DNS-rebinding TOCTOU gap, non-ws/wssrelay URLs are rejected, and metadata discovery is sequential. The adjacentremove_nostr_pubkeyTODO (deleting a pubkey without re-authentication) is left out of scope here.1b4bca3078to0dda543b03