Files
ai_wht_wechat/backend/config.prod.yaml
2026-01-07 10:42:04 +08:00

67 lines
2.9 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 小红书Python服务配置 - 生产环境
# ========== 服务配置 ==========
server:
host: "0.0.0.0"
port: 8020
debug: false
reload: false
# ========== 数据库配置 ==========
database:
host: 8.149.233.36
port: 3306
username: ai_wht_write
password: 7aK_H2yvokVumr84lLNDt8fDBp6P
dbname: ai_wht
charset: utf8mb4
max_connections: 20
min_connections: 5
# ========== 浏览器池配置 ==========
browser_pool:
idle_timeout: 1800 # 空闲超时(秒),已禁用自动清理,保持常驻
max_instances: 10 # 最大浏览器实例数(生产环境可以更多)
preheat_enabled: true # 是否启用预热
preheat_url: "https://creator.xiaohongshu.com/login" # 预热URL根据login.page自动调整
# ========== 登录/绑定功能配置 ==========
login:
headless: false # 登录/绑定时的浏览器模式: false=有头模式(配合Xvfb避免被检测)true=无头模式
page: "home" # 登录页面类型: creator=创作者中心(creator.xiaohongshu.com/login), home=小红书首页(www.xiaohongshu.com)
# ========== 定时发布调度器配置 ==========
scheduler:
enabled: true # 是否启用定时任务
cron: "0 */5 * * * *" # Cron表达式(秒 分 时 日 月 周) - 每5分钟执行一次
max_concurrent: 5 # 最大并发发布数
publish_timeout: 300 # 发布超时时间(秒)
max_articles_per_user_per_run: 5 # 每轮每个用户最大发文数
max_failures_per_user_per_run: 3 # 每轮每个用户最大失败次数(达到后暂停本轮后续发布)
max_daily_articles_per_user: 20 # 每个用户每日最大发文数(自动发布)
max_hourly_articles_per_user: 3 # 每个用户每小时最大发文数(自动发布)
headless: false # 浏览器模式: false=有头模式(配合Xvfb避免被检测)true=无头模式
# ========== 防封策略配置 ==========
enable_random_ua: true # 启用随机User-Agent防指纹识别
min_publish_interval: 60 # 最小发布间隔生产环境建议60-300秒
max_publish_interval: 300 # 最大发布间隔生产环境建议60-300秒
# ========== 代理池配置 ==========
proxy_pool:
enabled: false # 默认关闭,按需开启
api_url: "http://api.tianqiip.com/getip?secret=lu29e593&num=1&type=txt&port=1&mr=1&sign=4b81a62eaed89ba802a8f34053e2c964"
# ========== 阿里云短信配置 ==========
ali_sms:
access_key_id: "LTAI5tSMvnCJdqkZtCVWgh8R" # 生产环境建议使用环境变量
access_key_secret: "nyFzXyIi47peVLK4wR2qqbPezmU79W" # 生产环境建议使用环境变量
sign_name: "北京乐航时代科技" # 短信签名
template_code: "SMS_486210104" # 短信模板CODE
code_expire_minutes: 5 # 验证码有效期(分钟)
# ========== 日志配置 ==========
logging:
level: INFO
format: "[%(asctime)s] [%(levelname)s] %(message)s"