Repository navigation
Expand file tree
/
Copy pathstart_scriptotic_web.bat
More file actions
88 lines (80 loc) · 2.72 KB
/
Copy pathstart_scriptotic_web.bat
File metadata and controls
88 lines (80 loc) · 2.72 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@echo off
title Scriptotic Web Service Auto-Starter
echo ========================================
echo Scriptotic Auto-Startup Service
echo ========================================
echo.
cd /D "D:\Coding\Scriptotic"
:: Check if Flask API is already running
echo 🔍 Checking if Flask API is running...
netstat -an | findstr ":5000" >nul 2>&1
if %errorlevel% equ 0 (
echo ✅ Flask API already running on port 5000
goto :check_tunnel
) else (
echo 🚀 Starting Flask API server...
start "Scriptotic Flask API" /MIN python src/core/web_server.py
echo ⏳ Waiting for Flask server to start...
timeout /t 8 /nobreak >nul
:: Verify Flask started
netstat -an | findstr ":5000" >nul 2>&1
if %errorlevel% equ 0 (
echo ✅ Flask API started successfully
) else (
echo ❌ Flask API failed to start
pause
exit /b 1
)
)
:check_tunnel
:: Check if Cloudflare tunnel is already running
echo 🔍 Checking if Cloudflare tunnel is running...
tasklist /FI "IMAGENAME eq cloudflared.exe" 2>NUL | findstr "cloudflared.exe" >nul
if %errorlevel% equ 0 (
echo ✅ Cloudflare tunnel already running
goto :services_ready
) else (
echo 🚀 Starting Cloudflare tunnel...
start "Scriptotic Cloudflare Tunnel" /MIN "C:\pinokio\bin\cloudflared.exe" tunnel run api
echo ⏳ Waiting for tunnel to connect...
timeout /t 8 /nobreak >nul
:: Verify tunnel started
tasklist /FI "IMAGENAME eq cloudflared.exe" 2>NUL | findstr "cloudflared.exe" >nul
if %errorlevel% equ 0 (
echo ✅ Cloudflare tunnel started successfully
) else (
echo ❌ Cloudflare tunnel failed to start
echo Check if cloudflared.exe exists at C:\Program Files (x86)\cloudflared\cloudflared.exe
pause
exit /b 1
)
)
:services_ready
echo.
echo ========================================
echo 🎉 SERVICES READY 🎉
echo ========================================
echo.
echo 🌐 Web Interface: https://brinedew.com/apps/scriptotic
echo 🔧 Local API: http://localhost:5000
echo 🌐 Tunnel API: https://api.brinedew.com
echo.
echo ✅ Flask API server is running
echo ✅ Cloudflare tunnel is active
echo.
echo Both services will continue running in the background.
echo Your friends can now use: https://brinedew.com/apps/scriptotic
echo.
echo To stop services later, run: stop_scriptotic_web.bat
echo.
:: Test the connection
echo 🧪 Testing local API connection...
curl -s http://localhost:5000/api/server-status >nul 2>&1
if %errorlevel% equ 0 (
echo ✅ Local API is responding
) else (
echo ⚠️ Local API not responding yet (might still be starting)
)
echo.
echo Press any key to close this window (services will keep running)
pause >nul