tanbushi commited on
Commit
41397b9
·
1 Parent(s): 336c225

简化配置文件并添加环境变量:设置正确的公共URL

Browse files
Files changed (2) hide show
  1. docker-start.sh +5 -0
  2. opencode.json +0 -1
docker-start.sh CHANGED
@@ -23,6 +23,11 @@ echo "✅ .htpasswd file generated at ${HTPASSWD_FILE}"
23
  echo "🤖 Starting OpenCode web server on port ${GATEWAY_PORT}..."
24
  # 确保在正确的目录中启动
25
  cd /app
 
 
 
 
 
26
  # 添加CORS支持,允许所有来源(在代理环境中)
27
  opencode web --port ${GATEWAY_PORT} --hostname ${GATEWAY_HOST} --cors "*" &
28
  OPENCODE_PID=$!
 
23
  echo "🤖 Starting OpenCode web server on port ${GATEWAY_PORT}..."
24
  # 确保在正确的目录中启动
25
  cd /app
26
+ # 设置环境变量
27
+ export OPENCODE_PUBLIC_URL="https://airsltd-ocngx.hf.space/opencode"
28
+ export PUBLIC_URL="https://airsltd-ocngx.hf.space/opencode"
29
+ export BASE_URL="https://airsltd-ocngx.hf.space/opencode"
30
+ echo "🔧 Setting OPENCODE_PUBLIC_URL: ${OPENCODE_PUBLIC_URL}"
31
  # 添加CORS支持,允许所有来源(在代理环境中)
32
  opencode web --port ${GATEWAY_PORT} --hostname ${GATEWAY_HOST} --cors "*" &
33
  OPENCODE_PID=$!
opencode.json CHANGED
@@ -1,6 +1,5 @@
1
  {
2
  "$schema": "https://opencode.ai/config.json",
3
- "baseUrl": "https://airsltd-ocngx.hf.space/opencode",
4
  "theme": "opencode",
5
  "autoupdate": true
6
  }
 
1
  {
2
  "$schema": "https://opencode.ai/config.json",
 
3
  "theme": "opencode",
4
  "autoupdate": true
5
  }