Repository navigation
feat: 支持 Server酱 Max 与 Server酱 3 SendKey 路由 - #214
Merged
Merged
Conversation
Owner
|
感谢 @easychen 的提交!代码实现很规整,测试覆盖和日志脱敏也考虑得很周全。 非常抱歉,这个 PR 这次暂时不计划合入,主要出于项目维护边界的考量:
再次感谢对本项目的关注与贡献,也非常欢迎后续继续交流建议! |
# Conflicts: # src/views/configPage.html # tests/services/notify/channels.test.js
Owner
|
@easychen 非常抱歉!刚刚审阅时闹了个乌龙,起初看到 确认是 Server酱 官方的 Server酱 3 / Server酱 Max 正版升级后,已立刻重新打开本 PR,顺手解了一下和最新 非常抱歉造成误会,感谢官方亲自来提 PR 支持 SubsTracker!🙏 |
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.
变更摘要
为现有 Server酱 通知渠道新增 Server酱 Max(
scx-...) 与 Server酱 3(sctp...) 的原生 SendKey 路由支持,保持对原有 Server酱 Turbo(SCT...) 的完全向后兼容,不引入额外运行时依赖(适配 Cloudflare Workers 环境)。路由规则(与
serverchan-sdk1.2.0 保持一致)先对
SERVERCHAN_SENDKEY执行首尾空白裁剪(trim()),再严格区分大小写进行路由:scx-开头,严格匹配^scx-([1-9][0-9]{0,19})-(.+)$(区分大小写)https://<uid>.max.ft07.com/<sendkey>.sendsctapi.ftqq.comsctp开头,匹配^sctp(\d+)thttps://<uid>.push.ft07.com/send/<sendkey>.sendsctapi.ftqq.comSCT...)https://sctapi.ftqq.com/<sendkey>.send主要改动
src/services/notify/serverchan.js:resolveServerChanEndpoint(rawSendkey),统一在validateConfig与send中进行 SendKey 校验与端点解析。application/x-www-form-urlencoded,title/desp)与{ code: 0 }响应判断逻辑,兼容 Max / SC3 / Turbo。wpush.js的日志脱敏策略:在报错文本和raw诊断信息中屏蔽原始 SendKey 及包含 SendKey 的完整请求 URL,避免写入notify_log或控制台日志泄露密钥。src/views/configPage.html:SCT...)、Server酱 3(sctp...)与 Server酱 Max(scx-...)。tests/services/notify/channels.test.js:scx-/sctp格式显式报错且不触发fetch回退,以及上游响应/网络异常回显 SendKey 时的脱敏验证。测试与验证
tsc --noEmit -p jsconfig.json:通过(0 errors)tests/services/notify/channels.test.js:57/57 通过(含新增 14 条 Server酱 测试)tests/services/、tests/api/、tests/views/、tests/smoke.test.js:15/15 测试文件、164/164 用例全部通过参考链接
本 PR 由 AI 生成并通过自动化测试复验。