[PR #321] [MERGED] feat: notifiers #914

Closed
opened 2026-03-03 01:06:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/certimate-go/certimate/pull/321
Author: @fudiwei
Created: 11/9/2024
Status: Merged
Merged: 11/11/2024
Merged by: @usual2970

Base: mainHead: feat/notifier


📝 Commits (10+)

  • 83674e4 refactor: ensure compile-time check for Uploader implementations
  • 76fc47a Merge branch 'main' into feat/notifier
  • 551b06b feat: notifier
  • 94579d6 refactor: clean code
  • 150b666 refactor: maps utils
  • 5d93334 refactor: re-implement logic of notify
  • 8b04e96 feat: new UI for email notify settings
  • 44497a0 feat: new UI for notify settings
  • 8fecebc feat: show loading button when pushing test notifications
  • 1bedb31 fix: fix typo

📊 Changes

42 files changed (+1737 additions, -1013 deletions)

View changed files

📝 go.mod (+1 -1)
📝 internal/domain/domains.go (+8 -36)
📝 internal/domain/notify.go (+3 -3)
📝 internal/domain/setting.go (+1 -1)
📝 internal/notify/expire.go (+22 -23)
internal/notify/factory.go (+66 -0)
internal/notify/mail.go (+0 -56)
📝 internal/notify/notify.go (+27 -163)
📝 internal/notify/service.go (+4 -9)
internal/pkg/core/notifier/notifier.go (+23 -0)
internal/pkg/core/notifier/providers/bark/bark.go (+48 -0)
internal/pkg/core/notifier/providers/dingtalk/dingtalk.go (+45 -0)
internal/pkg/core/notifier/providers/email/email.go (+95 -0)
internal/pkg/core/notifier/providers/email/email_test.go (+51 -0)
internal/pkg/core/notifier/providers/lark/lark.go (+41 -0)
internal/pkg/core/notifier/providers/serverchan/serverchan.go (+55 -0)
internal/pkg/core/notifier/providers/telegram/telegram.go (+47 -0)
internal/pkg/core/notifier/providers/webhook/webhook.go (+43 -0)
📝 internal/pkg/core/uploader/providers/aliyun-cas/aliyun_cas.go (+7 -0)
📝 internal/pkg/core/uploader/providers/aliyun-slb/aliyun_slb.go (+7 -0)

...and 22 more files

📄 Description

该 PR 包含以下内容变更:

  • feat: 新增 Notifier(“通知器”)的抽象业务逻辑,并实现原有的通知渠道。相关代码位于 /internal/pkg/core/notifier/ 目录下。
  • feat: 调整消息推送系统设置 UI,露出表单项的标签,并在发送测试推送时显示加载中动画效果。
  • fix: 修复了部分国内邮件服务商(如新浪、126、163 等)因 TLS 版本问题导致无法推送邮件的问题。关闭 #316。
  • refactor: 优化代码。

【备注】

关于 Notifier

#227 中实现的 Uploader 类似,旨在:

  • 统一的业务抽象层,与 certimate 本身的业务流程解耦;
  • 各通知渠道独立化封装,对单元测试友好 (示例:/internal/pkg/core/notifier/providers/email/email_test.go);
  • 位于 /pkg/ 包下,便于日后作为类库对外暴露。

为了简化目前的开发工作,大部分新的 Notifier 仍然基于原有的 nikoksr/notify 实现,只是多了一层封装。但日后若接入更多 nikoksr/notify 未提供的渠道、或需要彻底废弃 nikoksr/notify 时,可平滑迁移。


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/certimate-go/certimate/pull/321 **Author:** [@fudiwei](https://github.com/fudiwei) **Created:** 11/9/2024 **Status:** ✅ Merged **Merged:** 11/11/2024 **Merged by:** [@usual2970](https://github.com/usual2970) **Base:** `main` ← **Head:** `feat/notifier` --- ### 📝 Commits (10+) - [`83674e4`](https://github.com/certimate-go/certimate/commit/83674e4b351c8ec8e4d66e8b8c54c481c3daecf2) refactor: ensure compile-time check for `Uploader` implementations - [`76fc47a`](https://github.com/certimate-go/certimate/commit/76fc47a27463f7345b5e74beaa11b91e2b80576f) Merge branch 'main' into feat/notifier - [`551b06b`](https://github.com/certimate-go/certimate/commit/551b06b4e83f6969ed7a05bae41fa888a3aebf99) feat: notifier - [`94579d6`](https://github.com/certimate-go/certimate/commit/94579d65c4f0eb4deb6e2c365c64109dbb1b2aa3) refactor: clean code - [`150b666`](https://github.com/certimate-go/certimate/commit/150b666d4b07e4d3b9f4a6434533368e8a252792) refactor: maps utils - [`5d93334`](https://github.com/certimate-go/certimate/commit/5d9333442621b74f57e534a8a6e291cd26017756) refactor: re-implement logic of notify - [`8b04e96`](https://github.com/certimate-go/certimate/commit/8b04e96a7d43ae015b54b618f445c988c5d26651) feat: new UI for email notify settings - [`44497a0`](https://github.com/certimate-go/certimate/commit/44497a0969d4b6c893e577fd56e1c074db3f9042) feat: new UI for notify settings - [`8fecebc`](https://github.com/certimate-go/certimate/commit/8fecebc254e1afdd839510b40c950315da3279cf) feat: show loading button when pushing test notifications - [`1bedb31`](https://github.com/certimate-go/certimate/commit/1bedb31a3ca2c10bd159914d70156a985beb106e) fix: fix typo ### 📊 Changes **42 files changed** (+1737 additions, -1013 deletions) <details> <summary>View changed files</summary> 📝 `go.mod` (+1 -1) 📝 `internal/domain/domains.go` (+8 -36) 📝 `internal/domain/notify.go` (+3 -3) 📝 `internal/domain/setting.go` (+1 -1) 📝 `internal/notify/expire.go` (+22 -23) ➕ `internal/notify/factory.go` (+66 -0) ➖ `internal/notify/mail.go` (+0 -56) 📝 `internal/notify/notify.go` (+27 -163) 📝 `internal/notify/service.go` (+4 -9) ➕ `internal/pkg/core/notifier/notifier.go` (+23 -0) ➕ `internal/pkg/core/notifier/providers/bark/bark.go` (+48 -0) ➕ `internal/pkg/core/notifier/providers/dingtalk/dingtalk.go` (+45 -0) ➕ `internal/pkg/core/notifier/providers/email/email.go` (+95 -0) ➕ `internal/pkg/core/notifier/providers/email/email_test.go` (+51 -0) ➕ `internal/pkg/core/notifier/providers/lark/lark.go` (+41 -0) ➕ `internal/pkg/core/notifier/providers/serverchan/serverchan.go` (+55 -0) ➕ `internal/pkg/core/notifier/providers/telegram/telegram.go` (+47 -0) ➕ `internal/pkg/core/notifier/providers/webhook/webhook.go` (+43 -0) 📝 `internal/pkg/core/uploader/providers/aliyun-cas/aliyun_cas.go` (+7 -0) 📝 `internal/pkg/core/uploader/providers/aliyun-slb/aliyun_slb.go` (+7 -0) _...and 22 more files_ </details> ### 📄 Description 该 PR 包含以下内容变更: - **feat**: 新增 Notifier(“通知器”)的抽象业务逻辑,并实现原有的通知渠道。相关代码位于 `/internal/pkg/core/notifier/` 目录下。 - **feat**: 调整消息推送系统设置 UI,露出表单项的标签,并在发送测试推送时显示加载中动画效果。 - **fix**: 修复了部分国内邮件服务商(如新浪、126、163 等)因 TLS 版本问题导致无法推送邮件的问题。关闭 #316。 - **refactor**: 优化代码。 --- ### 【备注】 #### 关于 Notifier 与 #227 中实现的 Uploader 类似,旨在: - 统一的业务抽象层,与 certimate 本身的业务流程解耦; - 各通知渠道独立化封装,对单元测试友好 (示例:`/internal/pkg/core/notifier/providers/email/email_test.go`); - 位于 `/pkg/` 包下,便于日后作为类库对外暴露。 为了简化目前的开发工作,大部分新的 Notifier 仍然基于原有的 [nikoksr/notify](https://github.com/nikoksr/notify) 实现,只是多了一层封装。但日后若接入更多 nikoksr/notify 未提供的渠道、或需要彻底废弃 nikoksr/notify 时,可平滑迁移。 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 01:06:48 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/certimate#914
No description provided.