Spaces:
Sleeping
Sleeping
update
Browse files74 unmodified lines7576777879808129 unmodified lines11111211311411511611711811912012112212312412512612774 unmodified linesif len(sys.argv) > 1 and sys.argv[1] == \"backup\": backup()\n\else: restore()' > /usr/local/bin/sync.py# 7. 容器入口脚本 (增加 UI 自动填充密码补丁)RUN echo "#!/bin/bash\n\mkdir -p /root/.openclaw/sessions\n\mkdir -p /root/.openclaw/workspace\n\29 unmodified lines}\n\EOF\n\\n\echo \"--- [PATCH] 正在应用 CSP 与 自动登录补丁... ---\"\n\# 1. 解除 iframe 限制\n\find /usr/local/lib/node_modules/openclaw -type f -name \"*.js\" | xargs sed -i 's/frame-ancestors .none./frame-ancestors */g' 2>/dev/null\n\find /usr/local/lib/node_modules/openclaw -type f -name \"*.js\" | xargs sed -i 's/X-Frame-Options/X-Frame-Ignore/g' 2>/dev/null\n\\n\# 2. 注入自动登录逻辑:如果环境变量中有密码,直接注入到前端配置中\n\if [ -n \"\$OPENCLAW_GATEWAY_PASSWORD\" ]; then\n\find /usr/local/lib/node_modules/openclaw -type f -name \"*.js\" | xargs sed -i \"s|process.env.OPENCLAW_GATEWAY_PASSWORD|'\$OPENCLAW_GATEWAY_PASSWORD'|g\" 2>/dev/null\n\# 针对新版 UI 的额外注入:强制覆盖默认 token\n\find /usr/local/lib/node_modules/openclaw -type f -name \"*.js\" | xargs sed -i \"s|gatewayToken:\\\"\\\"|gatewayToken:\\\"\$OPENCLAW_GATEWAY_PASSWORD\\\"|g\" 2>/dev/null\n\fi\n\\n\(while true; do sleep 10800; python3 /usr/local/bin/sync.py backup; done) &\n\\n\74 unmodified lines7576777879808129 unmodified lines11111211311411511611711811912012112212312412574 unmodified linesif len(sys.argv) > 1 and sys.argv[1] == \"backup\": backup()\n\else: restore()' > /usr/local/bin/sync.py# 7. 容器入口脚本 (强力注入自动登录补丁)RUN echo "#!/bin/bash\n\mkdir -p /root/.openclaw/sessions\n\mkdir -p /root/.openclaw/workspace\n\29 unmodified lines}\n\EOF\n\\n\echo \"--- [PATCH] 正在应用强制自动登录补丁... ---\"\n\# 1. 解除 iframe 和 CSP 限制\n\find /usr/local/lib/node_modules/openclaw -type f -name \"*.js\" | xargs sed -i 's/frame-ancestors .none./frame-ancestors */g' 2>/dev/null\n\find /usr/local/lib/node_modules/openclaw -type f -name \"*.js\" | xargs sed -i 's/X-Frame-Options/X-Frame-Ignore/g' 2>/dev/null\n\\n\# 2. 暴力补丁:直接向 HTML 注入脚本,强行修改浏览器的 LocalStorage\n\# 这一段脚本会在网页加载时运行,确保浏览器本地存储里存有正确的 token\n\INJECT_SCRIPT=\"<script>localStorage.setItem('openclaw:gateway:token', '\\\"\$OPENCLAW_GATEWAY_PASSWORD\\\"'); localStorage.setItem('openclaw:gateway:url', 'wss://' + window.location.host);</script>\"\n\find /usr/local/lib/node_modules/openclaw -type f -name \"index.html\" | xargs sed -i \"s|</head>|\$INJECT_SCRIPT</head>|g\" 2>/dev/null\n\\n\(while true; do sleep 10800; python3 /usr/local/bin/sync.py backup; done) &\n\\n\
Dockerfile+7-9