Commit Graph
100 Commits
Author SHA1 Message Date
19174616018 3b04f04a31 feat: 全屏截图改用管理后台框架 2025-12-31 20:12:39 +08:00
19174616018 ea1c7e8a00 feat: wkhtmltoimage支持自定义高度 2025-12-31 20:05:39 +08:00
19174616018 d269a99d3c fix: wkhtmltoimage使用安全cookie 2025-12-31 19:41:34 +08:00
19174616018 7c3d0a0947 fix: wkhtmltoimage兼容UA参数 2025-12-31 19:13:20 +08:00
19174616018 7cf39f80bc fix: 兼容旧浏览器后台与截图开关 2025-12-31 19:04:42 +08:00
19174616018 d108f3b51d bust spa asset cache by build id 2025-12-31 18:22:03 +08:00
19174616018 41ead4bead replace screenshot pipeline and update admin 2025-12-31 16:50:35 +08:00
19174616018andClaude Opus 4.5 2d98ab66a3 fix: 修复公告关闭功能 - 当次关闭与永久关闭区分
问题:不管选择"当次关闭"还是"永久关闭",都会永久关闭公告

修复:
- 当次关闭:使用 sessionStorage + pageToken
  - pageToken 基于 performance.timeOrigin 生成
  - 刷新页面后 token 变化,公告重新显示
- 永久关闭:使用 localStorage
  - 持久化存储,刷新/重开后不再显示

修改文件:
- app-frontend/src/layouts/AppLayout.vue
- templates/index.html

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 21:51:28 +08:00
19174616018andClaude Opus 4.5 70e09c83a8 fix: 修复浏览器池任务丢失和统计错误 bug
问题:
1. 当浏览器创建失败时,failed_tasks 增加但 total_tasks 不增加
   导致统计显示 "0/5" 这种不合理数据
2. 浏览器创建失败时任务直接丢失,没有重新分配给其他 Worker

修复:
- 添加本地浏览器创建重试(最多2次)
- 失败任务根据 retry_count 决定是否重新入队
- retry_count < 1 时重新入队让其他 Worker 处理
- retry_count >= 1 时才真正失败并计入统计
- 任务字典新增 retry_count 字段初始化为 0
- 添加回归测试用例

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 21:26:56 +08:00
19174616018andClaude Opus 4.5 01ffaf96a3 fix: CPU显示修复 + 报表面板添加浏览器池状态
1. CPU 显示修复:
   - routes/admin_api/core.py: 新增 _get_server_cpu_percent()
   - 首次调用使用 interval=0.1 避免返回 0.0
   - 后续调用使用缓存,TTL 1秒

2. 报表面板浏览器池状态:
   - admin-frontend/src/api/browser_pool.js: 新增 API 调用
   - ReportPage.vue: 添加浏览器池状态卡片
   - 显示总/活跃/空闲 Worker 数和队列等待数
   - Worker 表格带状态颜色标签(活跃/空闲/异常)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 20:15:48 +08:00
19174616018andClaude Opus 4.5 1b20478a08 feat: 风险分定时衰减 + 密码提示修复 + 浏览器池API + next回跳
1. 风险分衰减定时任务:
   - services/scheduler.py: 每天 CST 04:00 自动执行 decay_scores()
   - 支持 RISK_SCORE_DECAY_TIME_CST 环境变量覆盖

2. 密码长度提示统一为8位:
   - app-frontend/src/pages/RegisterPage.vue
   - app-frontend/src/layouts/AppLayout.vue
   - admin-frontend/src/pages/SettingsPage.vue
   - templates/register.html

3. 浏览器池统计API:
   - GET /yuyx/api/browser_pool/stats
   - 返回 worker 状态、队列等待数等信息
   - browser_pool_worker.py: 增强 get_stats() 方法

4. 登录后支持 next 参数回跳:
   - app-frontend/src/pages/LoginPage.vue: 检查 ?next= 参数
   - 仅允许站内路径(防止开放重定向)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 18:28:21 +08:00
19174616018andClaude Opus 4.5 3d9dba272e refactor: 删除版本更新功能 + 报表页自动刷新
删除版本与更新功能:
- routes/admin_api/update.py: 删除整个文件
- routes/admin_api/__init__.py: 移除 update 模块注册
- admin-frontend/src/pages/SystemPage.vue: 移除版本更新UI区块
- admin-frontend/src/api/update.js: 删除整个文件
- 删除 static/admin/assets/update-*.js

报表页自动刷新:
- admin-frontend/src/pages/ReportPage.vue: 添加 setInterval 每1秒刷新
- 在 onMounted 启动定时器,onUnmounted 清除
- 覆盖统计数据、运行中任务、系统信息等所有动态数据

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 12:41:26 +08:00
19174616018andClaude Opus 4.5 89f3fd9759 feat: 安全增强 + 删除密码重置申请功能 + 登录提醒开关
安全增强:
- 新增 SSRF、XXE、模板注入、敏感路径探测检测规则
- security/constants.py: 添加新的威胁类型和检测模式
- security/threat_detector.py: 实现新检测逻辑

删除密码重置申请功能:
- 移除 /api/password_resets 相关API
- 删除 password_reset_requests 数据库表
- 前端移除密码重置申请页面和菜单
- 用户只能通过邮��找回密码,未绑定邮箱需联系管理员

登录提醒全局开关:
- email_service.py: 添加 login_alert_enabled 字段
- routes/api_auth.py: 检查开关状态再发送登录提醒
- EmailPage.vue: 添加新设备登录提醒开关

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 12:08:36 +08:00
19174616018andClaude Opus 4.5 4ba933b001 feat: 添加安全仪表板前端页面
- 新增 SecurityPage.vue: 统计卡片、威胁事件表格、封禁管理、风险查询
- 新增 api/security.js: 安全相关API封装
- 路由添加 /security 页面
- 侧边栏添加"安全防护"菜单项

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 01:56:22 +08:00
19174616018andClaude Opus 4.5 759d99e8af fix: add security module to Dockerfile
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 01:31:51 +08:00
19174616018andClaude Opus 4.5 46253337eb feat: 实现完整安全防护系统
Phase 1 - 威胁检测引擎:
- security/threat_detector.py: JNDI/SQL/XSS/路径遍历/命令注入检测
- security/constants.py: 威胁检测规则和评分常量
- 数据库表: threat_events, ip_risk_scores, user_risk_scores, ip_blacklist

Phase 2 - 风险评分与黑名单:
- security/risk_scorer.py: IP/用户风险评分引擎,支持分数衰减
- security/blacklist.py: 黑名单管理,自动封禁规则

Phase 3 - 响应策略:
- security/honeypot.py: 蜜罐响应生成器
- security/response_handler.py: 渐进式响应策略

Phase 4 - 集成:
- security/middleware.py: Flask安全中间件
- routes/admin_api/security.py: 管理后台安全仪表板API
- 36个测试用例全部通过

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-27 01:28:38 +08:00
19174616018 e3b0c35da6 Harden auth risk controls and admin reauth 2025-12-26 21:07:47 +08:00
19174616018 f90b0a4f11 Harden auth, CSRF, and email log UX 2025-12-26 19:05:42 +08:00
19174616018andClaude Opus 4.5 ec84903745 fix: 启动后60秒内所有请求使用15秒超时
问题:之前的 _first_request 只对第一个HTTP请求有效,但login()
需要两次请求(GET登录页+POST登录),导致实际的POST登录
请求仍然只有5秒超时,在冷启动时容易失败。

修复:改为基于模块启动时间的超时策略
- 启动后60秒内:所有请求使用15秒超时
- 60秒后:恢复正常的5秒超时

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 01:42:03 +08:00
19174616018andClaude Opus 4.5 151fc3e09f perf: 启动预热优化 - 解决容器重启后首批任务慢/失败
问题:容器重启后前两批任务明显变慢或失败
- 第一批:代理/目标服务器连接冷启动导致超时
- 第二批:浏览器池冷启动需要创建浏览器

解决方案:
- browser_pool_worker.py: 添加 pre_warm 参数,启动时预创建1个浏览器
- api_browser.py: 添加 warmup_api_connection() 预热 TCP/TLS 连接
- api_browser.py: 首次请求使用更长超时(10s),后续恢复正常
- app.py: 启动时后台调用 API 预热

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 01:18:18 +08:00
19174616018andClaude Opus 4.5 1d44859857 perf: 优化任务执行速度 (40-70s → ~15s)
问题:容错机制引入了大量叠加的等待时间

优化内容:
- playwright_automation.py:
  - 登录超时 30s → 10s
  - 导航等待 2s → 0.5s
  - navigate_only 等待 1s → 0.3s
  - 首页轮询 8次×3s → networkidle + 2次×0.5s
- services/tasks.py:
  - 删除截图前固定 sleep(2)
- services/screenshots.py:
  - networkidle 超时 30s → 10s
  - selector 超时 20s → 5s

预计性能提升:从 40-70 秒降至约 15 秒

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 00:19:46 +08:00
19174616018andClaude Opus 4.5 79a571e58d fix: 容器重启后第一批任务失败
问题:容器重启时账号对象的 is_running 状态未被重置,
导致新任务提交时被拒绝("任务已在运行中")

修复:在启动流程中添加遗留任务状态清理逻辑
- 重置所有账号的 is_running/should_stop/status
- 清理活跃任务句柄

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 23:32:20 +08:00
19174616018andClaude Opus 4.5 5f4fb50001 refactor: 统一日志管理 + 数据库索引优化
- db/schema.py: 添加 4 个复合索引优化查询性能
  - idx_user_schedules_user_enabled
  - idx_schedule_execution_logs_schedule_id/user_id/status
- db/users.py: print → logger,密码升级日志改为记录 user_id
- crypto_utils.py: print → logger
- password_utils.py: print → logger

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 22:57:03 +08:00
19174616018 c5f019be5a chore: restore API request timeout 5s 2025-12-18 09:46:01 +08:00
19174616018 433a3cb806 fix: avoid blocking browser init 2025-12-18 09:38:02 +08:00
19174616018 5851120f87 fix: admin auth UX, password policy, deps, db pool 2025-12-17 23:53:11 +08:00
19174616018 9028f7e272 ui: 移除定时任务停用标签 2025-12-17 22:12:06 +08:00
19174616018 2ef0a10d6f fix(ui): 开关可见与布局对齐 2025-12-17 22:03:15 +08:00
19174616018 2f5940d339 fix(ui): 开关可见与卡片不拉伸 2025-12-17 21:14:54 +08:00
19174616018 db4201a269 fix(ui): 定时任务开关禁用态更清晰 2025-12-17 20:44:49 +08:00
19174616018 5393648d21 fix(api): 列表页失败不算完成 2025-12-17 19:24:08 +08:00
19174616018 3f667dd21b fix(api): 超时按单条处理避免中途结束 2025-12-17 15:49:05 +08:00
19174616018 6827d11f40 chore(update): 忽略备份文件的脏工作区提示 2025-12-16 23:48:58 +08:00
19174616018 4c9bed0f0b perf: 默认请求超时降为5s 2025-12-16 23:17:21 +08:00
19174616018 0e587ca497 ui: 运行中仅显示已浏览内容数 2025-12-16 21:23:03 +08:00
19174616018 1b707fdace fix: 浏览内容进度实时显示 2025-12-16 21:19:48 +08:00
19174616018 2abb9ab494 fix: 账号截图开关持久化与状态推送优化 2025-12-16 18:27:45 +08:00
19174616018 e699f4fb94 更新管理后台布局 2025-12-15 22:18:44 +08:00
19174616018 d650c6f584 优化报表页面,移除统计页面 2025-12-15 22:12:15 +08:00
19174616018 9aa28f5b9e 添加报表页面,更新用户管理和注册功能 2025-12-15 21:39:32 +08:00
19174616018 738eaa5211 更新邮件服务和SMTP配置功能 2025-12-15 20:32:28 +08:00
19174616018 8846945208 更新邮件页面和管理API 2025-12-15 17:16:56 +08:00
19174616018 49897081b6 更新日志页面和统计页面
- 更新 LogsPage 和 StatsPage 组件
- 添加 taskSource 工具模块
- 更新 db/tasks.py
- 重新构建前端静态资源
2025-12-15 16:25:37 +08:00
19174616018 a8b9f225bd 更新系统页面和更新功能
- 更新 admin-frontend 系统页面和更新 API
- 更新 routes 和 services 中的更新逻辑
- 重新构建前端静态资源
2025-12-15 15:58:12 +08:00
19174616018 de6d269fb4 更新 update_agent.py 2025-12-15 15:09:34 +08:00
19174616018 0d1397debe 添加自动更新功能 2025-12-15 14:34:08 +08:00
19174616018 809c735498 添加一键部署脚本 2025-12-15 13:57:25 +08:00
19174616018 10d5363e29 更新 schedules.py 2025-12-15 13:30:40 +08:00
19174616018 a619e96e73 同步本地更改 2025-12-15 10:48:58 +08:00
19174616018 dab29347bd 更新定时任务页面和前端构建 2025-12-14 23:09:27 +08:00
19174616018 1ec0d80f6c 清理冗余文件,更新 Dockerfile 和配置 2025-12-14 22:49:00 +08:00
19174616018 dac06d187e 更新 playwright_automation 和 screenshots 服务 2025-12-14 22:04:05 +08:00
19174616018 a346509a5f 同步更新:重构路由、服务模块,更新前端构建 2025-12-14 21:47:46 +08:00
19174616018andClaude Opus 4.5 cbddaf810e fix: 直接对iframe内容进行full_page截图
使用iframe.screenshot(full_page=True)来截取iframe内的完整内容。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 16:23:05 +08:00
19174616018andClaude Opus 4.5 a3497f2921 fix: 展开所有可滚动容器以截取完整页面内容
在截图前通过JavaScript展开所有带overflow的容器,确保full_page能够捕获全部内容。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 16:17:51 +08:00
19174616018andClaude Opus 4.5 94ceb959c7 fix: 使用JavaScript展开iframe高度以截取完整内容
在截图前通过JavaScript动态调整iframe及其父容器的高度,使其能够显示全部内容。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 16:11:58 +08:00
19174616018andClaude Opus 4.5 b408e78c74 fix: 改进截图逻辑,直接截取表格元素
尝试截取table.ltable元素来获取完整内容,而不是依赖full_page参数。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 16:08:41 +08:00
19174616018andClaude Opus 4.5 4400ded86a fix: 修复截图只截取可见区域的问题
改为对iframe内容进行截图而不是主页面,这样full_page=True才能正确截取iframe内的完整内容。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 16:04:36 +08:00
19174616018andClaude Opus 4.5 4510fbba83 fix: 修复截图只能截取区域的问题,改为截取整个网页内容
将 full_page=False 改为 full_page=True,使截图能够捕获完整的网页内容而不仅仅是可见区域。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-14 15:49:49 +08:00
19174616018 a9c8aac48f fix: 账号页闪烁/浏览类型/截图复制/时区统一 2025-12-14 11:30:49 +08:00
19174616018 2ec88eac3b fix(app): refine account progress and screenshots 2025-12-14 01:21:31 +08:00
19174616018 8931ad5d7f fix(app): screenshot copy button copies image; add copy link 2025-12-14 00:59:02 +08:00
19174616018 b4c7a3eac9 fix(app): hide account progress when idle; screenshot uses selected browse_type 2025-12-14 00:56:12 +08:00
19174616018 757de96fd9 fix(app): allow remark-only edit in accounts 2025-12-14 00:38:07 +08:00
19174616018 69443c2de6 feat(app): add announcements, feedback, settings (stage 5) 2025-12-14 00:27:05 +08:00
19174616018 54cf6fe538 feat(app): migrate schedules and screenshots (stage 4) 2025-12-14 00:15:19 +08:00
19174616018 9798ed52c3 feat(app): migrate /app accounts to Vue SPA (stage 3) 2025-12-13 23:56:47 +08:00
19174616018 324e0d614a feat(app): migrate auth pages to Vue SPA (stage 2) 2025-12-13 23:30:51 +08:00
19174616018 34f44eed3e feat(app): scaffold Vue3 frontend (stage 1) 2025-12-13 22:42:31 +08:00
19174616018 39153cc946 docs: confirm frontend refactor decisions 2025-12-13 22:32:27 +08:00
19174616018 56d2cadd81 docs: frontend UI refactor plan 2025-12-13 22:26:28 +08:00
19174616018 6bff5e4d97 fix: stats loader and smtp daily reset 2025-12-13 22:01:12 +08:00
19174616018 85a60009f3 chore(admin): final polish and QA doc 2025-12-13 21:46:34 +08:00
19174616018 49bc8b83b1 perf(admin): lazy routes and nav badges 2025-12-13 21:13:57 +08:00
19174616018 235ba28cc8 feat(admin): migrate admin UI to Vue3 2025-12-13 20:51:44 +08:00
19174616018 3c31f30ee4 docs: admin UI refactor plan 2025-12-13 20:51:08 +08:00
19174616018 2bc7dad44c fix: docker-compose挂载database.py 2025-12-13 19:01:22 +08:00
19174616018 7015de0055 feat: 添加公告功能 2025-12-13 18:40:42 +08:00
19174616018 d7d878dc08 fix: 内存溢出与任务调度优化 2025-12-13 17:40:36 +08:00
19174616018andClaude Opus 4.5 9e761140c1 feat: SMTP配额自动重置(北京时间凌晨0点)
- 添加reset_smtp_daily_quota函数主动重置配额
- 添加定时任务在北京时间00:00自动重置SMTP配额
- 保留被动重置作为备份机制

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 04:01:50 +08:00
19174616018andClaude Opus 4.5 a7976bcdfc fix: SMTP配额重置使用北京时间
- 添加pytz时区支持
- 配额重置日期改为使用北京时间(UTC+8)
- 确保配额在北京时间凌晨0点重置,而不是UTC时间

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 03:57:44 +08:00
19174616018andClaude Opus 4.5 d77595eba0 fix: 修复定时任务日志重复打印问题
- 添加配置变化检测,只在首次运行或配置变化时打印日志
- 避免每5秒重复打印相同的定时任务设置日志
- 减少日志噪音,提高日志可读性

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 03:38:47 +08:00
19174616018andClaude Opus 4.5 42cc86e290 fix: 修复browser_installer.py语法错误,同步服务器代码
- 修复browser_installer.py顶部错误的import语句
- 移除browser_installer.py中未正确实现的_cleanup_zombie_processes方法
- 恢复playwright_automation.py中的SIGKILL(服务器版本)
- 同步database.py和email_service.py的最新代码

注意:内存占用从50MB增加到142MB是正常的,因为:
1. 4个浏览器Worker线程(按需模式)占用基础内存
2. 新增的清理代码和SIGCHLD处理器占用少量内存
3. 当前内存使用在正常范围内

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 03:35:12 +08:00
19174616018andClaude Opus 4.5 512380a80d 删除敏感文件,更新.gitignore
删除的文件:
- data/cookies/*.json - 用户登录凭据
- deploy_to_production.sh - 服务器信息
- verify_deployment.sh - 服务器信息
- data/*.backup_* - 数据库备份
- docs/ - 内部文档
- ftp-manager.db - 无用空文件

更新.gitignore防止再次提交

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 15:41:33 +08:00
19174616018andClaude Opus 4.5 90f503518f 修复bug和清理调试代码
1. email_service.py: 删除未定义的log_email_send调用(send_email内部已记录日志)
2. app.py: 删除[DEBUG run_task]调试打印语句
3. playwright_automation.py: 删除[调试]诊断日志块

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 15:36:36 +08:00
19174616018 9c298928f3 添加自动备注日志 2025-12-12 10:48:36 +08:00
19174616018 db956e2487 自动获取真实姓名作为账号备注(静默完成) 2025-12-12 10:36:47 +08:00
19174616018andClaude Opus 4.5 8c8c708ce7 fix: 修复send_email参数名错误
使用正确的参数名: to_email, body, html_body

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 23:31:22 +08:00
19174616018andClaude Opus 4.5 264fc9e3f3 fix: 修复批次邮件在截图完成后发送
之前邮件在run_task线程结束时发送,但截图是异步的,导致截图还没完成就发送了。
现在改为在截图回调中检测,当所有截图完成时才发送打包邮件。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 23:27:56 +08:00
19174616018andClaude Opus 4.5 d6fa5b91ea feat: 定时任务截图打包发送邮件
1. 添加批次任务跟踪机制,收集同一定时任务的所有账号截图
2. 等所有账号执行完成后,将截图打包成ZIP发送一封邮件
3. 邮件包含任务执行详情表格和统计信息

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 23:21:24 +08:00
19174616018andClaude Opus 4.5 a3b97683ae fix: 使用容器内可用字体生成验证码
尝试多个字体路径,优先使用Liberation字体

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 22:52:39 +08:00
19174616018andClaude Opus 4.5 8ddf47c2aa fix: 增大验证码显示尺寸
前端验证码图片高度从36/40px增大到50px,配合后端生成的160x60图片

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 22:49:35 +08:00
19174616018andClaude Opus 4.5 ad3062bd28 fix: 修复邮件设置checkbox点击范围过大问题
将label改为div+span结构,使只有checkbox本身可点击

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 22:48:06 +08:00
19174616018andClaude Opus 4.5 79cf3c2f30 fix: 修复邮箱绑定验证错误及多项改进
1. 修复email_verified字段缺失导致的500错误
2. 将邮件主题从"知识管理平台"改为"自动化学习"
3. 增大验证码字体(28->42)和图片尺寸(120x40->160x60)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 22:45:44 +08:00
19174616018andClaude Opus 4.5 65e2414ede fix: 修复邮件Token时间解析错误
问题:数据库中的时间戳包含微秒(如 2025-12-11 14:31:20.307257),
但代码使用 '%Y-%m-%d %H:%M:%S' 格式解析会报错。

解决:添加 parse_datetime() 函数,支持带微秒和不带微秒两种格式。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 22:33:46 +08:00
19174616018andClaude Opus 4.5 b8abd6e1a2 feat: 添加邮件功能第六阶段 - API浏览任务通知
在API模式浏览任务完成时(不截图的情况下),也发送任务完成邮件通知

修改位置: app.py run_browse_task函数
- 在enable_screenshot=False时,浏览成功后发送邮件通知
- 复用email_service.send_task_complete_email_async()

至此邮件功能六个阶段全部完成:
1. 邮件基础设施(多SMTP配置、故障转移)
2. 注册邮箱验证
3. 密码重置邮件
4. 任务完成通知(带截图)
5. 用户邮箱绑定
6. API浏览任务通知

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 22:22:07 +08:00
19174616018andClaude Opus 4.5 29d4bdfbcb feat: 添加邮件功能第五阶段 - 用户邮箱绑定
1. 添加邮箱绑定验证邮件模板 (templates/email/bind_email.html)
2. 在email_service.py中添加:
   - send_bind_email_verification() 发送绑定验证邮件
   - verify_bind_email_token() 验证绑定Token
3. 在database.py中添加:
   - update_user_email() 更新用户邮箱
4. 在app.py中添加API:
   - GET /api/user/email - 获取用户邮箱信息
   - POST /api/user/bind-email - 发送绑定验证邮件
   - GET /api/verify-bind-email/<token> - 验证绑定Token
   - POST /api/user/unbind-email - 解绑邮箱
5. 更新templates/index.html:
   - 将"修改密码"弹窗改为"个人设置"
   - 添加邮箱绑定/解绑功能UI
   - 显示邮箱状态(未绑定/待验证/已验证)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 22:20:29 +08:00
19174616018andClaude Opus 4.5 0ccddd8c63 feat: 添加邮件功能第四阶段 - 任务完成通知
1. 添加任务完成邮件模板 (templates/email/task_complete.html)
2. 在email_service.py中添加:
   - task_notify_enabled 字段支持
   - send_task_complete_email() 函数,支持附件大小限制和分批发送
   - send_task_complete_email_async() 异步发送函数
   - MAX_ATTACHMENT_SIZE 常量 (10MB)
3. 更新app.py:
   - 邮件设置API支持task_notify_enabled字段
   - 截图回调中集成任务完成邮件发送
4. 更新admin.html:
   - 添加"启用任务完成通知"开关
   - 更新loadEmailSettings/updateEmailSettings函数

附件超过10MB时会自动分两封邮件发送(通知+截图),作为容错机制

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 22:09:59 +08:00
19174616018andClaude Opus 4.5 93375b612f feat: 添加邮件功能第三阶段 - 密码重置
实现通过邮件自助重置密码功能:
- 新增发送密码重置邮件API (/api/forgot-password)
- 新增密码重置页面路由 (/reset-password/<token>)
- 新增确认密码重置API (/api/reset-password-confirm)

新增文件:
- templates/email/reset_password.html - 密码重置邮件模板
- templates/reset_password.html - 密码重置页面

修改文件:
- email_service.py - 添加密码重置相关函数
  - send_password_reset_email()
  - verify_password_reset_token()
  - confirm_password_reset()
- app.py - 添加密码重置相关API
- templates/login.html - 忘记密码支持两种方式:
  - 启用邮件功能:通过邮件自助重置
  - 未启用邮件:提交申请等待管理员审核

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 21:58:49 +08:00
19174616018andClaude Opus 4.5 de8edcb3a6 feat: 添加邮件功能第二阶段 - 注册邮箱验证
实现注册时的邮箱验证功能:
- 修改注册API支持邮箱验证流程
- 新增邮箱验证API (/api/verify-email/<token>)
- 新增重发验证邮件API (/api/resend-verify-email)
- 新增邮箱验证状态查询API (/api/email/verify-status)

新增文件:
- templates/email/register.html - 注册验证邮件模板
- templates/verify_success.html - 验证成功页面
- templates/verify_failed.html - 验证失败页面

修改文件:
- email_service.py - 添加发送注册验证邮件函数
- app.py - 添加邮箱验证相关API
- database.py - 添加get_user_by_email函数
- app_config.py - 添加BASE_URL配置
- templates/register.html - 支持邮箱必填切换
- templates/login.html - 添加重发验证邮件功能
- templates/admin.html - 添加注册验证开关和BASE_URL设置

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-11 21:51:07 +08:00