refactor(backend): clean up jail service, add error handling service
- Extract jail status/processing to helper functions - Add error_handling.py service for centralized error handling - Update config.py with validation and defaults - Update .env.example with all config options - Remove obsolete Tasks.md, add Service-Development.md - Minor fixes across routers and services Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -24,6 +24,7 @@ from app.dependencies import (
|
||||
GeoCacheDep,
|
||||
HttpSessionDep,
|
||||
ServerStatusDep,
|
||||
SettingsDep,
|
||||
)
|
||||
from app.mappers import (
|
||||
map_domain_ban_trend_to_response,
|
||||
@@ -101,13 +102,14 @@ async def get_dashboard_bans(
|
||||
socket_path: Fail2BanSocketDep,
|
||||
http_session: HttpSessionDep,
|
||||
geo_cache: GeoCacheDep,
|
||||
settings: SettingsDep,
|
||||
range: TimeRange = Query(default=_DEFAULT_RANGE, description="Time-range preset."),
|
||||
source: Literal["fail2ban", "archive"] = Query(
|
||||
default="fail2ban",
|
||||
description="Data source: 'fail2ban' or 'archive'.",
|
||||
),
|
||||
page: int = Query(default=1, ge=1, description="1-based page number."),
|
||||
page_size: int = Query(default=DEFAULT_PAGE_SIZE, ge=1, le=500, description="Items per page."),
|
||||
page_size: int = Query(default=DEFAULT_PAGE_SIZE, ge=1, description="Items per page."),
|
||||
origin: BanOrigin | None = Query(
|
||||
default=None,
|
||||
description="Filter by ban origin: 'blocklist' or 'selfblock'. Omit for all.",
|
||||
@@ -143,6 +145,7 @@ async def get_dashboard_bans(
|
||||
source=source,
|
||||
page=page,
|
||||
page_size=page_size,
|
||||
max_page_size=settings.max_page_size,
|
||||
http_session=http_session,
|
||||
app_db=ban_ctx.db,
|
||||
geo_cache=geo_cache,
|
||||
|
||||
Reference in New Issue
Block a user