From dec7a6d0650332cf849bca7a95af5a71e3fac689 Mon Sep 17 00:00:00 2001 From: TingHsi Date: Mon, 9 May 2022 00:52:11 +0800 Subject: [PATCH] =?UTF-8?q?=E9=92=89=E9=92=89=E6=9C=BA=E5=99=A8=E4=BA=BA?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: TingHsi --- config/README.md | 8 ++++---- config/push.ini.example | 3 ++- push.py | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/config/README.md b/config/README.md index 70c1e14..924a195 100644 --- a/config/README.md +++ b/config/README.md @@ -108,9 +108,9 @@ ## dingrobot 钉钉群机器人 -[dingrobot]中的api_url填写**Webhook**地址 +**webhook**填写**Webhook**地址 -[setting]中的**push_token**用于填写**安全设置**中**加签**的密钥,此选项为可选项 +**secret**填写**安全设置**中**加签**的密钥,此选项为可选项 填写示例 @@ -118,9 +118,9 @@ [setting] enable=true push_server=dingrobot -push_token= [dingrobot] -api_url=https://oapi.dingtalk.com/robot/send?access_token=XXX +webhook=https://oapi.dingtalk.com/robot/send?access_token=XXX +secret= ``` diff --git a/config/push.ini.example b/config/push.ini.example index 4d99f60..c139ea4 100644 --- a/config/push.ini.example +++ b/config/push.ini.example @@ -27,4 +27,5 @@ api_url=https://api2.pushdeer.com token= [dingrobot] -api_url=https://oapi.dingtalk.com/robot/send?access_token=XXX \ No newline at end of file +webhook=https://oapi.dingtalk.com/robot/send?access_token=XXX +secret= \ No newline at end of file diff --git a/push.py b/push.py index 9b14b48..ec4aca2 100644 --- a/push.py +++ b/push.py @@ -105,8 +105,8 @@ def pushdeer(status, push_message): # 钉钉群机器人 def dingrobot(status, push_message): - api_url = cfg.get('dingrobot', 'api_url') # https://oapi.dingtalk.com/robot/send?access_token=XXX - secret = cfg.get('setting', 'push_token') # 安全设置 -> 加签 -> 密钥 + api_url = cfg.get('dingrobot', 'webhook') # https://oapi.dingtalk.com/robot/send?access_token=XXX + secret = cfg.get('dingrobot', 'secret') # 安全设置 -> 加签 -> 密钥 -> SEC* if secret: timestamp = str(round(time.time() * 1000))