Files
vue-driven-cloud-storage/docker-compose.yml
yuyx efaa2308eb feat: 全面优化代码质量至 8.55/10 分
## 安全增强
- 添加 CSRF 防护机制(Double Submit Cookie 模式)
- 增强密码强度验证(8字符+两种字符类型)
- 添加 Session 密钥安全检查
- 修复 .htaccess 文件上传漏洞
- 统一使用 getSafeErrorMessage() 保护敏感错误信息
- 增强数据库原型污染防护
- 添加被封禁用户分享访问检查

## 功能修复
- 修复模态框点击外部关闭功能
- 修复 share.html 未定义方法调用
- 修复 verify.html 和 reset-password.html API 路径
- 修复数据库 SFTP->OSS 迁移逻辑
- 修复 OSS 未配置时的错误提示
- 添加文件夹名称长度限制
- 添加文件列表 API 路径验证

## UI/UX 改进
- 添加 6 个按钮加载状态(登录/注册/修改密码等)
- 将 15+ 处 alert() 替换为 Toast 通知
- 添加防重复提交机制(创建文件夹/分享)
- 优化 loadUserProfile 防抖调用

## 代码质量
- 消除 formatFileSize 重复定义
- 集中模块导入到文件顶部
- 添加 JSDoc 注释
- 创建路由拆分示例 (routes/)

## 测试套件
- 添加 boundary-tests.js (60 用例)
- 添加 network-concurrent-tests.js (33 用例)
- 添加 state-consistency-tests.js (38 用例)
- 添加 test_share.js 和 test_admin.js

## 文档和配置
- 新增 INSTALL_GUIDE.md 手动部署指南
- 新增 VERSION.txt 版本历史
- 完善 .env.example 配置说明
- 新增 docker-compose.yml
- 完善 nginx.conf.example

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 10:45:51 +08:00

84 lines
2.3 KiB
YAML

# ============================================
# 玩玩云 Docker Compose 配置
# ============================================
# 使用方法:
# 1. 复制 backend/.env.example 为 backend/.env 并修改配置
# 2. 运行: docker-compose up -d
# 3. 访问: http://localhost (或配置的域名)
# ============================================
version: '3.8'
services:
# ============================================
# 后端服务
# ============================================
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: wanwanyun-backend
restart: unless-stopped
environment:
- NODE_ENV=production
- PORT=40001
# 以下配置建议通过 .env 文件或环境变量设置
# - JWT_SECRET=your-secret-key
# - ADMIN_USERNAME=admin
# - ADMIN_PASSWORD=admin123
env_file:
- ./backend/.env
volumes:
# 数据持久化
- ./backend/data:/app/data
- ./backend/storage:/app/storage
networks:
- wanwanyun-network
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:40001/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# ============================================
# Nginx 前端服务
# ============================================
nginx:
image: nginx:alpine
container_name: wanwanyun-nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
# 前端静态文件
- ./frontend:/usr/share/nginx/html:ro
# Nginx 配置
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
# SSL 证书(如有)
- ./nginx/ssl:/etc/nginx/ssl:ro
# Let's Encrypt 证书目录(可选)
# - /etc/letsencrypt:/etc/letsencrypt:ro
# - ./certbot/www:/var/www/certbot:ro
depends_on:
- backend
networks:
- wanwanyun-network
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost/"]
interval: 30s
timeout: 10s
retries: 3
networks:
wanwanyun-network:
driver: bridge
# ============================================
# 可选: 数据卷(用于更持久的数据存储)
# ============================================
# volumes:
# wanwanyun-data:
# wanwanyun-storage: