新增功能: - 创建 email_service.py 邮件服务模块 - 支持多SMTP配置(主备切换、故障转移) - 发送纯文本/HTML邮件 - 发送带附件邮件(支持ZIP压缩) - 异步发送队列(多线程工作池) - 每日发送限额控制 - 发送日志记录和统计 - 数据库表结构 - smtp_configs: 多SMTP配置表 - email_settings: 全局邮件设置 - email_tokens: 邮件验证Token - email_logs: 邮件发送日志 - email_stats: 邮件发送统计 - API接口 - GET/POST /yuyx/api/email/settings: 全局邮件设置 - CRUD /yuyx/api/smtp/configs: SMTP配置管理 - POST /yuyx/api/smtp/configs/<id>/test: 测试SMTP连接 - POST /yuyx/api/smtp/configs/<id>/primary: 设为主配置 - GET /yuyx/api/email/stats: 邮件统计 - GET /yuyx/api/email/logs: 邮件日志 - POST /yuyx/api/email/logs/cleanup: 清理日志 - 后台管理页面 - 新增"邮件配置"Tab - 全局邮件开关、故障转移开关 - SMTP配置列表管理 - 添加/编辑SMTP配置弹窗 - 邮件发送统计展示 - 邮件日志查询和清理 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
54 lines
1.2 KiB
Docker
54 lines
1.2 KiB
Docker
# 使用国内镜像源加速
|
|
FROM mcr.microsoft.com/playwright/python:v1.40.0-jammy
|
|
|
|
# 设置工作目录
|
|
WORKDIR /app
|
|
|
|
# 设置环境变量
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
|
|
ENV TZ=Asia/Shanghai
|
|
|
|
# 配置 pip 使用国内镜像源
|
|
RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ && pip config set install.trusted-host mirrors.aliyun.com
|
|
|
|
# 复制依赖文件
|
|
COPY requirements.txt .
|
|
|
|
# 安装Python依赖
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# 复制应用程序文件
|
|
COPY app.py .
|
|
COPY database.py .
|
|
COPY db_pool.py .
|
|
COPY playwright_automation.py .
|
|
COPY api_browser.py .
|
|
COPY browser_pool.py .
|
|
COPY browser_pool_worker.py .
|
|
COPY screenshot_worker.py .
|
|
COPY browser_installer.py .
|
|
COPY password_utils.py .
|
|
COPY crypto_utils.py .
|
|
COPY task_checkpoint.py .
|
|
COPY email_service.py .
|
|
|
|
# 复制新的优化模块
|
|
COPY app_config.py .
|
|
COPY app_logger.py .
|
|
COPY app_security.py .
|
|
COPY app_state.py .
|
|
COPY app_utils.py .
|
|
|
|
COPY templates/ ./templates/
|
|
COPY static/ ./static/
|
|
|
|
# 创建必要的目录
|
|
RUN mkdir -p data logs 截图
|
|
|
|
# 暴露端口(容器内端口,与 app_config.py 中 SERVER_PORT 默认值一致)
|
|
EXPOSE 51233
|
|
|
|
# 启动命令
|
|
CMD ["python", "app.py"]
|