Security: remove hardcoded credentials, use placeholders and config
This commit is contained in:
@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react'
|
||||
import api from '../api/client'
|
||||
import StatusBadge from './StatusBadge'
|
||||
import { copyToClipboard } from '../utils/clipboard'
|
||||
import { BACKEND_HOST } from '../config'
|
||||
import {
|
||||
X, Cpu, MemoryStick, HardDrive, Clock, Network, Shield, Route,
|
||||
Globe, Key, Download, Terminal, Wifi, Search, Plus, Trash2, Copy, Check, ExternalLink, Unplug, Plug, MonitorSmartphone,
|
||||
@@ -568,7 +569,7 @@ function TunnelTab({ agentId, agent }) {
|
||||
const [error, setError] = useState('')
|
||||
const [sshCopied, setSshCopied] = useState(null)
|
||||
|
||||
const backendHost = '192.168.85.13'
|
||||
const backendHost = BACKEND_HOST
|
||||
|
||||
const loadTunnels = () => {
|
||||
api.getTunnels(agentId)
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import { useState } from 'react'
|
||||
import { Copy, Check, Terminal, Monitor } from 'lucide-react'
|
||||
import { copyToClipboard } from '../utils/clipboard'
|
||||
|
||||
const BACKEND_URL = 'https://dsbmueller.spdns.org:8443'
|
||||
const API_KEY = '01532e5a7c9e70bf2757df77a2f5b9b9'
|
||||
import { BACKEND_URL, API_KEY } from '../config'
|
||||
|
||||
export default function InstallGuide({ agentName, platform: initialPlatform }) {
|
||||
const [platform, setPlatform] = useState(initialPlatform || 'freebsd')
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import api from '../api/client'
|
||||
import { BACKEND_HOST } from '../config'
|
||||
import StatusBadge from './StatusBadge'
|
||||
import {
|
||||
X, Cpu, MemoryStick, HardDrive, Clock, Network, Server, Monitor,
|
||||
@@ -673,7 +674,7 @@ function TunnelTab({ agentId, agent, webguiPort = 8006 }) {
|
||||
const [customPort, setCustomPort] = useState('')
|
||||
const [error, setError] = useState('')
|
||||
|
||||
const backendHost = '192.168.85.13'
|
||||
const backendHost = BACKEND_HOST
|
||||
|
||||
const loadTunnels = () => {
|
||||
api.getTunnels(agentId)
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// Frontend-Konfiguration — bei Deployment anpassen
|
||||
export const BACKEND_HOST = 'your-backend.example.com'
|
||||
export const BACKEND_URL = `https://${BACKEND_HOST}:8443`
|
||||
export const API_KEY = 'YOUR_API_KEY'
|
||||
@@ -9,7 +9,7 @@ const PLATFORMS = [
|
||||
{ id: 'windows', label: 'Windows', icon: Cpu },
|
||||
]
|
||||
|
||||
const BACKEND_URL = 'https://dsbmueller.spdns.org:8443'
|
||||
import { BACKEND_URL } from '../config'
|
||||
|
||||
export default function Firmware() {
|
||||
const [firmwareData, setFirmwareData] = useState(null)
|
||||
@@ -243,10 +243,10 @@ export default function Firmware() {
|
||||
{installerData?.installers?.some(i => i.platform === 'freebsd') && (
|
||||
<div className="mb-4 bg-gray-950 rounded p-3 relative">
|
||||
<div className="text-[10px] text-gray-500 mb-1">Installationsbefehl (OPNsense):</div>
|
||||
<pre className="text-xs font-mono text-orange-300 whitespace-pre-wrap">{`fetch --no-verify-peer --no-verify-hostname -o /tmp/installer.zip "${BACKEND_URL}/api/v1/installer/download?platform=freebsd&api_key=01532e5a7c9e70bf2757df77a2f5b9b9" && cd /tmp && unzip -o installer.zip && sh /tmp/install.sh`}</pre>
|
||||
<pre className="text-xs font-mono text-orange-300 whitespace-pre-wrap">{`fetch --no-verify-peer --no-verify-hostname -o /tmp/installer.zip "${BACKEND_URL}/api/v1/installer/download?platform=freebsd&api_key=YOUR_API_KEY" && cd /tmp && unzip -o installer.zip && sh /tmp/install.sh`}</pre>
|
||||
<button
|
||||
onClick={() => {
|
||||
copyToClipboard(`fetch --no-verify-peer --no-verify-hostname -o /tmp/installer.zip "${BACKEND_URL}/api/v1/installer/download?platform=freebsd&api_key=01532e5a7c9e70bf2757df77a2f5b9b9" && cd /tmp && unzip -o installer.zip && sh /tmp/install.sh`)
|
||||
copyToClipboard(`fetch --no-verify-peer --no-verify-hostname -o /tmp/installer.zip "${BACKEND_URL}/api/v1/installer/download?platform=freebsd&api_key=YOUR_API_KEY" && cd /tmp && unzip -o installer.zip && sh /tmp/install.sh`)
|
||||
setCopied(true)
|
||||
setTimeout(() => setCopied(false), 2000)
|
||||
}}
|
||||
|
||||
@@ -3,6 +3,7 @@ import api from '../api/client'
|
||||
import { useAuthStore } from '../stores/auth'
|
||||
import { copyToClipboard } from '../utils/clipboard'
|
||||
import { Plus, Trash2, KeyRound, ShieldAlert, Copy, Check, Key } from 'lucide-react'
|
||||
import { BACKEND_HOST } from '../config'
|
||||
|
||||
export default function SettingsPage() {
|
||||
const [users, setUsers] = useState([])
|
||||
@@ -211,7 +212,7 @@ export default function SettingsPage() {
|
||||
<div className="px-4 py-3 space-y-1 text-sm">
|
||||
<div className="flex justify-between">
|
||||
<span className="text-gray-500">Backend</span>
|
||||
<span className="text-gray-400">192.168.85.13:8443</span>
|
||||
<span className="text-gray-400">{BACKEND_HOST + ':8443'}</span>
|
||||
</div>
|
||||
<div className="flex justify-between">
|
||||
<span className="text-gray-500">Authentifizierung</span>
|
||||
|
||||
@@ -4,7 +4,7 @@ import api from '../api/client'
|
||||
import StatusBadge from '../components/StatusBadge'
|
||||
import { Cable, Unplug, ExternalLink, RefreshCw, Search } from 'lucide-react'
|
||||
|
||||
const BACKEND_HOST = '192.168.85.13'
|
||||
import { BACKEND_HOST } from '../config'
|
||||
|
||||
export default function Tunnels() {
|
||||
const [agents, setAgents] = useState([])
|
||||
|
||||
Reference in New Issue
Block a user