-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.yaml
More file actions
52 lines (45 loc) · 2.35 KB
/
Copy pathconfig.example.yaml
File metadata and controls
52 lines (45 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# 企业微信会话存档服务配置
# MySQL 数据库配置
mysql:
dsn: "user:password@tcp(127.0.0.1:3306)/wework_archive?charset=utf8mb4&parseTime=True&loc=Local"
max_open_conns: 20
max_idle_conns: 5
# 媒体文件存储配置
media:
base_path: "./media" # 媒体文件本地存储根目录
# 代理配置(企业微信会话存档有IP白名单限制,测试时需要使用代理)
proxy:
url: "http://127.0.0.1:10808"
password: "" # 代理认证密码,格式: user:pass,通常为空
# 存储时间格式(使用 YYYY/MM/DD/hh/mm/ss 占位符,程序启动时替换为实际时间)
# storage_database: 数据库表名前缀的时间格式
# 示例: YYYY-MM-DD → 表名 corp_2026-04-11_messages(按天分表)
# storage_file: 媒体文件目录的时间格式
# 示例: YYYY-MM-DD-hh → 目录 media/corp/2026-04-11-15/image/(按小时分目录)
# storage_filewords: 兼容旧配置,当 storage_database/storage_file 未设置时作为回退
# storage_filewords: "YYYY-MM-DD-hh"
storage_database: "YYYY-MM-DD"
storage_file: "YYYY-MM-DD-hh"
# 日志配置
log:
level: "info" # debug, info, warn, error
file: "" # 日志文件路径,留空则输出到 stdout
# 企业微信配置(支持多个企业)
corps:
- name: "my_corp" # 企业标识名(用于区分多个企业)
corp_id: "wwd08c8exxxx5ab44d" # 企业ID,在企业微信管理端-我的企业-企业信息查看
corp_secret: "xxxxxxxxxxxxxxxxxxxx" # 会话存档Secret,在管理端-管理工具-会话内容存档查看
rsa_private_key: | # RSA私钥(与管理端配置的公钥对应)
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA...
-----END RSA PRIVATE KEY-----
# 也可以指定私钥文件路径(与 rsa_private_key 二选一)
# rsa_private_key_file: "/path/to/private_key.pem"
poll_interval: 30 # 轮询间隔(秒)
batch_size: 500 # 每次拉取消息条数(最大1000)
sdk_timeout: 10 # SDK API 超时时间(秒)
# 可以配置多个企业
# - name: "another_corp"
# corp_id: "wwxxxxxxxxxx"
# corp_secret: "xxxxxxxxxxxxxxxxxxxx"
# rsa_private_key_file: "/path/to/another_key.pem"