From da3020b4f193bed1f77cc929629ad87df4cd8b6d Mon Sep 17 00:00:00 2001 From: Bruno Charest Date: Fri, 13 Mar 2026 15:59:42 -0400 Subject: [PATCH] feat: Add `start-container.sh` script for backend container orchestration. --- backend/start-container.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/backend/start-container.sh b/backend/start-container.sh index 4635d10..5f2ce76 100644 --- a/backend/start-container.sh +++ b/backend/start-container.sh @@ -27,6 +27,35 @@ find "$FOXY_HOME" -type f \( -name "*.json" -o -name "*.yaml" -o -name "*.yml" \ -exec sed -i 's/\/home\/openclaw/\/home\/foxy/g' {} + 2>/dev/null || true echo "✅ Path patching complete." +# ─── Ensure gateway config is Docker-ready ──────────────────────────────────── +OCCONFIG="$FOXY_HOME/openclaw.json" +if [ -f "$OCCONFIG" ]; then + echo "🔧 Patching OpenClaw config for Docker (LAN bind + Control UI)..." + python3 -c " +import json, sys + +path = sys.argv[1] +with open(path, 'r') as f: + cfg = json.load(f) + +# Ensure gateway section exists +gw = cfg.setdefault('gateway', {}) +gw['bind'] = 'lan' +gw['mode'] = 'local' + +# Control UI: required when bind != loopback +ui = gw.setdefault('controlUi', {}) +ui['dangerouslyAllowHostHeaderOriginFallback'] = True + +with open(path, 'w') as f: + json.dump(cfg, f, indent=2) + +print(' ✅ gateway.bind = lan') +print(' ✅ gateway.mode = local') +print(' ✅ gateway.controlUi.dangerouslyAllowHostHeaderOriginFallback = true') +" "$OCCONFIG" +fi + # ─── Gateway startup ───────────────────────────────────────────────────────── if [ "$OPENCLAW_TYPE" = "standalone" ]; then echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"