4e21ca937a
Deploy Documentation / deploy (push) Has been cancelled
Canary / Prepare Version (push) Has been cancelled
Canary / build-cli (push) Has been cancelled
Canary / Upload Install Script (push) Has been cancelled
Canary / bundle-desktop (push) Has been cancelled
Canary / bundle-desktop-intel (push) Has been cancelled
Canary / bundle-desktop-linux (push) Has been cancelled
Canary / bundle-desktop-windows (push) Has been cancelled
Canary / bundle-desktop-windows-cuda (push) Has been cancelled
Canary / Release (push) Has been cancelled
Unused Dependencies / machete (push) Has been cancelled
CI / changes (push) Has been cancelled
CI / Check Rust Code Format (push) Has been cancelled
CI / Build and Test Rust Project (push) Has been cancelled
CI / Build Rust Project on Windows (push) Has been cancelled
CI / Check MSRV (push) Has been cancelled
CI / Lint Rust Code (push) Has been cancelled
CI / Check Generated Schemas are Up-to-Date (push) Has been cancelled
CI / Test and Lint Electron Desktop App (push) Has been cancelled
CI / H5 Plaza Tests and Build (push) Has been cancelled
Live Provider Tests / check-fork (push) Has been cancelled
Live Provider Tests / changes (push) Has been cancelled
Live Provider Tests / Build Binary (push) Has been cancelled
Live Provider Tests / Smoke Tests (push) Has been cancelled
Live Provider Tests / Smoke Tests (Code Execution) (push) Has been cancelled
Live Provider Tests / Compaction Tests (push) Has been cancelled
Live Provider Tests / goose server HTTP integration tests (push) Has been cancelled
Publish Ask AI Bot Docker Image / docker (push) Has been cancelled
Publish Docker Image / docker (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
Fork goose with custom MCP widgets, platform extensions (aider, git, web, search), MindSpace H5 backend/frontend, Plaza/Ops UIs, and deploy scripts for tkmind.cn. Co-authored-by: Cursor <cursoragent@cursor.com>
52 lines
1.4 KiB
Bash
Executable File
52 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
||
set -euo pipefail
|
||
|
||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||
H5_DIR="${ROOT}/ui/h5"
|
||
H5_PORT="${H5_PORT:-8080}"
|
||
|
||
if [[ -f "${ROOT}/.env.local" ]]; then
|
||
set -a
|
||
# shellcheck disable=SC1091
|
||
source "${ROOT}/.env.local"
|
||
set +a
|
||
fi
|
||
|
||
export GOOSE_API_TARGET="${GOOSE_API_TARGET:-https://127.0.0.1:${GOOSE_PORT:-18006}}"
|
||
export GOOSE_SERVER__SECRET_KEY="${GOOSE_SERVER__SECRET_KEY:-local-dev-secret}"
|
||
export H5_PORT
|
||
export VITE_GOOSE_WORKING_DIR="${VITE_GOOSE_WORKING_DIR:-${ROOT}}"
|
||
|
||
echo "==> 检查 goosed..."
|
||
if ! curl -sk "${GOOSE_API_TARGET}/status" >/dev/null 2>&1; then
|
||
echo "goosed 未运行,正在启动..."
|
||
"${ROOT}/local_restart.sh"
|
||
fi
|
||
|
||
echo "==> 构建 H5..."
|
||
cd "${H5_DIR}"
|
||
if [[ ! -d node_modules ]]; then
|
||
pnpm install
|
||
fi
|
||
pnpm run build
|
||
|
||
echo "==> 启动 H5 服务 @ http://127.0.0.1:${H5_PORT}"
|
||
node server.mjs &
|
||
H5_PID=$!
|
||
echo "${H5_PID}" > "${ROOT}/.h5.pid"
|
||
|
||
if command -v cloudflared >/dev/null 2>&1 && [[ -f "${HOME}/.cloudflared/config.yml" ]]; then
|
||
echo "==> 启动 Cloudflare Tunnel (goo.tkmind.cn)"
|
||
cloudflared tunnel run goose-local &
|
||
CF_PID=$!
|
||
echo "${CF_PID}" > "${ROOT}/.cloudflared.pid"
|
||
echo ""
|
||
echo "✅ 已启动"
|
||
echo " 本地: http://127.0.0.1:${H5_PORT}"
|
||
echo " 公网: https://goo.tkmind.cn"
|
||
else
|
||
echo ""
|
||
echo "✅ H5 已启动: http://127.0.0.1:${H5_PORT}"
|
||
echo "ℹ️ 未检测到 cloudflared 配置,请参考 deploy/cloudflared/config.yml.example"
|
||
fi
|