Commit ad73fe4c authored by Hendrik Garske's avatar Hendrik Garske

Fix: WG API URL auf localhost geaendert fuer gleiche CapRover App

parent 70993869
...@@ -70,17 +70,17 @@ Die Anwendung läuft jetzt auf [http://localhost:3000](http://localhost:3000) ...@@ -70,17 +70,17 @@ Die Anwendung läuft jetzt auf [http://localhost:3000](http://localhost:3000)
### Backend-Konfiguration ### Backend-Konfiguration
In CapRover muss das wg-easy Backend separat konfiguriert werden: Wenn Frontend und Backend in der **gleichen CapRover App** laufen:
1. **Backend-URL**: Setze `WG_API_URL` als Environment Variable in CapRover 1. **Backend-URL**: Standardmäßig verwendet die App `http://localhost:51821`
- Wenn Backend als CapRover Service: `http://srv-captain--wg-easy-backend:51821` - Falls das Backend als separater Container im Stack läuft, verwende den Service-Namen
- Wenn Backend extern: `http://corex-wg-easy.corexmanagement.de:51821` - In CapRover kann optional `WG_API_URL` als Environment Variable gesetzt werden
- Wenn Backend auf separater Subdomain: `https://wg-easy-api.corexmanagement.de`
2. **Backend-Passwort**: Setze `WG_PASSWORD` als Environment Variable (Standard: `CoreX2024!Secure#VPN`) 2. **Backend-Passwort**: Standard ist `CoreX2024!Secure#VPN`
- Optional: `WG_PASSWORD` als Environment Variable in CapRover setzen
**Standardwerte (wenn keine Environment Variables gesetzt):** **Standardwerte (wenn keine Environment Variables gesetzt):**
- **WG_API_URL**: `http://srv-captain--wg-easy-backend:51821` (interner CapRover Service-Name) - **WG_API_URL**: `http://localhost:51821` (für gleiche CapRover App)
- **WG_PASSWORD**: `CoreX2024!Secure#VPN` - **WG_PASSWORD**: `CoreX2024!Secure#VPN`
## 🐳 Docker Setup ## 🐳 Docker Setup
......
// WireGuard Easy API Client // WireGuard Easy API Client
// WG API URL Konfiguration // WG API URL Konfiguration
// In CapRover: Das Frontend läuft auf Port 3000, das Backend muss separat konfiguriert sein // Wenn Frontend und Backend in der gleichen CapRover App laufen:
// - Backend ist über localhost erreichbar (gleicher Container) oder
// - Backend läuft als interner Service auf Port 51821
// //
// Optionen für das Backend: // Standard: localhost:51821 (wenn beide im gleichen Container)
// 1. Backend als separater CapRover Service: Verwende den internen Service-Namen // Alternative: Wenn Backend als separater Container im Stack läuft, verwende den Service-Namen
// z.B. 'http://srv-captain--wg-easy-backend:51821' (wenn Backend als CapRover App läuft) const WG_API_URL = process.env.WG_API_URL || 'http://localhost:51821'
// 2. Backend extern auf Port: 'http://corex-wg-easy.corexmanagement.de:51821'
// 3. Backend auf separater Subdomain: 'https://wg-easy-api.corexmanagement.de'
//
// In CapRover: Setze WG_API_URL als Environment Variable für die App
const WG_API_URL = process.env.WG_API_URL || 'http://srv-captain--wg-easy-backend:51821'
const WG_PASSWORD = process.env.WG_PASSWORD || 'CoreX2024!Secure#VPN' const WG_PASSWORD = process.env.WG_PASSWORD || 'CoreX2024!Secure#VPN'
interface WgClient { interface WgClient {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment