-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/optional wallet configuration #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
f7f376a1fcd0d0e11a10ed1b6577c9
merged 20 commits into
main
from
feature/optional-wallet-configuration
Jul 11, 2025
Merged
Feature/optional wallet configuration #61
f7f376a1fcd0d0e11a10ed1b6577c9
merged 20 commits into
main
from
feature/optional-wallet-configuration
Jul 11, 2025
Conversation
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
## New Features - **NIP-07 Extension Detection**: Intelligent background detection that only shows helper UI when no extension is found - **Production Build Environment Override**: Support localhost testing with production builds - **Smart Extension Checking**: Auto-detects extensions on load, graceful fallback for missing extensions ## UI Improvements - **Extension Helper Component**: Mobile-responsive guide with direct links to Chrome/Firefox stores - **Background Detection**: Login form shows immediately for users with extensions - **Improved UX**: Only users without extensions see the setup guide ## Technical Improvements - **Config Updates**: Production builds now support environment variable overrides for localhost testing - **Service Worker Management**: Disable caching on localhost to prevent build conflicts - **Better Error Handling**: Proper timeout and cleanup for extension detection ## Documentation Updates - **Production Testing Guide**: Instructions for localhost production build testing - **Environment Examples**: Clear .env.production examples for different scenarios - **Deployment Instructions**: Updated with proper serve commands ## Files Changed - Add: NostrExtensionCheck component with mobile-responsive design - Update: LoginForm with intelligent extension detection - Update: config.ts with environment override support - Update: README.md with production testing instructions - Update: Service worker disabled for localhost testing
…ctions - Add complete .env.development example with all required variables - Emphasize using start-app.sh script for Node.js compatibility - Include proper Nostr relay URLs and asset bucket configuration
- Replace hardcoded relay URLs with generic examples - Show proper comma-separated pattern without bias - Maintain neutrality in relay recommendations
## Major Architecture Change - Panel now integrates directly into relay server (port 9002) - No separate nginx proxy needed for basic deployment - Single origin serves both React app and API endpoints ## Configuration Updates - Simplified dynamic URL detection (same origin for panel + API) - Removed /front and /panel path requirements - Auto-detect WebSocket URL from current domain - Streamlined environment configuration ## Documentation Updates - Updated architecture diagrams for integrated deployment - Simplified environment configuration examples - Clarified development vs production setup - Removed complex reverse proxy requirements ## Benefits - ✅ Simplified deployment (single server) - ✅ No CORS issues (same origin) - ✅ Unified SSL certificate - ✅ Same build works everywhere
- Remove outdated /front/ location block - Keep wallet service proxying at /wallet/ - Maintain relay WebSocket as default location (/) - Panel runs integrated in relay server (port 9002) - no nginx needed
- Add /panel/ location block to proxy to relay server (port 9002) - Handle React Router SPA routing with fallback - Update production .env.production to use /panel basename - Now accessible at https://example.com/panel/ in production Production URLs: - Panel: /panel/ → port 9002 (React app + API) - Relay: / → port 9001 (WebSocket) - Wallet: /wallet/ → port 9003 (API)
- Remove URI path from proxy_pass in named locations (nginx requirement) - Simplify panel routing - Go server handles React Router internally - Update README to match working configuration - Remove complex fallback handling that caused proxy_pass syntax error The panel location now uses simple proxy_pass without URI conflicts.
Development (.env.development): - Direct service connections (ports 9001, 9002, 9003) - No base path - panel runs from root in dev mode - Remove specific relay defaults to maintain neutrality Production (.env.production): - Base path /panel to match nginx routing - Auto-detection for API URLs (same origin through nginx) - Clean configuration for deployment - Commented examples without favoring specific relays
- Remove hardcoded API URLs (now auto-detected) - Set /panel base path for nginx routing - Remove specific relay defaults to maintain neutrality - Align with current .env.production configuration - Clear comments about auto-detection features
Critical fixes based on backend dev feedback: 1. Add trailing slash to proxy_pass to strip /panel/ prefix properly 2. Add required proxy headers for proper request forwarding Before: /panel/login → http://127.0.0.1:9002/panel/login (broken) After: /panel/login → http://127.0.0.1:9002/login (correct) This fixes panel accessibility at https://domain.com/panel/
- Replace specific *.serveo.net with universal server_name _ - Now works with localhost, ngrok, serveo, custom domains, and any tunneling service - Remove service-specific limitations from configuration - Update both fixed config and README documentation
- Back to proven rewrite + break pattern that was working - Keep the added proxy headers for proper forwarding - Remove the trailing slash approach that broke functionality Working pattern: - rewrite ^/panel/(.*)$ / break strips /panel/ prefix - proxy_pass http://127.0.0.1:9002 (no trailing slash) - Restores https://afrihornet.ngrok.io/panel/ functionality
- Remove auto-detection fallback that was causing incorrect URL usage - Always require REACT_APP_WALLET_BASE_URL to be explicitly set - Prevent panel from incorrectly trying localhost:9002/wallet instead of localhost:9003 - Add clear error message when wallet URL environment variable is missing
- Include production environment configuration in repository - Ensures wallet URL is properly configured during build process - Required for automated deployment scripts that clone and build
- Remove auto-detection fallback for relay WebSocket URL - Always require REACT_APP_OWN_RELAY_URL to be explicitly set - Prevent panel from incorrectly connecting to ws://localhost:9002 instead of ws://localhost:9001 - Add clear error message when relay URL environment variable is missing - Update .env.production with correct relay URL: ws://localhost:9001
- Document direct access deployment method that actually works - Remove non-working reverse proxy configurations to prevent confusion - Clarify that service URLs (wallet/relay) require explicit configuration - Note that panel routing can be auto-detected but service URLs cannot - Add note that reverse proxy setup still needs proper configuration example TODO: Create working nginx configuration example for reverse proxy deployment
- Replace complex client-side Blossom upload with simple API call - Use POST /api/relay/icon endpoint with JWT authentication - Send panel_url (auto-detected from window.location.origin) and image file - Backend now handles Kind 117 event creation, Blossom storage, and config updates - Remove dependency on direct Blossom upload utilities - Improve error handling and user feedback
- Add kind 1060 (Double Ratchet DM - NIP-117) to selectable kinds - Add kind 1063 (File Metadata - NIP-94) to selectable kinds - Add kind 30078 (Application-specific Data - NIP-78) to selectable kinds - Update kindMapping.ts with kind 1060 description - All new kinds categorized under Basic Nostr Features - Users can now enable/disable these kinds in relay settings
- Make REACT_APP_WALLET_BASE_URL optional in config.ts - Add isWalletEnabled flag to detect wallet availability - Update SendButton and TopUpBalanceButton to show helpful messages when wallet not configured - Add support for kind 1060 (Double Ratchet DM - NIP-117), kind 1063 (File Metadata - NIP-94), and kind 30078 (Application-specific Data - NIP-78) - Simplify icon upload to use new backend API instead of client-side Blossom upload - Update .env.production to show wallet URL as optional (empty by default) - Update README documentation to reflect optional wallet configuration - Users can now deploy panel without wallet service and get clear guidance on enabling wallet features
f7f376a1fcd0d0e11a10ed1b6577c9
approved these changes
Jul 11, 2025
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 makes wallet configuration optional and adds support for new event kinds, improving deployment flexibility and expanding relay
functionality.
Key Changes
Optional Wallet Configuration
REACT_APP_WALLET_BASE_URLoptional in environment configurationisWalletEnabledflag to detect wallet availability at build timeNew Event Kind Support
Simplified Icon Upload
POST /api/relay/iconwith JWT authenticationBenefits
Improved Deployment Flexibility
Enhanced User Experience
Technical Details
Configuration Changes
REACT_APP_WALLET_BASE_URLwas required, would throw error if missingREACT_APP_WALLET_BASE_URLis optional, returnsnullwhen emptyComponent Updates
Environment File Updates
.env.production: SetREACT_APP_WALLET_BASE_URL=(empty by default)Testing Checklist
Migration Guide
For users without wallet service: