c9a99f4fb3
代码修复: - web/agent/agent.py: datetime.utcnow() → datetime.now(timezone.utc) - requirements.txt: 移除 paramiko==3.5.0 (已无活跃引用) - 删除 server/infrastructure/ssh/pool.py (DEPRECATED, 无引用) 连接池三层对齐 (config.py/.env.example/session.py): - DB_POOL_SIZE 100→160, DB_MAX_OVERFLOW 100→120 - 基于 MySQL max_connections=400, install.php 公式 文档修复 (21项): - P0: 硬编码域名/IP替换为配置变量占位符 - P1: 10个过时设计文档加归档标注 (引用旧文件结构) - P2: step-3-webssh报告 paramiko引用修正 - 6份审查报告连接池参数勘误 100/100→160/120 - ECC安全报告 EC5 datetime.utcnow 标记已修复 - docs/README.md 文档索引重写 - docs/memory/mem_nexus_overview.md 移除硬编码凭证 - docs/project/tech-stack-inventory.md paramiko标记已移除 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5.0 KiB
5.0 KiB
Nexus 6.0 关键文件清单 (2026-05-21 更新)
后端 (server/)
入口与配置
server/main.py— FastAPI 应用入口,lifespan,CORS,后台任务server/config.py— Settings + DB override + CORS_ORIGINSserver/domain/models/__init__.py— SQLAlchemy 模型(10表)
API 层
server/api/agent.py— Agent心跳接收 + 命令注入防护(BLOCKED_COMMAND_PATTERNS)server/api/auth.py— Login/logout/TOTP(旧)server/api/auth_jwt.py— JWT认证(新)server/api/websocket.py—/ws/alerts告警广播server/api/servers.py— 服务器CRUD + Redis实时状态server/api/settings.py— 动态配置读写server/api/health.py—/health端点(3层守护用)server/api/scripts.py— 脚本执行server/api/dependencies.py— FastAPI 依赖注入
应用服务层
server/application/services/auth_service.py— Redis session store(session:{token} 8h滑动TTL)server/application/services/server_service.py— Agent健康检查(httpx+Semaphore20)+ push委托server/application/services/sync_service.py— 批量推送引擎server/application/services/script_service.py— 脚本执行服务
后台任务
server/background/heartbeat_flush.py— Redis→MySQL 10min批量(TTL=900s)server/background/self_monitor.py— Python自检 30s循环
基础设施
server/infrastructure/redis/client.py— Redis异步客户端(max_connections从settings读)server/infrastructure/ssh/asyncssh_pool.py— asyncssh SSH连接池 (旧 paramiko pool.py 已删除)server/infrastructure/telegram/__init__.py— Telegram推送(httpx模块级单例)server/infrastructure/database/crypto.py— Fernet+AES双格式加密server/infrastructure/database/session.py— SQLAlchemy异步sessionserver/infrastructure/database/server_repo.py+setting_repo.py+admin_repo.py+ 等 — Repository层
前端 (web/) — PHP待替换
当前PHP文件(将被Tailwind CSS v4 + 静态HTML/JS替换)
web/install.php— 5步安装向导web/login.php/web/logout.php/web/totp.php— 认证web/index.php— Dashboardweb/servers.php— 服务器列表web/files.php/web/fm.php/web/tinyfm.php/web/webfm.php— 文件管理web/settings.php/web/config.php— 配置web/push.php/web/retry.php/web/schedules.php— 推送web/audit.php/web/logs.php— 审计日志web/scripts.php/web/deploy.php— 脚本与部署web/db.php/web/api_client.php/web/api_proxy.php— 数据层web/app.js/web/style.css— 前端资源web/ace/— ACE编辑器web/agent/agent.py/agent.sh/install.sh— Agent安装脚本
部署 (deploy/)
deploy/nexus.conf— Supervisor配置(uvicorn 4 workers)deploy/health_monitor.sh— Shell守护(cron 1min,3次失败→重启+Telegram)deploy/nginx_172.31.170.47.conf— WSL Nginx配置deploy/migrations/001_indexes.sql— 7个数据库索引
文档 (docs/)
项目顶层
docs/project/status.md— 项目进度总览 + 数据库结构 + 迭代计划docs/project/roadmap.md— 功能规划 + ADR决策 + 实现顺序docs/project/deploy.md— 部署指南docs/CLAUDE.md— 项目记忆(仓库根目录)
部门协作
docs/team/collaboration-charter.md— 部门协作章程(5阶段流水线)docs/team/(8个部门文档) — 管理组/工程部/测试部/产品部/设计部/CTO/运维/HR/制片人
技能定义
docs/skills/— 194个技能文件(各部门技能定义)
设计规格与实施计划
docs/design/specs/— 10个设计规格(推送/密码/重试/文件管理器/架构/等)docs/design/plans/— 5个实施计划
竞品分析
docs/research/jumpserver-easynode-architecture-analysis.md— JumpServer & EasyNode架构分析
项目记忆
docs/memory/MEMORY.md— 记忆索引docs/memory/mem_*.md— 17个记忆文件(概述/决策/数据流/守护/模块/测试/等)
修复文档
docs/changelog/fix-plan-2026-05-20.md— 代码问题修复计划(13项)docs/changelog/fix-plan-full-2026-05-20.md— 全量未完成项修复计划(24项)docs/changelog/fix-verification-report-2026-05-20.md— 修复验证报告
测试 (tests/)
tests/conftest.py— pytest + async fixturestests/test_api.py— API测试tests/load_test.py+tests/quick_load.py— 负载测试
MCP服务 (mcp/)
mcp/Nexus_server.py— Nexus远程MCP服务mcp/mcp_bridge.py— MCP桥接mcp/firefox_server.py— Firefox自动化MCP
配置
.env.example— 环境变量模板requirements.txt— Python依赖.gitea/workflows/ci-cd.yml+pre-commit.yml— CI/CD流水线
相关概念
- Nexus
- files
- reference
- architecture
- docs
- skills
- deployment
- testing
更新: 2026-05-21 全面整理