Coder Social home page Coder Social logo

luci-app-pushbot's Introduction

改名公告

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原创.
  • 因微信推送存在诸多弊端(无法分开聊天工具与功能性消息推送,通知内不显示内容,内容需要点开才能查看等),
  • 故由 然后七年 @zzsj0928 重新修改为本插件,为钉钉机器人API使用。
  • 本插件工作在:openwrt
  • 本插件支持:钉钉推送,企业微信推送,PushPlus推送,微信推送,企业微信应用推送,飞书推送,钉钉机器人推送,企业微信机器人推送,飞书机器人推送,一对多推送,Bark推送(仅iOS),PushDeer,PushDeer自架
  • 自20210911之后的版本,支持Bark群组,群组名默认为设备名
  • 自20210901之后的版本,增加依赖jq,请重新编译或在安装前同步安装jq

显示效果

通知栏:直接显示推送主题,一目了然,按设备不同,分组显示

消息列表:直接显示最新推送的标题

消息内容:直接显示所有推送信息,不用二次点开再查看

下载


#####################################################

以下为原插件简介:

简介

  • 用于 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

ps

  • 新功能看情况开发
  • 王者荣耀新赛季,不思进取中
  • 欢迎各种代码提交
  • 提交bug时请尽量带上设备信息,日志与描述(如执行/usr/bin/serverchan/serverchan后的提示、日志信息、/tmp/serverchan/ipAddress 文件信息)
  • 三言两句恕我无能为力
  • 武汉加油

luci-app-pushbot's People

Contributors

1715173329 avatar awter avatar beginner-go avatar binext avatar firkerword avatar kfermercer avatar tty228 avatar twinzo1 avatar vantstark avatar xylz0928 avatar zzsj0928 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

luci-app-pushbot's Issues

pushbot 未运行

openwrt 系统运行不起来 启用 后还是显示 未运行
日志里面也没有相关记录文件

获取网址的方式建议增加网络

对于单臂主路由来说,一个eth0里面有lan口,wan口等几个网络的v6地址。目前好像是随机获取到某个网络的v6地址,然后发出通知。实际上地址是没有变化的。

luci-app-pushbot 钉钉推送使用过程中 遇到的错误 及解决办法

1 推送不成功日志显示
【!!!!】当前网络不通!停止检测!
1.2 检查openwrt是否正常拨号成功
1.3 检查curl插件是否安装,我遇到就是curl插件有问题重新安装解决的

2定时任务不运行
在luci-app-pushbot插件界面设置定时任务后保存观察 系统计划任务内是否有/usr/bin/pushbot/pushbot 的定时计划 ,
2.2 没有任务的话在ssh登录openwrt运行一下 /usr/bin/pushbot/pushbot send 很玄学,后面保存定时任务就正常保存。

3 注意安装相关依赖插件 依赖 iputils-arping + curl 命令,安装前请 opkg update,小内存路由谨慎安装
如果无的话运行相关命令 。wrtbwmon是检测流量相关的依赖 ,没有安装在日志里有提示。

opkg update & opkg install iputils-arping & curl & wrtbwmon

4 关于钉钉机器人推送频率的疑问 以下是官方文档说明
https://open.dingtalk.com/document/orgapp-server/invocation-frequency-limit
自定义机器人发送消息频率限制
每个机器人每分钟最多发送20条。
如果超过20条,会限流10分钟

5 放一个x86的插件仓库 注意每次在web界面上传安装插件得运行opkg update 才能安装
https://op.dllkids.xyz/packages/x86_64/

json 文件生成失败

2021-10-25 17:05:38 【定时数据】创建定时任务
2021-10-25 17:05:39 【!!!】json 文件生成失败,请检查文件格式
2021-10-25 17:05:39 【!!!】定时推送失败,请检查网络或设置信息
2021-10-25 17:06:36 【初始化】设备MAC厂商信息不存在,重新下载
2021-10-25 17:06:36 【!!!】未安装 wrtbwmon ,流量统计不可用
2021-10-25 17:06:36 【!!!】无法获取依赖项 iputils-arping 版本号,请确认插件是否正常运行
2021-10-25 17:06:36 【初始化】载入在线设备
2021-10-25 17:06:47 【定时数据】创建定时任务
2021-10-25 17:06:47 【!!!】json 文件生成失败,请检查文件格式
2021-10-25 17:06:47 【!!!】定时推送失败,请检查网络或设置信息
2021-10-25 17:07:29 【定时数据】创建定时任务
2021-10-25 17:07:29 【!!!】json 文件生成失败,请检查文件格式
2021-10-25 17:07:29 【!!!】定时推送失败,请检查网络或设置信息
2021-10-25 17:10:47 【定时数据】创建定时任务
2021-10-25 17:10:47 【!!!】json 文件生成失败,请检查文件格式
2021-10-25 17:10:47 【!!!】定时推送失败,请检查网络或设置信息

钉钉推送失败

已经添加了钉钉自定义机器人的webhook,并设置安全关键字(路由名称,定时推送标题), 但测试、定时发送没有收到消息,日志里显示已经推送成功

无法推送信息

更新到最新版本 3.60 2022.07.22-1708
使用pushplus推送 ,配置无误,点击测试每次均可以收到推送信息
但根据日志看,设定的事件发生后无一推送成功

在两台路由器上测试,结果相同

2022-08-08 17:17:27 【!!警报!!】 CPU 负载过高: 2.69
2022-08-08 17:17:27 【!!警报!!】 CPU 占用前三: /usr/share/uugamebooster/uuplugin 23% /usr/sbin/nlbwmon 4% /etc/openclash/clash 0%
2022-08-08 19:24:37 【!!警报!!】 CPU 负载过高: 2.93
2022-08-08 19:24:37 【!!警报!!】 CPU 占用前三: /usr/share/uugamebooster/uuplugin 25% /etc/openclash/clash 0% /usr/bin/AdGuardHome/AdGuardHome 0%
2022-08-08 22:19:53 【!!警报!!】 CPU 负载过高: 2.79
2022-08-08 22:19:53 【!!警报!!】 CPU 占用前三: /usr/share/uugamebooster/uuplugin 25% /etc/openclash/clash 5% /usr/bin/AdGuardHome/AdGuardHome 5%
2022-08-08 23:26:14 【初始化】载入在线设备
2022-08-08 23:26:26 【初始化】载入在线设备
2022-08-08 23:27:06 【初始化】初始化完成
2022-08-08 23:27:20 【定时数据】创建定时任务
2022-08-08 23:27:21 定时推送任务完成
2022-08-08 23:41:49 【!!警报!!】 CPU 负载过高: 2.65
2022-08-08 23:41:49 【!!警报!!】 CPU 占用前三: /usr/share/uugamebooster/uuplugin 25% /usr/sbin/nlbwmon 2% /etc/openclash/clash 0%

如图事件均未收到

pushplus的api文件配置为
{
"_api": "这是 Pushbot:PushPlus api 文件",
"_api": "【PushPlus推送】",

"url": "http://www.pushplus.plus/send",
"data": "@${tempjsonpath}",
"content_type": "Content-Type:application/json",
"str_title_start": "#### ",
"str_title_end": "",
"str_linefeed": "\\n\\n",
"str_splitline": "\\n----\\n",
"str_space": " ",
"str_tab": "    ",
"table_tab": "",
"font_green": "<font color=#92D050>",
"font_green2": "",
"font_red": "<font color=#FF6666>",
"font_blue": "<font color=#76CCFF>",
"font_purple": "<font color=#6A65FF>",
"font_end": "</font>",
"font_end2": "",
"percentsym": "",
"boldstar": "",
"type":
  {
      	"token": "\"${pp_token}\"",
      	"channel": "\"${pp_channel}\"",
      	"webhook": "\"${pp_webhook}\"",
      	"topic": "\"${pp_topic}\"",
	"title": "\"${1}\"",
	"content": "\"${2}\"",
	"template": "\"markdown\""
  }

}

飞书推送不成功

已经添加了飞书自定义机器人的webhook,但测试发送没有收到消息,日志里显示已经推送成功

希望 pushbot也能添加Telegram推送的选项。

如何在 推送模式的下拉菜单里面 加Telegram选项 ??
原server酱是有的,但希望 pushbot也能添加Telegram推送的选项。
非常需要在pushbot里面添加这个Telegram推送。

设备MAC厂商信息下载失败

在线设备:
/usr/lib/lua/luci/dispatcher.lua:474: Failed to execute cbi dispatcher target for entry '/admin/services/pushbot/client'.
The called action terminated with an exception:
/usr/lib/lua/luci/template.lua:97: Failed to execute template 'cbi/simpleform'.
A runtime error occured: /usr/lib/lua/luci/template.lua:74: Failed to load template 'pushbot/pushbot_client'.
Error while parsing template '/usr/lib/lua/luci/view/pushbot/pushbot_client.htm':
No such file or directory
stack traceback:
[C]: in function 'assert'
/usr/lib/lua/luci/dispatcher.lua:474: in function 'dispatch'
/usr/lib/lua/luci/dispatcher.lua:126: in function

日志:
2022-02-22 12:20:53 【初始化】设备MAC厂商信息不存在,重新下载
2022-02-22 12:20:53 【初始化】载入在线设备
2022-02-22 12:20:59 【!!!】设备MAC厂商信息下载失败
2022-02-22 12:20:59 【初始化】初始化完成
2022-02-22 12:21:00 【!!!】获取 IPv4 地址失败
2022-02-22 12:22:02 【!!!】获取 IPv4 地址失败
2022-02-22 12:23:04 【!!!】获取 IPv4 地址失败

openwrt R22.2.2
设备 R2S
内核 5.10.100

😭😭😭

默认获取设备cpu温度命令错误,获取的为PCH温度

机器温度如下:
drivetemp-scsi-4-0
Adapter: SCSI adapter
temp1: +30.0°C

pch_haswell-virtual-0
Adapter: Virtual device
temp1: +67.0°C

acpitz-acpi-0
Adapter: ACPI interface
temp1: +47.0°C

drivetemp-scsi-5-0
Adapter: SCSI adapter
temp1: +54.0°C

drivetemp-scsi-0-0
Adapter: SCSI adapter
temp1: +34.0°C (low = +0.0°C, high = +60.0°C)
(crit low = +0.0°C, crit = +60.0°C)
(lowest = +27.0°C, highest = +34.0°C)

coretemp-isa-0000
Adapter: ISA adapter
Package id 0: +47.0°C (high = +84.0°C, crit = +100.0°C)
Core 0: +47.0°C (high = +84.0°C, crit = +100.0°C)
Core 1: +45.0°C (high = +84.0°C, crit = +100.0°C)
程序温度报警获取到的温度是南桥温度,
image

建议添加新推送项目

能不能添加推送web登录,ssh登录推送,登录失败类推送,这样能实时了解路由器情况,防止外部入侵暴力破解……

Brak 推送消息分組功能

Bark的功能有分組功能, 希望能添加
能夠把不同台的lede設備通知區分開來
官方用例如下 https://api.day.app/yourkey/需要分组的推送?group=groupName

钉钉推送 能否支持 加签的安全设置。

钉钉的推送机器人有 三个来源限制,
1、自定义关键字
2、加签
3、来源IP

现在用的自定义关键字,设置的路由器名称。 pushbot 推送的消息里不带路由名称的消息就无法推送了

来源IP 对家宽不适用,动态IP会变。

请问作者能否支持下 加签。这样安全也方便。

自定义推送出错

配置好自定义推送,发送测试信息正常,能收到
但启动后总是自动关闭,显示“读取设置出错,请检查设置项”,“请填写正确的Token/webhook"
然而,自定义推送并没有填写token的地方

IPv4 API列表问题

ifcfg.cn 已不能访问
ipv4.ddnspod.com 如果是做国内外分流这个域名会解析到国外IP

web&ssh登录信息推送在ipv6下测试反馈

目前在外网环境下使用ipv6公网地址,uhttpd监听ipv6地址web使用自定义端口,Dropbear开启ssh自定义端口。web使用ipv6公网地址ssl证书登录, ssh使用密码公钥登录。确认web&ssh登录成功。无检测到web和ssh登录信息,检查系统日志有登录信息记录,程序没有推送消息。
个人觉得:是否能在pushbot设置界面添加自定义httpd监听web&ssh端口来达到检测目的?包括ipv4地址及ipv6地址(http和https访问)。可行?

Requires documentation to set up Pushbot . . .

Hi . . .
Thanks for your very good app. It is really very practical.
I wanted to see if there is a document to be read that introduced
the implementation of the Pushbot notification system using the Telegram Bot?
Because I do not know how to set the Pushbot notification system.

112665896-2b164980-8e79-11eb-8c16-70bb0a1fb4ad

Thanks Bro ;-)

关于路由器统计在线不准

我这里是拨号,每次ip释放,重新拨号后wan口的在线时间重新计算了,这导致看路由器在线时间不正确,又不能选择lan口,这样ip变化通知有没得,所以可以新增一个用那个接口的时间作为路由器的在线时间,目测lan口不会因为拨号释放ip重新计算时间

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.