forked from Fosowl/agenticSeek
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_services.cmd
More file actions
45 lines (37 loc) · 1.23 KB
/
start_services.cmd
File metadata and controls
45 lines (37 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
@echo off
if "%1"=="full" (
echo Starting full deployment...
) else (
set "msg=Starting partial deployment... (backend run on host), use "full" to run all services in containers"
echo !msg!
)
@echo off
openssl rand -hex 32 >nul 2>&1
if %ERRORLEVEL% == 0 (
for /f %%i in ('openssl rand -hex 32') do set SEARXNG_SECRET_KEY=%%i
goto :key_generated
)
python --version >nul 2>&1
if %ERRORLEVEL% == 0 (
for /f %%i in ('python -c "import secrets; print(secrets.token_hex(32))"') do set SEARXNG_SECRET_KEY=%%i
goto :key_generated
)
py --version >nul 2>&1
if %ERRORLEVEL% == 0 (
for /f %%i in ('py -c "import secrets; print(secrets.token_hex(32))"') do set SEARXNG_SECRET_KEY=%%i
goto :key_generated
)
echo Error: Neither openssl nor python is available to generate a secret key.
echo Please install Python from https://python.org or OpenSSL
exit /b 2
:key_generated
echo Secret key generated successfully
REM Generate secret key
for /f %%i in ('powershell -command "[System.Web.Security.Membership]::GeneratePassword(64,0)"') do set SEARXNG_SECRET_KEY=%%i
if "%1"=="full" (
docker compose up -d backend
timeout /t 5 /nobreak >nul
docker compose --profile full up
) else (
docker compose --profile core up
)