diff --git a/delivery/fix_kit.bat b/delivery/fix_kit.bat deleted file mode 100644 index 5c7a3a7..0000000 --- a/delivery/fix_kit.bat +++ /dev/null @@ -1,41 +0,0 @@ -@echo off -REM One-shot fix: fill kit\site (python deps) + start everything + show live checks -cd /d %~dp0 -title fix-kit - -set "KIT=%~dp0..\..\kit" -echo === 1. kit python present? -if not exist "%KIT%\Python312\python.exe" ( - echo kit\Python312 is MISSING - run install_kit_transfer.bat under the installer account first - pause - exit /b 1 -) -echo OK - -echo === 2. python deps -> kit\site... -"%KIT%\Python312\python.exe" -m pip install --target "%KIT%\site" -r "%~dp0requirements.txt" 2>nul || ( - "%KIT%\Python312\python.exe" -m pip install --target "%KIT%\site" -r "%~dp0..\requirements.txt" -) || ( - echo ERROR: pip failed - probably no write access to kit (run this under the installer account, - echo or give rights: icacls C:\docchecker\app\kit /grant Users:(OI)(CI)M /T - pause - exit /b 1 -) -"%KIT%\Python312\python.exe" -c "import fastapi, uvicorn, httpx, docx, openpyxl, pptx; print('deps OK')" - -echo === 3. starting everything (ollama, LT, checker)... -call "%~dp0start_all.bat" - -echo === 4. live checks - wait a moment first... -timeout /t 12 /nobreak >nul -curl -s --max-time 8 -o nul -w "LT 8010: %%{http_code}" http://127.0.0.1:8010/v2/languages -echo. -curl -s --max-time 8 -o nul -w "LLM 11434: %%{http_code}" http://127.0.0.1:11434/v1/models -echo. -curl -s --max-time 8 http://127.0.0.1:8011/api/health -echo. -ollama list 2>nul -echo. -echo === если выше видно: LT 200 / LLM 200 / health с exceptions - всё работает. -echo === страничка: открыть 127.0.0.1:8011 (Ctrl+F5, если уже открыта) -pause \ No newline at end of file diff --git a/delivery/install_kit_transfer.bat b/delivery/install_kit_transfer.bat deleted file mode 100644 index bf69506..0000000 --- a/delivery/install_kit_transfer.bat +++ /dev/null @@ -1,37 +0,0 @@ -@echo off -REM Перенос компонентов в общий каталог kit (запускать ПОД ТОЙ учёткой, где выполнялась установка). -REM После этого сервисы работают под любым пользователем компьютера. -cd /d %~dp0 -set "KIT=%~dp0..\..\kit" -if not exist "%KIT%" mkdir "%KIT%" - -echo [1/4] Python -> shared kit... -if exist "%LocalAppData%\Programs\Python\Python312" ( - xcopy "%LocalAppData%\Programs\Python\Python312" "%KIT%\Python312\" /E /I /Y /Q >nul -) else ( - echo Python-установка не найдена в профиле этого пользователя - пропущено -) -echo [2/4] Ollama program -> shared kit... -if exist "%LocalAppData%\Programs\Ollama" ( - xcopy "%LocalAppData%\Programs\Ollama" "%KIT%\Ollama\" /E /I /Y /Q >nul -) else ( - echo Ollama-установка не найдена - пропущено -) -echo [3/4] Модели (~2.5 GB, подождать) -> shared kit... -if exist "%UserProfile%\.ollama\models" ( - xcopy "%UserProfile%\.ollama\models" "%KIT%\models\" /E /I /Y /Q >nul -) else ( - echo Модели не найдены в профиле - пропущено -) -echo [4/4] Python-зависимости -> shared site... -set "REQ=requirements.txt" -if not exist "%REQ%" set "REQ=..\requirements.txt" -if not exist "%REQ%" ( - echo requirements.txt не найден ни в delivery, ни в родительской папке - if /i not "%~1"=="NOPAUSE" pause - exit /b 1 -) -"%KIT%\Python312\python.exe" -m pip install --target "%KIT%\site" -r "%REQ%" -echo. -echo Готово. Теперь под ЛЮБЫМ пользователем работает start_all.bat -pause \ No newline at end of file diff --git a/delivery/start_all.bat b/delivery/start_all.bat index 35e7b59..9bbc5ba 100644 --- a/delivery/start_all.bat +++ b/delivery/start_all.bat @@ -1,12 +1,9 @@ @echo off -REM Start everything: Ollama + LanguageTool + checker service + browser page +REM Start everything on a one-user computer: LanguageTool + checker service + page +REM (ollama runs as its own tray app installed by OllamaSetup.exe; nothing needed here) cd /d %~dp0 -call start_llm.bat -timeout /t 4 /nobreak >nul call start_lt.bat timeout /t 8 /nobreak >nul call start_checker.bat echo. -echo === If a component above was missing (Python/Ollama), it did not start: -echo === follow the printed step and run start_all.bat again. pause \ No newline at end of file diff --git a/delivery/start_checker.bat b/delivery/start_checker.bat index e7fee29..8d52913 100644 --- a/delivery/start_checker.bat +++ b/delivery/start_checker.bat @@ -1,21 +1,13 @@ @echo off -REM docchecker service: kit (shift mode) or regular venv (one-user mode) +REM docchecker service + browser page: 127.0.0.1:8011 (no kit logic, per-user venv) cd /d %~dp0 set "SRV=%~dp0" if not exist "%SRV%static" set "SRV=%~dp0.." cd /d "%SRV%" -set "KIT=%~dp0..\..\kit" -set "PYEXE=" -if exist "%KIT%\Python312\python.exe" ( - set "PYEXE=%KIT%\Python312\python.exe" - set "PYTHONPATH=%KIT%\site" -) -if not defined PYEXE set "PYEXE=%~dp0venv\Scripts\python.exe" +set "PYEXE=%~dp0venv\Scripts\python.exe" if not exist "%PYEXE%" ( echo Python not found: run install.bat from delivery first - echo ^(or setup_online.bat on a computer with internet^) - echo If venv was copied from another computer - delete the venv folder - echo and recreate it with install.bat + echo ^(venv is created by install.bat on this very computer^) pause exit /b 1 ) @@ -29,7 +21,7 @@ for /l %%i in (1,1,6) do ( if not defined OK timeout /t 2 /nobreak >nul ) if not defined OK ( - echo Служба не поднялась за 12 сек — смотри окно docchecker, там причина + echo Service did not start in 12 s - see the docchecker window for the reason pause exit /b 1 ) diff --git a/delivery/start_llm.bat b/delivery/start_llm.bat deleted file mode 100644 index fb7e5db..0000000 --- a/delivery/start_llm.bat +++ /dev/null @@ -1,32 +0,0 @@ -@echo off -REM Ollama: check running service first (may run under another account), -REM then kit copy, then per-user install -cd /d %~dp0 -netstat -ano 2>nul | findstr ":11434" | findstr "LISTENING" >nul 2>nul -if %errorlevel%==0 goto :llm_ok -set "KIT=%~dp0..\..\kit" -if not exist "%KIT%\Ollama\ollama.exe" goto :try_local -set "OLLAMA_MODELS=%KIT%\models" -start "Ollama (docchecker)" /MIN "%KIT%\Ollama\ollama.exe" serve -timeout /t 6 /nobreak >nul -goto :verify -:try_local -set "OLLEXE=%LocalAppData%\Programs\Ollama\ollama.exe" -if not exist "%OLLEXE%" goto :not_found -set "OLLAMA_MODELS=" -start "Ollama (docchecker)" /MIN "%OLLEXE%" serve -timeout /t 6 /nobreak >nul -goto :verify -:verify -netstat -ano 2>nul | findstr ":11434" | findstr "LISTENING" >nul 2>nul -if %errorlevel%==0 goto :llm_ok -echo Ollama did not start - see its window, or run: "%OLLEXE%" serve -pause -exit /b 1 -:not_found -echo Ollama not found: run OllamaSetup.exe from delivery (double-click, Next), -echo then install_ollama_model.bat, then run start_all.bat again -pause -exit /b 1 -:llm_ok -echo Ollama: running \ No newline at end of file