Remove built-in proxy from deploy scripts and show pip install progress.

Proxy is optional via manual env vars only; update.sh also drops quiet pip/npm flags.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-28 12:50:06 +08:00
parent e797d188ee
commit 521a0fc66f
3 changed files with 32 additions and 8 deletions
+9 -5
View File
@@ -11,6 +11,8 @@ WEB_PORT="${WEB_PORT:-23566}"
API_PORT="${API_PORT:-8000}"
BRANCH="${BRANCH:-main}"
NODE_MAJOR="${NODE_MAJOR:-20}"
PIP_MIRROR="${PIP_MIRROR:-https://pypi.tuna.tsinghua.edu.cn/simple}"
NPM_REGISTRY="${NPM_REGISTRY:-https://registry.npmmirror.com}"
RED='\033[0;31m'
GREEN='\033[0;32m'
@@ -144,27 +146,29 @@ setup_postgresql() {
}
setup_backend() {
log_info "安装 Python 依赖…"
log_info "安装 Python 依赖(显示完整进度,Paddle 包较大,约 10–30 分钟)…"
cd "${INSTALL_DIR}/backend"
python3 -m venv venv
# shellcheck disable=SC1091
source venv/bin/activate
pip install --upgrade pip -q
pip install -r requirements.txt -q
pip install --upgrade pip --progress-bar on -i "${PIP_MIRROR}"
pip install -r requirements.txt --progress-bar on -i "${PIP_MIRROR}"
deactivate
}
setup_frontend() {
log_info "构建前端…"
cd "${INSTALL_DIR}/frontend"
npm ci --silent
npm config set registry "${NPM_REGISTRY}"
npm ci
npm run build
}
setup_gateway() {
log_info "安装 Web 网关依赖…"
cd "${INSTALL_DIR}/deploy/pm2"
npm ci --silent
npm config set registry "${NPM_REGISTRY}"
npm ci
}
start_pm2() {
+6 -3
View File
@@ -3,6 +3,8 @@ set -euo pipefail
INSTALL_DIR="${INSTALL_DIR:-/opt/secondary-school-grade-archive}"
BRANCH="${BRANCH:-main}"
PIP_MIRROR="${PIP_MIRROR:-https://pypi.tuna.tsinghua.edu.cn/simple}"
NPM_REGISTRY="${NPM_REGISTRY:-https://registry.npmmirror.com}"
GREEN='\033[0;32m'
NC='\033[0m'
@@ -19,17 +21,18 @@ git pull origin "${BRANCH}"
log_info "更新后端依赖…"
cd backend
source venv/bin/activate
pip install -r requirements.txt -q
pip install -r requirements.txt --progress-bar on -i "${PIP_MIRROR}"
deactivate
log_info "重建前端…"
cd ../frontend
npm ci --silent
npm config set registry "${NPM_REGISTRY}"
npm ci
npm run build
log_info "更新网关…"
cd ../deploy/pm2
npm ci --silent
npm ci
log_info "重启 PM2…"
cd "${INSTALL_DIR}"