openclaw: switch to built-in Workbench, drop control-center container
The openclaw package bundles a Control UI (Workbench) served directly at the gateway port. Drop the separate openclaw-control-center app container and point nginx at port 18789 instead of 4310. Added X-Forwarded-Proto/For headers so the gateway can see the real client address through nginx. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
67bf9d18bc
commit
a8cca03c0e
3 changed files with 3 additions and 45 deletions
|
|
@ -28,48 +28,5 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
app = {
|
|
||||||
service = {
|
|
||||||
image = "node:22-alpine";
|
|
||||||
container_name = "openclaw";
|
|
||||||
restart = "unless-stopped";
|
|
||||||
network_mode = "host";
|
|
||||||
volumes = [
|
|
||||||
"/var/openclaw/app:/app"
|
|
||||||
"/var/openclaw/gateway:/gateway"
|
|
||||||
"/root/.openclaw:/root/.openclaw"
|
|
||||||
];
|
|
||||||
environment = {
|
|
||||||
PORT = "4310";
|
|
||||||
UI_BIND_ADDRESS = "127.0.0.1";
|
|
||||||
OPENCLAW_HOME = "/root/.openclaw";
|
|
||||||
OPENCLAW_BIN_PATH = "/gateway/node_modules/.bin/openclaw";
|
|
||||||
OPENCLAW_GATEWAY_TOKEN = "openclaw-local-dev";
|
|
||||||
};
|
|
||||||
command = [
|
|
||||||
"sh" "-c"
|
|
||||||
''
|
|
||||||
set -e
|
|
||||||
apk add --no-cache git
|
|
||||||
if [ ! -d /app/repo ]; then
|
|
||||||
git clone https://github.com/TianyiDataScience/openclaw-control-center.git /app/repo
|
|
||||||
fi
|
|
||||||
cd /app/repo
|
|
||||||
if [ ! -f .env ]; then
|
|
||||||
cp .env.example .env
|
|
||||||
sed -i "s|OPENCLAW_HOME=.*|OPENCLAW_HOME=/root/.openclaw|" .env
|
|
||||||
sed -i "s|PORT=.*|PORT=4310|" .env
|
|
||||||
fi
|
|
||||||
sed -i 's/resolveUiLanguage(url.searchParams, "zh")/resolveUiLanguage(url.searchParams, "en")/g' src/ui/server.ts
|
|
||||||
sed -i 's/hasExplicitLanguage ? resolvedLanguage : "zh"/hasExplicitLanguage ? resolvedLanguage : "en"/g' src/ui/server.ts
|
|
||||||
sed -i 's/language: "zh",/language: "en",/g' src/runtime/ui-preferences.ts
|
|
||||||
npm install
|
|
||||||
npm run build
|
|
||||||
exec npm run dev:ui
|
|
||||||
''
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -242,7 +242,6 @@ in {
|
||||||
"d /var/paperless/consume 0755 root root"
|
"d /var/paperless/consume 0755 root root"
|
||||||
"d /var/paperless/postgres 0755 root root"
|
"d /var/paperless/postgres 0755 root root"
|
||||||
"d /var/paperless/redis 0755 root root"
|
"d /var/paperless/redis 0755 root root"
|
||||||
"d /var/openclaw/app 0755 root root"
|
|
||||||
"d /var/openclaw/gateway 0755 root root"
|
"d /var/openclaw/gateway 0755 root root"
|
||||||
"d /var/riverside/files 0755 root root"
|
"d /var/riverside/files 0755 root root"
|
||||||
"d /var/riverside/postgres 0755 root root"
|
"d /var/riverside/postgres 0755 root root"
|
||||||
|
|
|
||||||
|
|
@ -59,12 +59,14 @@
|
||||||
basicAuthFile = "/var/openclaw/htpasswd";
|
basicAuthFile = "/var/openclaw/htpasswd";
|
||||||
|
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://127.0.0.1:4310/";
|
proxyPass = "http://127.0.0.1:18789/";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_read_timeout 86400;
|
proxy_read_timeout 86400;
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue