4 Commits

Author SHA1 Message Date
4193b46b5f docs: add false completion prevention rules and fix swagger gaps
Changes:
- Add FALSE_COMPLETION_PREVENTION.md documenting false completion patterns
- Add integrity check script (scripts/check-integrity.sh) for automated verification
- Fix swagger annotation gaps in 3 handlers (+10 annotations):
  - password_reset_handler.go: +4 annotations
  - totp_handler.go: +4 annotations
  - log_handler.go: +2 annotations
- Define IntegrationRedisSuite type for Redis integration tests
- Update QUALITY_STANDARD.md with swagger completeness and response format requirements
- Update PROJECT_EXPERIENCE_SUMMARY.md with new learnings on false completion

Integrity check now validates:
- Swagger annotation completeness per handler
- Response format uniformity (with OAuth whitelist)
- Test infrastructure type definitions
- Repository test coverage
2026-04-11 23:38:43 +08:00
3b0bcf0ff7 fix: P0问题修复 - JWT配置、安全扫描、备份、Runbook
P0 问题修复(按照 gap analysis):

1. JWT密钥配置修复
   - config.yaml 移除占位符,改为空字符串
   - 添加测试验证 JWT_SECRET 环境变量覆盖功能

2. Docker 部署完善
   - 添加 deploy.resources 限制(内存 512M,CPU 0.5)
   - 添加 healthcheck 健康检查
   - 添加 restart: unless-stopped 重启策略

3. 安全扫描集成
   - 创建 scripts/security/run-gosec.sh 安全扫描脚本
   - 创建 scripts/security/workflow-template.yml CI工作流模板
   - 运行 gosec 扫描发现 6 个 HIGH 级别整数溢出问题

4. 备份自动化
   - 创建 scripts/backup/backup.sh 自动备份脚本
   - 支持 SQLite 数据库和配置文件备份
   - 支持备份验证、自动清理、恢复功能

5. Runbook 文档
   - 创建 docs/runbooks/ 目录
   - 添加 4 个核心 Runbook:服务启动、服务停止、备份恢复、日志分析
   - 添加 README.md 索引文档
2026-04-08 22:31:43 +08:00
5b6bd93179 refactor: 整理项目根目录结构
整理内容:
- 删除 60+ 临时测试输出文件 (*.txt)
- 移动二进制文件到 bin/ 目录
- 移动 Shell 脚本到 scripts/ 目录
  - scripts/dev/: check_gitea.sh, check_sub2api.sh, run_tests.sh
  - scripts/deploy/: deploy_*.sh, simple_deploy.sh
  - scripts/ops/: fix_nginx.sh, fix_ssl.sh, install_docker.sh
  - scripts/test/: test_*.sh, test_*.bat
- 移动批处理文件到 scripts/
- 移动 Python 脚本到 tools/
- 清理临时日志文件

保留根目录必要文件:
- go.mod, go.sum, go.work
- Makefile, docker-compose.yml
- .env.example, .gitignore
- README.md, AGENTS.md, DEPLOY_GUIDE.md

验证: go build ./... && go test ./... 通过
2026-04-07 18:10:36 +08:00
bbeeb63dfa docs: project docs, scripts, deployment configs, and evidence 2026-04-02 11:22:17 +08:00