Cuts release 0.20.0. ## Highlights - X-Request-ID header on every response + sanitized to [A-Za-z0-9_-] (CRLF log-forging mitigation) - Error pages (HTML + JSON 500) surface request_id for support tickets - Dev debug toolbar gated by DEBUG=1 — fastapi-debug-toolbar with custom DuckDBPanel - Centralized app.logging_config.setup_logging() replaces 23 scattered basicConfig calls - Telegram bot drops bot.log file — stdout only (BREAKING) ## Devin findings addressed - BUG_0001: .env.template no longer claims FastAPI debug=True - BUG_0002: subprocess extractor logs INFO to stderr again - ANALYSIS_0003: _wants_html no longer matches Accept: */* (curl gets JSON as before) - BUG on b1c6ee9: HTML 500 page no longer leaks str(exc) in production - BUG on b13d2fe: 2 CLAUDE.md compliance flags (transform.py + ws_gateway) accepted as scope-limited logging refactor — follow-up to update CLAUDE.md if needed See CHANGELOG [0.20.0] for full notes.
20 lines
855 B
Python
20 lines
855 B
Python
"""Configuration for WebSocket Gateway."""
|
|
|
|
import os
|
|
|
|
|
|
def _get_required_env(key: str) -> str:
|
|
"""Get a required environment variable or fail fast."""
|
|
value = os.environ.get(key)
|
|
if not value:
|
|
raise ValueError(f"Missing required environment variable: {key}")
|
|
return value
|
|
|
|
|
|
WS_GATEWAY_HOST: str = os.environ.get("WS_GATEWAY_HOST", "127.0.0.1")
|
|
WS_GATEWAY_PORT: int = int(os.environ.get("WS_GATEWAY_PORT", "8765"))
|
|
WS_DISPATCH_SOCKET: str = os.environ.get("WS_DISPATCH_SOCKET", "/run/ws-gateway/ws.sock")
|
|
DESKTOP_JWT_SECRET: str = _get_required_env("DESKTOP_JWT_SECRET")
|
|
HEARTBEAT_INTERVAL_SECONDS: int = int(os.environ.get("HEARTBEAT_INTERVAL_SECONDS", "30"))
|
|
HEARTBEAT_TIMEOUT_MISSED: int = int(os.environ.get("HEARTBEAT_TIMEOUT_MISSED", "3"))
|
|
MAX_CONNECTIONS_PER_USER: int = int(os.environ.get("MAX_CONNECTIONS_PER_USER", "5"))
|