-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support for rsspush webhook #35
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,134 +1,24 @@ | ||
<h1>接口文档</h1> | ||
|
||
> 接口文档有 [在线版](https://service-epwdrzxg-1255787947.gz.apigw.tencentcs.com/release/docs) ,本文档更新可能较在线版晚。 | ||
接口文档见[这里](https://heimdallr.zeabur.app/docs)。 | ||
|
||
# 通用 | ||
|
||
## channel 取值 | ||
|
||
目前支持以下通知渠道 | ||
|
||
- `bark` - [Bark](https://github.com/Finb/Bark) | ||
- `wecom-app` - [企业微信应用消息](https://developer.work.weixin.qq.com/document/path/90236) | ||
- `wecom-webhook` - [企业微信机器人webhook](https://developer.work.weixin.qq.com/document/path/91770) | ||
- `pushover` - [Pushover](https://pushover.net/api) | ||
- `pushdeer` - [PushDeer](http://pushdeer.com) | ||
- `chanify` - [Chanify](https://github.com/chanify/chanify) | ||
- `email`- 邮件 | ||
|
||
### <div id="multi-channel">推送到多个渠道</div> | ||
|
||
> `v0.1.3` 后支持推送到多个渠道 | ||
|
||
需要推送到多个渠道时,`channel` 参数传入多个渠道,以 `+` 分隔,如 `bark+wecom-app+wecom-webhook` 。 | ||
|
||
# 接口 | ||
|
||
## Path Variable Style | ||
`/{channel}/{title}/{body}/{key}` | ||
|
||
> `GET` / `POST` | ||
|
||
- `channel` 为推送的渠道,可以是 `bark`、`wecom-webhook`、`wecom-app` 等。 | ||
- `title` 为推送的标题,可以是任意字符串。(可以不填) | ||
- `body` 为推送的内容,可以是任意字符串。 | ||
- `key` 为环境变量中设置的key,当设置了环境变量时必填。 | ||
|
||
## Get Param Style | ||
|
||
`/{channel}?title={title}&body={body}&key={key}` | ||
|
||
> `GET` | ||
|
||
- `channel` 为推送的渠道,可以是 `bark`、`wecom-webhook`、`wecom-app` 等。 | ||
- `title` 为推送的标题,可以是任意字符串。(可以不填) | ||
- `body` 为推送的内容,可以是任意字符串。 | ||
- `key` 为环境变量中设置的key,当设置了环境变量时必填。 | ||
|
||
## JSON | ||
|
||
`/send` | ||
|
||
> `POST` | ||
|
||
请求参数 | ||
|
||
```json | ||
{ | ||
"channel": "string", | ||
"title": "", | ||
"body": "", | ||
"key": "" | ||
} | ||
``` | ||
|
||
## Form | ||
|
||
`/sendForm` | ||
|
||
> `POST` | ||
|
||
- `channel` 为推送的渠道,可以是 `bark`、`wecom-webhook`、`wecom-app` 等。 | ||
- `title` 为推送的标题,可以是任意字符串。(可以不填) | ||
- `body` 为推送的内容,可以是任意字符串。 | ||
- `key` 为环境变量中设置的key,当设置了环境变量时必填。 | ||
|
||
## Echo | ||
|
||
`/echo/{channel}` | ||
|
||
> `POST` | ||
|
||
- `channel` 为推送的渠道,可以是 `bark`、`wecom-webhook`、`wecom-app` 等。 | ||
- POST 请求的 body 会原样返回。 | ||
|
||
## Wecom | ||
|
||
`/wecom-app` `/wecom-webhook` | ||
|
||
> `POST` | ||
|
||
请求参数 | ||
## 返回示例 | ||
|
||
```json | ||
{ | ||
"title": "", | ||
"body": "", | ||
"msg_type": "text" | ||
} | ||
``` | ||
|
||
- `msg_type` 取值可以是 `text` 或 `markdown`,默认为 `text` 。使用`markdown` 时,`body` 可以传入 Markdown 格式的文本。 | ||
|
||
# 返回示例 | ||
|
||
## 成功 | ||
### 成功 | ||
```json | ||
{"code": 0, "message": "success"} | ||
``` | ||
|
||
## 错误 | ||
### 错误 | ||
|
||
### 通知渠道返回错误信息 | ||
#### 通知渠道返回错误信息 | ||
|
||
```json | ||
{"code": 1, "message": "{channel} return {msg}"} | ||
``` | ||
|
||
### 不支持的渠道 | ||
|
||
```json | ||
{"code": 2, "message": "{channel} is not supported"} | ||
``` | ||
|
||
### 运行错误 | ||
|
||
```json | ||
{"code": 3, "message": "xxx"} | ||
``` | ||
|
||
### 认证错误 | ||
#### 认证错误 | ||
|
||
```json | ||
{"code": -1, "message": "key not authorized"} | ||
{"code": -1, "message": "key is invalid"} | ||
``` |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<h1>使用 Heimdallr 接收 rsspush 推送</h1> | ||
|
||
先按照 [rsspush](https://github.com/easychen/rsspush) 文档安装配置好 RSSPush。 | ||
|
||
在 SendKey 处,填入 Heimdallr 的 webhook,如下。 | ||
|
||
``` | ||
https://example.com/webhook/rsspush/{key} | ||
``` | ||
|
||
其中 `{key}` 为通知渠道的 `token`。 | ||
|
||
> 提示:RSSPush 没有提供测试通知渠道的方式,如果需要测试,可以把拉取时间间隔调为1分钟,然后从 [Lorem RSS](https://lorem-rss.herokuapp.com/) 这个网站复制 `https://lorem-rss.herokuapp.com/feed` 到 RSS 订阅处,即可每隔一分钟触发一次。 | ||
|
||
## 加餐 —— 接收 V2EX 新消息 | ||
在 V2EX [提醒系统](https://v2ex.com/notifications) 底部有一个【Atom Feed for Notifications】,复制该地址到 RSSPush 中即可接收 V2EX 新消息推送。 |
This file contains 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
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium