forked from ShaerWare/AI_Secretary_System
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_with_tunnel.sh
More file actions
executable file
·64 lines (52 loc) · 1.71 KB
/
start_with_tunnel.sh
File metadata and controls
executable file
·64 lines (52 loc) · 1.71 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
#!/bin/bash
# Start AI Secretary with ngrok/cloudflare tunnel for external access
set -e
TUNNEL_TYPE="${1:-cloudflare}" # cloudflare or ngrok
echo "🚀 Starting AI Secretary with $TUNNEL_TYPE tunnel..."
# Start AI Secretary in background
echo "📦 Starting AI Secretary..."
./start_gpu.sh &
AI_PID=$!
# Wait for orchestrator to be ready
echo "⏳ Waiting for orchestrator to start..."
for i in {1..30}; do
if curl -s http://localhost:8002/health > /dev/null 2>&1; then
echo "✅ Orchestrator is ready"
break
fi
sleep 2
done
# Check if ready
if ! curl -s http://localhost:8002/health > /dev/null 2>&1; then
echo "❌ Orchestrator failed to start"
exit 1
fi
# Start tunnel
echo ""
echo "🌐 Starting $TUNNEL_TYPE tunnel..."
echo "=========================================="
if [ "$TUNNEL_TYPE" = "cloudflare" ]; then
# Cloudflare tunnel (no registration needed)
if ! command -v cloudflared &> /dev/null; then
echo "❌ cloudflared not found. Install:"
echo " curl -L --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb"
echo " sudo dpkg -i cloudflared.deb"
exit 1
fi
echo "📌 Copy the URL below for your website:"
echo ""
cloudflared tunnel --url http://localhost:8002
elif [ "$TUNNEL_TYPE" = "ngrok" ]; then
# ngrok tunnel
if ! command -v ngrok &> /dev/null; then
echo "❌ ngrok not found. Install from https://ngrok.com/download"
exit 1
fi
echo "📌 Copy the 'Forwarding' URL for your website:"
echo ""
ngrok http 8002
else
echo "❌ Unknown tunnel type: $TUNNEL_TYPE"
echo "Usage: $0 [cloudflare|ngrok]"
exit 1
fi