Skip to content

Commit

Permalink
docs: add parameter desp for ServerChan and optimize Webhook (jeess…
Browse files Browse the repository at this point in the history
…y2#581)

* docs: add parameter `desp` for ServerChan

Add the parameter `desp` because the length limit of the ServerChan title is 32.

See: https://sct.ftqq.com/sendkey

* docs: optimize the description of `Requestbody`

* docs: optimize the config of webhook

docs: optimize the description of Requestbody again

docs: add POST for ServerChan

* docs: webhook

---------

Co-authored-by: jeessy2 <[email protected]>
  • Loading branch information
WaterLemons2k and jeessy2 authored Mar 2, 2023
1 parent 8c4974a commit 0a9e455
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
38 changes: 29 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,28 +90,48 @@
| #{ipv6Result} | IPv6地址更新结果: `未改变` `失败` `成功`|
| #{ipv6Domains} | IPv6的域名,多个以`,`分割 |

- RequestBody为空GET请求,不为空POST请求
- Server酱: `https://sctapi.ftqq.com/[SendKey].send?title=主人IPv4变了#{ipv4Addr},域名更新结果:#{ipv4Result}`
- Bark: `https://api.day.app/[YOUR_KEY]/主人IPv4变了#{ipv4Addr},域名更新结果:#{ipv4Result}`
- 钉钉:
- 如 RequestBody 为空则为 GET 请求,否则为 POST 请求
- <details><summary>Server酱</summary>

```
https://sctapi.ftqq.com/[SendKey].send?title=你的公网IP变了&desp=主人IPv4变了#{ipv4Addr},域名更新结果:#{ipv4Result}
```
- <details><summary>Bark</summary>

```
https://api.day.app/[YOUR_KEY]/主人IPv4变了#{ipv4Addr},域名更新结果:#{ipv4Result}
```
</details>
- <details><summary>钉钉</summary>

- 钉钉电脑端 -> 群设置 -> 智能群助手 -> 添加机器人 -> 自定义
- 只勾选 `自定义关键词`, 输入的关键字必须包含在RequestBody的content中, 如:`你的公网IP变了`
- URL中输入钉钉给你的 `Webhook地址`
- RequestBody中输入 `{"msgtype": "markdown","markdown": {"title":"你的公网IP变了","text": "#### 你的公网IP变了 \n - IPV4地址:#{ipv4Addr} \n - 域名更新结果:#{ipv4Result} \n"}}`
- 飞书:
</details>
- <details><summary>飞书</summary>

- 飞书电脑端 -> 群设置 -> 添加机器人 -> 自定义机器人
- 安全设置只勾选 `自定义关键词`, 输入的关键字必须包含在RequestBody的content中, 如:`你的公网IP变了`
- URL中输入飞书给你的 `Webhook地址`
- RequestBody中输入 `{"msg_type": "post","content": {"post": {"zh_cn": {"title": "你的公网IP变了","content": [[{"tag": "text","text": "IPV4地址:#{ipv4Addr}"}] , [{"tag": "text","text": "域名更新结果:#{ipv4Result}"}]]}}}}`
- Telegram: [ddns-telegram-bot](https://github.com/WingLim/ddns-telegram-bot)
- plusplus 推送加:
</details>
- <details><summary>Telegram</summary>

[ddns-telegram-bot](https://github.com/WingLim/ddns-telegram-bot)
</details>
- <details><summary>plusplus 推送加</summary>

- [获取token](https://www.pushplus.plus/push1.html)
- URL中输入 `https://www.pushplus.plus/send`
- RequestBody中输入 `{"token":"your token","title":"你的公网IP变了","content":"你的公网IP变了 \n - IPV4地址:#{ipv4Addr} \n - 域名更新结果:#{ipv4Result} \n"}`
- Discord:
</details>
- <details><summary>Discord</summary>

- Discord任意客户端 -> 伺服器 -> 频道设置 -> 整合 -> 查看Webhook -> 新Webhook -> 复制Webhook网址
- URL中输入Discord复制的 `Webhook网址`
- RequestBody中输入 `{"content":"域名 #{ipv4Domains} 动态解析 #{ipv4Result}.","embeds":[{"description":"#{ipv4Domains} 的动态解析 #{ipv4Result}, IP: #{ipv4Addr}","color":15258703,"author":{"name":"DDNS"},"footer":{"text":"DDNS #{ipv4Result}"}}]}`
</details>

- [查看更多Webhook配置参考](https://github.com/jeessy2/ddns-go/issues/327)

Expand All @@ -127,7 +147,7 @@
| #{domain} | 当前域名 |
| #{recordType} | 记录类型 `A``AAAA` |
| #{ttl} | ttl |
- RequestBody为空GET请求,不为空POST请求
- 如 RequestBody 为空则为 GET 请求,否则为 POST 请求
- [Callback配置参考](https://github.com/jeessy2/ddns-go/wiki/Callback配置参考)

## 界面
Expand Down
2 changes: 1 addition & 1 deletion web/writing.html
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ <h5 class="portlet__head">Webhook</h5>
{{- .WebhookRequestBody -}}
</textarea>
<small id="WebhookRequestBody_help" class="form-text text-muted">
RequestBody 为空 GET 请求,不为空 POST 请求。支持的变量同上
RequestBody 为空则为 GET 请求,否则为 POST 请求。支持的变量同上
</small>
</div>
</div>
Expand Down

0 comments on commit 0a9e455

Please sign in to comment.