Files
BanGUI/backend/app/helpers/jail_helpers.py
Lukas 1e39e5a1d6 Refactor app helpers and use AppStateDep in config router
Move service-dependent helper wrappers from app.utils to app.helpers and update config router activation/rollback to use explicit AppState dependency.
2026-04-07 20:39:56 +02:00

24 lines
679 B
Python

"""Shared jail management helpers for service-layer code."""
from __future__ import annotations
from typing import TYPE_CHECKING
from app.services.jail_service import reload_all
if TYPE_CHECKING:
from collections.abc import Sequence
async def reload_jails(
socket_path: str,
include_jails: Sequence[str] | None = None,
exclude_jails: Sequence[str] | None = None,
) -> None:
"""Reload fail2ban jails using the shared jail service helper."""
await reload_all(
socket_path,
include_jails=list(include_jails) if include_jails is not None else None,
exclude_jails=list(exclude_jails) if exclude_jails is not None else None,
)