From 2fe492b06b253c1719b365c00947d87aa9cef8eb Mon Sep 17 00:00:00 2001 From: PTah Date: Sat, 20 Jun 2026 00:06:26 +1000 Subject: [PATCH] fix: WinRM read_timeout must exceed operation_timeout (0.10.2) --- backend/app/services/winrm_connect.py | 6 ++++-- backend/app/version.py | 2 +- backend/tests/test_health.py | 4 ++-- frontend/package.json | 2 +- frontend/src/version.ts | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/backend/app/services/winrm_connect.py b/backend/app/services/winrm_connect.py index 6d8cefb..95e0cc0 100644 --- a/backend/app/services/winrm_connect.py +++ b/backend/app/services/winrm_connect.py @@ -60,14 +60,16 @@ def test_winrm_connection( except ImportError as exc: raise RuntimeError("pywinrm is not installed on SAC server") from exc + operation_timeout_sec = max(5, timeout_sec) + read_timeout_sec = operation_timeout_sec + 15 endpoint = f"http://{target}:5985/wsman" try: session = winrm.Session( endpoint, auth=(user, password), transport="ntlm", - read_timeout_sec=timeout_sec, - operation_timeout_sec=timeout_sec, + read_timeout_sec=read_timeout_sec, + operation_timeout_sec=operation_timeout_sec, ) result = session.run_cmd("hostname") except winrm.exceptions.WinRMTransportError as exc: diff --git a/backend/app/version.py b/backend/app/version.py index 5569f59..80ad5dd 100644 --- a/backend/app/version.py +++ b/backend/app/version.py @@ -1,5 +1,5 @@ """Единый источник версии SAC (API, health, логи, OpenAPI).""" APP_NAME = "Security Alert Center" -APP_VERSION = "0.10.1" +APP_VERSION = "0.10.2" APP_VERSION_LABEL = f"{APP_NAME} v.{APP_VERSION}" diff --git a/backend/tests/test_health.py b/backend/tests/test_health.py index 3d4b592..54b7823 100644 --- a/backend/tests/test_health.py +++ b/backend/tests/test_health.py @@ -4,6 +4,6 @@ from app.version import APP_NAME, APP_VERSION, APP_VERSION_LABEL def test_version_constants(): - assert APP_VERSION == "0.10.1" + assert APP_VERSION == "0.10.2" assert APP_NAME == "Security Alert Center" - assert APP_VERSION_LABEL == "Security Alert Center v.0.10.1" + assert APP_VERSION_LABEL == "Security Alert Center v.0.10.2" diff --git a/frontend/package.json b/frontend/package.json index 78ec829..8726d4c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "sac-ui", "private": true, - "version": "0.10.1", + "version": "0.10.2", "type": "module", "scripts": { "dev": "vite", diff --git a/frontend/src/version.ts b/frontend/src/version.ts index d531f7a..980a38e 100644 --- a/frontend/src/version.ts +++ b/frontend/src/version.ts @@ -1,4 +1,4 @@ /** Fallback до загрузки /health; при релизе держите в sync с backend/app/version.py */ export const APP_NAME = "Security Alert Center"; -export const APP_VERSION = "0.10.1"; +export const APP_VERSION = "0.10.2"; export const APP_VERSION_LABEL = `${APP_NAME} v.${APP_VERSION}`;