Repository navigation
新增飞书群机器人与 Discord 渠道,移除 NotifyX 与 Gotify - #132
Merged
todosdev[bot] merged 2 commits intoOct 20, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
feishu,同时兼容国内版open.feishu.cn与国际版open.larksuite.com)和 Discord(discord),渠道总数保持 8 个。enabled_channels中的残留 ID 由既有清理迁移一并剔除。Changes
新增发送器(
worker/src/services/notify/)feishu.ts:双域名 +/open-apis/bot/v2/hook/路径白名单,走validateOutboundUrl、redirect: "manual"、safeErrorText;开启签名校验时按官方算法(key =${timestamp}\n${secret}、空消息、HMAC-SHA256 + Base64)生成sign;解析返回体,code非 0 判失败并带回msg,不打印配置或请求体。discord.ts:仅接受discord.com/discordapp.com且路径以/api/webhooks/开头;**标题**+ 正文 + 可选 URL,按码点截断到 2000 字符;仅 HTTP 200/204 判成功,429 不自动重试。注册与存储
notify/index.ts、types.ts:注册feishu/discord,删除gotify/notifyx;VALID_CHANNELS与NotificationConfig同步。lib/setup.ts:新增feishu_config、discord_config加列迁移(PRAGMA table_info查列、缺则 ALTER);退役清理迁移的过滤集合扩为serverchan、pushplus、gotify、notifyx,保持幂等与坏行跳过;getSchema()与schema.sql两处建表定义同步删旧列、加新列。db/queries/notifications.ts:配置列白名单替换为两个新列。routes/me.ts:两份敏感字段子串名单各补"secret",保证飞书签名密钥读取时打码、回传占位符时不覆盖真实值。前端
lib/channels.ts、pages/channels/ChannelPage.tsx:渠道列表与配置表单换为feishu(webhook_url+ 可选secret)与discord(webhook_url)。components/ChannelSelector.tsx:已选但不在渠道列表中的退役 ID 不再被静默丢弃,而是渲染为带Retired channel提示的可移除 chip——否则这类老条目保存必然被后端 400 拒绝。locales/zh.json、locales/en.json:渠道名键替换(飞书群机器人 / Feishu Bot、Discord)。文档
README.md、README.en.md、CLAUDE.md:渠道名单同步为最终 8 个。Testing
pnpm typecheck、pnpm build、pnpm format:check通过;pnpm test6 个测试文件 54 个用例全绿(本机 pnpm 包装器异常,用其pnpm.mjs直调并加 PATH shim 执行)。worker/test/feishu.test.ts、worker/test/discord.test.ts:签名与node:crypto离线期望值一致、双域名/路径白名单、业务code非 0 判失败、200/204 与 429/500 判定、2000 码点截断不切坏代理对。worker/test/migrations.test.ts:老库加列与默认值、既有数据不变、gotify_config/notifyx_config休眠保留、四渠道清理保序与幂等、全新安装列集合、清理后不再产生Unknown channel历史。POST /api/admin/setup),加列与清理才生效。