-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.def.js
More file actions
32 lines (31 loc) · 1.14 KB
/
Copy pathconfig.def.js
File metadata and controls
32 lines (31 loc) · 1.14 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
/*
* Webhook 插件配置模板
* 复制为 config.js 生效(推荐用锅巴 WebUI 写入 config.json)。
*/
export default {
// 是否启用 webhook 服务
enabled: true,
// 挂载方式: 'auto'(默认,优先复用云崽 HTTP 服务)| 'express' | 'standalone'(独立端口)
mode: 'auto',
// 独立服务监听地址与端口(standalone 或 auto 回退时生效)
host: '0.0.0.0',
port: 5788,
// 全局校验 Token(可选):非空时请求须带请求头 X-Webhook-Token: <token>
token: '',
// ==================== 接口规则 ====================
// 每项 = 一个自定义接口:path / method(默认 post)/ enabled / secretHeaders /
// template / targets([{ type:'private'|'group', id }],forward 即合并转发)/
// responseBody / responseStatus(字段说明见 README 与锅巴表单)
rules: [
{
path: '/webhook/notify',
method: 'post',
enabled: true,
secretHeaders: {},
template: '收到新通知\n标题:{body.title}\n内容:{body.content}',
targets: [{ type: 'private', id: '10001' }],
responseBody: '',
responseStatus: 200
}
]
}