fix: harden backend stability and test production utilities

This commit is contained in:
237899745
2026-07-27 12:17:57 +08:00
parent 2c5a22fad8
commit f90311e68c
20 changed files with 803 additions and 1388 deletions

View File

@@ -81,8 +81,8 @@ sudo chown -R $USER:$USER /var/www/wanwanyun
```bash
cd /var/www/wanwanyun/backend
# 安装依赖
npm install --production
# 严格按锁文件安装生产依赖
npm ci --omit=dev
# 创建数据目录
mkdir -p data storage
@@ -133,6 +133,8 @@ sudo systemctl reload nginx
### 7. 配置系统服务
> 后端当前使用进程内限流器与用量缓存,只能运行一个实例。不要使用 PM2 cluster 模式或同时启动多个 systemd 实例。
创建 systemd 服务文件:
```bash
@@ -242,7 +244,7 @@ sudo tail -f /var/log/nginx/error.log
```bash
cd /var/www/wanwanyun
sudo git pull
cd backend && npm install --production
cd backend && npm ci --omit=dev
sudo systemctl restart wanwanyun
```