Skip to content

Conversation

@Maphikza
Copy link
Member

Summary

Migrate wallet operations to use panel API proxy routes, remove legacy relay URL configuration, implement automatic default icon
management, and add support for new Nostr event kinds.

Key Changes

  • Migrate wallet operations to panel API proxy - Route all wallet operations through /api/wallet-proxy/* instead of direct wallet
    communication
  • Remove REACT_APP_WALLET_BASE_URL requirement - Eliminate wallet URL configuration, always available through API
  • Remove REACT_APP_OWN_RELAY_URL requirement - Simplify configuration by removing external relay dependencies
  • Add automatic relay icon management - Auto-sets Hornets logo with domain-aware URL detection
  • Fix TypeScript compilation errors - Add back window.nostr type definitions after NDK removal
  • Implement webpack chunk splitting - Split large JS files into <1MB chunks for better ngrok compatibility
  • Update nginx routing - Panel now serves from root path (/) with relay at /relay
  • Clean up environment files - Remove obsolete relay URL references from all .env files

Technical Details

  • Wallet proxy: All wallet operations (auth, health, transactions) now go through panel API proxy routes
  • Authentication: Improved wallet proxy authentication flow with panel JWT tokens
  • New NIPs: Added Double Ratchet DM (NIP-117), File Metadata (NIP-94), Application-specific Data (NIP-78)
  • Relay icon: Automatically updates from localhost to production domain using static file serving
  • Login: Uses window.nostr directly, profile API uses panel API
  • Webpack: Splits vendor chunks to prevent "Unexpected end of input" errors
  • Deployment: Simplified by eliminating wallet URL configuration requirements

Breaking Changes

  • Remove REACT_APP_OWN_RELAY_URL environment variable requirement
  • Remove REACT_APP_WALLET_BASE_URL environment variable requirement
  • Change nginx routing structure (panel at /, relay at /relay)
  • Wallet operations now use /api/wallet-proxy/* endpoints instead of direct wallet URLs

Maphikza added 16 commits July 12, 2025 20:59
  - Route all wallet operations through /api/wallet-proxy/* instead of direct wallet communication
  - Remove REACT_APP_WALLET_BASE_URL requirement from configuration
  - Update authentication, health checks, transaction size calculation, and transaction creation endpoints
  - Simplify deployment by eliminating wallet URL configuration
  - Maintain same request/response formats for seamless backend integration
  - Remove conditional wallet availability checks since wallet is always available through API
  - Update documentation to reflect simplified configuration requirements
  - Add panel JWT token authentication to all wallet proxy requests
  - Fix 401 errors by using readToken() to get panel authentication
  - Update challenge, verify, health check, and transaction endpoints
  - Ensure proper authentication flow: panel login -> wallet operations
  - Prevent circular dependency in authentication process
  - Remove panel JWT requirement from /challenge and /verify endpoints
  - These endpoints are publicly accessible as part of wallet auth flow
  - Keep panel JWT authentication for protected endpoints (health, tx-size, transaction)
  - Resolve 401 errors on wallet authentication initiation
…management

- Remove REACT_APP_OWN_RELAY_URL requirement from config and environment
- Simplify NDK configuration to use default relay URLs only
- Add automatic relay icon management with domain-aware default logo
- Relay icon now defaults to logo-dark-192.png served from current domain
- Auto-updates icon URL when domain changes (localhost to production)
- Remove obsolete blossomUpload.ts (replaced by panel API)
- Update documentation to reflect simplified configuration
- Add profile API system with caching and default profile pictures
- Clean up unused relay URL references across codebase
- Move isValidUrl and isImageUrl functions from deleted blossomUpload.ts to utils.ts
- Update IconUpload component to import from utils instead of blossomUpload
- Resolves compile error about missing blossomUpload module
- Add console logs to track when relay icon should be auto-updated
- Debug why empty relayicon field is not triggering backend update
- Logs will show settings state, expected icon URL, and update flow
- Replace direct URL setting with automatic upload via /api/relay/icon endpoint
- Automatically upload default bee logo when relayicon field is empty
- Detect domain changes (localhost to production) and re-upload icon
- Remove infinite loop caused by backend not persisting URL strings
- Add proper error handling and user feedback messages
- Use existing panel API infrastructure for consistent behavior
- Remove NDK initialization since login uses window.nostr directly
- Remove external relay URLs (relay.damus.io, relay.snort.social, etc.)
- Profile API uses panel API instead of direct relay connections
- Eliminates WebSocket connection errors to external relays
- Simplifies app startup and reduces external dependencies
- All Nostr operations now go through panel API or browser extension
- Add formatDate function to handle 0001-01-01T00:00:00Z (Go zero time)
- Display 'Not available' for zero time values instead of raw timestamp
- Format valid dates as readable format (e.g., 'January 15, 2024')
- Update subscription status logic to ignore zero time values
- Prevents confusing display of ancient dates from backend
- Add back global Window interface declaration for nostr property
- Defines window.nostr as optional NostrProvider type
- Fixes TypeScript compilation error in LoginForm and other components
- Required after removing NDK which previously provided these types
- Remove REACT_APP_OWN_RELAY_URL from .env.production, .env.development, and .env.production.example
- Remove REACT_APP_NOSTR_RELAY_URLS references from all environment files
- Update comments to reflect that Nostr operations now use panel API
- Simplifies environment configuration after removing direct relay connections
- Remove REACT_APP_NOSTR_RELAY_URLS from development and production examples
- Update configuration comments to reflect panel API usage
- Remove relay URLs from manual override section
- Complete cleanup of obsolete relay configuration documentation
- Change routing: root (/) now serves panel service (port 9002)
- Move relay service to /relay path (port 9001)
- Keep wallet service at /wallet path (port 9003)
- Maintain WebSocket support for relay service at new path
- Panel (frontend + API) is now the main entry point for the domain
- Configure webpack to split chunks with 1MB max size limit
- Separate vendor chunks from node_modules for better caching
- Create common chunks for code shared across modules
- Prevents large JavaScript files that cause truncation through ngrok
- Improves reliability of asset delivery through tunnels
- Resolves 'Unexpected end of input' JavaScript errors
- Replace Blossom upload with direct static file URL (/{origin}/logo-dark-192.png)
- Remove complex upload logic that was causing 500 errors
- Auto-detect domain changes (localhost to production) and update icon URL
- Simplify icon management - no server-side upload needed for default icon
- Fix malformed Blossom URLs that were causing ERR_NAME_NOT_RESOLVED
- Users can still upload custom icons via IconUpload component if needed
Maphikza added 2 commits July 16, 2025 11:43
…aths

- Update nginx configuration to use regex matching for relay location
- Add rewrite rule to strip /relay prefix before forwarding to relay service
- Handle WebSocket connections for both URL formats that clients might use
- Update README with complete working nginx configuration example
- Update fixed_nginx_config.conf with tested configuration for reference
  - Replace existing logo-dark-192.png and logo-dark-512.png with new design
  - Update both public and src/assets folders with new logo files
  - Maintain consistent branding across panel interface
@f7f376a1fcd0d0e11a10ed1b6577c9 f7f376a1fcd0d0e11a10ed1b6577c9 merged commit dd81811 into main Jul 17, 2025
2 checks passed
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.

3 participants