mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-03 03:23:56 +08:00
⛅ Sync 2026-10-06 21:11:19
This commit is contained in:
1 parent
fa160a7a5e
commit
bcd6b07350
430 files changed
+1035
-48585
No files matched your search
@@ -1,8 +1,8 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-pushbot
|
||||
PKG_VERSION:=3.60
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=3.55
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_MAINTAINER:=tty228 <tty228@yeah.net> zzsj0928
|
||||
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
# 改名公告
|
||||
#### 2021年04月25日 起luci-app-serverchand 改名为 luci-app-pushbot
|
||||
|
||||
如需拉取编译
|
||||
请把:
|
||||
|
||||
`# git clone https://github.com/zzsj0928/luci-app-serverchand package/luci-app-serverchand`
|
||||
|
||||
改为
|
||||
|
||||
`git clone https://github.com/zzsj0928/luci-app-pushbot package/luci-app-pushbot`
|
||||
|
||||
并把 .config 中
|
||||
|
||||
`CONFIG_PACKAGE_luci-app-serverchand=y`
|
||||
|
||||
改为
|
||||
|
||||
`CONFIG_PACKAGE_luci-app-pushbot=y`
|
||||
|
||||
注意:本次改名需要提前备份serverchand配置,并于PushBot中重新配置。
|
||||
|
||||
再次谢谢各位支持
|
||||
|
||||
# 申明
|
||||
- 本插件由[tty228/luci-app-serverchan](https://github.com/tty228/luci-app-serverchan)原创.
|
||||
- 因微信推送存在诸多弊端(无法分开聊天工具与功能性消息推送,通知内不显示内容,内容需要点开才能查看等),
|
||||
- 故由 然后七年 @zzsj0928 重新修改为本插件,为钉钉机器人API使用。
|
||||
- 本插件工作在:openwrt
|
||||
- 本插件支持:钉钉推送,企业微信推送,PushPlus推送,微信推送,企业微信应用推送,飞书推送,钉钉机器人推送,企业微信机器人推送,飞书机器人推送,一对多推送,Bark推送(仅iOS)
|
||||
- 自20210911之后的版本,支持Bark群组,群组名默认为设备名
|
||||
- 自20210901之后的版本,增加依赖jq,请重新编译或在安装前同步安装jq
|
||||
|
||||
# 显示效果
|
||||
## 通知栏:直接显示推送主题,一目了然,按设备不同,分组显示
|
||||
<img src="https://raw.githubusercontent.com/zzsj0928/ReadmeContents/main/Serverchand/Msg.Notification.jpg" width="500">
|
||||
|
||||
## 消息列表:直接显示最新推送的标题
|
||||
<img src="https://raw.githubusercontent.com/zzsj0928/ReadmeContents/main/Serverchand/Msg.List.jpg" width="500">
|
||||
|
||||
## 消息内容:直接显示所有推送信息,不用二次点开再查看
|
||||
<img src="https://raw.githubusercontent.com/zzsj0928/ReadmeContents/main/Serverchand/MsgContentDetials.jpeg" width="500">
|
||||
|
||||
# 下载
|
||||
- [luci-app-pushbot](https://github.com/zzsj0928/luci-app-pushbot/releases)
|
||||
|
||||
|
||||
-----------------------------------------------------
|
||||
#####################################################
|
||||
-----------------------------------------------------
|
||||
|
||||
# 以下为原插件简介:
|
||||
|
||||
# 简介
|
||||
- 用于 OpenWRT/LEDE 路由器上进行 Server酱 微信/Telegram 推送的插件
|
||||
- 基于 serverchan 提供的接口发送信息,Server酱说明:http://sc.ftqq.com/1.version
|
||||
- **基于斐讯 k3 制作,不同系统不同设备,请自行修改部分代码,无测试条件无法重现的 bug 不考虑修复**
|
||||
- 依赖 iputils-arping + curl 命令,安装前请 `opkg update`,小内存路由谨慎安装
|
||||
- 使用主动探测设备连接的方式检测设备在线状态,以避免WiFi休眠机制,主动探测较为耗时,**如遇设备休眠频繁,请自行调整超时设置**
|
||||
- 流量统计功能依赖 wrtbwmon ,自行选装或编译,该插件与 Routing/NAT 、Flow Offloading 冲突,开启无法获取流量,自行选择,L大版本直接编译 luci-app-wrtbwmon
|
||||
|
||||
#### 主要功能
|
||||
- 路由 ip/ipv6 变动推送
|
||||
- 设备别名
|
||||
- 设备上线推送
|
||||
- 设备离线推送及流量使用情况
|
||||
- CPU 负载、温度监视
|
||||
- 定时推送设备运行状态
|
||||
- MAC 白名单、黑名单、按接口检测设备
|
||||
- 免打扰
|
||||
- 无人值守任务
|
||||
|
||||
#### 说明
|
||||
- 潘多拉系统、或不支持 sh 的系统,请将脚本开头 `#!/bin/sh` 改为 `#!/bin/bash`,或手动安装 `sh`
|
||||
- 追新是没有意义的,没有问题没必要更新,上班事情忙完了,摸鱼又不会摸,只能靠写几行 bug ,才能缓解无聊这样子
|
||||
|
||||
#### 已知问题
|
||||
- 直接关闭接口时,该接口的离线设备会忽略检测
|
||||
- 部分设备无法读取到设备名,脚本使用 `cat /var/dhcp.leases` 命令读取设备名,如果 dhcp 中不存在设备名,则无法读取设备名(如二级路由设备、静态ip设备),请使用设备名备注
|
||||
|
||||
# Download
|
||||
- [luci-app-serverchan](https://github.com/tty228/luci-app-serverchan/releases)
|
||||
- [wrtbwmon](https://github.com/brvphoenix/wrtbwmon)
|
||||
- [luci-app-wrtbwmon](https://github.com/brvphoenix/luci-app-wrtbwmon)
|
||||
|
||||
#### ps
|
||||
- 新功能看情况开发
|
||||
- 王者荣耀新赛季,不思进取中
|
||||
- 欢迎各种代码提交
|
||||
- 提交bug时请尽量带上设备信息,日志与描述(如执行`/usr/bin/serverchan/serverchan`后的提示、日志信息、/tmp/serverchan/ipAddress 文件信息)
|
||||
- 三言两句恕我无能为力
|
||||
- 武汉加油
|
||||
|
||||
@@ -46,7 +46,6 @@ a:value("/usr/bin/pushbot/api/ent_wechat.json",translate("企业微信"))
|
||||
a:value("/usr/bin/pushbot/api/feishu.json",translate("飞书"))
|
||||
a:value("/usr/bin/pushbot/api/bark.json",translate("Bark"))
|
||||
a:value("/usr/bin/pushbot/api/pushplus.json",translate("PushPlus"))
|
||||
a:value("/usr/bin/pushbot/api/pushdeer.json",translate("PushDeer"))
|
||||
a:value("/usr/bin/pushbot/api/diy.json",translate("自定义推送"))
|
||||
|
||||
a=s:taboption("basic", Value,"dd_webhook",translate('Webhook'), translate("钉钉机器人 Webhook")..",只输入access_token=后面的即可<br>调用代码获取<a href='https://developers.dingtalk.com/document/robots/custom-robot-access' target='_blank'>点击这里</a><br><br>")
|
||||
@@ -85,19 +84,6 @@ a=s:taboption("basic", Value,"pp_topic",translate('PushPlus Topic'), translate("
|
||||
a.rmempty = true
|
||||
a:depends("pp_topic_enable","1")
|
||||
|
||||
a=s:taboption("basic", Value,"pushdeer_key",translate('PushDeer Key'), translate("PushDeer Key").."<br>调用代码获取<a href='http://www.pushdeer.com/' target='_blank'>点击这里</a><br><br>")
|
||||
a.rmempty = true
|
||||
a:depends("jsonpath","/usr/bin/pushbot/api/pushdeer.json")
|
||||
|
||||
a=s:taboption("basic", Flag,"pushdeer_srv_enable",translate("自建 PushDeer 服务器"))
|
||||
a.default=0
|
||||
a.rmempty = true
|
||||
a:depends("jsonpath","/usr/bin/pushbot/api/pushdeer.json")
|
||||
|
||||
a=s:taboption("basic", Value,"pushdeer_srv",translate('PushDeer Server'), translate("PushDeer 自建服务器地址").."<br>如https://your.domain:port<br>具体自建服务器设定参见:<a href='http://www.pushdeer.com/selfhosted.html' target='_blank'>点击这里</a><br><br>")
|
||||
a.rmempty = true
|
||||
a:depends("pushdeer_srv_enable","1")
|
||||
|
||||
a=s:taboption("basic", Value,"fs_webhook",translate('WebHook'), translate("飞书 WebHook").."<br>调用代码获取<a href='https://www.feishu.cn/hc/zh-CN/articles/360024984973' target='_blank'>点击这里</a><br><br>")
|
||||
a.rmempty = true
|
||||
a:depends("jsonpath","/usr/bin/pushbot/api/feishu.json")
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
{
|
||||
"_api": "这是 PushDeer推送 api 文件",
|
||||
"_api": "【PushDeer推送】",
|
||||
|
||||
"url": "${pushdeer_srv}/message/push",
|
||||
"data": "@${tempjsonpath}",
|
||||
"content_type": "Content-Type:application/json",
|
||||
"str_title_start": "**【",
|
||||
"str_title_end": "】**",
|
||||
"str_linefeed": "\\n\\n",
|
||||
"str_splitline": "\\n\\n---\\n\\n",
|
||||
"str_space": " ",
|
||||
"str_tab": " ",
|
||||
"table_tab": "┋",
|
||||
"font_green": "",
|
||||
"font_green2": "",
|
||||
"font_red": "",
|
||||
"font_blue": "",
|
||||
"font_purple": "",
|
||||
"font_end": "",
|
||||
"font_end2": "",
|
||||
"percentsym": "",
|
||||
"boldstar": "**",
|
||||
"type":
|
||||
{
|
||||
"pushkey": "\"${pushdeer_key}\"",
|
||||
"type": "\"markdown\"",
|
||||
"text": "\"${1}\"",
|
||||
"desp": "\"${nowtime}${str_linefeed}${2}\""
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ function read_config(){
|
||||
"pushbot_sheep" "starttime" "endtime" "pushbot_whitelist" "pushbot_blacklist" "pushbot_interface" "MAC_online_list" "MAC_offline_list" \
|
||||
"up_timeout" "down_timeout" "timeout_retry_count" "thread_num" "soc_code" "pve_host" "pve_port"\
|
||||
"err_enable" "err_sheep_enable" "err_device_aliases" "network_err_event" "system_time_event" "autoreboot_time" "network_restart_time" "public_ip_event" "public_ip_retry_count" \
|
||||
"jsonpath" "dd_webhook" "we_webhook" "pp_token" "pp_channel" "pp_webhook" "pp_topic_enable" "pp_topic" "fs_webhook" "pushdeer_key" "pushdeer_srv_enable" "pushdeer_srv" "bark_srv_enable" "bark_srv" "bark_token" "bark_sound" "bark_icon" "bark_icon_enable" "bark_level"
|
||||
"jsonpath" "dd_webhook" "we_webhook" "pp_token" "pp_channel" "pp_webhook" "pp_topic_enable" "pp_topic" "fs_webhook" "bark_srv_enable" "bark_srv" "bark_token" "bark_sound" "bark_icon" "bark_icon_enable" "bark_level"
|
||||
|
||||
for str_version in "wrtbwmon" "iputils-arping" "curl" "iw"; do
|
||||
eval `echo ${str_version:0:2}"_version"`=`opkg list-installed|grep -w ^${str_version}|awk '{print $3}'` 2>/dev/null
|
||||
@@ -45,7 +45,6 @@ function read_config(){
|
||||
[ -z "$down_timeout" ] || [ "$down_timeout" -eq "0" ] && down_timeout="20";down_timeout=`expr ${down_timeout} / 2 + 1`
|
||||
[ -z "$timeout_retry_count" ] && timeout_retry_count="2";[ "$timeout_retry_count" -eq "0" ] && timeout_retry_count="1"
|
||||
[ ! -z "$bark_token" ] && [ -z "$bark_srv" ] && bark_srv="https://api.day.app"
|
||||
[ ! -z "$pushdeer_key" ] && [ -z "$pushdeer_srv" ] && pushdeer_srv="https://api2.pushdeer.com"
|
||||
|
||||
# 字符串读取
|
||||
str_title_start=`/usr/bin/jq -r '.str_title_start' ${jsonpath}`
|
||||
@@ -86,7 +85,7 @@ function pushbot_init(){
|
||||
[ ! -f "/usr/sbin/wrtbwmon" ] && echo "`date "+%Y-%m-%d %H:%M:%S"` 【!!!】未安装 wrtbwmon ,流量统计不可用" >> ${logfile}
|
||||
[ -z "$ip_version" ] && echo "`date "+%Y-%m-%d %H:%M:%S"` 【!!!】无法获取依赖项 iputils-arping 版本号,请确认插件是否正常运行" >> ${logfile}
|
||||
[ -z "$cu_version" ] && echo "`date "+%Y-%m-%d %H:%M:%S"` 【!!!】无法获取依赖项 curl 版本号,请确认插件是否正常运行" >> ${logfile}
|
||||
[ -z "${dd_webhook}${pp_token}${we_webhook}${fs_webhook}${bark_token}${pushdeer_key}" ] && echo "`date "+%Y-%m-%d %H:%M:%S"` 【!!!】请填写正确的Token/Webhook " >> ${logfile} && return 1
|
||||
[ -z "${dd_webhook}${pp_token}${we_webhook}${fs_webhook}${bark_token}" ] && echo "`date "+%Y-%m-%d %H:%M:%S"` 【!!!】请填写正确的Token/Webhook " >> ${logfile} && return 1
|
||||
local interfacelist=`getinterfacelist` && [ -z "$interfacelist" ] && echo "`date "+%Y-%m-%d %H:%M:%S"` 【!!!】无法正确获取接口信息,请确认插件是否正常运行" >> ${logfile}
|
||||
return 0
|
||||
}
|
||||
@@ -113,7 +112,7 @@ function down_oui(){
|
||||
[ $logrow -lt "10" ] && rm -f ${oui_base} >/dev/null 2>&1
|
||||
if [ ! -z "$oui_data" ] && [ "$oui_data" -ne "3" ] && [ ! -f ${oui_base} ]; then
|
||||
echo "`date "+%Y-%m-%d %H:%M:%S"` 【初始化】设备MAC厂商信息不存在,重新下载" >> ${logfile}
|
||||
wget --no-check-certificate -t 3 -T 15 -O ${dir}oui.txt https://standards-oui.ieee.org/oui/oui.txt >/dev/null 2>&1
|
||||
wget --no-check-certificate -t 3 -T 15 -O ${dir}oui.txt https://linuxnet.ca/ieee/oui.txt >/dev/null 2>&1
|
||||
if [ -f ${dir}oui.txt ] && [ "$oui_data" -eq "1" ]; then
|
||||
cat ${dir}oui.txt|grep "base 16"|grep -i "apple\|aruba\|asus\|autelan\|belkin\|bhu\|buffalo\|cctf\|cisco\|comba\|datang\|dell\|dlink\|dowell\|ericsson\|fast\|feixun\|\
|
||||
fiberhome\|fujitsu\|grentech\|h3c\|hisense\|hiwifi\|honghai\|honghao\|hp\|htc\|huawei\|intel\|jinli\|jse\|lenovo\|lg\|liteon\|malata\|meizu\|mercury\|meru\|moto\|netcore\|\
|
||||
@@ -222,7 +221,7 @@ function getname(){
|
||||
done
|
||||
( ! echo "$tmp_name"|grep -q -w "unknown\|*" ) && [ ! -z "$tmp_name" ] && echo "$tmp_name" && return || unset tmp_name # 为unknown时重新读取
|
||||
[ -f "$oui_base" ] && local tmp_name=$(cat $oui_base|grep -i $(echo "$2"|cut -c 1,2,4,5,7,8)|sed -nr 's#^.*16)..(.*)#\1#gp'|sed 's/ /_/g')
|
||||
[ ! -z "$oui_data" ] && [ "$oui_data" -eq "4" ] && local tmp_name=$(curl -sS "https://standards-oui.ieee.org/oui/oui.txt"|grep -i $(echo "$2"|cut -c 1,2,4,5,7,8)|sed -nr 's#^.*16)..(.*)#\1#gp'|sed 's/ /_/g')
|
||||
[ ! -z "$oui_data" ] && [ "$oui_data" -eq "4" ] && local tmp_name=$(curl -sS "http://standards-oui.ieee.org/oui.txt"|grep -i $(echo "$2"|cut -c 1,2,4,5,7,8)|sed -nr 's#^.*16)..(.*)#\1#gp'|sed 's/ /_/g')
|
||||
[ -z "$tmp_name" ] && local tmp_name="unknown"
|
||||
echo "$tmp_name"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user