Skip to content

siiway/org-webhook-spliter

Repository files navigation

org-webhook-spliter

Language / 语言: 中文 | English

一个 Cloudflare Worker, 用于拆分组织 Webhook 到不同目标, 防止组织内部隐私信息泄漏

功能

部署

点击下面的按钮部署:

Deploy to Cloudflare

Secrets 列表

SECRET

如果此变量值不为 /disableddisabled, 则只允许路径名为此变量值的请求

如设置 SECRET 为 abcd/abcd, 则访问 /abcd 可正常转发请求, 其他路径 (/ 除外) 返回 Wrong Secret! 并拒绝转发请求

REPO_CONFIG

基于仓库的配置 (优先级高于 ORG_CONFIG)

格式:

{
    "siiway/.github": [
        "https://discord.com/api/webhooks/1422516241670738041/xxx/github"
        // 还可添加更多目标 url
    ],
    // "siiway/internal": [...] // 还可添加更多仓库
}

ORG_CONFIG

基于组织的配置

格式:

{
    "siiway": { // 组织登录名 (github.com/siiway -> siiway)
        "private": [ // 私有仓库通知
            {
                "name": "dc-webhook",
                "url": "https://discord.com/api/webhooks/1422185291191418900/xxx/github"
            },
            // 还可添加更多目标 url
        ],
        "public": [ // 公开仓库通知
            {
                "name": "dc-webhook-pub",
                "url": "https://discord.com/api/webhooks/1199938889469657118/xxx/github",
                "headers": {
                    "Authorization": "Bot My.Bot.Token" // 你或许可以传递授权标头来绕过基于 ip 的速率限制?
                }
            }
        ],
        "others": [ // 不与具体仓库关联的通知
            {
                "url": "https://discord.com/api/webhooks/1422185291191418900/xxx/github" // 如果你觉得在返回中显示这个 url 不危险
            }
        ]
    },
    // "sleepy-project": {
        // 还可添加更多组织
    // }
}

HEADERS

请求头设置

格式:

{
    "Authorization": "Bearer TOKEN",
    "Content-Type": "application/json",
    "X-Delete-Me": null, // 设置为 null 来删除已有 header
    // ...
}

Tip

也支持使用 YAML 配置
详见: types/config.d.ts

About

一个简单的 Cloudflare Worker, 用于拆分私有 / 公开仓库的组织 Webhook

Topics

Resources

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published