tc test
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 10s

This commit is contained in:
2026-03-07 16:36:24 +01:00
parent f55e899fc5
commit 0c69daf229
13 changed files with 459 additions and 609 deletions

View File

@@ -25,13 +25,6 @@ def _env_float(name: str, default: float) -> float:
return float(value)
def _env_bool(name: str, default: bool) -> bool:
value = os.getenv(name)
if value in (None, ""):
return default
return value.strip().lower() in {"1", "true", "yes", "on"}
@dataclass(frozen=True)
class BackendSettings:
db_dsn: str
@@ -51,12 +44,7 @@ class BackendSettings:
sniffer_recv_bytes: int
sniffer_buffer_drain_interval_seconds: float
sniffer_thread_join_timeout_seconds: float
capture_interface: str
capture_header_enabled: bool
capture_automanage: bool
capture_automanaged_mirror_if: str
capture_automanaged_capture_if: str
capture_build_dir: str
bridge_bpf_build_dir: str
telemetry_process_stop_timeout_seconds: float
telemetry_reader_join_timeout_seconds: float
ndpi_max_flows: int
@@ -86,12 +74,7 @@ def load_settings() -> BackendSettings:
sniffer_recv_bytes=_env_int("BACKEND_SNIFFER_RECV_BYTES", 65_536),
sniffer_buffer_drain_interval_seconds=_env_float("BACKEND_SNIFFER_BUFFER_DRAIN_INTERVAL_SECONDS", 5.0),
sniffer_thread_join_timeout_seconds=_env_float("BACKEND_SNIFFER_THREAD_JOIN_TIMEOUT_SECONDS", 2.0),
capture_interface=_env_str("BACKEND_CAPTURE_INTERFACE", ""),
capture_header_enabled=_env_bool("BACKEND_CAPTURE_HEADER_ENABLED", True),
capture_automanage=_env_bool("BACKEND_CAPTURE_AUTOMANAGE", True),
capture_automanaged_mirror_if=_env_str("BACKEND_CAPTURE_MIRROR_INTERFACE", "mitmcap0"),
capture_automanaged_capture_if=_env_str("BACKEND_CAPTURE_AUTOMANAGED_INTERFACE", "mitmcap1"),
capture_build_dir=_env_str("BACKEND_CAPTURE_BUILD_DIR", "/tmp/mitm-bpf"),
bridge_bpf_build_dir=_env_str("BACKEND_BRIDGE_BPF_BUILD_DIR", "/tmp/mitm-bpf"),
telemetry_process_stop_timeout_seconds=_env_float("BACKEND_TELEMETRY_PROCESS_STOP_TIMEOUT_SECONDS", 3.0),
telemetry_reader_join_timeout_seconds=_env_float("BACKEND_TELEMETRY_READER_JOIN_TIMEOUT_SECONDS", 2.0),
ndpi_max_flows=_env_int("BACKEND_NDPI_MAX_FLOWS", 200_000),