release: interne IPs durch .env-Platzhalter ersetzt
- frontend/src/config.js liest jetzt aus VITE_BACKEND_HOST / VITE_BACKEND_PORT / VITE_API_KEY - frontend/.env.example hinzugefuegt (Vorlage fuer eigene Konfiguration) - frontend/src/config.example.js auf .env-Ansatz aktualisiert - frontend/.env zu .gitignore hinzugefuegt - dist/ war bereits ignoriert (Build-Artefakt mit internen IPs) - backend/main.go: localIPs() ermittelt IPs dynamisch, keine Hardcodierung - Alle internen IPs (192.168.x.x, 10.172.x.x) nur in ignorierten Dateien
This commit is contained in:
parent
ebd3aecdb5
commit
9035da89ce
4
.gitignore
vendored
4
.gitignore
vendored
@ -38,6 +38,10 @@ frontend/dist/
|
|||||||
frontend/src/config.js
|
frontend/src/config.js
|
||||||
!frontend/src/config.example.js
|
!frontend/src/config.example.js
|
||||||
|
|
||||||
|
# .env hat echte Credentials — nie einchecken
|
||||||
|
frontend/.env
|
||||||
|
!frontend/.env.example
|
||||||
|
|
||||||
# ========================
|
# ========================
|
||||||
# OS / Editor
|
# OS / Editor
|
||||||
# ========================
|
# ========================
|
||||||
|
|||||||
11
frontend/.env.example
Normal file
11
frontend/.env.example
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# RMM Frontend Konfiguration
|
||||||
|
# Kopiere diese Datei nach .env und trage deine Werte ein
|
||||||
|
|
||||||
|
# IP/Hostname des RMM Backends (ohne https://, ohne Port)
|
||||||
|
VITE_BACKEND_HOST=your-backend-host
|
||||||
|
|
||||||
|
# Port des RMM Backends
|
||||||
|
VITE_BACKEND_PORT=8443
|
||||||
|
|
||||||
|
# API-Key fuer den Frontend-Zugriff (aus den Backend-Einstellungen)
|
||||||
|
VITE_API_KEY=your-api-key-here
|
||||||
@ -1,6 +1,8 @@
|
|||||||
// Frontend-Konfiguration — VOR dem Build anpassen, dann als config.js speichern
|
// Frontend-Konfiguration — wird automatisch aus .env gelesen
|
||||||
// config.js ist in .gitignore und wird NICHT eingecheckt
|
// Kopiere frontend/.env.example → frontend/.env und trage deine Werte ein
|
||||||
|
// config.js und .env sind in .gitignore und werden NICHT eingecheckt
|
||||||
|
|
||||||
export const BACKEND_HOST = 'BACKEND_IP_ODER_HOSTNAME'
|
export const BACKEND_HOST = import.meta.env.VITE_BACKEND_HOST || 'localhost'
|
||||||
export const BACKEND_URL = `https://${BACKEND_HOST}:8443`
|
export const BACKEND_PORT = import.meta.env.VITE_BACKEND_PORT || '8443'
|
||||||
export const API_KEY = 'DEIN_API_KEY'
|
export const BACKEND_URL = `https://${BACKEND_HOST}:${BACKEND_PORT}`
|
||||||
|
export const API_KEY = import.meta.env.VITE_API_KEY || ''
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user