feat: Stage 4 — fail2ban connection and server status
This commit is contained in:
@@ -33,7 +33,8 @@ from starlette.middleware.base import BaseHTTPMiddleware
|
||||
|
||||
from app.config import Settings, get_settings
|
||||
from app.db import init_db
|
||||
from app.routers import auth, health, setup
|
||||
from app.routers import auth, dashboard, health, setup
|
||||
from app.tasks import health_check
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Ensure the bundled fail2ban package is importable from fail2ban-master/
|
||||
@@ -114,6 +115,9 @@ async def _lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
|
||||
scheduler.start()
|
||||
app.state.scheduler = scheduler
|
||||
|
||||
# --- Health-check background probe ---
|
||||
health_check.register(app)
|
||||
|
||||
log.info("bangui_started")
|
||||
|
||||
try:
|
||||
@@ -268,5 +272,6 @@ def create_app(settings: Settings | None = None) -> FastAPI:
|
||||
app.include_router(health.router)
|
||||
app.include_router(setup.router)
|
||||
app.include_router(auth.router)
|
||||
app.include_router(dashboard.router)
|
||||
|
||||
return app
|
||||
|
||||
Reference in New Issue
Block a user