shrimp-lover-2026 commited on
Commit
fd583ea
·
verified ·
1 Parent(s): 8118fcf

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +6 -74
entrypoint.sh CHANGED
@@ -1,78 +1,10 @@
1
- #!/bin/sh
2
- set -e
3
 
4
- # ساخت فایل کانفیگ از متغیرهای محیطی
5
- cat > /home/node/.openclaw/openclaw.json << EOF
6
- {
7
- "env": {
8
- "OPENROUTER_API_KEY": "${OPENROUTER_API_KEY}",
9
- "GOOGLE_GENERATIVE_AI_API_KEY": "${GOOGLE_AI_API_KEY}"
10
- },
11
- "gateway": {
12
- "mode": "local",
13
- "bind": "all",
14
- "port": 18789,
15
- "auth": {
16
- "mode": "token",
17
- "token": "${OPENCLAW_GATEWAY_TOKEN}"
18
- },
19
- "trustedProxies": ["0.0.0.0/0"],
20
- "controlUi": {
21
- "enabled": true,
22
- "allowInsecureAuth": true,
23
- "dangerouslyDisableDeviceAuth": true
24
- }
25
- },
26
- "channels": {
27
- "telegram": {
28
- "enabled": true,
29
- "botToken": "${TELEGRAM_BOT_TOKEN}",
30
- "allowFrom": ["${TELEGRAM_ALLOWED_USER_ID}"]
31
- }
32
- },
33
- "agents": {
34
- "defaults": {
35
- "model": {
36
- "primary": "google/gemini-2.0-flash",
37
- "fallbacks": [
38
- "openrouter/openai/gpt-oss-120b:free",
39
- "google/gemini-1.5-flash"
40
- ]
41
- },
42
- "models": {
43
- "google/gemini-2.0-flash": {},
44
- "google/gemini-1.5-flash": {},
45
- "google/gemini-1.5-pro": {},
46
- "openrouter/openai/gpt-oss-120b:free": {},
47
- "openrouter/google/gemini-2.0-flash-exp:free": {},
48
- "openrouter/meta-llama/llama-3.3-70b-instruct:free": {}
49
- }
50
- }
51
- }
52
- }
53
- EOF
54
 
55
- echo " Config file created"
56
 
57
- # اجرای gateway در پس‌زمینه
58
- npx openclaw gateway --port 18789 --token "${OPENCLAW_GATEWAY_TOKEN}" &
59
- GATEWAY_PID=$!
60
- echo "✅ Gateway started (PID: $GATEWAY_PID)"
61
 
62
- # صبر میکنیم تا gateway روی port 18789 بیاد بالا
63
- echo "⏳ Waiting for gateway on port 18789..."
64
- for i in $(seq 1 30); do
65
- if nc -z 127.0.0.1 18789 2>/dev/null; then
66
- echo "✅ Gateway is ready!"
67
- break
68
- fi
69
- echo " attempt $i/30..."
70
- sleep 1
71
- done
72
-
73
- # فوروارد port 7860 به 18789
74
- socat TCP-LISTEN:7860,fork,reuseaddr TCP:127.0.0.1:18789 &
75
- echo "✅ socat started (7860 -> 18789)"
76
-
77
- # نگه داشتن container زنده
78
- wait $GATEWAY_PID
 
1
+ #!/bin/bash
 
2
 
3
+ export PORT=7860
4
+ export HOST=0.0.0.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
+ echo "Starting OpenClaw..."
7
 
8
+ npm install --omit=dev
 
 
 
9
 
10
+ npm start