{"id":50368425,"url":"https://github.com/weaming/webhook","last_synced_at":"2026-05-30T05:30:32.917Z","repository":{"id":342948862,"uuid":"1175720114","full_name":"weaming/webhook","owner":"weaming","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-08T05:00:25.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-08T10:16:16.925Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/weaming.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-08T04:25:17.000Z","updated_at":"2026-03-08T05:00:28.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/weaming/webhook","commit_stats":null,"previous_names":["weaming/webhook"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/weaming/webhook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaming%2Fwebhook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaming%2Fwebhook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaming%2Fwebhook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaming%2Fwebhook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weaming","download_url":"https://codeload.github.com/weaming/webhook/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaming%2Fwebhook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33681809,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-30T05:30:31.333Z","updated_at":"2026-05-30T05:30:32.909Z","avatar_url":"https://github.com/weaming.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 配置定义的消息转发网络\n\n## 安装\n\n```\ngo build -ldflags \"-s -w\" -o ./webhook ./cmd/webhook/\n```\n\n## 使用\n\n```\n$ ./webhook gen webhook.yaml\n2025/10/29 22:25:08 配置文件已生成: webhook.yaml\n\n$ ./webhook view webhook.yaml\n=== Webhook 路由配置视图 ===\n\n监听地址: :8080\n\n路由端点:\n  /complex -\u003e root\n  /broadcast -\u003e broadcast-all\n  /broadcast-logged -\u003e broadcast-with-log\n  /wecom -\u003e wecom-alerts\n  /tradingview/public -\u003e broadcast-all\n  /alert/normal -\u003e log-normal\n  /alert/important -\u003e log-important\n  /alert/urgent -\u003e log-urgent\n  /dev/null -\u003e blackhole\n\n节点拓扑图:\n\n└─ root [虚拟节点]\n  ├─ node-a [虚拟节点]\n  │ └─ node-c [虚拟节点]\n  │   └─ telegram-channel [Telegram: 通知频道]\n  └─ node-b [虚拟节点]\n    └─ wecom-alerts [企业微信: 告警群]\n└─ broadcast-all [虚拟节点]\n  ├─ wecom-alerts [企业微信: 告警群]\n  ├─ telegram-channel [Telegram: 通知频道]\n  └─ custom-webhook [Webhook: https://example.com/webhook]\n└─ broadcast-with-log [虚拟节点]\n  ├─ log-important [日志: 重要]\n  │ └─ wecom-alerts [企业微信: 告警群]\n  └─ custom-webhook [Webhook: https://example.com/webhook]\n└─ log-normal [日志: 一般]\n└─ log-urgent [日志: 紧急]\n  ├─ wecom-alerts [企业微信: 告警群]\n  └─ telegram-channel [Telegram: 通知频道]\n└─ blackhole [叶子节点]\n```\n\n另一个例子：\n\n```\n监听地址: 127.0.0.1:9999\n\n路由端点:\n  /tradingview/public -\u003e tv-public\n  /private -\u003e private\n  /wecom -\u003e wecom-bighand\n  /trump -\u003e node-trump\n\n节点拓扑图:\n\n└─ tv-public [虚拟节点]\n  ├─ log-normal [日志: 一般]\n  └─ wecom-bighand [企业微信: 告警群]\n└─ private [虚拟节点]\n  ├─ log-important [日志: 重要]\n  └─ tg-weaming [Telegram: 私人通知频道]\n└─ node-trump [虚拟节点]\n  ├─ log-important [日志: 重要]\n  ├─ wecom-bighand [企业微信: 告警群]\n  └─ tg-trump [Telegram: 川普刚刚说了什么]\n```\n\n## 消息格式化 (Telegram)\n\n支持通过以下两种方式指定 Telegram 消息的解析模式：\n\n### 1. 节点配置\n在 `nodes` 定义中设置 `parse_mode`：\n- `HTML`: 使用 HTML 标签\n- `Markdown`: 使用旧版 Markdown (建议用 V2)\n- `MarkdownV2`: 使用 MarkdownV2 格式\n\n### 2. Content-Type 自动识别 (优先级最高)\n当客户端请求时，服务端会根据请求头中的 `Content-Type` 自动覆盖节点的配置：\n- `text/html` → 强制使用 `HTML`\n- `text/markdown` → 强制使用 `Markdown`\n- `text/x-markdown-v2` → 强制使用 `MarkdownV2`\n\n\u003e [!TIP]\n\u003e 代码会自动处理大小写，因此配置 `html` 或 `HTML` 均可生效。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweaming%2Fwebhook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweaming%2Fwebhook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweaming%2Fwebhook/lists"}