sharween commited on
Commit
f700426
·
verified ·
1 Parent(s): df0d213

Update start-openclaw.sh

Browse files
Files changed (1) hide show
  1. start-openclaw.sh +36 -0
start-openclaw.sh CHANGED
@@ -7,9 +7,45 @@ mkdir -p /root/.openclaw/agents/main/sessions
7
  mkdir -p /root/.openclaw/credentials
8
  mkdir -p /root/.openclaw/sessions
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  # 2. 执行恢复
11
  python3 /app/sync.py restore
12
 
 
13
  # 3. 处理 API 地址
14
  CLEAN_BASE=$(echo "$OPENAI_API_BASE" | sed "s|/chat/completions||g" | sed "s|/v1/|/v1|g" | sed "s|/v1$|/v1|g")
15
 
 
7
  mkdir -p /root/.openclaw/credentials
8
  mkdir -p /root/.openclaw/sessions
9
 
10
+ # 4. 生成配置文件
11
+ cat > /root/.openclaw/openclaw.json <<EOF
12
+ {
13
+ "models": {
14
+ "providers": {
15
+ "nvidia": {
16
+ "baseUrl": "$CLEAN_BASE",
17
+ "apiKey": "$OPENAI_API_KEY",
18
+ "api": "openai-completions",
19
+ "models": [
20
+ { "id": "$MODEL", "name": "$MODEL", "contextWindow": 128000 }
21
+ ]
22
+ }
23
+ }
24
+ },
25
+ "agents": { "defaults": { "model": { "primary": "nvidia/$MODEL" } } },
26
+ "commands": {
27
+ "restart": true
28
+ },
29
+ "gateway": {
30
+ "mode": "local",
31
+ "bind": "lan",
32
+ "port": $PORT,
33
+ "trustedProxies": ["0.0.0.0/0"],
34
+ "auth": { "mode": "token", "token": "$OPENCLAW_GATEWAY_PASSWORD" },
35
+ "controlUi": {
36
+ "enabled": true,
37
+ "allowInsecureAuth": true,
38
+ "dangerouslyDisableDeviceAuth": true,
39
+ "dangerouslyAllowHostHeaderOriginFallback": true
40
+ },
41
+ }
42
+ }
43
+ EOF
44
+
45
  # 2. 执行恢复
46
  python3 /app/sync.py restore
47
 
48
+
49
  # 3. 处理 API 地址
50
  CLEAN_BASE=$(echo "$OPENAI_API_BASE" | sed "s|/chat/completions||g" | sed "s|/v1/|/v1|g" | sed "s|/v1$|/v1|g")
51