Skip to content

armgit / ARES

Public Imported from GitHub
0

ARES - authorized red-team engagement automation with dashboard, campaign scope, module orchestration, OPSEC controls, encrypted vault, and reporting.

fix: register health route on main API app

Mafifrizicfb2863bdcf6
diff --git a/ares/api/server.py b/ares/api/server.py
index 289c46a..d71b1f7 100644
--- a/ares/api/server.py
+++ b/ares/api/server.py
@@ -52,7 +52,6 @@ from ares.api.rbac import (
require_operator,
require_team_lead,
)
-from ares.api.routes.health import router as health_router
from ares.core.campaign import Campaign
from ares.core.config import AresSettings, get_settings
from ares.core.engine import AresEngine
@@ -238,7 +237,18 @@ app = FastAPI(
docs_url="/docs" if _debug else None,
redoc_url="/redoc" if _debug else None,
)
-app.include_router(health_router)
+
+
[email protected]("/health", tags=["health"])
+async def health(request: Request) -> dict[str, Any]:
+ db_ok = getattr(request.app.state, "db", None) is not None
+ return {
+ "status": "ok" if db_ok else "degraded",
+ "version": _ares_version,
+ "db": "connected" if db_ok else "unavailable",
+ }
+
+
_mount_dashboard(app)