Files
fanqie-go/config/config.yaml
T

103 lines
2.6 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.
# 番茄小说API服务配置文件
# 服务器配置
server:
port: "40180" # 监听端口
host: "0.0.0.0" # 监听地址
access_key: "" # 访问密钥,为空则不启用验证(用于 /status 和 /self-info)
# 番茄小说配置
fanqie:
# 算法类型: "gorgon" 或 "8404"
# gorgon: Gorgon算法
# 8404: 备用算法
algorithm: "gorgon"
# 签名方法: "sign2" 或 "sign4"
# sign2: 仅Gorgon签名
# sign4: X-Gorgon + X-Ladon + X-Argus 完整签名
signature: "sign4"
# 内容处理配置
content:
# 是否移除图片(默认false,保留图片)
remove_images: false
# 是否移除图片描述(默认false,保留描述)
remove_image_desc: true
# 是否移除空行(默认true,移除空行)
remove_blank_lines: true
# 是否移除HTML标签(默认false,保留HTML)
remove_html_tags: true
# 是否移除章节名(默认false,保留章节名)
remove_chapter_title: true
# 是否添加段落缩进(默认true,添加两个全角空格)
add_paragraph_indent: true
# 段落间使用双换行(true=\n\n, false=\n)
double_newline: true
# 是否启用段评功能(默认true,启用段评)
enable_review: true
# 漫画处理配置
manga:
# 输出模式:proxy / data_uri / url
# proxy: 返回本地代理URL /manga/image/{itemID}/{index}
# data_uri: 返回 data:image/jpeg;base64,/9j/4AAQ...
# url: 返回原始图片URL数组
output_mode: "url"
# 缓存配置
cache:
# 是否启用正文内容缓存
enabled: true
# 存储后端:sqlite | postgres
backend: postgres
# SQLite数据库文件路径(backend 为 sqlite 时使用)
sqlite_path: "./cache.db"
# PostgreSQL连接配置(backend 为 postgres 时使用)
# 敏感值(密码等)建议放 .env,见 .env.example;环境变量优先于此处配置
postgres:
host: "127.0.0.1"
port: 5432
user: "postgres"
password: ""
database: "fanqie"
sslmode: "disable" # disable | prefer | require
# Redis缓存(启用后正文缓存与音频代理缓存走 Redis,统计数据与设备池仍在 SQL 库)
redis:
enabled: true
host: "127.0.0.1"
port: 6379
password: ""
db: 1
# 是否启用正文内容缓存自动清理
cleanup_enabled: true
# 正文内容缓存清理时间(秒),0表示不自动清理
cleanup_seconds: 86400
# 设备密钥池配置
device_key_pool:
# 是否启用设备密钥池
enabled: true
# 初始化设备数量
initial_size: 20
# 最小设备数量(低于此数量自动补充)
min_size: 10
# 最大设备数量
max_size: 30