Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@joelklabo
Copy link
Contributor

@joelklabo joelklabo commented Jan 20, 2026

Summary

Complete Nostr channel extension for clawdbot - enables sending/receiving messages via Nostr protocol with profile management.

Features

Messaging Infrastructure

  • NostrBus - Core message bus for Nostr protocol communication
  • Channel - Full channel implementation for send/receive
  • SeenTracker - Message deduplication with LRU cache
  • StateStore - Persistent state management for relay connections

Profile Management

  • PUT /api/channels/nostr/:accountId/profile - update profile
  • GET /api/channels/nostr/:accountId/profile - get current profile
  • POST /api/channels/nostr/:accountId/profile/import - import from relays
  • UI form for editing name, about, picture, banner, website

Security

  • SSRF validation blocks private IPs (127.x, 10.x, 172.16-31.x, IPv4-mapped IPv6)
  • Rate limiting (5 req/min per account)
  • Mutex to prevent concurrent publish race conditions
  • Profile import with signature verification
  • Requires https:// for all image/website URLs

Observability

  • Metrics collection for relay connections, message counts, latency
  • Integration with existing telemetry infrastructure

Files Added

  • extensions/nostr/ - Complete Nostr extension (27 files, ~5500 lines)
  • ui/src/ui/views/channels.nostr.ts - Nostr card UI
  • ui/src/ui/views/channels.nostr-profile-form.ts - Profile edit form
  • docs/channels/nostr.md - Documentation

Tests

275 passing tests including:

  • Unit tests for all components
  • Fuzz tests for profile parsing and bus reliability
  • Integration tests for relay communication

Code Review

Reviewed by Claude Opus 4.5 - fixed race condition in mutex and SSRF bypass vulnerabilities.

@joelklabo joelklabo changed the title feat(nostr): add profile management API and UI feat(nostr): add Nostr channel extension with messaging and profile management Jan 20, 2026
@steipete steipete self-assigned this Jan 20, 2026
@steipete
Copy link
Contributor

Thank you! I will unfurl this... this PR deletes a massive amount of unrelated files?

- Add Nostr profile state to channels controller and app state
- Add controller functions: startNostrProfileEdit, cancelNostrProfileEdit,
  updateNostrProfileField, saveNostrProfile, importNostrProfile
- Wire up profile form callbacks in renderChannels
- Edit Profile button now opens form and Save calls PUT /api/channels/nostr/:accountId/profile
- Import from Relays calls POST /api/channels/nostr/:accountId/profile/import
@joelklabo joelklabo force-pushed the feat/nostr-profile-management branch from 9a6808f to adfd423 Compare January 20, 2026 19:12
@steipete
Copy link
Contributor

Integrated the Nostr plugin from this PR and kept it optional/on-demand only.

What changed:

  • Nostr extension + plugin manifest + UI profile editor wired into the Control UI.
  • Onboarding install choice now defaults to local path on update.channel=dev and npm on stable/beta.
  • Docs: added/expanded /channels/nostr and listed Nostr in channels + plugin docs.
  • Changelog entry with thanks for feat(nostr): add Nostr channel extension with messaging and profile management #1323.
  • Cleanup: removed accidental extensions/nostr node_modules symlinks.

Ignored unintended deletions; only Nostr-related files were kept.

Tests: pnpm lint; pnpm build; pnpm test; pnpm docs:build.

@steipete
Copy link
Contributor

Recap of what we did:

  • Integrated the Nostr plugin (extension + manifest + UI profile editor) while ignoring unintended deletions.
  • Kept it optional/on-demand; onboarding lists optional plugins and installs on demand.
  • Install defaults now prefer local path on update.channel=dev, npm on stable/beta.
  • Docs: expanded /channels/nostr and listed Nostr in channels + plugin docs.
  • Changelog entry with thanks for feat(nostr): add Nostr channel extension with messaging and profile management #1323.
  • Cleaned stray Nostr node_modules symlinks.

Tests: pnpm lint; pnpm build; pnpm test; pnpm docs:build.

@steipete steipete closed this Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants