Skip to content

Commit

Permalink
[bot] AutoMerging: merge all upstream's changes:
Browse files Browse the repository at this point in the history
* https://github.com/coolsnowwolf/lede:
  firewall: update to latest HEAD (coolsnowwolf#8666)
  luci-app-jd-dailybonus: sync upstream (coolsnowwolf#8647)
  luci-app-serverchan: update ipv4.list (coolsnowwolf#8648)
  luci-app-pushbot: sync upstream (coolsnowwolf#8649)
  • Loading branch information
github-actions[bot] committed Jan 12, 2022
2 parents 65b3ea1 + 2813273 commit 9299f64
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ o = s:option(Value, 'dd_token', translate('Dingding Bot Token'))
o.rmempty = true
o.description = translate('创建一个群机器人并获取API Token,设置安全关键字为:京东')

-- pushplus

o = s:option(Value, 'pp_token', translate('pushplus Token'))
o.rmempty = true
o.description = translate('微信推送,基于pushplus服务,请自行登录 https://www.pushplus.plus/ 绑定并获取 Token。')

-- telegram

o = s:option(Value, 'tg_token', translate('Telegram Bot Token'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# See /LICENSE for more information.
#

USE_PROCD=1
START=25
STOP=10

NAME=jd-dailybonus
CRON_FILE=/etc/crontabs/root
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ notify() {
uclient-fetch -q --post-file=/tmp/jd-djson.json "https://oapi.dingtalk.com/robot/send?access_token=${dtoken}"
fi

#pushplus
ptoken=$(uci_get_by_type global pp_token)
POST_URL="http://www.pushplus.plus/send"
if [ ! -z $ptoken ]; then
curl -s -d "{\"token\":\"$ptoken\",\"title\":\"$title\",\"content\":\"$desc\"}" -H 'Content-Type: application/json' $POST_URL
fi

#telegram
TG_BOT_TOKEN=$(uci_get_by_type global tg_token)
TG_USER_ID=$(uci_get_by_type global tg_userid)
Expand Down
45 changes: 36 additions & 9 deletions package/lean/luci-app-pushbot/luasrc/model/cbi/pushbot/setting.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

local nt = require "luci.sys".net
local fs=require"nixio.fs"
local e=luci.model.uci.cursor()
Expand Down Expand Up @@ -48,11 +48,11 @@ 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/diy.json",translate("自定义推送"))

a=s:taboption("basic", Value,"dd_webhook",translate('Webhook'), translate("钉钉机器人 Webhook").."只输入aaccess_token=后面的即可<br>调用代码获取<a href='https://developers.dingtalk.com/document/robots/custom-robot-access' target='_blank'>点击这里</a><br><br>")
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>")
a.rmempty = true
a:depends("jsonpath","/usr/bin/pushbot/api/dingding.json")

a=s:taboption("basic", Value, "we_webhook", translate("Webhook"),translate("企业微信机器人 Webhook").."<br>调用代码获取<a href='https://work.weixin.qq.com/api/doc/90000/90136/91770' target='_blank'>点击这里</a><br><br>")
a=s:taboption("basic", Value, "we_webhook", translate("Webhook"),translate("企业微信机器人 Webhook")..",只输入key=后面的即可<br>调用代码获取<a href='https://work.weixin.qq.com/api/doc/90000/90136/91770' target='_blank'>点击这里</a><br><br>")
a.rmempty = true
a:depends("jsonpath","/usr/bin/pushbot/api/ent_wechat.json")

Expand Down Expand Up @@ -101,6 +101,26 @@ a=s:taboption("basic", Value,"bark_srv",translate('Bark Server'), translate("Bar
a.rmempty = true
a:depends("bark_srv_enable","1")

a=s:taboption("basic", Value,"bark_sound",translate('Bark Sound'), translate("Bark 通知声音").."<br>如silence.caf<br>具体设定参见:<a href='https://github.com/Finb/Bark/tree/master/Sounds' target='_blank'>点击这里</a><br><br>")
a.rmempty = true
a.default = "silence.caf"
a:depends("jsonpath","/usr/bin/pushbot/api/bark.json")

a=s:taboption("basic", Flag,"bark_icon_enable",translate(" Bark 通知图标"))
a.default=0
a.rmempty = true
a:depends("jsonpath","/usr/bin/pushbot/api/bark.json")

a=s:taboption("basic", Value,"bark_icon",translate('Bark Icon'), translate("Bark 通知图标").."(仅 iOS15 或以上支持)<br>如http://day.app/assets/images/avatar.jpg<br>具体设定参见:<a href='https://github.com/Finb/Bark#%E5%85%B6%E4%BB%96%E5%8F%82%E6%95%B0' target='_blank'>点击这里</a><br><br>")
a.rmempty = true
a.default = "http://day.app/assets/images/avatar.jpg"
a:depends("bark_icon_enable","1")

a=s:taboption("basic", Value,"bark_level",translate('Bark Level'), translate("Bark 时效性通知").."<br>可选参数值:<br/>active:不设置时的默认值,系统会立即亮屏显示通知。<br/>timeSensitive:时效性通知,可在专注状态下显示通知。<br/>passive:仅将通知添加到通知列表,不会亮屏提醒。")
a.rmempty = true
a.default = "active"
a:depends("jsonpath","/usr/bin/pushbot/api/bark.json")

a=s:taboption("basic", TextValue, "diy_json", translate("自定义推送"))
a.optional = false
a.rows = 28
Expand Down Expand Up @@ -355,8 +375,8 @@ a=s:taboption("crontab", ListValue,"regular_time",translate("发送时间"))
a.rmempty = true
for t=0,23 do
a:value(t,translate("每天"..t..""))
end
a.default=8
end
a.default=8
a.datatype=uinteger
a:depends("crontab","1")

Expand All @@ -365,7 +385,7 @@ a.rmempty = true
a:value("",translate("关闭"))
for t=0,23 do
a:value(t,translate("每天"..t..""))
end
end
a.default="关闭"
a.datatype=uinteger
a:depends("crontab","1")
Expand All @@ -376,7 +396,7 @@ a.rmempty = true
a:value("",translate("关闭"))
for t=0,23 do
a:value(t,translate("每天"..t..""))
end
end
a.default="关闭"
a.datatype=uinteger
a:depends("crontab","1")
Expand Down Expand Up @@ -406,7 +426,7 @@ a=s:taboption("crontab", Flag,"router_temp",translate("设备温度"))
a.default=1
a:depends("crontab","1")
a:depends("crontab","2")

a=s:taboption("crontab", Flag,"router_wan",translate("WAN信息"))
a.default=1
a:depends("crontab","1")
Expand All @@ -415,7 +435,14 @@ a:depends("crontab","2")
a=s:taboption("crontab", Flag,"client_list",translate("客户端列表"))
a.default=1
a:depends("crontab","1")
a:depends("crontab","2")
a:depends("crontab","2")

a=s:taboption("crontab", Value,"google_check_timeout",translate("全球互联检测超时时间"))
a.rmempty = true
a.optional = false
a.default = "10"
a.datatype = "and(uinteger,min(3))"
a.description = translate("过短的时间可能导致检测不准确")

e=s:taboption("crontab", Button,"_add",translate("手动发送"))
e.inputtitle=translate("发送")
Expand Down
24 changes: 13 additions & 11 deletions package/lean/luci-app-pushbot/root/usr/bin/pushbot/api/bark.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@
"font_end2": "",
"percentsym": "",
"boldstar": "",
"type":
{
"device_key": "\"${bark_token}\"",
"title": "\"${1}\"",
"body": "\"${nowtime}${str_linefeed}${2}\"",
"ext_params": {
"group": "\"${device_name}\"",
"isArchive": "1"
}
}
}
"type": {
"device_key": "\"${bark_token}\"",
"title": "\"${1}\"",
"body": "\"${nowtime}${str_linefeed}${2}\"",
"ext_params": {
"group": "\"${device_name}\"",
"isArchive": "1",
"icon": "\"${bark_icon}\"",
"level": "\"${bark_level}\""
},
"sound": "\"${bark_sound}\""
}
}
7 changes: 4 additions & 3 deletions package/lean/luci-app-pushbot/root/usr/bin/pushbot/pushbot
Original file line number Diff line number Diff line change
Expand Up @@ -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" "bark_srv_enable" "bark_srv" "bark_token"
"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
Expand Down Expand Up @@ -1109,17 +1109,18 @@ function add_ip_black(){
function send(){
echo "`date "+%Y-%m-%d %H:%M:%S"` 【定时数据】创建定时任务" >> ${logfile}
pushbot_disturb;local send_disturb=$?
get_config "send_title" "router_status" "router_temp" "router_wan" "client_list"
get_config "send_title" "router_status" "router_temp" "router_wan" "client_list" "google_check_timeout"

[ -z "$send_title" ] && local send_title="路由状态:"
[ -z "$google_check_timeout" ] && local google_check_timeout="10"
[ ! -z "$1" ] && local send_title="发送测试:" && local send_content="${str_splitline}${str_title_start}内容1${str_title_end}${str_linefeed}${str_tab}设备1${str_linefeed}${str_tab}设备2${str_splitline}${str_title_start}内容2${str_title_end}${str_linefeed}${str_tab}设备3${str_linefeed}${str_tab}设备4"
[ -z "$1" ] && [ ! -z "$client_list" ] && [ "$client_list" -eq "1" ] && > ${dir}send_enable.lock && pushbot_first &

if [ -z "$1" ] && [ ! -z "$router_status" ] && [ "$router_status" -eq "1" ]; then
local systemload=`cat /proc/loadavg|awk '{print $1" "$2" "$3}'`
local cpuload=`getcpu`
local ramload=`free -m|sed -n '2p'|awk '{printf "%.2f%%\n",($3/$2)*100}'`
local Qwai=`curl -o /dev/null --connect-timeout 5 -s -w %{http_code} www.google.com`
local Qwai=`curl -o /dev/null --connect-timeout ${google_check_timeout} -s -w %{http_code} www.google.com`
if [[ "$Qwai" -eq "200" ]] || [[ "$Qwai" -eq "301" ]] || [[ "$Qwai" -eq "302" ]]; then
local Qwai_status="已连通!"
else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
www.cip.cc
ipv4.ddnspod.com
ifcfg.cn
speed.neu.edu.cn/getIP.php
ddns.oray.com/checkip
Expand Down
6 changes: 3 additions & 3 deletions package/network/config/firewall/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ PKG_RELEASE:=1

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/firewall3.git
PKG_SOURCE_DATE:=2021-08-14
PKG_SOURCE_VERSION:=40e5f6a2bd0b5406eff7e1d2d4f95bbf8f9410a4
PKG_MIRROR_HASH:=4acd7d3c688d31a07ad871dcdbcd06d975ac86745d9f3a6caed68e694635965c
PKG_SOURCE_DATE:=2022-01-10
PKG_SOURCE_VERSION:=0f16ea5f055722a532d4e68c7ba34ed084b48b37
PKG_MIRROR_HASH:=219478ef95b170b5122030715eac7b3317f2ac4d67e1a936c22a78b10e056123
PKG_MAINTAINER:=Jo-Philipp Wich <[email protected]>
PKG_LICENSE:=ISC

Expand Down

0 comments on commit 9299f64

Please sign in to comment.