Внедрение KESL на ВМ2 + замена CLAMAV на KESL
This commit is contained in:
@@ -8,7 +8,7 @@ from app.adapters import TrustedDnsResolver
|
||||
from app.api import create_app
|
||||
from app.config import ActiveConfig, validate_config
|
||||
from app.db import engine_and_sessions
|
||||
from app.file_pipeline import ClamAvInstream, DependencyFailure
|
||||
from app.file_pipeline import DependencyFailure, KeslSocketScanner
|
||||
from app.repository import Repository
|
||||
from app.service import SafetyService
|
||||
from app.settings import BootstrapSettings, EmergencyMode
|
||||
@@ -29,13 +29,14 @@ async def build_runtime() -> tuple[object, object]:
|
||||
resolver = TrustedDnsResolver(
|
||||
[item.strip() for item in settings.dns_resolvers.split(",") if item.strip()]
|
||||
)
|
||||
clamav = ClamAvInstream(settings.clamav_host, settings.clamav_port)
|
||||
antivirus = KeslSocketScanner(settings.antivirus_socket)
|
||||
if mode.mock:
|
||||
signatures_version = "unavailable"
|
||||
files_ready = False
|
||||
else:
|
||||
try:
|
||||
signatures_version = await clamav.signatures_version()
|
||||
status = await antivirus.status()
|
||||
signatures_version = status.signatures_version
|
||||
files_ready = True
|
||||
except DependencyFailure:
|
||||
signatures_version = "unavailable"
|
||||
@@ -47,6 +48,7 @@ async def build_runtime() -> tuple[object, object]:
|
||||
resolver,
|
||||
files_ready=files_ready,
|
||||
signatures_version=signatures_version,
|
||||
antivirus=antivirus,
|
||||
)
|
||||
app = create_app(service, settings.service_token.get_secret_value())
|
||||
instrument_fastapi(app)
|
||||
|
||||
Reference in New Issue
Block a user