-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.sh
More file actions
executable file
·42 lines (31 loc) · 1.39 KB
/
dev.sh
File metadata and controls
executable file
·42 lines (31 loc) · 1.39 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
#!/bin/bash
# Development script to start all tunnel services in tmux panes
SESSION="tunnels-dev"
# Kill existing session if it exists
tmux has-session -t $SESSION 2>/dev/null
if [ $? -eq 0 ]; then
echo "Killing existing tmux session: $SESSION"
tmux kill-session -t $SESSION
fi
# Create new session
tmux new-session -d -s $SESSION -n "tunnels"
# Pane 1: Test Service (port 3000)
tmux send-keys -t $SESSION:0.0 "cd $(pwd)" C-m
tmux send-keys -t $SESSION:0.0 "echo '--- Starting Test Service (port 3000) ---'" C-m
tmux send-keys -t $SESSION:0.0 "uv run python test_service/app.py" C-m
# Split window vertically for panes 2 and 3
tmux split-window -v -t $SESSION:0
# Pane 2: Tunnel Server (port 8000)
tmux send-keys -t $SESSION:0.1 "cd $(pwd)" C-m
tmux send-keys -t $SESSION:0.1 "echo '--- Starting Tunnel Server (port 8000) ---'" C-m
tmux send-keys -t $SESSION:0.1 "uv run server.py --secret super-secret123" C-m
# Wait for server to start before starting client
sleep 3
# Split pane 2 horizontally to create pane 3
tmux split-window -h -t $SESSION:0.1
# Pane 3: Tunnel Client
tmux send-keys -t $SESSION:0.2 "cd $(pwd)" C-m
tmux send-keys -t $SESSION:0.2 "echo '--- Starting Tunnel Client ---'" C-m
tmux send-keys -t $SESSION:0.2 "uv run client.py --server-url http://localhost:8000 --local-url http://localhost:3000 --secret super-secret123" C-m
# Attach to the session
tmux attach-session -t $SESSION