You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement dynamic URL detection for true deployment portability
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.
This repository is home to the hornet storage panel which is a typescript / react web application designed for managing a hornet storage nostr multimedia relay which can be found here: https://github.com/HORNET-Storage/HORNETS-Nostr-Relay
**Great news!** Thanks to dynamic URL detection, **no environment variable changes are needed** when using tunnels. The panel automatically adapts to any domain:
365
+
366
+
- ✅ `ngrok http 80` → Panel works immediately at `https://abc123.ngrok.io/front/`
367
+
- ✅ Custom domain tunnel → Panel works immediately
368
+
- ✅ Any hosting provider → Panel works immediately
369
+
370
+
**No rebuilds or environment changes required!**
311
371
312
372
## 🔧 Configuration Options
313
373
374
+
> **🚀 Major Improvement**: The panel now uses **dynamic URL detection** instead of hardcoded environment variables. This means **one build works everywhere** - no more environment-specific builds or complex URL configuration!
375
+
314
376
### REACT_APP_BASENAME
315
377
Controls where the React app is served from:
316
378
-`/front` - App accessible at `https://domain.com/front/`
317
379
-`/admin` - App accessible at `https://domain.com/admin/`
318
380
- `` (empty) - App accessible at `https://domain.com/`
319
381
320
382
### Service URLs
321
-
-**REACT_APP_BASE_URL**: Panel API endpoint
322
-
-**REACT_APP_WALLET_BASE_URL**: Wallet service endpoint
323
-
-**REACT_APP_ASSETS_BUCKET**: Static assets URL
383
+
**🎯 Auto-Detection**: Service URLs are now automatically detected in production:
**Note**: When using direct port access, each backend service must be configured to allow your frontend's origin in their CORS settings. Using a reverse proxy eliminates CORS issues entirely.
435
+
347
436
#### 4. Routing Issues with Reverse Proxy
348
437
**Error**: 404 on refresh or direct URL access
349
438
**Solution**: Configure nginx to handle React Router:
@@ -366,7 +455,7 @@ Start services in this order:
366
455
1. Relay Service (Port 9001) - Core WebSocket functionality
367
456
2. Panel API (Port 9002) - Main backend
368
457
3. Wallet Service (Port 9003) - Payment processing
369
-
4.Transcribe API (Port 8000) - Additional features
**Note**: This panel is designed to work with the [HORNETS Nostr Relay](https://github.com/HORNET-Storage/HORNETS-Nostr-Relay). Ensure you have the relay service running for full functionality.
546
+
**Note**: This panel is designed to work with the HORNETS Storage ecosystem:
547
+
-**[HORNETS Nostr Relay](https://github.com/HORNET-Storage/HORNETS-Nostr-Relay)** - Core relay service (required)
548
+
-**[Super Neutrino Wallet](https://github.com/HORNET-Storage/Super-Neutrino-Wallet)** - Payment processing (required for paid features)
549
+
-**[NestShield](https://github.com/HORNET-Storage/NestShield)** - Media moderation service (optional)
550
+
551
+
Ensure you have at minimum the relay service running for basic functionality.
0 commit comments