From 512654689e7ba8d7c30f58861b4f8427fa815c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=9F=E6=84=8F?= Date: Sun, 17 Sep 2023 14:37:48 +0800 Subject: [PATCH 1/2] update: about QQ notification (#2076) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update notify.js add QMSG_HOST * Update notification.md Update about qq notification qmsg privatization host * Update notification.md 更新关于qq通知qmsg的私有化host * Update notification.md Update about qq notification qmsg privatization host * Update README.md * Update README.md --------- Co-authored-by: Austin Lee --- docs/src/en/guide/features/notification.md | 1 + docs/src/guide/features/notification.md | 1 + packages/server/src/service/notify.js | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/src/en/guide/features/notification.md b/docs/src/en/guide/features/notification.md index a871eb7b01e..6256e76bd0e 100644 --- a/docs/src/en/guide/features/notification.md +++ b/docs/src/en/guide/features/notification.md @@ -56,6 +56,7 @@ We use [Mr. Server](http://sc.ftqq.com/3.version) to wechat notification. You ne We use [Mr. Qmsg](https://qmsg.zendee.cn) to send QQ notification. You need to set `QMSG_KEY` in env which applied in Mr. Qmsg. - `QMSG_KEY`: KEY applied in Mr. Qmsg, It's required for this service. +- `QMSG_HOST`: HOST applied in Mr. QmsgPrivate, Optional. It's required for this host. Defalut is `https://qmsg.zendee.cn` - `QQ_ID`: The QQ ID of the receiver(s), except for QQ group. If there are more than one QQ ID, use commas to separate multiple values, e.g. `1244453393,2952937634` (should all be included in your Mr. Qmsg's QQ ID list). - `AUTHOR_EMAIL`: The blogger’s email is used to distinguish whether the posted comment is posted by the blogger himself. If it is posted by the blogger, there will be no reminder notification. - `SITE_NAME`: Your site name, it will be displayed in notification message. diff --git a/docs/src/guide/features/notification.md b/docs/src/guide/features/notification.md index e7472d01b7b..16ad0cb87e6 100644 --- a/docs/src/guide/features/notification.md +++ b/docs/src/guide/features/notification.md @@ -78,6 +78,7 @@ ww479cadfqfe8c151f,MPKN9gX97w4e4b4h4u7u4i4i4i4iO6mN_dDedBFzqC5c,@all,1000002,2S8 QQ 通知使用了 [Qmsg 酱](https://qmsg.zendee.cn) 提供的服务,需要在环境变量中配置在 Qmsg 酱中申请的 `QMSG_KEY`。 - `QMSG_KEY`: Qmsg 酱提供的 KEY,必填。 +- `QMSG_Host`: Qmsg 酱提供的私有化 HOST,选填。默认为 `https://qmsg.zendee.cn`。 - `QQ_ID`: 接收消息的 QQ 号 (不支持 QQ 群),可以添加多个,以半角逗号分割,如: `1244453393,2952937634` (必须均在您的 Qmsg 酱 QQ 号列表中)。 - `AUTHOR_EMAIL`: 博主邮箱,用来区分发布的评论是否是博主本身发布的。如果是博主发布的则不进行提醒通知。 - `SITE_NAME`: 网站名称,用于在消息中显示。 diff --git a/packages/server/src/service/notify.js b/packages/server/src/service/notify.js index 580d39aad7d..4813c7c42e5 100644 --- a/packages/server/src/service/notify.js +++ b/packages/server/src/service/notify.js @@ -184,7 +184,7 @@ module.exports = class extends think.Service { } async qq(self, parent) { - const { QMSG_KEY, QQ_ID, SITE_NAME, SITE_URL } = process.env; + const { QMSG_KEY, QQ_ID, SITE_NAME, SITE_URL, QMSG_HOST } = process.env; if (!QMSG_KEY) { return false; @@ -219,7 +219,9 @@ module.exports = class extends think.Service { form.append('msg', this.ctx.locale(contentQQ, data)); form.append('qq', QQ_ID); - return fetch(`https://qmsg.zendee.cn/send/${QMSG_KEY}`, { + const qmsgHost = QMSG_HOST ? QMSG_HOST.replace(/\/$/, '') : 'https://qmsg.zendee.cn'; + + return fetch(`${qmsgHost}/send/${QMSG_KEY}`, { method: 'POST', header: form.getHeaders(), body: form, From e1402e6f1b481d27f775491b358278f6d8a4315d Mon Sep 17 00:00:00 2001 From: wxsm Date: Sun, 17 Sep 2023 14:39:17 +0800 Subject: [PATCH 2/2] fix dead link (#2084) --- packages/hexo-next/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/hexo-next/package.json b/packages/hexo-next/package.json index ded167777ce..dd1103875b5 100644 --- a/packages/hexo-next/package.json +++ b/packages/hexo-next/package.json @@ -7,7 +7,7 @@ "NexT", "waline" ], - "homepage": "https://github.com/walinejs/waline/packages/hexo-next/#readme", + "homepage": "https://github.com/walinejs/waline/tree/main/packages/hexo-next#readme", "bugs": { "url": "https://github.com/walinejs/waline/issues" },