-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathentrypoint.sh
More file actions
51 lines (45 loc) 路 1.29 KB
/
Copy pathentrypoint.sh
File metadata and controls
51 lines (45 loc) 路 1.29 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
#!/bin/bash
set -e
echo "Loading configuration..."
if [ -f "/config/config.env" ]; then
source /config/config.env
echo "Config loaded"
fi
export PATH="$HOME/.local/bin:$PATH"
echo "Starting Happy service for mobile access..."
echo "Claude: $(which claude 2>/dev/null || echo 'not found')"
echo "Happy: $(which happy 2>/dev/null || echo 'not found')"
echo "Auto-starting Happy service..."
# Change to workspace directory before starting happy
cd /workspace
# Check if already authenticated
if [ -f "/root/.happy/access.key" ]; then
echo "Authentication found, starting Happy with auto-config..."
echo "Working directory: $(pwd)"
# Use expect to handle Claude Code initial setup
expect -c "
set timeout -1
spawn happy
expect {
\"Choose the text style\" {
puts \"Auto-selecting dark mode...\"
send \"\r\"
exp_continue
}
\"Press Enter to continue\" {
puts \"Accepting security notes...\"
send \"\r\"
exp_continue
}
\"Welcome\" {
puts \"Happy service ready!\"
interact
}
eof { exit 0 }
}
"
else
echo "No authentication found. First time setup needed:"
echo "docker exec -it <container> happy"
tail -f /dev/null
fi