diff --git a/.gitignore b/.gitignore index 0152b6e..384c679 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ __pycache__ node_modules .mypy_cache .venv +CLAUDE.md diff --git a/config.json b/config.json index 1f58e7b..3283685 100644 --- a/config.json +++ b/config.json @@ -1,8 +1,8 @@ { - "name": "Nostr Client", + "name": "Nostr Proxy", "short_description": "Nostr relay multiplexer", "version": "1.1.0", - "tile": "/nostrclient/static/images/nostr-bitcoin.png", + "tile": "/nostrclient/static/images/nostr-proxy.png", "contributors": ["calle", "motorina0", "dni"], "min_lnbits_version": "1.4.0", "images": [ diff --git a/description.md b/description.md index 5293087..413ac51 100644 --- a/description.md +++ b/description.md @@ -1,6 +1,6 @@ An always-on relay multiplexer that simplifies connecting to multiple Nostr relays. -Instead of your Nostr client managing connections to dozens of relays, you connect to a single WebSocket endpoint provided by `nostrclient`, which then fans out your requests to all configured relays and aggregates the responses back to you. +Other LNbits extensions like **Nostr Market** and **NWC Provider** use this extension to communicate on Nostr. You can also connect your own Nostr client to the WebSocket endpoint, which fans out your requests to all configured relays and aggregates the responses. - **Simplified Client Configuration** - Connect to one endpoint instead of managing multiple relay connections - **Always-On Connectivity** - Your LNbits instance maintains persistent connections to relays diff --git a/models.py b/models.py index 937c6c5..977d0e6 100644 --- a/models.py +++ b/models.py @@ -47,6 +47,7 @@ class TestMessageResponse(BaseModel): class Config(BaseModel): private_ws: bool = True public_ws: bool = False + private_ws_endpoint: str | None = None class UserConfig(BaseModel): diff --git a/static/images/generate_logo.py b/static/images/generate_logo.py new file mode 100644 index 0000000..68745e9 --- /dev/null +++ b/static/images/generate_logo.py @@ -0,0 +1,118 @@ +#!/usr/bin/env python3 +""" +Generate the Nostr Proxy logo. +Requires: pip install Pillow +""" +import math + +from PIL import Image, ImageDraw # type: ignore[import-not-found] + +# Render at 4x size for antialiasing +scale = 4 +size = 128 * scale +final_size = 128 + +dark_purple = (80, 40, 120) +light_purple = (140, 100, 180) +white = (255, 255, 255) +white_transparent = (255, 255, 255, 180) + +margin = 4 * scale + +swoosh_center = ((128 + 100) * scale, -90 * scale) +swoosh_radius = 220 * scale + +# Create circular mask +mask = Image.new("L", (size, size), 0) +mask_draw = ImageDraw.Draw(mask) +mask_draw.ellipse([margin, margin, size - margin, size - margin], fill=255) + +# Create background with swoosh +bg = Image.new("RGBA", (size, size), (0, 0, 0, 0)) +bg_draw = ImageDraw.Draw(bg) +bg_draw.ellipse([margin, margin, size - margin, size - margin], fill=dark_purple) +bg_draw.ellipse( + [ + swoosh_center[0] - swoosh_radius, + swoosh_center[1] - swoosh_radius, + swoosh_center[0] + swoosh_radius, + swoosh_center[1] + swoosh_radius, + ], + fill=light_purple, +) + +# Apply circular mask +final = Image.new("RGBA", (size, size), (0, 0, 0, 0)) +final.paste(bg, mask=mask) +draw = ImageDraw.Draw(final) + +center_x, center_y = size // 2, size // 2 +radius = 44 * scale +angles = [-35, -12, 12, 35] +relay_positions = [ + ( + center_x + radius * math.cos(math.radians(a)), + center_y + radius * math.sin(math.radians(a)), + ) + for a in angles +] + +for x, y in relay_positions: + draw.line([(center_x, center_y), (x, y)], fill=white_transparent, width=2 * scale) + +# Central circle (the multiplexer) +draw.ellipse( + [ + center_x - 14 * scale, + center_y - 14 * scale, + center_x + 14 * scale, + center_y + 14 * scale, + ], + fill=white, +) + +# Bi-directional arrow +arrow_head_size = 8 * scale +left_tip = 10 * scale # leftmost point of left arrow +right_tip = center_x - 14 * scale # rightmost point (touching circle) + +# Arrow shaft - between the two arrow heads (not extending into them) +shaft_left = left_tip + arrow_head_size +shaft_right = right_tip - arrow_head_size +draw.line( + [(shaft_left, center_y), (shaft_right, center_y)], + fill=white, + width=4 * scale, +) + +# Right-pointing arrow head (going into circle) - tip touches circle +draw.polygon( + [ + (right_tip, center_y), + (right_tip - arrow_head_size, center_y - 6 * scale), + (right_tip - arrow_head_size, center_y + 6 * scale), + ], + fill=white, +) + +# Left-pointing arrow head (coming out) - tip at left edge +draw.polygon( + [ + (left_tip, center_y), + (left_tip + arrow_head_size, center_y - 6 * scale), + (left_tip + arrow_head_size, center_y + 6 * scale), + ], + fill=white, +) + +# Draw output circles on top +for x, y in relay_positions: + draw.ellipse( + [x - 7 * scale, y - 7 * scale, x + 7 * scale, y + 7 * scale], fill=white + ) + +# Downscale with LANCZOS for antialiasing +final = final.resize((final_size, final_size), Image.LANCZOS) + +final.save("nostr-proxy.png") +print("Logo saved to nostr-proxy.png") diff --git a/static/images/nostr-proxy.png b/static/images/nostr-proxy.png new file mode 100644 index 0000000..c470619 Binary files /dev/null and b/static/images/nostr-proxy.png differ diff --git a/templates/nostrclient/index.html b/templates/nostrclient/index.html index ca44f1b..a2b141d 100644 --- a/templates/nostrclient/index.html +++ b/templates/nostrclient/index.html @@ -141,30 +141,6 @@
- This extension is a always-on nostr client that other extensions can - use to send and receive events on nostr. Add multiple nostr relays to - connect to. The extension then opens a websocket for you to use at + An always-on relay multiplexer for your LNbits instance. Other + extensions like Nostr Market and NWC Provider use this to communicate + on Nostr. You can also connect your own Nostr client to the WebSocket + endpoint below.
-
-
+ Only Admin users can manage this extension. +
++ + 💡 Have feedback or found a bug? Let us know on GitHub +
- Only Admin users can manage this extension. -