Simford.Dong commited on
Commit ·
893ce54
1
Parent(s): ee5fbce
fix: fix Dockerfile parse error in python generator block
Browse files- Dockerfile +56 -56
Dockerfile
CHANGED
|
@@ -224,62 +224,62 @@ python3 /usr/local/bin/sync.py restore\n\
|
|
| 224 |
export OPENCLAW_GATEWAY_TOKEN=\"\$GW_PASS\"\n\
|
| 225 |
\n\
|
| 226 |
# 生成 openclaw.json 配置文件 (使用 Python 确保 JSON 格式 100% 正确)
|
| 227 |
-
python3 -c "
|
| 228 |
-
import os, json
|
| 229 |
-
proxies_env = os.getenv('OPENCLAW_GATEWAY_TRUSTED_PROXIES', '10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,100.64.0.0/10')
|
| 230 |
-
proxies = [p.strip() for p in proxies_env.split(',') if p.strip()]
|
| 231 |
-
|
| 232 |
-
config = {
|
| 233 |
-
'models': {
|
| 234 |
-
'mode': 'merge',
|
| 235 |
-
'providers': {
|
| 236 |
-
'openrouter': {
|
| 237 |
-
'baseUrl': os.getenv('OPENROUTER_BASE_URL'),
|
| 238 |
-
'apiKey': os.getenv('OPENROUTER_API_KEY'),
|
| 239 |
-
'api': 'openai-completions',
|
| 240 |
-
'models': [
|
| 241 |
-
{'id': 'stepfun/step-3.5-flash:free', 'name': 'Step-3.5 Flash (Free)', 'contextWindow': 200000, 'maxTokens': 8192}
|
| 242 |
-
]
|
| 243 |
-
}
|
| 244 |
-
}
|
| 245 |
-
},
|
| 246 |
-
'agents': {
|
| 247 |
-
'defaults': {
|
| 248 |
-
'model': {'primary': 'openrouter/stepfun/step-3.5-flash:free'},
|
| 249 |
-
'workspace': '~/.openclaw/workspace'
|
| 250 |
-
}
|
| 251 |
-
},
|
| 252 |
-
'gateway': {
|
| 253 |
-
'mode': 'local',
|
| 254 |
-
'bind': 'lan',
|
| 255 |
-
'port': int(os.getenv('PORT', 7860)),
|
| 256 |
-
'trustProxy': True,
|
| 257 |
-
'trustedProxies': proxies,
|
| 258 |
-
'auth': {
|
| 259 |
-
'mode': 'token',
|
| 260 |
-
'token': os.getenv('GW_PASS')
|
| 261 |
-
},
|
| 262 |
-
'controlUi': {
|
| 263 |
-
'enabled': True,
|
| 264 |
-
'allowInsecureAuth': True,
|
| 265 |
-
'allowedOrigins': ['*']
|
| 266 |
-
}
|
| 267 |
-
},
|
| 268 |
-
'channels': {
|
| 269 |
-
'feishu': {
|
| 270 |
-
'enabled': True,
|
| 271 |
-
'appId': os.getenv('FEISHU_APP_ID'),
|
| 272 |
-
'appSecret': os.getenv('FEISHU_APP_SECRET'),
|
| 273 |
-
'domain': os.getenv('FEISHU_DOMAIN', 'feishu'),
|
| 274 |
-
'connectionMode': os.getenv('FEISHU_CONNECTION_MODE', 'websocket'),
|
| 275 |
-
'dmPolicy': 'open',
|
| 276 |
-
'allowFrom': ['*'],
|
| 277 |
-
'ignoreEvents': ['im.message.message_read_v1', 'im.chat.access_event.bot_p2p_chat_entered_v1']
|
| 278 |
-
}
|
| 279 |
-
}
|
| 280 |
-
}
|
| 281 |
-
with open('/root/.openclaw/openclaw.json', 'w') as f:
|
| 282 |
-
json.dump(config, f, indent=2)
|
| 283 |
"
|
| 284 |
\n\
|
| 285 |
# 修复权限建议\n\
|
|
|
|
| 224 |
export OPENCLAW_GATEWAY_TOKEN=\"\$GW_PASS\"\n\
|
| 225 |
\n\
|
| 226 |
# 生成 openclaw.json 配置文件 (使用 Python 确保 JSON 格式 100% 正确)
|
| 227 |
+
python3 -c "\n\
|
| 228 |
+
import os, json\n\
|
| 229 |
+
proxies_env = os.getenv('OPENCLAW_GATEWAY_TRUSTED_PROXIES', '10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,100.64.0.0/10')\n\
|
| 230 |
+
proxies = [p.strip() for p in proxies_env.split(',') if p.strip()]\n\
|
| 231 |
+
\n\
|
| 232 |
+
config = {\n\
|
| 233 |
+
'models': {\n\
|
| 234 |
+
'mode': 'merge',\n\
|
| 235 |
+
'providers': {\n\
|
| 236 |
+
'openrouter': {\n\
|
| 237 |
+
'baseUrl': os.getenv('OPENROUTER_BASE_URL'),\n\
|
| 238 |
+
'apiKey': os.getenv('OPENROUTER_API_KEY'),\n\
|
| 239 |
+
'api': 'openai-completions',\n\
|
| 240 |
+
'models': [\n\
|
| 241 |
+
{'id': 'stepfun/step-3.5-flash:free', 'name': 'Step-3.5 Flash (Free)', 'contextWindow': 200000, 'maxTokens': 8192}\n\
|
| 242 |
+
]\n\
|
| 243 |
+
}\n\
|
| 244 |
+
}\n\
|
| 245 |
+
},\n\
|
| 246 |
+
'agents': {\n\
|
| 247 |
+
'defaults': {\n\
|
| 248 |
+
'model': {'primary': 'openrouter/stepfun/step-3.5-flash:free'},\n\
|
| 249 |
+
'workspace': '~/.openclaw/workspace'\n\
|
| 250 |
+
}\n\
|
| 251 |
+
},\n\
|
| 252 |
+
'gateway': {\n\
|
| 253 |
+
'mode': 'local',\n\
|
| 254 |
+
'bind': 'lan',\n\
|
| 255 |
+
'port': int(os.getenv('PORT', 7860)),\n\
|
| 256 |
+
'trustProxy': True,\n\
|
| 257 |
+
'trustedProxies': proxies,\n\
|
| 258 |
+
'auth': {\n\
|
| 259 |
+
'mode': 'token',\n\
|
| 260 |
+
'token': os.getenv('GW_PASS')\n\
|
| 261 |
+
},\n\
|
| 262 |
+
'controlUi': {\n\
|
| 263 |
+
'enabled': True,\n\
|
| 264 |
+
'allowInsecureAuth': True,\n\
|
| 265 |
+
'allowedOrigins': ['*']\n\
|
| 266 |
+
}\n\
|
| 267 |
+
},\n\
|
| 268 |
+
'channels': {\n\
|
| 269 |
+
'feishu': {\n\
|
| 270 |
+
'enabled': True,\n\
|
| 271 |
+
'appId': os.getenv('FEISHU_APP_ID'),\n\
|
| 272 |
+
'appSecret': os.getenv('FEISHU_APP_SECRET'),\n\
|
| 273 |
+
'domain': os.getenv('FEISHU_DOMAIN', 'feishu'),\n\
|
| 274 |
+
'connectionMode': os.getenv('FEISHU_CONNECTION_MODE', 'websocket'),\n\
|
| 275 |
+
'dmPolicy': 'open',\n\
|
| 276 |
+
'allowFrom': ['*'],\n\
|
| 277 |
+
'ignoreEvents': ['im.message.message_read_v1', 'im.chat.access_event.bot_p2p_chat_entered_v1']\n\
|
| 278 |
+
}\n\
|
| 279 |
+
}\n\
|
| 280 |
+
}\n\
|
| 281 |
+
with open('/root/.openclaw/openclaw.json', 'w') as f:\n\
|
| 282 |
+
json.dump(config, f, indent=2)\n\
|
| 283 |
"
|
| 284 |
\n\
|
| 285 |
# 修复权限建议\n\
|