| #!/bin/bash |
|
|
| set -e |
|
|
| |
| mkdir -p /root/.openclaw/agents/main/sessions |
| mkdir -p /root/.openclaw/credentials |
| mkdir -p /root/.openclaw/sessions |
|
|
| |
| python3 /app/sync.py restore |
|
|
| |
| CLEAN_BASE=$(echo "$OPENAI_API_BASE" | sed "s|/chat/completions||g" | sed "s|/v1/|/v1|g" | sed "s|/v1$|/v1|g") |
|
|
| |
| cat > /root/.openclaw/openclaw.json <<EOF |
| { |
| "logging": { |
| "level": "debug", |
| "consoleLevel": "debug", |
| "consoleStyle": "pretty", |
| "redactSensitive": "tools" |
| }, |
| "session": { |
| "dmScope": "per-channel-peer" |
| }, |
| "models": { |
| "providers": { |
| "nvidia": { |
| "baseUrl": "$OPENAI_API_BASE", |
| "apiKey": "$OPENAI_API_KEY", |
| "api": "openai-completions", |
| "models": [ |
| { "id": "$MODEL", "name": "$MODEL", "contextWindow": 128000 } |
| ] |
| } |
| } |
| }, |
| "agents": { "defaults": { "model": { "primary": "nvidia/$MODEL" } } }, |
| "commands": { |
| "restart": true |
| }, |
| "gateway": { |
| "mode": "local", |
| "bind": "lan", |
| "port": $PORT, |
| "trustedProxies": ["0.0.0.0/0"], |
| "auth": { "mode": "token", "token": "$OPENCLAW_GATEWAY_PASSWORD" }, |
| "controlUi": { |
| "allowedOrigins": ["https://r1000-openclaw.hf.space"], |
| "enabled": true, |
| "allowInsecureAuth": true, |
| "dangerouslyDisableDeviceAuth": true, |
| "dangerouslyAllowHostHeaderOriginFallback": true |
| }, |
| }, |
| "tools": { |
| "agentToAgent": { |
| "enabled": true, |
| "allow": ["assistant", "coder", "designer"] |
| }, |
| "allow": ["exec", "read", "write", "edit", "process", "bash", "sessions_spawn", "sessions_send", "sessions_list", "message", "gateway", "cron"], |
| "deny": [], |
| "elevated": { |
| "enabled": true, |
| "allowFrom": { |
| "line": ["*"], |
| "discord": ["*"] |
| } |
| } |
| } |
| } |
| EOF |
|
|
| |
| (while true; do sleep 1800; python3 /app/sync.py backup; done) & |
|
|
| |
| openclaw doctor --fix |
|
|
| exec openclaw gateway run --port $PORT |