Download scripts/start-cloud.sh from hunian003/message: direct link, hf CLI and curl.
- Browser
- Download file 1.21 kB
-
https://huggingface.co/spaces/hunian003/message/resolve/main/scripts/start-cloud.sh
- Command line
-
hf download hf://spaces/hunian003/message/scripts/start-cloud.sh
-
curl -L -o start-cloud.sh https://huggingface.co/spaces/hunian003/message/resolve/main/scripts/start-cloud.sh
1.21 kB
| set -euo pipefail | |
| cd "$(dirname "$0")/.." | |
| for tool in node npm uv; do command -v "$tool" >/dev/null || { echo "缺少必需工具: $tool" >&2; exit 1; }; done | |
| : "${MESSAGE_DATA_DIR:?请设置仓库外的持久数据绝对目录}" | |
| : "${MESSAGE_ALLOWED_HOSTS:?请设置明确的Host允许名单}" | |
| : "${MESSAGE_ALLOWED_ORIGINS:?请设置明确的界面Origin允许名单}" | |
| # 所有安装使用锁文件且不执行依赖安装脚本;此步骤只准备消费者,不随插件安装运行。 | |
| npm ci --ignore-scripts --no-audit --no-fund | |
| uv sync --project apps/market-api --frozen --no-dev --no-install-project | |
| npm run build:web | |
| catalog="${MESSAGE_BOOTSTRAP_CATALOG:-$(pwd)/.build/catalog}" | |
| mkdir -p "$catalog" | |
| npm pack ./plugins/text-tools --ignore-scripts --pack-destination "$catalog" | |
| npm pack ./plugins/mcp-export --ignore-scripts --pack-destination "$catalog" | |
| export MESSAGE_BOOTSTRAP_CATALOG="$catalog" | |
| export MESSAGE_FRONTEND_DIR="$(pwd)/dist/frontend" | |
| exec apps/market-api/.venv/bin/python -m uvicorn app.cloud_main:app --app-dir apps/market-api \ | |
| --host "${MESSAGE_BIND_HOST:-127.0.0.1}" --port "${MESSAGE_PORT:-7860}" --workers 1 \ | |
| --no-proxy-headers --timeout-graceful-shutdown 15 | |