210304394e
Implements issue #5. Off by default; set LIVEVIEW_KEY in .env to enable. No JWT required — key-based auth via ?key= query param. Returns 403 when disabled or key is wrong. Read-only ReactFlow canvas (pan/zoom, no editing). Standalone mode loads from localStorage without a key. Includes 8 backend tests and 9 frontend tests.
30 lines
1.3 KiB
Bash
30 lines
1.3 KiB
Bash
# Backend - server-side only (NEVER commit .env)
|
|
SECRET_KEY=change_me_in_production
|
|
SQLITE_PATH=./data/homelab.db
|
|
CORS_ORIGINS=["http://localhost:5173","http://localhost:3000"]
|
|
|
|
# Auth — default credentials: admin / admin
|
|
# ⚠️ Change before exposing on a network.
|
|
# Generate a new hash: python3 -c "from passlib.context import CryptContext; print(CryptContext(schemes=['bcrypt']).hash('yourpassword'))"
|
|
# ⚠️ Keep the single quotes around the hash — bcrypt hashes contain \$ which Docker misinterprets without them.
|
|
AUTH_USERNAME=admin
|
|
AUTH_PASSWORD_HASH='$2b$12$RtMbyw17l4N5UGzeXMNAWuzCaVV.XFBY7ZetWheQhxcBDcxahapkG'
|
|
|
|
# Scanner — JSON array of CIDR ranges to scan
|
|
SCANNER_RANGES=["192.168.1.0/24"]
|
|
|
|
# Status checker interval in seconds
|
|
STATUS_CHECKER_INTERVAL=60
|
|
|
|
# MCP server — used by the mcp service (port 8001)
|
|
# MCP_API_KEY: authenticates AI clients (Claude Code, etc.) → MCP server
|
|
# MCP_SERVICE_KEY: authenticates MCP server → backend (never exposed externally)
|
|
# Generate keys: python3 -c "import secrets; print(secrets.token_hex(32))"
|
|
MCP_API_KEY=mcp_sk_changeme
|
|
MCP_SERVICE_KEY=svc_changeme
|
|
|
|
# Live view — read-only public canvas at /view?key=<value>
|
|
# Off by default. Set to a random secret to enable.
|
|
# Generate: python3 -c "import secrets; print(secrets.token_urlsafe(32))"
|
|
# LIVEVIEW_KEY=
|