ryan
6bdd3eb786
feat(订阅配置): 支持环境变量展开并校验订阅连接地址
...
Motivation:
订阅连接地址中的敏感凭据不应硬编码到配置文件,改为通过环境变量注入,并自动跳过未配置或非 AMQP 协议的订阅,避免无效连接导致启动失败。
Changes:
* 订阅 URL 加载时展开环境变量并去除首尾空白
* 新增 AMQP 协议校验,仅 amqp/amqps 地址视为有效连接
* 非 AMQP 协议的订阅(如未配置的占位符)不再参与激活
* docker-compose 环境变量改用映射格式并加引号,规避特殊字符解析问题
* 补充环境变量展开与占位符跳过相关的单元测试
2026-08-15 17:57:09 +08:00
ryan
4fe9f83b89
chore(订阅): 重连错误日志补充 Broker 地址
...
Motivation:
多 Broker 部署场景下,订阅者重连失败时仅记录错误名称,难以快速定位是哪一台 Broker 连接异常。补充 Broker 地址并规范化错误字段,提升故障排查效率。
Changes:
* 重连失败日志新增 broker host 字段
* 新增 brokerHost 函数,从连接 URL 解析并输出主机地址
* 错误字段改为记录错误信息字符串,避免直接序列化 error 对象
2026-08-15 17:49:31 +08:00
ryan
ab295d6d28
feat: log raw MQ body after dedup
...
Keep the original payload on post-dedup handling logs so accepted, filtered, and error paths can be traced.
2026-08-15 17:37:14 +08:00
ryan
6f846a0a3c
feat: subscribe to RabbitMQ trade signals and notify by rules
...
Consume configurable queues, format signals (including period), share NotifyService with HTTP, and drop duplicate bodies within 1h.
2026-08-15 17:34:49 +08:00
ryan
a07963e150
feat: enhance Safew chat handling and testing
...
- Updated `GroupsFromUpdates` function to return the number of updates processed, improving the polling mechanism.
- Added a new test `TestGroupsFromUpdatesCallbackAndJoinRequest` to validate handling of callback queries and join requests.
- Introduced `safewAllowedUpdates` to specify allowed update types in the polling request, enhancing chat management.
- Implemented `ensureWebhookCleared` method to manage webhook state before polling, improving reliability.
2026-08-15 01:56:12 +08:00
ryan
2000908bac
feat: enhance Safew watcher initialization and token management
...
- Added functionality to list and start Safew tokens in the main server function, ensuring proper initialization of the Safew watcher.
- Introduced `ensureSafewWatcher` method in the ChannelHandler to manage Safew tokens during channel creation and updates.
- Implemented `StartTokens` method in the Watcher to handle multiple tokens efficiently.
- Enhanced error handling and logging for Safew watcher operations to improve observability.
2026-08-15 01:28:51 +08:00
ryan
5e783adf7a
feat: implement chat merging and logging in Safew
...
- Introduced a new function `mergeAndLog` in the Watcher to handle merging Safew chats and logging newly discovered chats.
- Added a test `TestNewSafewChatsSkipsKnownIDs` to ensure that known chat IDs are skipped during the merging process.
- Enhanced the polling mechanism to improve chat management and reduce duplicates.
2026-08-15 01:10:35 +08:00
ryan
e369f398d8
feat: enhance Safew error handling and polling mechanism
...
- Added error_msg field to safewAPIResponse for better error descriptions.
- Updated safewErrorDescription function to include error_msg in the output.
- Introduced a new test to verify that error messages are included in Safew error descriptions.
- Improved the polling mechanism in the Watcher to handle conflicts and ensure no overlapping polls occur.
2026-08-15 01:07:01 +08:00
ryan
bd8a9ff96d
feat: 增加 SafeW 已监控群列表接口
...
通过 getUpdates 将群写入 Redis,供创建/编辑渠道时选择 chat_id,避免前端重复传递 token。
2026-08-15 00:40:40 +08:00
ryan
0d0cd0c510
feat: 新增 SafeW 出站通知渠道
...
通过 Bot API sendMessage 投递渲染后的通知,MarkdownV2 自动转义标题与正文。
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-14 00:58:44 +08:00
ryan
39f3774940
feat: 配置列表分页与钉钉机器人分钟级排队限流
...
统一 sources/templates/channels/rules 列表为分页响应,避免配置增多时全量返回;按钉钉 access_token 限制每分钟发送并在超限时等待下一分钟,降低触发官方封禁风险。
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-08-10 00:34:26 +08:00
ryan
c74bab3033
fix(数据存储): 确保列表查询返回空数组而非 null,并补充 HTTPie/Postman API 文档
...
Motivation:
当数据库查询无结果时,Go 的 `var slice []Type` 声明会使 JSON 序列化输出 `null`,而非 `[]`。这在 API 响应中造成不一致,也增加了客户端的空值处理负担。改为 `make([]Type, 0)` 后空结果统一输出为 `[]`,提升 API 规范性。
Changes:
* 统一 store 层所有 List 方法使用 `make([]Type, 0)` 初始化切片,覆盖 Sources、Channels、Templates、Rules、MessageLogs 及 RuleChannels 查询
* 新增完整的 cURL 示例文档,覆盖全部 API 端点(通知、Source、Template、Channel、Rule、消息记录)
* 新增 Postman Collection JSON 文件,可直接导入 HTTPie 使用,包含环境变量配置
2026-07-31 22:09:39 +08:00
ryan
cecf8e72f5
fix(邮件发送): 适配 MailerSend SMTP 并迁移基础设施至 1Panel
...
Motivation:
将通知服务部署到 1Panel 生产环境,集成 MailerSend 邮件服务,修复 SMTP 协议中 MAIL FROM 命令因携带显示名而导致的发送失败问题。
Changes:
* 修复 SMTP MAIL FROM 命令传入带显示名的完整地址导致发送失败的问题,新增 extractEmailAddr 提取裸地址
* 更新 SMTP 配置为 MailerSend 真实凭证,From 地址适配其域名验证要求
* 移除 docker-compose 中内置的 MySQL/Redis 服务,改为依赖外部 1Panel 基础设施
* 更新环境变量为生产环境实际凭据
2026-07-31 17:28:35 +08:00
ryan
a0d26fa3a3
refactor: rename database tables for notification entities to improve clarity and consistency
2026-07-02 16:04:18 +08:00
ryan
c5225d8c97
feat: add Logbull remote logging via slog handler, tee to stdout
2026-06-27 15:17:59 +08:00
ryan
835b92ec00
fix: wire retry into router, fix Docker config path, fix condition error handling, remove dead code
2026-06-27 13:32:33 +08:00
ryan
2271a54139
feat: retry mechanism with exponential backoff
2026-06-27 13:26:13 +08:00
ryan
8e0c95edd9
feat: rule CRUD with enable/disable and message log query
2026-06-27 13:23:37 +08:00
ryan
682ca3df81
feat: management handlers — source, template, channel CRUD
2026-06-27 13:23:10 +08:00
ryan
2cf6601be0
feat: notify handler — parse, match, evaluate, render, route
2026-06-27 13:22:14 +08:00
ryan
127cf12656
feat: auth and rate limit middleware
2026-06-27 13:20:56 +08:00
ryan
83c4166f0c
feat: engine — template renderer, rule matcher, channel router
2026-06-27 13:19:15 +08:00
ryan
49b2384cf7
feat: email adapter with SMTP TLS support
2026-06-27 13:17:32 +08:00
ryan
414c8c7cbf
feat: channel adapters — dingtalk, wecom, bark
2026-06-27 13:15:57 +08:00
ryan
54af29e4fc
feat: condition evaluator for rule filtering
2026-06-27 13:15:02 +08:00
ryan
d7ae840d9a
fix: atomic rate limiter and error handling in cache invalidation
2026-06-27 13:12:37 +08:00
ryan
69e32cb3ec
feat: message parser with json/regex/text modes
2026-06-27 13:11:05 +08:00
ryan
d030f0f0df
fix: error handling in rule store
2026-06-27 13:09:34 +08:00
ryan
3f75699431
feat: redis cache layer with rule/channel caching and rate limiter
2026-06-27 13:07:56 +08:00
ryan
a8e939da40
feat: rule and message_log store CRUD
2026-06-27 13:06:54 +08:00
ryan
236105ea9c
feat: template and channel store CRUD
2026-06-27 13:04:57 +08:00
ryan
7cd84c8468
feat: store connection and source CRUD
2026-06-27 13:02:17 +08:00
ryan
3d0b91fe23
feat: data models and database migration
2026-06-27 12:59:33 +08:00
ryan
976ec3ca70
feat: project scaffold, config loading, skeleton main
2026-06-27 12:57:11 +08:00