Feature/relay icon upload and dynamic urls#59
Merged
f7f376a1fcd0d0e11a10ed1b6577c9 merged 7 commits intomainfrom Jul 7, 2025
Merged
Feature/relay icon upload and dynamic urls#59f7f376a1fcd0d0e11a10ed1b6577c9 merged 7 commits intomainfrom
f7f376a1fcd0d0e11a10ed1b6577c9 merged 7 commits intomainfrom
Conversation
- Fix backend API communication for blacklist mode - In blacklist mode: selected items are blocked, backend receives inverse (allowed items) - In whitelist mode: selected items are allowed, backend receives them directly - Fix mode switching to preserve blocked items when loading from backend - Add helper functions to calculate inverse kinds for blacklist mode - Ensure core kinds are never blockable in blacklist mode - Add AddKindForm component for dynamic kind addition
- Add 10-minute caching to subscriber profile fetching to prevent backend spam - Implement LRU cache with automatic cleanup for thousands of users - Fix blacklist mode reconciliation to properly show blocked items on page refresh - Use Set-based logic for more reliable blacklist calculations - Remove App Buckets functionality from relay settings - Clean up excessive console logging
- Properly include dynamic kinds in backend whitelist calculation - Separate predefined vs dynamic kinds in reconciliation logic - Fix kind formatting in AddKindForm - Improve UI labels for better UX - Show dynamic kinds in both whitelist and blacklist modes
- Implement dual icon upload: URL input or file upload with Blossom server integration - Add IconUpload component with drag-and-drop and URL validation - Integrate NIP-98 HTTP authentication for Blossom uploads - Add Kind 117 file metadata event publishing before upload - Update RelayInfoSettings to use new IconUpload component - Add relay_icon field to both frontend and backend type definitions - Make software and version fields read-only as per requirements - Fix form value synchronization for dynamic icon loading Icon uploads now support both direct URL entry and file uploads via Blossom server with proper Nostr authentication.
Replace hardcoded environment variables with runtime URL detection using window.location.origin.
This eliminates the need for environment-specific builds and makes the panel deployable anywhere.
Key improvements:
- Panel API URLs auto-detected from current domain in production
- Wallet service URLs auto-detected from current domain in production
- Relay WebSocket URLs auto-detected from current domain in production
- One build now works on ANY domain (localhost, custom domains, ngrok tunnels)
- No more REACT_APP_BASE_URL or REACT_APP_WALLET_BASE_URL needed in production
- Simplified deployment process with minimal environment configuration
- Updated README with comprehensive deployment guidance and launch-ready improvements
Production URLs now resolve to:
- Panel API: ${window.location.origin}/panel
- Wallet API: ${window.location.origin}/wallet
- Relay WebSocket: wss://${window.location.host}
Development mode still uses localhost URLs for easy local development.
Kind 117 events are required for Blossom file uploads to work properly. Without this kind in the relay's whitelist, users cannot upload files such as relay icons, as the Kind 117 metadata events would be rejected. Changes: - Added kind117 to CORE_KINDS array (cannot be removed by users) - Added Kind 117 to noteOptions with description 'Blossom File Metadata' - Ensures file upload functionality works out of the box
f7f376a1fcd0d0e11a10ed1b6577c9
approved these changes
Jul 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements dual icon upload functionality and eliminates hardcoded URLs for true deployment portability.
Key Features
Icon Upload System
Dynamic URL Detection
window.location.originTechnical Implementation
IconUploadcomponent with tabbed interface (URL/Upload)relay_iconfield in both frontend and backend interfacesDeployment Benefits
REACT_APP_BASE_URLneeded in productionFiles Changed
src/components/common/IconUpload.tsx- Dual upload componentsrc/utils/blossomUpload.ts- Blossom integration utilitiessrc/config/config.ts- Dynamic URL detection