增加PushPlus方式,支持Mac版微信模板消息以及企业微信应用推送
This commit is contained in:
parent
81e24f9696
commit
74920e434a
22
UseHelp.md
22
UseHelp.md
@ -82,6 +82,28 @@ ps:因微信的原因,server酱的旧版将在2021年4月后下线,新版
|
|||||||
|
|
||||||
`config.yaml`中配置`server`的`token`等信息,`enable`设置为 `1`表示推送
|
`config.yaml`中配置`server`的`token`等信息,`enable`设置为 `1`表示推送
|
||||||
|
|
||||||
|
## 推送加【Mac 版微信可用】
|
||||||
|
|
||||||
|
免费的微信模板消息通知,支持在 Mac 版微信查看
|
||||||
|
|
||||||
|
### Mac微信效果
|
||||||
|
|
||||||
|
![image-20220126110109185](images/image-20220126110109185.png)
|
||||||
|
|
||||||
|
具体配置方法见 pushplus 公众号文章:https://mp.weixin.qq.com/s/YRYb04PUFNVZejzV2G-k4w
|
||||||
|
|
||||||
|
同时也支持使用企业微信应用通知,只需从 API 接口修改默认配置即可:
|
||||||
|
|
||||||
|
![image-20220126105710922](images/image-20220126105710922.png)
|
||||||
|
|
||||||
|
修改成功:
|
||||||
|
|
||||||
|
![image-20220126110312664](images/image-20220126110312664.png)
|
||||||
|
|
||||||
|
### 企业微信应用效果
|
||||||
|
|
||||||
|
![image-20220126110919827](images/image-20220126110919827.png)
|
||||||
|
|
||||||
# Github 访问限制
|
# Github 访问限制
|
||||||
|
|
||||||
监控工具更新 请求次数过多,超过了每小时请求,添加gihtub token
|
监控工具更新 请求次数过多,超过了每小时请求,添加gihtub token
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
# 每3分钟检测一次githu
|
# 每3分钟检测一次githu
|
||||||
# 是否有新的cve漏洞提交记录,若有则通过server酱和钉钉机器人推送,飞书捷径推送(二者配置一个即可)
|
# 是否有新的cve漏洞提交记录,若有则通过server酱和钉钉机器人推送,飞书捷径推送(二者配置一个即可)
|
||||||
# 建议使用screen命令运行在自己的linux vps后台上,就可以愉快的接收各种cve了
|
# 建议使用screen命令运行在自己的linux vps后台上,就可以愉快的接收各种cve了
|
||||||
|
|
||||||
# https://my.oschina.net/u/4581868/blog/4380482
|
# https://my.oschina.net/u/4581868/blog/4380482
|
||||||
# https://github.com/kiang70/Github-Monitor
|
# https://github.com/kiang70/Github-Monitor
|
||||||
import json
|
import json
|
||||||
@ -36,13 +35,17 @@ def load_config():
|
|||||||
server_sckey = config['all_config']['server'][1]['sckey']
|
server_sckey = config['all_config']['server'][1]['sckey']
|
||||||
app_name = config['all_config']['server'][2]['app_name']
|
app_name = config['all_config']['server'][2]['app_name']
|
||||||
return app_name,github_token,server_sckey
|
return app_name,github_token,server_sckey
|
||||||
|
elif int(config['all_config']['pushplus'][0]['enable']) == 1:
|
||||||
|
pushplus_token = config['all_config']['pushplus'][1]['token']
|
||||||
|
app_name = config['all_config']['pushplus'][2]['app_name']
|
||||||
|
return app_name,github_token,pushplus_token
|
||||||
elif int(config['all_config']['tgbot'][0]['enable']) ==1 :
|
elif int(config['all_config']['tgbot'][0]['enable']) ==1 :
|
||||||
tgbot_token = config['all_config']['tgbot'][1]['token']
|
tgbot_token = config['all_config']['tgbot'][1]['token']
|
||||||
tgbot_group_id = config['all_config']['tgbot'][2]['group_id']
|
tgbot_group_id = config['all_config']['tgbot'][2]['group_id']
|
||||||
app_name = config['all_config']['tgbot'][3]['app_name']
|
app_name = config['all_config']['tgbot'][3]['app_name']
|
||||||
return app_name,github_token,tgbot_token,tgbot_group_id
|
return app_name,github_token,tgbot_token,tgbot_group_id
|
||||||
elif int(config['all_config']['tgbot'][0]['enable']) == 0 and int(config['all_config']['feishu'][0]['enable']) == 0 and int(config['all_config']['server'][0]['enable']) == 0 and int(config['all_config']['dingding'][0]['enable']) == 0:
|
elif int(config['all_config']['tgbot'][0]['enable']) == 0 and int(config['all_config']['feishu'][0]['enable']) == 0 and int(config['all_config']['server'][0]['enable']) == 0 and int(config['all_config']['pushplus'][0]['enable']) == 0 and int(config['all_config']['dingding'][0]['enable']) == 0:
|
||||||
print("[-] 配置文件有误,四个社交软件的enable不能为0")
|
print("[-] 配置文件有误,五个社交软件的enable不能为0")
|
||||||
|
|
||||||
github_headers = {
|
github_headers = {
|
||||||
'Authorization': "token {}".format(load_config()[1])
|
'Authorization': "token {}".format(load_config()[1])
|
||||||
@ -80,6 +83,8 @@ def create_database():
|
|||||||
dingding("test", "连接成功", load_config()[2], load_config()[3])
|
dingding("test", "连接成功", load_config()[2], load_config()[3])
|
||||||
elif load_config()[0] == "server":
|
elif load_config()[0] == "server":
|
||||||
server("test", "连接成功", load_config()[2])
|
server("test", "连接成功", load_config()[2])
|
||||||
|
elif load_config()[0] == "pushplus":
|
||||||
|
pushplus("test", "连接成功", load_config()[2])
|
||||||
elif load_config()[0] == "tgbot":
|
elif load_config()[0] == "tgbot":
|
||||||
tgbot("test", "连接成功", load_config()[2], load_config()[3])
|
tgbot("test", "连接成功", load_config()[2], load_config()[3])
|
||||||
#根据排序获取本年前20条CVE
|
#根据排序获取本年前20条CVE
|
||||||
@ -259,6 +264,8 @@ def send_body(url,query_pushed_at,query_tag_name):
|
|||||||
dingding(text, body,load_config()[2],load_config()[3])
|
dingding(text, body,load_config()[2],load_config()[3])
|
||||||
elif load_config()[0] == "server":
|
elif load_config()[0] == "server":
|
||||||
server(text, body,load_config()[2])
|
server(text, body,load_config()[2])
|
||||||
|
elif load_config()[0] == "pushplus":
|
||||||
|
pushplus(text, body,load_config()[2])
|
||||||
elif load_config()[0] == "tgbot":
|
elif load_config()[0] == "tgbot":
|
||||||
tgbot(text,body,load_config()[2],load_config()[3])
|
tgbot(text,body,load_config()[2],load_config()[3])
|
||||||
conn = sqlite3.connect('data.db')
|
conn = sqlite3.connect('data.db')
|
||||||
@ -288,6 +295,8 @@ def send_body(url,query_pushed_at,query_tag_name):
|
|||||||
feishu(text,body,load_config()[2])
|
feishu(text,body,load_config()[2])
|
||||||
elif load_config()[0] == "server":
|
elif load_config()[0] == "server":
|
||||||
server(text, body,load_config()[2])
|
server(text, body,load_config()[2])
|
||||||
|
elif load_config()[0] == "pushplus":
|
||||||
|
pushplus(text, body,load_config()[2])
|
||||||
elif load_config()[0] == "tgbot":
|
elif load_config()[0] == "tgbot":
|
||||||
tgbot(text,body,load_config()[2],load_config()[3])
|
tgbot(text,body,load_config()[2],load_config()[3])
|
||||||
conn = sqlite3.connect('data.db')
|
conn = sqlite3.connect('data.db')
|
||||||
@ -314,6 +323,8 @@ def send_body(url,query_pushed_at,query_tag_name):
|
|||||||
feishu(text,body,load_config[2])
|
feishu(text,body,load_config[2])
|
||||||
elif load_config()[0] == "server":
|
elif load_config()[0] == "server":
|
||||||
server(text, body, load_config()[2])
|
server(text, body, load_config()[2])
|
||||||
|
elif load_config()[0] == "pushplus":
|
||||||
|
pushplus(text, body,load_config()[2])
|
||||||
elif load_config()[0] == "tgbot":
|
elif load_config()[0] == "tgbot":
|
||||||
tgbot(text, body, load_config()[2], load_config()[3])
|
tgbot(text, body, load_config()[2], load_config()[3])
|
||||||
conn = sqlite3.connect('data.db')
|
conn = sqlite3.connect('data.db')
|
||||||
@ -393,6 +404,13 @@ def server(text, msg,sckey):
|
|||||||
requests.get(uri, headers=github_headers, timeout=10)
|
requests.get(uri, headers=github_headers, timeout=10)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
|
# pushplus https://www.pushplus.plus/push1.html
|
||||||
|
def pushplus(text, msg,token):
|
||||||
|
try:
|
||||||
|
uri = 'https://www.pushplus.plus/send?token={}&title={}&content={}'.format(token,text, msg)# 将 xxxx 换成自己的pushplus的 token
|
||||||
|
requests.get(uri, headers=github_headers, timeout=10)
|
||||||
|
except Exception as e:
|
||||||
|
pass
|
||||||
# 添加Telegram Bot推送支持
|
# 添加Telegram Bot推送支持
|
||||||
def tgbot(text, msg,token,group_id):
|
def tgbot(text, msg,token,group_id):
|
||||||
import telegram
|
import telegram
|
||||||
@ -443,6 +461,9 @@ def sendNews(data):
|
|||||||
elif load_config()[0] == "server":
|
elif load_config()[0] == "server":
|
||||||
server(text, body, load_config()[2])
|
server(text, body, load_config()[2])
|
||||||
print("server酱 发送 CVE 成功")
|
print("server酱 发送 CVE 成功")
|
||||||
|
elif load_config()[0] == "pushplus":
|
||||||
|
pushplus(text, body, load_config()[2])
|
||||||
|
print("pushplus 发送 CVE 成功")
|
||||||
elif load_config()[0] == "tgbot":
|
elif load_config()[0] == "tgbot":
|
||||||
tgbot(text, body, load_config()[2], load_config()[3])
|
tgbot(text, body, load_config()[2], load_config()[3])
|
||||||
print("tgbot 发送 CVE 成功")
|
print("tgbot 发送 CVE 成功")
|
||||||
|
BIN
images/image-20220126105710922.png
Normal file
BIN
images/image-20220126105710922.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 268 KiB |
BIN
images/image-20220126110109185.png
Normal file
BIN
images/image-20220126110109185.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 49 KiB |
BIN
images/image-20220126110312664.png
Normal file
BIN
images/image-20220126110312664.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 298 KiB |
BIN
images/image-20220126110919827.png
Normal file
BIN
images/image-20220126110919827.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 247 KiB |
Loading…
Reference in New Issue
Block a user