fix(bridge): remove environment= from supervisord programs, inherit from container

supervisord %(ENV_VAR)s expansion fails hard if the variable is absent.
For optional vars like DINGTALK_CLIENT_ID this crashes the entire supervisor.
Fix: remove all per-program environment= directives. All vars are injected
via docker run -e and supervisord child processes inherit them automatically.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-03-08 06:12:52 -07:00
parent 5ec6f113cd
commit c3b31ebf47
1 changed files with 7 additions and 7 deletions

View File

@ -6,11 +6,16 @@ logfile=/dev/stdout
logfile_maxbytes=0
pidfile=/tmp/supervisord.pid
; All env vars (OPENCLAW_GATEWAY_TOKEN, CLAUDE_API_KEY, IT0_INSTANCE_ID,
; IT0_AGENT_SERVICE_URL, DINGTALK_CLIENT_ID, DINGTALK_CLIENT_SECRET, etc.)
; are passed via "docker run -e". Child processes inherit them from supervisord's
; own environment — no need for per-program environment= directives, which would
; cause "cannot be expanded" errors for any var that is absent or optional.
; OpenClaw gateway process
[program:openclaw]
command=node /app/openclaw/dist/openclaw.mjs
directory=/app/openclaw
; No user= — inherited from container user
autostart=true
autorestart=true
startretries=5
@ -18,13 +23,11 @@ stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
environment=HOME="/home/node",NODE_ENV="production",OPENCLAW_GATEWAY_TOKEN="%(ENV_OPENCLAW_GATEWAY_TOKEN)s",CLAUDE_API_KEY="%(ENV_CLAUDE_API_KEY)s"
; IT0 Bridge process
[program:it0-bridge]
command=node /app/bridge/dist/index.js
directory=/app/bridge
; No user= — inherited from container user
autostart=true
autorestart=true
startretries=10
@ -33,14 +36,12 @@ stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
environment=HOME="/home/node",BRIDGE_PORT="3000",OPENCLAW_GATEWAY_URL="ws://127.0.0.1:18789",OPENCLAW_GATEWAY_TOKEN="%(ENV_OPENCLAW_GATEWAY_TOKEN)s",IT0_INSTANCE_ID="%(ENV_IT0_INSTANCE_ID)s",IT0_AGENT_SERVICE_URL="%(ENV_IT0_AGENT_SERVICE_URL)s"
; DingTalk Channel — stays running only if DINGTALK_CLIENT_ID is set.
; Clean exit (code 0) = not configured → supervisord leaves it EXITED, no restart loop.
; start-dingtalk.sh exits 0 when unconfigured → supervisord leaves it EXITED, no restart loop.
[program:dingtalk-channel]
command=/app/bridge/start-dingtalk.sh
directory=/app/bridge
; No user= — inherited from container user
autostart=true
autorestart=unexpected
exitcodes=0
@ -50,4 +51,3 @@ stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
environment=HOME="/home/node",OPENCLAW_GATEWAY_URL="ws://127.0.0.1:18789",OPENCLAW_GATEWAY_TOKEN="%(ENV_OPENCLAW_GATEWAY_TOKEN)s",DINGTALK_CLIENT_ID="%(ENV_DINGTALK_CLIENT_ID)s",DINGTALK_CLIENT_SECRET="%(ENV_DINGTALK_CLIENT_SECRET)s"