release: alle hardcodierten IPs entfernt, Konfiguration via Env-Variablen und Auto-Discovery

This commit is contained in:
cynfo3000
2026-03-07 14:31:24 +01:00
parent c76868e806
commit 5fc46a8148
8 changed files with 57 additions and 22 deletions
+1 -1
View File
@@ -291,7 +291,7 @@ Siehe [FIRMWARE.md](FIRMWARE.md) fuer Details.
# Peer anlegen
curl -sk -H "X-API-Key: YOUR_API_KEY" -X POST \
https://your-backend:8443/api/v1/agents/6beb8dfd38ecf03eab6c0f21b4ac7bee/wireguard/peers \
-d '{"name":"VPN_MUELLER","allowed_ips":"0.0.0.0/0","dns":"10.172.100.210"}'
-d '{"name":"VPN_MUELLER","allowed_ips":"0.0.0.0/0","dns":"<DNS-SERVER>"}'
# Peer mit eigenem Endpoint
curl -sk -H "X-API-Key: YOUR_API_KEY" -X POST \
+1 -1
View File
@@ -620,7 +620,7 @@ Peer-Anlage: Keypair generiert auf Firewall, naechste freie IP automatisch, Endp
# Peer anlegen
curl -sk -H "X-API-Key: YOUR_API_KEY" -X POST \
https://your-backend:8443/api/v1/agents/6beb8dfd38ecf03eab6c0f21b4ac7bee/wireguard/peers \
-d '{"name":"VPN_MUELLER","allowed_ips":"0.0.0.0/0","dns":"10.172.100.210"}'
-d '{"name":"VPN_MUELLER","allowed_ips":"0.0.0.0/0","dns":"<DNS-SERVER>"}'
# Alle Peers
curl -sk -H "X-API-Key: YOUR_API_KEY" \
+5 -5
View File
@@ -51,7 +51,7 @@ Dann `config.js` anpassen:
```js
// frontend/src/config.js
export const BACKEND_HOST = '192.168.85.13' // IP des Backend-Servers (für direkte Links, z.B. Tunnel-Ports)
export const BACKEND_HOST = '<BACKEND-IP>' // IP des Backend-Servers (für direkte Links, z.B. Tunnel-Ports)
export const BACKEND_URL = `https://${BACKEND_HOST}:8443`
export const API_KEY = 'DEIN_API_KEY' // aus backend/config.yaml → api_keys[0]
```
@@ -66,7 +66,7 @@ Für die **lokale Entwicklung** (`npm run dev`) muss zusätzlich `vite.config.js
// vite.config.js → server.proxy
proxy: {
'/api': {
target: 'https://192.168.85.13:8443', // Backend-IP anpassen
target: 'https://<BACKEND-IP>:8443', // Backend-IP anpassen
changeOrigin: true,
secure: false,
ws: true, // WebSocket-Proxy aktivieren (Web Terminal, Agent-WS)
@@ -127,7 +127,7 @@ server {
location /api/ {
client_max_body_size 50m;
proxy_pass https://192.168.85.13:8443;
proxy_pass https://<BACKEND-IP>:8443;
proxy_ssl_verify off;
proxy_set_header Host $host;
@@ -166,7 +166,7 @@ rm -f /etc/nginx/sites-enabled/default
nginx -t && systemctl reload nginx
```
> **Backend-IP anpassen:** `192.168.85.13:8443` durch die tatsächliche Backend-Adresse ersetzen.
> **Backend-IP anpassen:** `<BACKEND-IP>:8443` durch die tatsächliche Backend-Adresse ersetzen.
---
@@ -228,7 +228,7 @@ API-Calls werden per Proxy an das Backend weitergeleitet — `vite.config.js` an
// vite.config.js
proxy: {
'/api': {
target: 'https://192.168.85.13:8443', // Backend-IP anpassen
target: 'https://<BACKEND-IP>:8443', // Backend-IP anpassen
changeOrigin: true,
secure: false,
ws: true, // WebSocket-Proxy (Web Terminal, Agent-WS)