🍉 Sync 2026-04-27 08:33:04

This commit is contained in:
github-actions[bot] committed 2026-04-27 08:33:04 +08:00
1 parent 576eeccfeb
commit 7ae30bfa80
1284 files changed
+652917 -268

No files matched your search

+2 -2
View File
@@ -5,8 +5,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ddns-go
PKG_VERSION:=6.16.10
PKG_RELEASE:=9
PKG_VERSION:=6.16.12
PKG_RELEASE:=10
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/jeessy2/ddns-go/tar.gz/v$(PKG_VERSION)?
+3 -3
View File
@@ -5,12 +5,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=gn
PKG_RELEASE:=4
PKG_RELEASE:=5
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://gn.googlesource.com/gn.git
PKG_SOURCE_DATE:=2026-03-31
PKG_SOURCE_VERSION:=6e8dcdebbadf4f8aa75e6a4b6e0bdf89dce1513a
PKG_SOURCE_DATE:=2025-11-07
PKG_SOURCE_VERSION:=e7f3202128bdb2429872fdb138626a010b2bff7f
PKG_MIRROR_HASH:=skip
PKG_LICENSE:=BSD 3-Clause
+2 -2
View File
@@ -3,7 +3,7 @@
#ifndef OUT_LAST_COMMIT_POSITION_H_
#define OUT_LAST_COMMIT_POSITION_H_
#define LAST_COMMIT_POSITION_NUM 2355
#define LAST_COMMIT_POSITION "2355 (6e8dcdebbadf)"
#define LAST_COMMIT_POSITION_NUM 2292
#define LAST_COMMIT_POSITION "2292 (e7f3202128bd)"
#endif // OUT_LAST_COMMIT_POSITION_H_
+1 -1
View File
@@ -9,7 +9,7 @@ LUCI_TITLE:=LuCI support for Timewol
LUCI_DEPENDS:=+etherwake
LUCI_PKGARCH:=all
PKG_VERSION:=1.1
PKG_RELEASE:=1
PKG_RELEASE:=2
include $(TOPDIR)/feeds/luci/luci.mk
@@ -1,16 +1,18 @@
module("luci.controller.timewol", package.seeall)
function index()
if not nixio.fs.access("/etc/config/timewol") then return end
if not nixio.fs.access("/etc/config/luci-app-control-timewol") then
return
end
entry({"admin", "control"}, firstchild(), "Control", 44).dependent = false
entry({"admin", "control", "timewol"}, cbi("timewol"), _("Timed Wakeup"), 95).dependent = true
entry({"admin", "control", "timewol", "status"}, call("status")).leaf = true
entry({"admin", "control"}, firstchild(), "Control", 44).dependent = false
entry({"admin", "control", "timewol"}, cbi("timewol"), _("Timed Wakeup"), 95).dependent = true
entry({"admin", "control", "timewol", "status"}, call("status")).leaf = true
end
function status()
local e = {}
e.status = luci.sys.call("cat /etc/crontabs/root | grep etherwake >/dev/null") == 0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
local e = {}
e.status = luci.sys.call("cat /etc/crontabs/root | grep etherwake >/dev/null") == 0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
@@ -1,6 +1,6 @@
local i = require "luci.sys"
t = Map("timewol", translate("Timed network wake-up"), translate("Wake up your LAN device regularly"))
t = Map("luci-app-control-timewol", translate("Timed network wake-up"), translate("Wake up your LAN device regularly"))
e = t:section(TypedSection, "basic", translate("Basic setting"))
e.anonymous = true
@@ -15,10 +15,16 @@ e.addremove = true
nolimit_mac = e:option(Value, "macaddr", translate("MAC Address"))
nolimit_mac.rmempty = false
i.net.mac_hints(function(e, t) nolimit_mac:value(e, "%s (%s)" % {e, t}) end)
i.net.mac_hints(function(e, t)
nolimit_mac:value(e, "%s (%s)" % {e, t})
end)
nolimit_eth = e:option(Value, "maceth", translate("Network interface"))
nolimit_eth.rmempty = false
for t, e in ipairs(i.net.devices()) do if e ~= "lo" then nolimit_eth:value(e) end end
for t, e in ipairs(i.net.devices()) do
if e ~= "lo" then
nolimit_eth:value(e)
end
end
a = e:option(Value, "minute", translate("minutes"))
a.optional = false
@@ -9,7 +9,7 @@
START=99
CONFIG=timewol
CONFIG="luci-app-control-timewol"
uci_get_by_type() {
local index=0
@@ -1,19 +1,19 @@
#!/bin/sh
[ ! -f "/usr/share/ucitrack/luci-app-timewol.json" ] && {
cat > /usr/share/ucitrack/luci-app-timewol.json << EEOF
[ ! -f "/usr/share/ucitrack/luci-app-luci_app_control_timewol.json" ] && {
cat > /usr/share/ucitrack/luci-app-luci_app_control_timewol.json << EEOF
{
"config": "timewol",
"init": "timewol"
"config": "luci_app_control_timewol",
"init": "luci_app_control_timewol"
}
EEOF
}
uci -q batch <<-EOF >/dev/null
delete ucitrack.@timewol[-1]
add ucitrack timewol
set ucitrack.@timewol[-1].init=timewol
delete ucitrack.@luci_app_control_timewol[-1]
add ucitrack luci_app_control_timewol
set ucitrack.@luci_app_control_timewol[-1].init=luci-app-control-timewol
commit ucitrack
EOF
rm -f /tmp/luci-indexcache
rm -rf /tmp/luci-*cache
exit 0
@@ -2,10 +2,10 @@
"luci-app-control-timewol": {
"description": "Grant UCI access for luci-app-control-timewol",
"read": {
"uci": [ "timewol" ]
"uci": [ "luci-app-control-timewol" ]
},
"write": {
"uci": [ "timewol" ]
"uci": [ "luci-app-control-timewol" ]
}
}
}
@@ -1,4 +1,4 @@
{
"config": "timewol",
"init": "timewol"
"config": "luci-app-control-timewol",
"init": "luci-app-control-timewol"
}
+1 -1
View File
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for Webrestriction
LUCI_PKGARCH:=all
PKG_VERSION:=1.1
PKG_RELEASE:=1
PKG_RELEASE:=2
include $(TOPDIR)/feeds/luci/luci.mk
@@ -1,16 +1,18 @@
module("luci.controller.webrestriction", package.seeall)
function index()
if not nixio.fs.access("/etc/config/webrestriction") then return end
if not nixio.fs.access("/etc/config/luci-app-control-webrestriction") then
return
end
entry({"admin", "control"}, firstchild(), "Control", 44).dependent = false
entry({"admin", "control", "webrestriction"}, cbi("webrestriction"), _("Access Control"), 11).dependent = true
entry({"admin", "control", "webrestriction", "status"}, call("status")).leaf = true
entry({"admin", "control"}, firstchild(), "Control", 44).dependent = false
entry({"admin", "control", "webrestriction"}, cbi("webrestriction"), _("Access Control"), 11).dependent = true
entry({"admin", "control", "webrestriction", "status"}, call("status")).leaf = true
end
function status()
local e = {}
e.status = luci.sys.call("iptables -L FORWARD | grep WEB_RESTRICTION >/dev/null") == 0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
local e = {}
e.status = luci.sys.call("iptables -w -L FORWARD | grep WEB_RESTRICTION >/dev/null") == 0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
@@ -1,6 +1,7 @@
local o = require "luci.sys"
a = Map("webrestriction", translate("Access Control"), translate("Use the blacklist or whitelist mode to control whether a client in the list can connect to the Internet."))
a = Map("luci-app-control-webrestriction", translate("Access Control"), translate(
"Use the blacklist or whitelist mode to control whether a client in the list can connect to the Internet."))
a.template = "webrestriction/index"
e = a:section(TypedSection, "basic", translate("Running Status"))
@@ -21,7 +22,8 @@ t.default = "blacklist"
t:value("whitelist", translate("Whitelist"))
t:value("blacklist", translate("Blacklist"))
e = a:section(TypedSection, "macbind", translate("List setting"), translate("In blacklist mode, the client in the list is prohibited from connecting to the Internet. In whitelist mode, only the clients in the list can connect to the Internet."))
e = a:section(TypedSection, "macbind", translate("List setting"), translate(
"In blacklist mode, the client in the list is prohibited from connecting to the Internet. In whitelist mode, only the clients in the list can connect to the Internet."))
e.template = "cbi/tblsection"
e.anonymous = true
e.addremove = true
@@ -32,5 +34,7 @@ t.rmempty = false
t = e:option(Value, "macaddr", translate("MAC Address"))
t.rmempty = true
o.net.mac_hints(function(e, a) t:value(e, "%s (%s)" % {e, a}) end)
o.net.mac_hints(function(e, a)
t:value(e, "%s (%s)" % {e, a})
end)
return a
@@ -0,0 +1,81 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2016 fw867 <ffkykzs@gmail.com>
# Copyright (C) 2024 Lienol
START=99
CONFIG="luci-app-control-webrestriction"
ipt="iptables -w"
ip6t="ip6tables -w"
iptables_w(){
$ipt 1 "$@"
$ip6t 1 "$@"
}
add_rule(){
action=$1
local items=$(uci show ${CONFIG} | grep "=macbind" | cut -d '.' -sf 2 | cut -d '=' -sf 1)
for i in $items; do
enable=$(uci -q get ${CONFIG}.${i}.enable)
macaddr=$(uci -q get ${CONFIG}.${i}.macaddr)
if [ -z $enable ] || [ -z $macaddr ]; then
continue
fi
if [ "$enable" == "1" ]; then
iptables_w -A WEB_RESTRICTION -m mac --mac-source $macaddr -j $action
[ "$limit_type" == "blacklist" ] && {
iptables_w -t nat -A WEB_RESTRICTION -m mac --mac-source $macaddr -j RETURN
}
fi
unset enable macaddr
done
}
start(){
stop
ENABLED=$(uci -q get ${CONFIG}.@basic[0].enable || echo "0")
[ "${ENABLED}" != "1" ] && exit 0
limit_type=$(uci -q get ${CONFIG}.@basic[0].limit_type)
iptables_w -N WEB_RESTRICTION
if [ "$limit_type" == "blacklist" ]; then
iptables_w -t nat -N WEB_RESTRICTION
add_rule DROP
else
add_rule ACCEPT
iptables_w -A WEB_RESTRICTION -j DROP
fi
FW3_INDEX_4=$($ipt -L FORWARD --line-numbers | tail -n +3 | grep -E ACCEPT | grep ctstate | grep fw3 | awk '{print $1}')
[ -n "$FW3_INDEX_4" ] && let FW3_INDEX_4+=1
$ipt -I FORWARD $FW3_INDEX_4 -j WEB_RESTRICTION
FW3_INDEX_6=$($ip6t -L FORWARD --line-numbers | tail -n +3 | grep -E ACCEPT | grep ctstate | grep fw3 | awk '{print $1}')
[ -n "$FW3_INDEX_6" ] && let FW3_INDEX_6+=1
$ip6t -I FORWARD $FW3_INDEX_6 -j WEB_RESTRICTION
[ "$limit_type" == "blacklist" ] && {
iptables_w -t nat -I PREROUTING 1 -j WEB_RESTRICTION
}
}
stop(){
ipt_del() {
for i in $(seq 1 $($1 -nL $2 | grep -c "WEB_RESTRICTION")); do
local index=$($1 --line-number -nL $2 | grep "WEB_RESTRICTION" | head -1 | awk '{print $1}')
$1 -w -D $2 $index 2>/dev/null
done
}
ipt_del "$ipt" "FORWARD"
ipt_del "$ipt" "INPUT"
ipt_del "$ipt -t nat" "PREROUTING"
ipt_del "$ip6t" "FORWARD"
ipt_del "$ip6t" "INPUT"
ipt_del "$ip6t -t nat" "PREROUTING"
iptables_w -F WEB_RESTRICTION 2>/dev/null
iptables_w -X WEB_RESTRICTION 2>/dev/null
iptables_w -t nat -F WEB_RESTRICTION 2>/dev/null
iptables_w -t nat -X WEB_RESTRICTION 2>/dev/null
}
@@ -1,86 +0,0 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2016 fw867 <ffkykzs@gmail.com>
# Copyright (C) 2024 Lienol
START=99
CONFIG=webrestriction
ipt="iptables -w"
ip6t="ip6tables -w"
add_rule(){
action=$1
local items=$(uci show ${CONFIG} | grep "=macbind" | cut -d '.' -sf 2 | cut -d '=' -sf 1)
for i in $items; do
enable=$(uci -q get ${CONFIG}.${i}.enable)
macaddr=$(uci -q get ${CONFIG}.${i}.macaddr)
if [ -z $enable ] || [ -z $macaddr ]; then
continue
fi
if [ "$enable" == "1" ]; then
$ipt -A WEB_RESTRICTION -m mac --mac-source $macaddr -j $action
$ip6t -A WEB_RESTRICTION -m mac --mac-source $macaddr -j $action 2>/dev/null
[ "$limit_type" == "blacklist" ] && {
$ipt -t nat -A WEB_RESTRICTION -m mac --mac-source $macaddr -j RETURN
$ip6t -t nat -A WEB_RESTRICTION -m mac --mac-source $macaddr -j RETURN 2>/dev/null
}
fi
unset enable macaddr
done
}
start(){
stop
ENABLED=$(uci -q get ${CONFIG}.@basic[0].enable || echo "0")
[ "${ENABLED}" != "1" ] && exit 0
limit_type=$(uci -q get ${CONFIG}.@basic[0].limit_type)
$ipt -N WEB_RESTRICTION
$ip6t -N WEB_RESTRICTION 2>/dev/null
if [ "$limit_type" == "blacklist" ]; then
$ipt -t nat -N WEB_RESTRICTION
$ip6t -t nat -N WEB_RESTRICTION 2>/dev/null
add_rule DROP
else
add_rule ACCEPT
$ipt -A WEB_RESTRICTION -j DROP
$ip6t -A WEB_RESTRICTION -j DROP 2>/dev/null
fi
#获取FORWARD ACCEPT规则行号
FA_INDEX=`$ipt -L FORWARD --line-numbers | tail -n +3 | grep -E ACCEPT | grep ctstate | grep fw3 | awk '{print $1}'`
[ -n "$FA_INDEX" ] && let FA_INDEX+=1
$ipt -I FORWARD $FA_INDEX -j WEB_RESTRICTION
#获取FORWARD ACCEPT规则行号
FA_INDEX=`$ip6t -L FORWARD --line-numbers | tail -n +3 | grep -E ACCEPT | grep ctstate | grep fw3 | awk '{print $1}'`
[ -n "$FA_INDEX" ] && let FA_INDEX+=1
$ip6t -I FORWARD $FA_INDEX -j WEB_RESTRICTION
[ "$limit_type" == "blacklist" ] && {
$ipt -t nat -I PREROUTING 1 -j WEB_RESTRICTION
$ip6t -t nat -I PREROUTING 1 -j WEB_RESTRICTION 2>/dev/null
}
}
stop(){
ipt_del() {
for i in $(seq 1 $($1 -nL $2 | grep -c "WEB_RESTRICTION")); do
local index=$($1 --line-number -nL $2 | grep "WEB_RESTRICTION" | head -1 | awk '{print $1}')
$1 -w -D $2 $index 2>/dev/null
done
}
ipt_del "$ipt" "FORWARD"
ipt_del "$ipt" "INPUT"
ipt_del "$ipt -t nat" "PREROUTING"
ipt_del "$ip6t" "FORWARD"
ipt_del "$ip6t" "INPUT"
ipt_del "$ip6t -t nat" "PREROUTING"
$ipt -F WEB_RESTRICTION 2>/dev/null
$ipt -X WEB_RESTRICTION 2>/dev/null
$ipt -t nat -F WEB_RESTRICTION 2>/dev/null
$ipt -t nat -X WEB_RESTRICTION 2>/dev/null
$ip6t -F WEB_RESTRICTION 2>/dev/null
$ip6t -X WEB_RESTRICTION 2>/dev/null
$ip6t -t nat -F WEB_RESTRICTION 2>/dev/null
$ip6t -t nat -X WEB_RESTRICTION 2>/dev/null
}
@@ -1,19 +1,19 @@
#!/bin/sh
[ ! -f "/usr/share/ucitrack/luci-app-webrestriction.json" ] && {
cat > /usr/share/ucitrack/luci-app-webrestriction.json << EEOF
[ ! -f "/usr/share/ucitrack/luci-app-luci_app_control_webrestriction.json" ] && {
cat > /usr/share/ucitrack/luci-app-luci_app_control_webrestriction.json << EEOF
{
"config": "webrestriction",
"init": "webrestriction"
"config": "luci_app_control_webrestriction",
"init": "luci_app_control_webrestriction"
}
EEOF
}
uci -q batch <<-EOF >/dev/null
delete ucitrack.@webrestriction[-1]
add ucitrack webrestriction
set ucitrack.@webrestriction[-1].init=webrestriction
delete ucitrack.@luci_app_control_webrestriction[-1]
add ucitrack luci_app_control_webrestriction
set ucitrack.@luci_app_control_webrestriction[-1].init=luci-app-control-webrestriction
commit ucitrack
EOF
rm -f /tmp/luci-indexcache
rm -rf /tmp/luci-*cache
exit 0
@@ -2,10 +2,10 @@
"luci-app-control-webrestriction": {
"description": "Grant UCI access for luci-app-control-webrestriction",
"read": {
"uci": [ "webrestriction" ]
"uci": [ "luci-app-control-webrestriction" ]
},
"write": {
"uci": [ "webrestriction" ]
"uci": [ "luci-app-control-webrestriction" ]
}
}
}
@@ -1,4 +1,4 @@
{
"config": "webrestriction",
"init": "webrestriction"
"config": "luci-app-control-webrestriction",
"init": "luci-app-control-webrestriction"
}
+1 -1
View File
@@ -9,7 +9,7 @@ LUCI_TITLE:=LuCI support for Weburl
LUCI_DEPENDS:=+iptables-mod-filter +kmod-ipt-filter
LUCI_PKGARCH:=all
PKG_VERSION:=1.1
PKG_RELEASE:=1
PKG_RELEASE:=2
include $(TOPDIR)/feeds/luci/luci.mk
@@ -1,16 +1,18 @@
module("luci.controller.weburl", package.seeall)
function index()
if not nixio.fs.access("/etc/config/weburl") then return end
if not nixio.fs.access("/etc/config/luci-app-control-weburl") then
return
end
entry({"admin", "control"}, firstchild(), "Control", 44).dependent = false
entry({"admin", "control", "weburl"}, cbi("weburl"), _("URL Filter"), 12).dependent = true
entry({"admin", "control", "weburl", "status"}, call("status")).leaf = true
entry({"admin", "control"}, firstchild(), "Control", 44).dependent = false
entry({"admin", "control", "weburl"}, cbi("weburl"), _("URL Filter"), 12).dependent = true
entry({"admin", "control", "weburl", "status"}, call("status")).leaf = true
end
function status()
local e = {}
e.status = luci.sys.call("iptables -L FORWARD | grep WEBURL >/dev/null") == 0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
local e = {}
e.status = luci.sys.call("iptables -w -L FORWARD | grep WEBURL >/dev/null") == 0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
@@ -1,6 +1,7 @@
local o = require "luci.sys"
a = Map("weburl", translate("URL Filter"), translate("Set keyword filtering here, can be any character in the URL, can filter such as video sites, QQ, thunder, Taobao..."))
a = Map("luci-app-control-weburl", translate("URL Filter"), translate(
"Set keyword filtering here, can be any character in the URL, can filter such as video sites, QQ, thunder, Taobao..."))
a.template = "weburl/index"
t = a:section(TypedSection, "basic", translate("Running Status"))
@@ -10,7 +11,8 @@ e = t:option(DummyValue, "weburl_status", translate("Running Status"))
e.template = "weburl/weburl"
e.value = translate("Collecting data...")
t = a:section(TypedSection, "basic", translate("Basic setting"), translate("In general, normal filtering works fine, but forced filtering uses more complex algorithms and leads to higher CPU usage."))
t = a:section(TypedSection, "basic", translate("Basic setting"), translate(
"In general, normal filtering works fine, but forced filtering uses more complex algorithms and leads to higher CPU usage."))
t.anonymous = true
e = t:option(Flag, "enable", translate("Enable"))
@@ -19,7 +21,8 @@ e.rmempty = false
e = t:option(Flag, "algos", translate("Forced filter"))
e.rmempty = false
t = a:section(TypedSection, "macbind", translate("Keyword setting"), translate("MAC addresses do not filter out all clients. For example, only specified clients are filtered out. Filtering time is optional."))
t = a:section(TypedSection, "macbind", translate("Keyword setting"), translate(
"MAC addresses do not filter out all clients. For example, only specified clients are filtered out. Filtering time is optional."))
t.template = "cbi/tblsection"
t.anonymous = true
t.addremove = true
@@ -30,7 +33,9 @@ e.rmempty = false
e = t:option(Value, "macaddr", translate("MAC Address"))
e.rmempty = true
o.net.mac_hints(function(t, a) e:value(t, "%s (%s)" % {t, a}) end)
o.net.mac_hints(function(t, a)
e:value(t, "%s (%s)" % {t, a})
end)
e = t:option(Value, "timeon", translate("Start time"))
e.placeholder = "00:00"
@@ -0,0 +1,74 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2016 fw867 <ffkykzs@gmail.com>
# Copyright (C) 2024 Lienol
START=99
CONFIG="luci-app-control-weburl"
iptables_w(){
iptables -w 1 "$@"
ip6tables -w 1 "$@"
}
start(){
stop
ENABLED=$(uci -q get ${CONFIG}.@basic[0].enable || echo "0")
[ "${ENABLED}" != "1" ] && exit 0
ALGOS=$(uci -q get ${CONFIG}.@basic[0].algos || echo "0")
WEBURL_ALGOS="bm"
[ "${ALGOS}" = "1" ] && WEBURL_ALGOS="kmp"
# resolve interface
local interface=$(
. /lib/functions/network.sh
network_is_up "lan" && network_get_device device "lan"
echo "${device:-br-lan}"
)
iptables_w -t filter -N WEBURL_REJECT
iptables_w -t filter -I WEBURL_REJECT -j DROP
iptables_w -t filter -I WEBURL_REJECT -p tcp -j REJECT --reject-with tcp-reset
iptables_w -t filter -N WEBURL_RULES
iptables_w -t filter -N WEBURL
iptables_w -t filter -I WEBURL -i $interface -m length --length 53:768 -j WEBURL_RULES
# iptables_w -t filter -I WEBURL -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables_w -t filter -I FORWARD -j WEBURL
local items=$(uci show ${CONFIG} | grep "=macbind" | cut -d '.' -sf 2 | cut -d '=' -sf 1)
for i in $items; do
enable=$(uci -q get ${CONFIG}.${i}.enable || echo "0")
macaddr=$(uci -q get ${CONFIG}.${i}.macaddr)
timeon=$(uci -q get ${CONFIG}.${i}.timeon)
timeoff=$(uci -q get ${CONFIG}.${i}.timeoff)
keyword=$(uci -q get ${CONFIG}.${i}.keyword)
if [ "$enable" == "0" ] || [ -z "$keyword" ]; then
continue
fi
if [ -z "$timeon" ] || [ -z "$timeoff" ]; then
settime=""
else
settime="-m time --kerneltz --timestart $timeon --timestop $timeoff"
fi
if [ -z "$macaddr" ]; then
iptables_w -t filter -I WEBURL_RULES $settime -m string --string "$keyword" --algo $WEBURL_ALGOS -j WEBURL_REJECT
else
iptables_w -t filter -I WEBURL_RULES $settime -m mac --mac-source $macaddr -m string --string "$keyword" --algo $WEBURL_ALGOS -j WEBURL_REJECT
fi
unset enable macaddr timeon timeoff keyword
done
logger -t weburl "weburl filter on $interface"
}
stop(){
iptables_w -t filter -D FORWARD -j WEBURL 2>/dev/null
iptables_w -t filter -F WEBURL 2>/dev/null
iptables_w -t filter -X WEBURL 2>/dev/null
iptables_w -t filter -F WEBURL_RULES 2>/dev/null
iptables_w -t filter -X WEBURL_RULES 2>/dev/null
iptables_w -t filter -F WEBURL_REJECT 2>/dev/null
iptables_w -t filter -X WEBURL_REJECT 2>/dev/null
}
@@ -1,90 +0,0 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2016 fw867 <ffkykzs@gmail.com>
# Copyright (C) 2024 Lienol
START=99
CONFIG=weburl
ipt="iptables -w"
ip6t="ip6tables -w"
start(){
stop
ENABLED=$(uci -q get ${CONFIG}.@basic[0].enable || echo "0")
[ "${ENABLED}" != "1" ] && exit 0
ALGOS=$(uci -q get ${CONFIG}.@basic[0].algos || echo "0")
WEBURL_ALGOS="bm"
[ "${ALGOS}" = "1" ] && WEBURL_ALGOS="kmp"
# resolve interface
local interface=$(
. /lib/functions/network.sh
network_is_up "lan" && network_get_device device "lan"
echo "${device:-br-lan}"
)
$ipt -t filter -N WEBURL_REJECT
$ipt -t filter -I WEBURL_REJECT -j DROP
$ipt -t filter -I WEBURL_REJECT -p tcp -j REJECT --reject-with tcp-reset
$ipt -t filter -N WEBURL_RULES
$ipt -t filter -N WEBURL
$ipt -t filter -I WEBURL -i $interface -m length --length 53:768 -j WEBURL_RULES
# $ipt -t filter -I WEBURL -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
$ipt -t filter -I FORWARD -j WEBURL
$ip6t -t filter -N WEBURL_REJECT 2>/dev/null
$ip6t -t filter -I WEBURL_REJECT -j DROP 2>/dev/null
$ip6t -t filter -I WEBURL_REJECT -p tcp -j REJECT --reject-with tcp-reset 2>/dev/null
$ip6t -t filter -N WEBURL_RULES 2>/dev/null
$ip6t -t filter -N WEBURL 2>/dev/null
$ip6t -t filter -I WEBURL -i $interface -m length --length 53:768 -j WEBURL_RULES 2>/dev/null
# $ip6t -t filter -I WEBURL -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT 2>/dev/null
$ip6t -t filter -I FORWARD -j WEBURL 2>/dev/null
local items=$(uci show ${CONFIG} | grep "=macbind" | cut -d '.' -sf 2 | cut -d '=' -sf 1)
for i in $items; do
enable=$(uci -q get ${CONFIG}.${i}.enable || echo "0")
macaddr=$(uci -q get ${CONFIG}.${i}.macaddr)
timeon=$(uci -q get ${CONFIG}.${i}.timeon)
timeoff=$(uci -q get ${CONFIG}.${i}.timeoff)
keyword=$(uci -q get ${CONFIG}.${i}.keyword)
if [ "$enable" == "0" ] || [ -z "$keyword" ]; then
continue
fi
if [ -z "$timeon" ] || [ -z "$timeoff" ]; then
settime=""
else
settime="-m time --kerneltz --timestart $timeon --timestop $timeoff"
fi
if [ -z "$macaddr" ]; then
$ipt -t filter -I WEBURL_RULES $settime -m string --string "$keyword" --algo $WEBURL_ALGOS -j WEBURL_REJECT
$ip6t -t filter -I WEBURL_RULES $settime -m string --string "$keyword" --algo $WEBURL_ALGOS -j WEBURL_REJECT 2>/dev/null
else
$ipt -t filter -I WEBURL_RULES $settime -m mac --mac-source $macaddr -m string --string "$keyword" --algo $WEBURL_ALGOS -j WEBURL_REJECT
$ip6t -t filter -I WEBURL_RULES $settime -m mac --mac-source $macaddr -m string --string "$keyword" --algo $WEBURL_ALGOS -j WEBURL_REJECT 2>/dev/null
fi
unset enable macaddr timeon timeoff keyword
done
logger -t weburl "weburl filter on $interface"
}
stop(){
$ipt -t filter -D FORWARD -j WEBURL 2>/dev/null
$ipt -t filter -F WEBURL 2>/dev/null
$ipt -t filter -X WEBURL 2>/dev/null
$ipt -t filter -F WEBURL_RULES 2>/dev/null
$ipt -t filter -X WEBURL_RULES 2>/dev/null
$ipt -t filter -F WEBURL_REJECT 2>/dev/null
$ipt -t filter -X WEBURL_REJECT 2>/dev/null
$ip6t -t filter -D FORWARD -j WEBURL 2>/dev/null
$ip6t -t filter -F WEBURL 2>/dev/null
$ip6t -t filter -X WEBURL 2>/dev/null
$ip6t -t filter -F WEBURL_RULES 2>/dev/null
$ip6t -t filter -X WEBURL_RULES 2>/dev/null
$ip6t -t filter -F WEBURL_REJECT 2>/dev/null
$ip6t -t filter -X WEBURL_REJECT 2>/dev/null
}
@@ -1,19 +1,19 @@
#!/bin/sh
[ ! -f "/usr/share/ucitrack/luci-app-weburl.json" ] && {
cat > /usr/share/ucitrack/luci-app-weburl.json << EEOF
[ ! -f "/usr/share/ucitrack/luci-app-luci_app_control_weburl.json" ] && {
cat > /usr/share/ucitrack/luci-app-luci_app_control_weburl.json << EEOF
{
"config": "weburl",
"init": "weburl"
"config": "luci_app_control_weburl",
"init": "luci_app_control_weburl"
}
EEOF
}
uci -q batch <<-EOF >/dev/null
delete ucitrack.@weburl[-1]
add ucitrack weburl
set ucitrack.@weburl[-1].init=weburl
delete ucitrack.@luci_app_control_weburl[-1]
add ucitrack luci_app_control_weburl
set ucitrack.@luci_app_control_weburl[-1].init=luci-app-control-weburl
commit ucitrack
EOF
rm -f /tmp/luci-indexcache
rm -rf /tmp/luci-*cache
exit 0
@@ -2,10 +2,10 @@
"luci-app-control-weburl": {
"description": "Grant UCI access for luci-app-control-weburl",
"read": {
"uci": [ "weburl" ]
"uci": [ "luci-app-control-weburl" ]
},
"write": {
"uci": [ "weburl" ]
"uci": [ "luci-app-control-weburl" ]
}
}
}
@@ -1,4 +1,4 @@
{
"config": "weburl",
"init": "weburl"
"config": "luci-app-control-weburl",
"init": "luci-app-control-weburl"
}
+2 -2
View File
@@ -6,8 +6,8 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for Fileassistant
LUCI_PKGARCH:=all
PKG_VERSION:=1.0-5
PKG_RELEASE:=2
PKG_VERSION:=1.0
PKG_RELEASE:=3
include $(TOPDIR)/feeds/luci/luci.mk
+1 -1
View File
@@ -9,7 +9,7 @@ LUCI_TITLE:=LuCI support for KodExplorer
LUCI_DEPENDS:=+nginx-ssl +unzip +zoneinfo-asia +php8 +php8-fastcgi +php8-fpm +php8-mod-curl +php8-mod-dom +php8-mod-gd +php8-mod-iconv +php8-mod-mbstring +php8-mod-opcache +php8-mod-session +php8-mod-zip +php8-mod-sqlite3 +php8-mod-pdo +php8-mod-pdo-sqlite +php8-mod-pdo-mysql +php8-mod-xml +php8-mod-xmlreader +php8-mod-xmlwriter
LUCI_PKGARCH:=all
PKG_VERSION:=20220109
PKG_RELEASE:=1
PKG_RELEASE:=2
include $(TOPDIR)/feeds/luci/luci.mk
+1 -1
View File
@@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-openvpn-client
PKG_VERSION:=20250227
PKG_RELEASE:=1
PKG_RELEASE:=2
LUCI_TITLE:=LuCI support for OpenVPN Client
LUCI_DEPENDS:=+openvpn-openssl +kmod-tun
@@ -0,0 +1,4 @@
{
"config": "luci-app-openvpn-client",
"init": "luci-app-openvpn-client"
}
+2 -3
View File
@@ -8,9 +8,8 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for SSR Mudb Server
LUCI_DEPENDS:=+libsodium +luci-lib-jsonc +python3
LUCI_PKGARCH:=all
PKG_VERSION:=11
PKG_RELEASE:=1
PKG_DATE:=20211211
PKG_VERSION:=20211211
PKG_RELEASE:=2
include $(TOPDIR)/feeds/luci/luci.mk
@@ -0,0 +1,4 @@
{
"config": "ssr_mudb_server",
"init": "ssr_mudb_server"
}
+2 -2
View File
@@ -10,12 +10,12 @@ include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=natflow
PKG_VERSION:=20260313
PKG_RELEASE:=4
PKG_RELEASE:=5
PKG_SOURCE:=$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/ptpt52/natflow.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_VERSION:=dec114c967aaa181af8c7290ac5e97c8258d56fd
PKG_SOURCE_VERSION:=0659b45f42a8bc80bc9bf17537aa6ef379a92faf
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_MAINTAINER:=Chen Minqiang <ptpt52@gmail.com>
PKG_LICENSE:=GPL-2.0
+46
View File
@@ -0,0 +1,46 @@
# SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2009-2013 OpenWrt.org
#
include $(TOPDIR)/rules.mk
PKG_NAME:=BaiduPCS-Go
PKG_VERSION:=3.9.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/qjfoidnh/BaiduPCS-Go/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=de71666e961a3eeb90f8aca7b11934c3f0296d1870e036a7c086ba1decfca8ab
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
GO_PKG:=github.com/qjfoidnh/BaiduPCS-Go
GO_PKG_LDFLAGS_X:=main.Version=v$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
define Package/BaiduPCS-Go
SECTION:=net
CATEGORY:=Network
SUBMENU:=Download Manager
TITLE:=Terminal utility for Baidu Network Disk
URL:=https://github.com/qjfoidnh/BaiduPCS-Go
DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle
endef
define Package/BaiduPCS-Go/install
$(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
$(INSTALL_DIR) $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/bin/BaiduPCS-Go $(1)/usr/bin/
endef
$(eval $(call GoBinPackage,BaiduPCS-Go))
$(eval $(call BuildPackage,BaiduPCS-Go))
+85
View File
@@ -0,0 +1,85 @@
#
# Copyright (C) 2019 OpenWrt.org
#
# KFERMercer <KFER.Mercer@gmail.com>
#
# This is free software, licensed under the GNU General Public License v3.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=baidupcs-web
PKG_VERSION:=3.7.1
PKG_RELEASE:=2
include $(INCLUDE_DIR)/package.mk
define Package/baidupcs-web
SECTION:=net
CATEGORY:=Network
TITLE:=BaiduPCS-Web is a web controller for BaiduPCS-Go
URL:=https://github.com/Erope/baidupcs-web
endef
define Package/$(PKG_NAME)/description
BaiduPCS-Web is a web controller for BaiduPCS-Go
endef
# 禁止OpenWrt对二进制文件进行strip
STRIP:=true
ifeq ($(ARCH),i386)
PKG_ARCH_BAIDUPCS-WEB:=386
endif
ifeq ($(ARCH),x86_64)
PKG_ARCH_BAIDUPCS-WEB:=amd64
endif
ifeq ($(ARCH),mipsel)
PKG_ARCH_BAIDUPCS-WEB:=mipsle
endif
ifeq ($(ARCH),mips)
PKG_ARCH_BAIDUPCS-WEB:=mipsle
endif
ifeq ($(ARCH),arm)
ifeq ($(BOARD),bcm53xx)
PKG_ARCH_BAIDUPCS-WEB:=armv5
else ifeq ($(BOARD),kirkwood)
PKG_ARCH_BAIDUPCS-WEB:=armv5
else
PKG_ARCH_BAIDUPCS-WEB:=armv7
endif
endif
ifeq ($(ARCH),aarch64)
PKG_ARCH_BAIDUPCS-WEB:=arm64
endif
PKG_SOURCE:=BaiduPCS-Go-v$(PKG_VERSION)-linux-$(PKG_ARCH_BAIDUPCS-WEB).zip
PKG_SOURCE_URL:=https://github.com/coolsnowwolf/baidupcs-web/raw/master/
UNZIP_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)/$(PKG_NAME)-unzip
PKG_HASH:=skip
define Build/Prepare
mkdir -vp $(UNZIP_DIR)
unzip -od $(UNZIP_DIR) $(DL_DIR)/$(PKG_SOURCE)
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/baidupcs-web/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(UNZIP_DIR)/*/BaiduPCS-Go $(1)/usr/bin/baidupcs-web
chmod 755 $(1)/usr/bin/baidupcs-web
endef
$(eval $(call BuildPackage,baidupcs-web))
+51
View File
@@ -0,0 +1,51 @@
#
# Copyright (C) 2015-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v3.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=k3wifi
PKG_VERSION:=1
PKG_RELEASE:=3
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
TITLE:=k3wifi
DEPENDS:=
URL:=https://github.com/xiangfeidexiaohuo/Phicomm-K3_Wireless-Firmware
endef
define Package/$(PKG_NAME)/description
k3wifi fw
endef
define Build/Prepare
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/lib
$(INSTALL_DIR) $(1)/lib/firmware
$(INSTALL_DIR) $(1)/lib/firmware/brcm
# $(INSTALL_DATA) ./files/lib/firmware/brcm/brcmfmac4366c-pcie.bin_69027 $(1)/lib/firmware/brcm/brcmfmac4366c-pcie.bin
$(INSTALL_DATA) ./files/lib/firmware/brcm/brcmfmac4366c-pcie.bin_ac88.48260 $(1)/lib/firmware/brcm/brcmfmac4366c-pcie.bin
# $(INSTALL_DATA) ./files/lib/firmware/brcm/brcmfmac4366c-pcie.bin_ac88_1 $(1)/lib/firmware/brcm/brcmfmac4366c-pcie.bin
# $(INSTALL_DATA) ./files/lib/firmware/brcm/brcmfmac4366c-pcie.bin_ac88_2 $(1)/lib/firmware/brcm/brcmfmac4366c-pcie.bin
# $(INSTALL_DATA) ./files/lib/firmware/brcm/brcmfmac4366c-pcie.bin_ac88_3 $(1)/lib/firmware/brcm/brcmfmac4366c-pcie.bin
# $(INSTALL_DATA) ./files/lib/firmware/brcm/brcmfmac4366c-pcie.bin_asus-dhd24 $(1)/lib/firmware/brcm/brcmfmac4366c-pcie.bin
# $(INSTALL_DATA) ./files/lib/firmware/brcm/brcmfmac4366c-pcie.bin_ea9500_175339 $(1)/lib/firmware/brcm/brcmfmac4366c-pcie.bin
# $(INSTALL_DATA) ./files/lib/firmware/brcm/brcmfmac4366c-pcie.bin_ea9500_179240 $(1)/lib/firmware/brcm/brcmfmac4366c-pcie.bin
# $(INSTALL_DATA) ./files/lib/firmware/brcm/brcmfmac4366c-pcie.bin_k3 $(1)/lib/firmware/brcm/brcmfmac4366c-pcie.bin
# $(INSTALL_DATA) ./files/lib/firmware/brcm/brcmfmac4366c-pcie.bin_r8500 $(1)/lib/firmware/brcm/brcmfmac4366c-pcie.bin
endef
$(eval $(call BuildPackage,$(PKG_NAME)))
@@ -0,0 +1,34 @@
# brcmfmac4366c
Ps:适用于斐讯K3的LEDE/OpenWrt替换无线驱动(如果当前驱动足够稳定,没必要替换)
| 驱动 | 说明 |
| :----: | :----: |
| brcmfmac4366c-pcie.bin_ac88.48260 | 提取ac88u固件3.0.0.4.386.48260的驱动 |
| brcmfmac4366c-pcie.bin_ac88_3 | 2020-03-12的ac88u固件提取,也是大雕lean源码自带的驱动 |
| brcmfmac4366c-pcie.bin_ac88_2 | 2019-07-23的ac88u固件提取 |
| brcmfmac4366c-pcie.bin_ac88_1 | 2016-09-12的ac88u固件提取 |
| brcmfmac4366c-pcie.bin_r8500 | 2016-06-28的r8500的LEDE固件提取 |
| brcmfmac4366c-pcie.bin_ea9500_175339 | ea9500 v1.1.7.175339固件提取 |
| brcmfmac4366c-pcie.bin_ea9500_179240 | ea9500 v1.1.7.179240固件提取 |
| brcmfmac4366c-pcie.bin_k3 | k3原厂,不支持密码,切记!!! |
| brcmfmac4366c-pcie.bin_asus-dhd24 | ASUS 382.dhd24.ko提取 |
| brcmfmac4366c-pcie.bin_69027 | 匿名,听说很nice! |
怎么替换驱动?
1.WinSCP等软件登录进路由器
2.进到/lib/firmware/brcm/目录
3.将brcmfmac4366c-pcie.bin改成brcmfmac4366c-pcie.bin.bak
4.将你要替换的驱动传到/lib/firmware/brcm/目录
5.然后将替换进去的驱动改名成brcmfmac4366c-pcie.bin
6.重启路由
+76
View File
@@ -0,0 +1,76 @@
#
# Copyright (C) 2015-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v3.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=adbyby
PKG_VERSION:=2.7
PKG_RELEASE:=20200315
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
TITLE:=Powerful adblock module to block ad.
DEPENDS:=@(i386||x86_64||arm||mipsel||mips||aarch64)
URL:=http://www.adbyby.com/
endef
define Package/$(PKG_NAME)/description
Adbyby is a powerful adblock module to block ad,just like adblock.
endef
ifeq ($(ARCH),x86_64)
ADBYBY_DIR:=amd64
endif
ifeq ($(ARCH),mipsel)
ADBYBY_DIR:=mipsle
endif
ifeq ($(ARCH),mips)
ADBYBY_DIR:=mips
endif
ifeq ($(ARCH),i386)
ADBYBY_DIR:=x86
endif
ifeq ($(ARCH),arm)
ADBYBY_DIR:=armv7
ifeq ($(BOARD),bcm53xx)
ADBYBY_DIR:=arm
endif
ifeq ($(BOARD),kirkwood)
ADBYBY_DIR:=arm
endif
endif
ifeq ($(ARCH),aarch64)
ADBYBY_DIR:=armv7
endif
define Build/Prepare
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/share/adbyby
$(INSTALL_BIN) ./files/adbyby.sh $(1)/usr/share/adbyby/
$(INSTALL_CONF) ./files/adhook.ini $(1)/usr/share/adbyby/
$(INSTALL_CONF) ./files/user.action $(1)/usr/share/adbyby/
$(INSTALL_DIR) $(1)/usr/share/adbyby/data
$(INSTALL_DATA) ./files/data/* $(1)/usr/share/adbyby/data/
$(INSTALL_DIR) $(1)/usr/share/adbyby/doc
$(INSTALL_DATA) ./files/doc/* $(1)/usr/share/adbyby/doc/
$(INSTALL_BIN) ./files/$(ADBYBY_DIR)/adbyby $(1)/usr/share/adbyby/adbyby
endef
$(eval $(call BuildPackage,$(PKG_NAME)))
+16
View File
@@ -0,0 +1,16 @@
#!/bin/sh
PROG_PATH=/usr/share/adbyby
err=0
until [ $err -ge 5 ]; do
if [ -n "$(pgrep $PROG_PATH/adbyby)" ]; then
iptables-save | grep ADBYBY >/dev/null || \
/etc/init.d/adbyby add_rule
sleep 10
err=0
else
$PROG_PATH/adbyby --no-daemon &>/dev/null &
sleep 1
err=$((err+1))
fi
done
/etc/init.d/adbyby del_rule
+14
View File
@@ -0,0 +1,14 @@
[cfg]
### 2.1 ###
listen-address=0.0.0.0:8118
buffer-limit=1024
keep-alive-timeout=30
socket-timeout=60
### 2.5 ###
max_client_connections=0
### 2.6 ###
stack_size=200
auto_restart=0
### 2.7 ###
debug=0
ipset=0
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
+25
View File
@@ -0,0 +1,25 @@
! -----¸üÐÂʱ¼ä: 2018-10-08 23:07:52 by:xwhyc-----
.php?ad=
/99rejs/js
/agetsou.js^
/c@*!25.js|$script
/cococ-66/$script
/defaultts.tc.qq.com/*.ts?index=0&start=0&
/defaultts.tc.qq.com/*.ts?index=0&start=0&end=*&ver=4
/gg_js/
/imgs.js?t=
/js/adtop.js|
/js/guanggao_gg.js?d=
/js/sss/ad.js
/static/js/aall.js
/unionjs/$script
/variety.tc.qq.com/*.mp4^*fmt=hd
/variety.tc.qq.com/*.mp4^*fmt=shd
/video.dispatch.tc.qq.com/*.mp4^*sdtfrom=
/view/image/QT_HY.jpg?t=
/view/js/slade.js|$script
/vlive.qqvideo.tc.qq.com/*.mp4^*fmt=hd
/vlive.qqvideo.tc.qq.com/*.mp4^*fmt=shd
/vmind.qqvideo.tc.qq.com/*.mp4^*sdtfrom=
/vmindhls.tc.qq.com/*ugc=0&ga=0&gv=0&start=
/zzhzgg.js
+15
View File
@@ -0,0 +1,15 @@
! ------------------------------ ADByby 自定义过滤语法简表---------------------------------
! -------------- 规则基于abp规则,并进行了字符替换部分的扩展-----------------------------
! ABP规则请参考https://adblockplus.org/zh_CN/filters,下面为大致摘要
! "!" 为行注释符,注释行以该符号起始作为一行注释语义,用于规则描述
! "*" 为字符通配符,能够匹配0长度或任意长度的字符串,该通配符不能与正则语法混用。
! "^" 为分隔符,可以是除了字母、数字或者 _ - . % 之外的任何字符。
! "|" 为管线符号,来表示地址的最前端或最末端
! "||" 为子域通配符,方便匹配主域名下的所有子域。
! "~" 为排除标识符,通配符能过滤大多数广告,但同时存在误杀, 可以通过排除标识符修正误杀链接。
! "##" 为元素选择器标识符,后面跟需要隐藏元素的CSS样式例如 #ad_id .ad_class
!! 元素隐藏暂不支持全局规则和排除规则
!! 字符替换扩展
! 文本替换选择器标识符,后面跟需要替换的文本数据,格式:$s@模式字符串@替换后的文本@
! 支持通配符*和?
! -------------------------------------------------------------------------------------------
Whitespace-only changes.
+30
View File
@@ -0,0 +1,30 @@
! -----更新时间: 2018-10-08 23:06:11 by:xwhyc-----------------------------------------------
! -----广告反馈:http://www.adbyby.com/help.htm QQ群: 79547134(满), 364066294(满),470705224(满),534897434,438394572--------------
!-------------------------------------------
/showadv/
3199.cn###ad640,[id^="ad0"]
76fengyun.com###down_box{display:block!important;}.gggg,.ggao
9553.com##[class="zm"]
962.net##.show_ad,.g-962-ad
amazon.cn##.adv-float-div
downsx.rocks##.adbox,.Left-ad3_fixed,.google-ad2_fixed
edu-acc.cn###doyoo_monitor
fx678.com##[class^="adv-"]
||76fengyun.com/body22233.js
||76fengyun.com/file/$s@onclick="window.open('*');startWait();"@onclick="window.open(document.getElementById('downpage_link').href);startWait();"@
||atanx.alicdn.com/t/tanxssp.js?_v=
||biquguan.com/guan/$script
||djv99sxoqpv11.cloudfront.net
||jmxlaser.com
||jump2.bdimg.com/p/$s@<div class="l_post l_post_bright j_l_post clearfix ?????????? "@<div style="display:none"@
||nxkycx.com
||res.jklan.cn/wp-content/themes/tt/js/system.js?ver=$s@function goto()@function xxx()@
||tieba.com/p/$s@<div class="l_post l_post_bright j_l_post clearfix ?????????? "@<div style="display:none"@
||ychap.com
!-----------------------
/qkostn.js|
|http://mark.l.qq.com/fcgi-bin/get_video_mark_all*&strAdParam=
!---------adbyby---------
+1
View File
@@ -0,0 +1 @@
(function(global){var DOC=global.document,w3c_css=global.getComputedStyle,undef=void 0,reg_combinator=/^\s*([>+~,\s])\s*(\*|(?:[-\w*]|[^\x00-\xa0]|\\.)*)/,trimLeft=/^\s+/,trimRight=/\s+$/,reg_comma=/^\s*,\s*/,reg_sequence=/^([#\.:]|\[\s*)((?:[-\w]|[^\x00-\xa0]|\\.)+)/,reg_pseudo=/^\(\s*("([^"]*)"|'([^']*)'|[^\(\)]*(\([^\(\)]*\))?)\s*\)/,reg_attrib=/^\s*(?:(\S?=)\s*(?:(['"])(.*?)\2|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,reg_attrval=/\\([0-9a-fA-F]{2,2})/g,reg_sensitive=/^(?:title|id|name|class|for|href|src)$/,reg_backslash=/\\/g,reg_tag=/^((?:[-\w\*]|[^\x00-\xa0]|\\.)+)/,reg_parse_pseudo=/(-?)(\d*)n([-+]?\d*)/,reg_quick=/^(^|[#.])((?:[-\w]|[^\x00-\xa0]|\\.)+)$/,has_in=function(a,b){return(a in b)},dom={html:DOC.documentElement,mix:function(target,source){var args=[].slice.call(arguments),key,ride=typeof args[args.length-1]=="boolean"?args.pop():true;target=target||{};for(var i=1;source=args[i++];){for(key in source){if(ride||!has_in(key,target)){target[key]=source[key]}}}return target},rword:/[^, ]+/g,uuid:1,getUid:w3c_css?function(node){return node.uniqueNumber||(node.uniqueNumber=dom.uuid++)}:function(node){var uid=node.getAttribute("uniqueNumber");if(!uid){uid=dom.uuid++;node.setAttribute("uniqueNumber",uid)}return uid},oneObject:function(array,val){if(typeof array=="string"){array=array.match(dom.rword)||[]}var result={},value=val!==undef?val:1;for(var i=0,n=array.length;i<n;i++){result[array[i]]=value}return result}},hash_operator={"=":1,"!=":2,"|=":3,"~=":4,"^=":5,"$=":6,"*=":7},slice=Array.prototype.slice,attrURL=dom.oneObject("action,cite,codebase,data,href,longdesc,lowsrc,src,usemap",2),bools=dom["@bools"]="autofocus,autoplay,async,checked,controls,declare,disabled,defer,defaultchecked,contenteditable,ismap,loop,multiple,noshade,open,noresize,readonly,selected",boolOne=dom.oneObject(bools),fixGetAttribute,fixHasAttribute,fixById,fixByTag,filterPseudoHasExp=function(strchild,strsibling,type){return{exec:function(flags,lastResult,args){var result=[],flag_not=flags.not,child=strchild,sibling=strsibling,ofType=type,cache={},lock={},a=args.a,b=args.b,i=0,ri=0,el,found,diff,count;if(!ofType&&a===1&&b===0){return flag_not?[]:lastResult}for(var checkName=ofType?"nodeName":"nodeType",parent,pid,checkValue;el=lastResult[i++];){parent=el.parentNode;pid=dom.getUid(parent);if(!lock[pid]){count=lock[pid]=1;checkValue=ofType?el.nodeName:1;for(var node=parent[child];node;node=node[sibling]){if(node[checkName]===checkValue){pid=dom.getUid(node);cache[pid]=count++}}}diff=cache[dom.getUid(el)]-b;found=a===0?diff===0:(diff%a===0&&diff/a>=0);(found^flag_not)&&(result[ri++]=el)}return result}}},onePosition=dom.oneObject("eq,gt,lt,first,last,even,odd"),siblingCheck=function(a,b,ret){if(a===b){return ret}var cur=a.nextSibling;while(cur){if(cur===b){return -1}cur=cur.nextSibling}return 1},sortOrder1=function(a,b){if(a===b){sortOrder1.hasDuplicate=true;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition){return a.compareDocumentPosition?-1:1}return a.compareDocumentPosition(b)&4?-1:1},sortOrder2=function(a,b){if(a===b){sortOrder2.hasDuplicate=true;return 0}var al,bl,ap=[],bp=[],aup=a.parentNode,bup=b.parentNode,cur=aup;if(aup===bup){return siblingCheck(a,b)}else{if(!aup){return -1}else{if(!bup){return 1}}}while(cur){ap.unshift(cur);cur=cur.parentNode}cur=bup;while(cur){bp.unshift(cur);cur=cur.parentNode}al=ap.length;bl=bp.length;for(var i=0;i<al&&i<bl;i++){if(ap[i]!==bp[i]){return siblingCheck(ap[i],bp[i])}}return i===al?siblingCheck(a,bp[i],-1):siblingCheck(ap[i],b,1)},_toHex=function(x,y){return String.fromCharCode(parseInt(y,16))},parse_pseudo=function(key,match){var expr=match[3]||match[2];expr=expr?expr.replace(reg_attrval,_toHex):match[1];if(!key.indexOf("nth")){expr=expr.replace(/^\+|\s*/g,"");match=(expr==="even"&&"2n"||expr==="odd"&&"2n+1"||!/\D/.test(expr)&&"0n+"+expr||expr).match(reg_parse_pseudo);return{a:(match[1]+(match[2]||1))-0,b:match[3]-0}}return expr},makeArray=function(nodes,result,flag_multi){nodes=slice.call(nodes,0);if(result){result.push.apply(result,nodes)}else{result=nodes}return flag_multi?dom.unique(result):result},getElementsByTagName=function(tagName,els,flag_xml){var method="getElementsByTagName",elems=[],uniqResult={},prefix;if(flag_xml&&tagName.indexOf(":")>0&&els.length&&els[0].lookupNamespaceURI){var arr=tagName.split(":");prefix=arr[0];tagName=arr[1];method="getElementsByTagNameNS";prefix=els[0].lookupNamespaceURI(prefix)}switch(els.length){case 0:return elems;case 1:var all=prefix?els[0][method](prefix,tagName):els[0][method](tagName);for(var i=0,ri=0,el;el=all[i++];){if(el.nodeType===1){elems[ri++]=el}}return elems;default:for(var nodes,i=0,ri=0;el=els[i++];){nodes=prefix?el[method](prefix,tagName):el[method](tagName);for(var uid,j=0,node;node=nodes[j++];){uid=dom.getUid(node);if(!uniqResult[uid]){uniqResult[uid]=elems[ri++]=node}}}return elems}},getElementsByXPath=function(xpath,context,doc){var result=[];try{if(global.DOMParser){var nodes=doc.evaluate(xpath,context,Line truncated
Binary file not shown.
Binary file not shown.
+10
View File
@@ -0,0 +1,10 @@
;¸üйæÔòurl,dir,size,reverse,reverse
http://update.adbyby.com/rule3/lazy.jpg \data\lazy.txt 385337 4 0
http://update.adbyby.com/rule3/video.jpg \data\video.txt 1028 4 0
http://update.adbyby.com/rule3/user.action \user.action 512 5 0
http://update.adbyby.com/rule3/clean.ini \data\clean.ini 2167 0 0
http://update.adbyby.com/rule3/adclear.ini \data\adclear.ini 4901 0 0
https://github.com/gchangchen/suho/raw/master/adhook.dll \adhook.dll 117248 0 0 2.4.3.2
https://github.com/gchangchen/suho/raw/master/adhook64.dll \adhook64.dll 142848 0 0 2.4.3.2
https://github.com/gchangchen/suho/raw/master/adbyby.exe \adbyby.exe 1004183 1 0 2.4.4.0
View File
Whitespace-only changes.
BIN
View File
Binary file not shown.
+57
View File
@@ -0,0 +1,57 @@
#
# Copyright (C) 2010-2023 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=autocore
PKG_RELEASE:=$(COMMITCOUNT)
include $(INCLUDE_DIR)/package.mk
define Package/autocore-arm
TITLE:=Arm auto core loadbalance script.
MAINTAINER:=CN_SZTL
DEPENDS:=@(arm||aarch64) \
+TARGET_bcm27xx:bcm27xx-userland \
+TARGET_bcm53xx:nvram +ethtool
VARIANT:=arm
endef
define Package/autocore-x86
TITLE:=x86/x64 auto core loadbalance script.
MAINTAINER:=Lean
DEPENDS:=@TARGET_x86 +bc +lm-sensors +ethtool +pciutils
VARIANT:=x86
endef
define Package/autocore-arm/description
A luci autoconfig hotplug script.
endef
define Package/autocore-x86/description
A usb autoconfig hotplug script.
endef
define Build/Compile
endef
define Package/autocore-arm/install
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) ./files/arm/sbin/cpuinfo $(1)/sbin/cpuinfo
$(INSTALL_BIN) ./files/arm/sbin/ethinfo $(1)/sbin/ethinfo
$(INSTALL_BIN) ./files/arm/sbin/usage $(1)/sbin/usage
endef
define Package/autocore-x86/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/x86/autocore $(1)/etc/init.d/autocore
$(INSTALL_DIR) $(1)/sbin
$(CP) ./files/x86/sbin/* $(1)/sbin
endef
$(eval $(call BuildPackage,autocore-arm))
$(eval $(call BuildPackage,autocore-x86))
+39
View File
@@ -0,0 +1,39 @@
#!/bin/sh
cpu_arch="$(cat "/proc/cpuinfo" | grep "model name" | sed -n "1p" | awk -F ': ' '{print $2}')"
[ -z "${cpu_arch}" ] && cpu_arch="ARMv8 Processor"
cpu_cores="$(cat "/proc/cpuinfo" | grep "processor" | wc -l)"
if grep -q "bcm27xx" "/etc/openwrt_release"; then
cpu_freq="$(expr $(vcgencmd measure_clock arm | awk -F '=' '{print $2}') / 1000000)Mhz"
elif grep -q "bcm53xx" "/etc/openwrt_release"; then
cpu_freq="$(nvram get clkfreq | awk -F ',' '{print $1}')MHz"
elif grep -q "mvebu" "/etc/openwrt_release"; then
cpu_freq="$(cat "/proc/cpuinfo" | grep "BogoMIPS" | sed -n "1p" | awk -F ': ' '{print $2}')MHz"
elif ! grep -q "filogic" "/etc/openwrt_release"; then
cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpufreq/policy0/cpuinfo_cur_freq) / 1000)MHz"
if grep -q "rockchip" "/etc/openwrt_release"; then
big_cpu_freq="$(expr $(cat /sys/devices/system/cpu/cpufreq/policy4/cpuinfo_cur_freq 2>"/dev/null") / 1000 2>"/dev/null")"
[ -n "${big_cpu_freq}" ] && big_cpu_freq="${big_cpu_freq}MHz "
fi
fi
if grep -q "ipq" "/etc/openwrt_release"; then
if grep -q "ipq40xx" "/etc/openwrt_release"; then
sys_temp="$(awk '{ printf("%.1f°C ", $0 / 1000) }' /sys/class/ieee80211/phy*/device/hwmon/hwmon*/temp1_input)"
else
sys_temp="$(awk '{ printf("%.1f°C ", $0 / 1000) }' /sys/class/thermal/thermal_zone0/temp)"
fi
echo -n "${cpu_arch} x ${cpu_cores} (${cpu_freq}, ${sys_temp})"
else
if grep -q "bcm27xx" "/etc/openwrt_release"; then
cpu_temp="$(vcgencmd measure_temp | awk -F '=' '{print $2}' | awk -F "'" '{print $1}')°C"
else
cpu_temp="$(awk "BEGIN{printf (\"%.1f\n\",$(cat /sys/class/thermal/thermal_zone0/temp)/1000) }")°C"
fi
if grep -q "filogic" "/etc/openwrt_release"; then
echo -n "${cpu_arch} x ${cpu_cores} (${cpu_temp})"
else
echo -n "${cpu_arch} x ${cpu_cores} (${big_cpu_freq}${cpu_freq}, ${cpu_temp})"
fi
fi
+52
View File
@@ -0,0 +1,52 @@
#!/usr/bin/lua
-- Copyright (C) 2022 ImmortalWrt.org
local util = require "luci.util"
local jsonc = require "luci.jsonc"
local eth_info = {}
local ifname, stat
for ifname, stat in pairs(util.ubus("network.device", "status")) do
while true do
if (ifname:match("^(br-.+)$")) == ifname then
break
else
if stat["devtype"] ~= "ethernet" then
break
end
if not stat["link-supported"] or #stat["link-supported"] == 0 then
break
end
local status = 0
local speed = " - "
local duplex = 0
if(stat.speed ~= nil) then
status = stat.carrier and 1 or 0
if stat.speed:sub(1, 1) == "-" then
speed = " - "
else
speed = stat.speed:sub(1, -2) .. "Mb/s"
end
if stat.carrier and stat.speed:sub(-1) == "F" then
duplex = 1
else
duplex = 0
end
end
eth_info[#eth_info+1] = { name = ifname, status = status,
speed = speed, duplex = duplex }
break
end
end
end
table.sort(eth_info,
function(a, b)
return a.name < b.name
end)
print(jsonc.stringify(eth_info))
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh
NSS_PATH="/sys/kernel/debug/qca-nss-drv/stats"
cpu_usage="$(top -n1 | awk '/^CPU/ {printf("%d%", 100 - $8)}')"
[ ! -d "$NSS_PATH" ] || \
npu_usage="$(grep '%' "$NSS_PATH"/cpu_load_ubi | awk -F ' ' '{print $2}')"
if [ -d "$NSS_PATH" ]; then
echo -n "CPU: ${cpu_usage}, NPU: ${npu_usage}"
else
echo -n "CPU: ${cpu_usage}"
fi
+74
View File
@@ -0,0 +1,74 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2017 lean <coolsnowwolf@gmail.com>
START=99
start()
{
rfc=4096
cc=$(grep -c processor /proc/cpuinfo)
rsfe=$(echo $cc*$rfc | bc)
sysctl -w net.core.rps_sock_flow_entries=$rsfe >/dev/null
for fileRps in $(ls /sys/class/net/eth*/queues/rx-*/rps_cpus)
do
echo $cc > $fileRps
done
for fileRfc in $(ls /sys/class/net/eth*/queues/rx-*/rps_flow_cnt)
do
echo $rfc > $fileRfc
done
uci set network.@globals[0].packet_steering=1
uci commit network
a=$(cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq)
b=$(echo -n ' : ')
c=$(cat /proc/cpuinfo | grep 'core id' | sort -u | wc -l)
d=$(echo -n 'C')
e=$(cat /proc/cpuinfo | grep 'processor' | wc -l)
f=$(echo -n 'T ')
g=$(dmesg | grep 'DMI:' | awk -F ',' '{print $1 }' | awk -F ':' '{print $2 }')
if [ -d /sys/devices/cpu_atom/ ]; then
pcore=$(cat /sys/devices/cpu_core/cpus | awk -F- '{print $2}')
pc=$(echo "($pcore+1)/2" | bc)
ecore1=$(cat /sys/devices/cpu_atom/cpus | awk -F- '{print $1}')
ecore2=$(cat /sys/devices/cpu_atom/cpus | awk -F- '{print $2}')
ec=$(echo "$ecore2-$ecore1+1" | bc)
hydrid='('${pc}'P+'${ec}'E)'
fi
h=${g}' - '${a}${b}${c}${d}${e}${f}${hydrid}
mkdir -p /tmp/sysinfo
echo $h > /tmp/sysinfo/model
all_pcis=`lspci | grep -i 'eth' | grep -i 'x550' | cut -d ' ' -f 1`
all_ifs=`cat /proc/net/dev | grep -i 'eth' | cut -d : -f 1 | sed 's/^[ \t]*//g'`
for ifname in ${all_ifs}
do
if_pci=`ethtool -i ${ifname} | grep -i 'bus-info' | cut -d : -f 3-`
if [[ "$all_pcis" =~ "$if_pci" ]]
then
ethtool -s ${ifname} advertise 0x1800000001028
fi
done
a=$(ip address | grep ^[0-9] | awk -F: '{print $2}' | sed "s/ //g" | grep '^[e]' | grep -v "@" | grep -v "\.")
b=$(echo "$a" | wc -l)
for i in $(seq 1 $b)
do
c=$(echo "$a" | sed -n ${i}p)
ethtool -K $c rx-checksum on >/dev/null 2>&1
ethtool -K $c tx-checksum-ip-generic on >/dev/null 2>&1 || (
ethtool -K $c tx-checksum-ipv4 on >/dev/null 2>&1
ethtool -K $c tx-checksum-ipv6 on >/dev/null 2>&1)
ethtool -K $c tx-scatter-gather on >/dev/null 2>&1
ethtool -K $c gso on >/dev/null 2>&1
ethtool -K $c tso on >/dev/null 2>&1
ethtool -K $c ufo on >/dev/null 2>&1
done
}
+11
View File
@@ -0,0 +1,11 @@
#!/bin/sh
MHz=`grep 'MHz' /proc/cpuinfo | cut -c11- |sed -n '1p'`
if [ "$(grep 'AMD' /proc/cpuinfo)" != "" ]; then
TEMP=`sensors 2>/dev/null | grep 'Tctl' | cut -c16-`
else
TEMP=`sensors 2>/dev/null | grep 'Core 0' | cut -c12-`
fi
echo "$MHz MHz $TEMP "
+39
View File
@@ -0,0 +1,39 @@
#!/bin/sh
a=$(ip address | grep ^[0-9] | awk -F: '{print $2}' | sed "s/ //g" | grep '^[e]' | grep -v "@" | grep -v "\.")
b=$(echo "$a" | wc -l)
rm -f /tmp/state/ethinfo
echo -n "[" > /tmp/state/ethinfo
for i in $(seq 1 $b)
do
h=$(echo '{"name":' )
c=$(echo "$a" | sed -n ${i}p)
d=$(ethtool $c)
e=$(echo "$d" | grep "Link detected" | awk -F: '{printf $2}' | sed 's/^[ \t]*//g')
if [ $e = yes ]; then
l=1
else
l=0
fi
f=$(echo "$d" | grep "Speed" | awk -F: '{printf $2}' | sed 's/^[ \t]*//g' | tr -d "Unknown!")
[ -z "$f" ] && f=" - "
g=$(echo "$d" | grep "Duplex" | awk -F: '{printf $2}' | sed 's/^[ \t]*//g')
if [ "$g" == "Full" ]; then
x=1
else
x=0
fi
echo -n "$h \"$c\", \"status\": $l, \"speed\": \"$f\", \"duplex\": $x}," >> /tmp/state/ethinfo
done
sed -i 's/.$//' /tmp/state/ethinfo
echo -n "]" >> /tmp/state/ethinfo
cat /tmp/state/ethinfo
+8
View File
@@ -0,0 +1,8 @@
#!/bin/sh
if [ $(busybox ps -w | grep getcpu | grep -v grep | wc -l) -le 2 ]; then
AT=$(cat /proc/stat | grep "^cpu " | awk '{print $2+$3+$4+$5+$6+$7+$8 " " $2+$3+$4+$7+$8}')
sleep 1
BT=$(cat /proc/stat | grep "^cpu " | awk '{print $2+$3+$4+$5+$6+$7+$8 " " $2+$3+$4+$7+$8}')
printf "%.01f%%" $(echo $AT $BT | awk '{print (($4-$2)/($3-$1))*100}') >/tmp/cpuusage
fi
+75
View File
@@ -0,0 +1,75 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ddns-scripts_aliyun
PKG_VERSION:=1.0.3
PKG_RELEASE:=2
PKG_LICENSE:=GPLv2
PKG_MAINTAINER:=Sense <sensec@gmail.com>
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
SUBMENU:=IP Addresses and Names
TITLE:=DDNS extension for AliYun.com
PKGARCH:=all
DEPENDS:=+ddns-scripts +wget-ssl +openssl-util
endef
define Package/$(PKG_NAME)/description
Dynamic DNS Client scripts extension for AliYun.com
endef
define Build/Configure
endef
define Build/Compile
$(CP) ./*.sh $(PKG_BUILD_DIR)
$(CP) ./*.json $(PKG_BUILD_DIR)
endef
define Package/$(PKG_NAME)/preinst
#!/bin/sh
# if NOT run buildroot then stop service
[ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1
exit 0 # suppress errors
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/lib/ddns
$(INSTALL_BIN) $(PKG_BUILD_DIR)/update_aliyun_com.sh $(1)/usr/lib/ddns
$(INSTALL_DIR) $(1)/usr/share/ddns/default
$(INSTALL_DATA) $(PKG_BUILD_DIR)/aliyun.com.json $(1)/usr/share/ddns/default
endef
define Package/$(PKG_NAME)/postinst
#!/bin/sh
# remove old services file entries
/bin/sed -i '/aliyun\.com/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1
/bin/sed -i '/aliyun\.com/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1
# and create new
printf "%s\\t\\t%s\\n" '"aliyun.com"' '"update_aliyun_com.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services
printf "%s\\t\\t%s\\n" '"aliyun.com"' '"update_aliyun_com.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6
# on real system restart service if enabled
[ -z "$${IPKG_INSTROOT}" ] && {
/etc/init.d/ddns enabled && \
/etc/init.d/ddns start >/dev/null 2>&1
}
exit 0 # suppress errors
endef
define Package/$(PKG_NAME)/prerm
#!/bin/sh
# if NOT run buildroot then stop service
[ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1
# remove services file entries
/bin/sed -i '/aliyun\.com/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1
/bin/sed -i '/aliyun\.com/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1
exit 0 # suppress errors
endef
$(eval $(call BuildPackage,$(PKG_NAME)))
@@ -0,0 +1,9 @@
{
"name": "aliyun.com",
"ipv4": {
"url": "update_aliyun_com.sh"
},
"ipv6": {
"url": "update_aliyun_com.sh"
}
}
@@ -0,0 +1,248 @@
#!/bin/sh
#
# 用于阿里云解析的DNS更新脚本
# 2017-2018 Sense <sensec at gmail dot com>
# 阿里云解析API文档 https://help.aliyun.com/document_detail/29739.html
#
# 本脚本由 dynamic_dns_functions.sh 内的函数 send_update() 调用
#
# 需要在 /etc/config/ddns 中设置的选项
# option username - 阿里云API访问账号 Access Key ID。可通过 aliyun.com 帐号管理的 accesskeys 获取, 或者访问 https://ak-console.aliyun.com
# option password - 阿里云API访问密钥 Access Key Secret
# option domain - 完整的域名。建议主机与域名之间使用 @符号 分隔,否则将以第一个 .符号 之前的内容作为主机名
#
# 检查传入参数
[ -z "$username" ] && write_log 14 "配置错误!保存阿里云API访问账号的'用户名'不能为空"
[ -z "$password" ] && write_log 14 "配置错误!保存阿里云API访问密钥的'密码'不能为空"
# 检查外部调用工具
WGET_SSL='wget'
[ -n "$WGET_SSL" ] || write_log 13 "使用阿里云API需要 GNU Wget 支持,请先安装"
command -v sed >/dev/null 2>&1 || write_log 13 "使用阿里云API需要 sed 支持,请先安装"
command -v openssl >/dev/null 2>&1 || write_log 13 "使用阿里云API需要 openssl-util 支持,请先安装"
# 包含用于解析 JSON 格式返回值的函数
. /usr/share/libubox/jshn.sh
# 变量声明
local __HOST __DOMAIN __TYPE __URLBASE __CMDBASE __URLARGS __SEPARATOR __RECID
[ $use_https -eq 0 ] && __URLBASE="http://alidns.aliyuncs.com/" || __URLBASE="https://alidns.aliyuncs.com/"
__SEPARATOR="&"
# 从 $domain 分离主机和域名
[ "${domain:0:2}" == "@." ] && domain="${domain/./}" # 主域名处理
[ "$domain" == "${domain/@/}" ] && domain="${domain/./@}" # 未找到分隔符,兼容常用域名格式
__HOST="${domain%%@*}"
__DOMAIN="${domain#*@}"
[ -z "$__HOST" -o "$__HOST" == "$__DOMAIN" ] && __HOST="@"
# 设置记录类型
[ $use_ipv6 -eq 0 ] && __TYPE="A" || __TYPE="AAAA"
# 构造基本通信命令
build_command() {
__CMDBASE="$WGET_SSL --no-hsts -nv -t 1 -O $DATFILE -o $ERRFILE"
# 绑定用于通信的主机/IP
if [ -n "$bind_network" ]; then
local bind_ip run_prog
[ $use_ipv6 -eq 0 ] && run_prog="network_get_ipaddr" || run_prog="network_get_ipaddr6"
eval "$run_prog bind_ip $bind_network" || \
write_log 13 "无法使用 '$run_prog $bind_network' 获取本地IP地址 - 错误代码: '$?'"
write_log 7 "强制使用IP '$bind_ip' 通信"
__CMDBASE="$__CMDBASE --bind-address=$bind_ip"
fi
# 强制设定IP版本
if [ $force_ipversion -eq 1 ]; then
[ $use_ipv6 -eq 0 ] && __CMDBASE="$__CMDBASE -4" || __CMDBASE="$__CMDBASE -6"
fi
# 设置CA证书参数
if [ $use_https -eq 1 ]; then
if [ "$cacert" = "IGNORE" ]; then
__CMDBASE="$__CMDBASE --no-check-certificate"
elif [ -f "$cacert" ]; then
__CMDBASE="$__CMDBASE --ca-certificate=${cacert}"
elif [ -d "$cacert" ]; then
__CMDBASE="$__CMDBASE --ca-directory=${cacert}"
elif [ -n "$cacert" ]; then
write_log 14 "在 '$cacert' 中未找到用于 HTTPS 通信的有效证书"
fi
fi
# 如果没有设置,禁用代理 (这可能是 .wgetrc 或环境设置错误)
[ -z "$proxy" ] && __CMDBASE="$__CMDBASE --no-proxy"
}
# 用于阿里云API的通信函数
aliyun_transfer() {
local __PARAM=$*
local __CNT=0
local __RUNPROG __ERR PID_SLEEP
[ $# -eq 0 ] && write_log 12 "'aliyun_transfer()' 出错 - 参数数量错误"
while : ; do
build_Request $__PARAM
__RUNPROG="$__CMDBASE '${__URLBASE}?${__URLARGS}'"
write_log 7 "#> $__RUNPROG"
eval $__RUNPROG
__ERR=$?
[ $__ERR -eq 0 ] && return 0
write_log 3 "wget 错误代码: '$__ERR'"
write_log 7 "$(cat $ERRFILE)"
if [ $VERBOSE -gt 1 ]; then
write_log 4 "传输失败 - 详细模式: $VERBOSE - 出错后不再重试"
return 1
fi
__CNT=$(( $__CNT + 1 ))
[ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \
write_log 14 "$retry_count 次重试后传输还是失败"
write_log 4 "传输失败 - $__CNT/$retry_count 在 $RETRY_SECONDS 秒后重试"
sleep $RETRY_SECONDS &
PID_SLEEP=$!
wait $PID_SLEEP
PID_SLEEP=0
done
}
# 百分号编码
percentEncode() {
if [ -z "${1//[A-Za-z0-9_.~-]/}" ]; then
echo -n "$1"
else
local string=$1; local i=0; local ret chr
while [ $i -lt ${#string} ]; do
chr=${string:$i:1}
[ -z "${chr#[^A-Za-z0-9_.~-]}" ] && chr=$(printf '%%%02X' "'$chr")
ret="$ret$chr"
i=$(( $i + 1 ))
done
echo -n "$ret"
fi
}
# 构造阿里云解析请求参数
build_Request() {
local args=$*; local string
local HTTP_METHOD="GET"
# 添加请求参数
__URLARGS=
for string in $args; do
case "${string%%=*}" in
Format|TTL|Version|AccessKeyId|SignatureMethod|Timestamp|SignatureVersion|SignatureNonce|Signature) ;; # 过滤公共参数
*) __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}");;
esac
done
__URLARGS="${__URLARGS:1}"
# 附加公共参数
string="Format=JSON"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
string="TTL=600";__URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
string="Version=2015-01-09"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
string="AccessKeyId=$username"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
string="SignatureMethod=HMAC-SHA1"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
string="Timestamp="$(date -u '+%Y-%m-%dT%H:%M:%SZ'); __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
string="SignatureVersion=1.0"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
string="SignatureNonce="$(cat '/proc/sys/kernel/random/uuid'); __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
# 对请求参数进行排序,用于生成签名
string=$(echo -n "$__URLARGS" | sed 's/\'"${__SEPARATOR}"'/\n/g' | sort | sed ':label; N; s/\n/\'"${__SEPARATOR}"'/g; b label')
# 构造用于计算签名的字符串
string="${HTTP_METHOD}${__SEPARATOR}"$(percentEncode "/")"${__SEPARATOR}"$(percentEncode "$string")
# 字符串计算签名HMAC值
local signature=$(echo -n "$string" | openssl dgst -sha1 -hmac "${password}&" -binary)
# HMAC值编码成字符串,得到签名值
signature=$(echo -n "$signature" | openssl base64)
# 附加签名参数
string="Signature=$signature"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}")
}
# 添加解析记录
add_domain() {
local value
aliyun_transfer "Action=AddDomainRecord" "DomainName=${__DOMAIN}" "RR=${__HOST}" "Type=${__TYPE}" "Value=${__IP}" || write_log 14 "服务器通信失败"
json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1
json_get_var value "RecordId"
[ -z "$value" ] && write_log 14 "添加新解析记录失败"
write_log 7 "添加新解析记录成功"
return 0
}
# 修改解析记录
update_domain() {
local value
aliyun_transfer "Action=UpdateDomainRecord" "RecordId=${__RECID}" "RR=${__HOST}" "Type=${__TYPE}" "Value=${__IP}" || write_log 14 "服务器通信失败"
json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1
json_get_var value "RecordId"
[ -z "$value" ] && write_log 14 "修改解析记录失败"
write_log 7 "修改解析记录成功"
return 0
}
# 启用解析记录
enable_domain() {
local value
aliyun_transfer "Action=SetDomainRecordStatus" "RecordId=${__RECID}" "Status=Enable" || write_log 14 "服务器通信失败"
json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1
json_get_var value "Status"
[ "$value" != "Enable" ] && write_log 14 "启用解析记录失败"
write_log 7 "启用解析记录成功"
return 0
}
# 获取子域名解析记录列表
describe_domain() {
local count value; local ret=0
aliyun_transfer "Action=DescribeSubDomainRecords" "SubDomain=${__HOST}.${__DOMAIN}" || write_log 14 "服务器通信失败"
write_log 7 "获取到解析记录: $(cat "$DATFILE" 2> /dev/null)"
json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1
json_get_var count "TotalCount"
if [ $count -eq 0 ]; then
write_log 7 "解析记录不存在"
ret=1
else
local i=1;
while [ $i -le $count ]; do
json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1
json_select "DomainRecords" >/dev/null 2>&1
json_select "Record" >/dev/null 2>&1
json_select $i >/dev/null 2>&1
i=$(( $i + 1 ))
json_get_var value "Type"
if [ "$value" != "${__TYPE}" ]; then
write_log 7 "当前解析类型: ${__TYPE}, 获得不匹配类型: $value"
ret=1; continue
else
ret=0
json_get_var __RECID "RecordId"
write_log 7 "获得解析记录ID: ${__RECID}, 类型: $value"
json_get_var value "Locked"
[ $value -ne 0 ] && write_log 14 "解析记录被锁定"
json_get_var value "Status"
[ "$value" != "ENABLE" ] && ret=$(( $ret | 2 )) && write_log 7 "解析记录被禁用"
json_get_var value "Value"
[ "$value" != "${__IP}" ] && ret=$(( $ret | 4 )) && write_log 7 "地址需要修改"
break
fi
done
fi
return $ret
}
build_command
describe_domain
ret=$?
if [ $ret -eq 1 ]; then
sleep 3 && add_domain
else
[ $(( $ret & 2 )) -ne 0 ] && sleep 3 && enable_domain
[ $(( $ret & 4 )) -ne 0 ] && sleep 3 && update_domain
fi
return 0
+81
View File
@@ -0,0 +1,81 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ddns-scripts_dnspod
PKG_VERSION:=1.0.2
PKG_RELEASE:=1
PKG_LICENSE:=GPLv2
PKG_MAINTAINER:=Small_5
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
SUBMENU:=IP Addresses and Names
TITLE:=DDNS extension for Dnspod.com/Dnspod.cn
PKGARCH:=all
DEPENDS:=+ddns-scripts +wget-ssl +ca-bundle
endef
define Package/$(PKG_NAME)/description
Dynamic DNS Client scripts extension for Dnspod.com/Dnspod.cn
endef
define Build/Configure
endef
define Build/Compile
$(CP) ./*.sh $(PKG_BUILD_DIR)
$(CP) ./*.json $(PKG_BUILD_DIR)
endef
define Package/$(PKG_NAME)/preinst
#!/bin/sh
# if NOT run buildroot then stop service
[ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1
exit 0 # suppress errors
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/lib/ddns
$(INSTALL_BIN) $(PKG_BUILD_DIR)/*.sh $(1)/usr/lib/ddns
$(INSTALL_DIR) $(1)/usr/share/ddns/default
$(INSTALL_DATA) $(PKG_BUILD_DIR)/*.json $(1)/usr/share/ddns/default
endef
define Package/$(PKG_NAME)/postinst
#!/bin/sh
# remove old services file entries
/bin/sed -i '/dnspod\.com/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1
/bin/sed -i '/dnspod\.cn/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1
/bin/sed -i '/dnspod\.com/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1
/bin/sed -i '/dnspod\.cn/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1
# and create new
printf "%s\\t\\t%s\\n" '"dnspod.com"' '"update_dnspod_com.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services
printf "%s\\t\\t%s\\n" '"dnspod.cn"' '"update_dnspod_cn.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services
printf "%s\\t\\t%s\\n" '"dnspod.com"' '"update_dnspod_com.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6
printf "%s\\t\\t%s\\n" '"dnspod.cn"' '"update_dnspod_cn.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6
# on real system restart service if enabled
[ -z "$${IPKG_INSTROOT}" ] && {
/etc/init.d/ddns enabled && \
/etc/init.d/ddns start >/dev/null 2>&1
}
exit 0 # suppress errors
endef
define Package/$(PKG_NAME)/prerm
#!/bin/sh
# if NOT run buildroot then stop service
[ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1
# remove services file entries
/bin/sed -i '/dnspod\.com/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1
/bin/sed -i '/dnspod\.cn/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1
/bin/sed -i '/dnspod\.com/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1
/bin/sed -i '/dnspod\.cn/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1
exit 0 # suppress errors
endef
$(eval $(call BuildPackage,$(PKG_NAME)))
@@ -0,0 +1,9 @@
{
"name": "dnspod.cn",
"ipv4": {
"url": "update_dnspod_cn.sh"
},
"ipv6": {
"url": "update_dnspod_cn.sh"
}
}
@@ -0,0 +1,9 @@
{
"name": "dnspod.com",
"ipv4": {
"url": "update_dnspod_com.sh"
},
"ipv6": {
"url": "update_dnspod_com.sh"
}
}
@@ -0,0 +1,155 @@
#!/bin/sh
#检查传入参数
[ -z "$username" ] && write_log 14 "Configuration error! [User name] cannot be empty"
[ -z "$password" ] && write_log 14 "Configuration error! [Password] cannot be empty"
#检查外部调用工具
WGET_SSL='wget'
[ -n "$WGET_SSL" ] || write_log 13 "GNU Wget support is required to use dnspod API. Please install first"
# 变量声明
local __URLBASE __HOST __DOMAIN __TYPE __CMDBASE __POST __POST1 __RECIP __RECID __value __TTL
__URLBASE="https://dnsapi.cn/"
# 从 $domain 分离主机和域名
[ "${domain:0:2}" == "@." ] && domain="${domain/./}" # 主域名处理
[ "$domain" == "${domain/@/}" ] && domain="${domain/./@}" # 未找到分隔符,兼容常用域名格式
__HOST="${domain%%@*}"
__DOMAIN="${domain#*@}"
[ -z "$__HOST" -o "$__HOST" == "$__DOMAIN" ] && __HOST="@"
# 设置记录类型
[ $use_ipv6 -eq 0 ] && __TYPE="A" || __TYPE="AAAA"
# 构造基本通信命令
build_command() {
__CMDBASE="$WGET_SSL --no-hsts -nv -t 1 -O $DATFILE -o $ERRFILE"
# 绑定用于通信的主机/IP
if [ -n "$bind_network" ]; then
local bind_ip run_prog
[ $use_ipv6 -eq 0 ] && run_prog="network_get_ipaddr" || run_prog="network_get_ipaddr6"
eval "$run_prog bind_ip $bind_network" || \
write_log 13 "Unable to get local IP address with '$run_prog $ bind_network' - error code: '$?'"
write_log 7 "Forced use of IP '$bind_ip' communication"
__CMDBASE="$__CMDBASE --bind-address=$bind_ip"
fi
# 强制设定IP版本
if [ $force_ipversion -eq 1 ]; then
[ $use_ipv6 -eq 0 ] && __CMDBASE="$__CMDBASE -4" || __CMDBASE="$__CMDBASE -6"
fi
# 设置CA证书参数
if [ $use_https -eq 1 ]; then
if [ "$cacert" = "IGNORE" ]; then
__CMDBASE="$__CMDBASE --no-check-certificate"
elif [ -f "$cacert" ]; then
__CMDBASE="$__CMDBASE --ca-certificate=${cacert}"
elif [ -d "$cacert" ]; then
__CMDBASE="$__CMDBASE --ca-directory=${cacert}"
elif [ -n "$cacert" ]; then
write_log 14 "A valid certificate for HTTPS communication was not found in '$cacert'"
fi
fi
# 如果没有设置,禁用代理 (这可能是 .wgetrc 或环境设置错误)
[ -z "$proxy" ] && __CMDBASE="$__CMDBASE --no-proxy"
__CMDBASE="$__CMDBASE --post-data"
}
# 用于Dnspod API的通信函数
dnspod_transfer() {
local __A=$1
local __CNT=0
local __ERR=0
local __B PID_SLEEP
case "$__A" in
0)
__B="$__CMDBASE '$__POST' ${__URLBASE}Record.List"
;;
1)
__B="$__CMDBASE '$__POST1' ${__URLBASE}Record.Create"
;;
2)
__B="$__CMDBASE '$__POST1&record_id=$__RECID&ttl=$__TTL' ${__URLBASE}Record.Modify"
;;
esac
while : ; do
write_log 7 "#> $__B"
eval $__B
__ERR=`jsonfilter -i $DATFILE -e "@.status.code"`
[ $__ERR -eq 1 ] && return 0
[ $__A -eq 0 ] && [ $__ERR -eq 10 ] && return 0
write_log 3 "Error message:[$(jsonfilter -i $DATFILE -e "@.status.message")]"
if [ $VERBOSE -gt 1 ]; then
write_log 4 "Transfer failed - detailed mode: $VERBOSE - Do not try again after an error"
return 1
fi
__CNT=$(( $__CNT + 1 ))
[ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && write_log 14 "Transfer failed after $retry_count retries"
write_log 4 "Transfer failed - $__CNT Try again in $RETRY_SECONDS seconds"
sleep $RETRY_SECONDS &
PID_SLEEP=$!
wait $PID_SLEEP
PID_SLEEP=0
done
}
#添加解析记录
add_domain() {
dnspod_transfer 1
write_log 7 "Add new parsing record [${__HOST}.${__DOMAIN}],[type:$__TYPE],[ip:$__IP] successfully!"
return 0
}
#修改解析记录
update_domain() {
dnspod_transfer 2
write_log 7 "Modify new parsing record [${__HOST}.${__DOMAIN}],[type:$__TYPE],[ip:$__IP],[TTL:$__TTL] successfully!"
return 0
}
#获取域名解析记录
describe_domain() {
ret=0
__POST="login_token=$username,$password&format=json&domain=$__DOMAIN&sub_domain=$__HOST&record_type=$__TYPE"
__POST1="$__POST&value=$__IP&record_type=$__TYPE&record_line_id=0"
dnspod_transfer 0
__TMP=`jsonfilter -i $DATFILE -e "@.records[@.type!='NS']"`
__value=`jsonfilter -s "$__TMP" -e "@.name"`
if [ "$__value" == "" ]; then
write_log 7 "Parsing record:[${__HOST}.${__DOMAIN}] does not exist"
ret=1
else
__RECID=`jsonfilter -s "$__TMP" -e "@.id"`
__value=`jsonfilter -s "$__TMP" -e "@.type"`
__TTL=`jsonfilter -s "$__TMP" -e "@.ttl"`
write_log 7 "Get parsing recordID:[$__RECID]"
if [ "$__value" != "$__TYPE" ]; then
write_log 7 "Current parsing [type:$__TYPE], get mismatched [type:$__value]"
write_log 7 "Address needs to be modified, local address:[$__IP]"
ret=2
else
__RECIP=`jsonfilter -s "$__TMP" -e "@.value"`
if [ "$__RECIP" != "$__IP" ]; then
write_log 7 "Address needs to be modified, local address:[$__IP]"
ret=2
fi
fi
fi
}
build_command
describe_domain
if [ $ret == 1 ];then
sleep 3 && add_domain
elif [ $ret == 2 ];then
sleep 3 && update_domain
else
write_log 7 "Local IP:[$__IP] parsing records IP:[$__RECIP] address does not need to be modified"
fi
return 0
@@ -0,0 +1,165 @@
#!/bin/sh
#检查传入参数
[ -z "$username" ] && write_log 14 "Configuration error! [User name] cannot be empty"
[ -z "$password" ] && write_log 14 "Configuration error! [Password] cannot be empty"
#检查外部调用工具
WGET_SSL='wget'
[ -n "$WGET_SSL" ] || write_log 13 "GNU Wget support is required to use Alibaba Cloud API. Please install first"
# 变量声明
local __URLBASE __HOST __DOMAIN __TYPE __CMDBASE __TOKEN __POST __POST1 __RECIP __RECID __value __TTL
__URLBASE="https://api.dnspod.com/"
# 从 $domain 分离主机和域名
[ "${domain:0:2}" == "@." ] && domain="${domain/./}" # 主域名处理
[ "$domain" == "${domain/@/}" ] && domain="${domain/./@}" # 未找到分隔符,兼容常用域名格式
__HOST="${domain%%@*}"
__DOMAIN="${domain#*@}"
[ -z "$__HOST" -o "$__HOST" == "$__DOMAIN" ] && __HOST="@"
# 设置记录类型
[ $use_ipv6 -eq 0 ] && __TYPE="A" || __TYPE="AAAA"
# 构造基本通信命令
build_command() {
__CMDBASE="$WGET_SSL --no-hsts -nv -t 1 -O $DATFILE -o $ERRFILE"
# 绑定用于通信的主机/IP
if [ -n "$bind_network" ]; then
local bind_ip run_prog
[ $use_ipv6 -eq 0 ] && run_prog="network_get_ipaddr" || run_prog="network_get_ipaddr6"
eval "$run_prog bind_ip $bind_network" || \
write_log 13 "Unable to get local IP address with '$run_prog $ bind_network' - error code: '$?'"
write_log 7 "Forced use of IP '$bind_ip' communication"
__CMDBASE="$__CMDBASE --bind-address=$bind_ip"
fi
# 强制设定IP版本
if [ $force_ipversion -eq 1 ]; then
[ $use_ipv6 -eq 0 ] && __CMDBASE="$__CMDBASE -4" || __CMDBASE="$__CMDBASE -6"
fi
# 设置CA证书参数
if [ $use_https -eq 1 ]; then
if [ "$cacert" = "IGNORE" ]; then
__CMDBASE="$__CMDBASE --no-check-certificate"
elif [ -f "$cacert" ]; then
__CMDBASE="$__CMDBASE --ca-certificate=${cacert}"
elif [ -d "$cacert" ]; then
__CMDBASE="$__CMDBASE --ca-directory=${cacert}"
elif [ -n "$cacert" ]; then
write_log 14 "A valid certificate for HTTPS communication was not found in '$cacert'"
fi
fi
# 如果没有设置,禁用代理 (这可能是 .wgetrc 或环境设置错误)
[ -z "$proxy" ] && __CMDBASE="$__CMDBASE --no-proxy"
__CMDBASE="$__CMDBASE --post-data"
}
# 用于Dnspod API的通信函数
dnspod_transfer() {
local __A=$1
local __CNT=0
local __ERR=0
local __B __C PID_SLEEP
case "$__A" in
0)
__B="$__CMDBASE 'login_email=$username&login_password=$password&format=json' ${__URLBASE}Auth"
__C=$__B
;;
1)
__B="$__CMDBASE '$__POST' ${__URLBASE}Record.List"
__C=1
;;
2)
__B="$__CMDBASE '$__POST1' ${__URLBASE}Record.Create"
__C=1
;;
3)
__B="$__CMDBASE '$__POST1&record_id=$__RECID&ttl=$__TTL' ${__URLBASE}Record.Modify"
__C=1
;;
esac
while : ; do
[ $__C -eq 1 ] && __C=$(echo -e "$__B" | sed -e "s/${__TOKEN#*,}/***PW***/g")
write_log 7 "#> $__C"
eval $__B
__ERR=`jsonfilter -i $DATFILE -e "@.status.code"`
[ $__ERR -eq 1 ] && return 0
[ $__A -eq 1 ] && [ $__ERR -eq 10 ] && return 0
write_log 3 "Error message:[$(jsonfilter -i $DATFILE -e "@.status.message")]"
if [ $VERBOSE -gt 1 ]; then
write_log 4 "Transfer failed - detailed mode: $VERBOSE - Do not try again after an error"
return 1
fi
__CNT=$(( $__CNT + 1 ))
[ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && write_log 14 "Transfer failed after $retry_count retries"
write_log 4 "Transfer failed - $__CNT Try again in $RETRY_SECONDS seconds"
sleep $RETRY_SECONDS &
PID_SLEEP=$!
wait $PID_SLEEP
PID_SLEEP=0
done
}
#添加解析记录
add_domain() {
dnspod_transfer 2
write_log 7 "Add new parsing record [${__HOST}.${__DOMAIN}],[type:$__TYPE],[ip:$__IP] successfully!"
return 0
}
#修改解析记录
update_domain() {
dnspod_transfer 3
write_log 7 "Modify new parsing record [${__HOST}.${__DOMAIN}],[type:$__TYPE],[ip:$__IP],[TTL:$__TTL] successfully!"
return 0
}
#获取域名解析记录
describe_domain() {
ret=0
dnspod_transfer 0
__TOKEN=`jsonfilter -i $DATFILE -e "@.user_token"`
__POST="user_token=$__TOKEN&format=json&domain=$__DOMAIN&sub_domain=$__HOST"
__POST1="$__POST&value=$__IP&record_type=$__TYPE&record_line=default"
dnspod_transfer 1
__TMP=`jsonfilter -i $DATFILE -e "@.records[@.type!='NS']"`
__value=`jsonfilter -s "$__TMP" -e "@.name"`
if [ "$__value" == "" ]; then
write_log 7 "Parsing record:[${__HOST}.${__DOMAIN}] does not exist"
ret=1
else
__RECID=`jsonfilter -s "$__TMP" -e "@.id"`
__value=`jsonfilter -s "$__TMP" -e "@.type"`
__TTL=`jsonfilter -s "$__TMP" -e "@.ttl"`
write_log 7 "Get parsing recordID:[$__RECID]"
if [ "$__value" != "$__TYPE" ]; then
write_log 7 "Current parsing [type:$__TYPE], get mismatched [type:$__value]"
write_log 7 "Address needs to be modified, local address:[$__IP]"
ret=2
else
__RECIP=`jsonfilter -s "$__TMP" -e "@.value"`
if [ "$__RECIP" != "$__IP" ]; then
write_log 7 "Address needs to be modified, local address:[$__IP]"
ret=2
fi
fi
fi
}
build_command
describe_domain
if [ $ret == 1 ];then
sleep 3 && add_domain
elif [ $ret == 2 ];then
sleep 3 && update_domain
else
write_log 7 "Local IP:[$__IP] parsing records IP:[$__RECIP] address does not need to be modified"
fi
return 0
+42
View File
@@ -0,0 +1,42 @@
#
# Copyright (C) 2015-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v3.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=dsmboot
PKG_VERSION:=5.2
PKG_RELEASE:=5967.1
include $(INCLUDE_DIR)/package.mk
define Package/$(PKG_NAME)
SECTION:=net
CATEGORY:=Network
TITLE:=Synology DSM pxeboot from TFTP
DEPENDS:=
endef
define Package/$(PKG_NAME)/description
DSM 5.2 boot from TFTP
endef
define Build/Prepare
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/root
$(INSTALL_DATA) ./files/* $(1)/root/
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/dsmboot $(1)/etc/uci-defaults/yyy-dsmboot
endef
$(eval $(call BuildPackage,$(PKG_NAME)))
+10
View File
@@ -0,0 +1,10 @@
#!/bin/sh
uci -q batch <<-EOF >/dev/null
set dhcp.@dnsmasq[0].enable_tftp='1'
set dhcp.@dnsmasq[0].dhcp_boot='pxelinux.0'
set dhcp.@dnsmasq[0].tftp_root='/root'
commit dhcp
EOF
exit 0
+9
View File
@@ -0,0 +1,9 @@
default 0
timeout 0
fallback 0
title Synology DSM
map --mem (pd)/dsm.iso (hd32)
map --hook
chainloader (hd32)
Binary file not shown.
+59
View File
@@ -0,0 +1,59 @@
#
# Copyright (C) 2015 OpenWrt-dist
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=ipv6helper
PKG_VERSION:=1.0
PKG_RELEASE:=3
PKG_LICENSE:=GPLv3
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=LEAN
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/ipv6helper
SECTION:=ipv6
TITLE:=IPv6 Helper and Dynamic Update he.net of ip
PKGARCH:=all
DEPENDS:=+luci-proto-ipv6 +wget-ssl +odhcpd-ipv6only +odhcp6c +6in4 \
+PACKAGE_firewall:ip6tables \
+PACKAGE_firewall:libip6tc \
+PACKAGE_firewall:kmod-ipt-nat6
endef
define Package/ipv6helper/description
IPv6 Helper and Dynamic Update he.net of ip
endef
define Build/Prepare
endef
define Build/Configure
endef
define Build/Compile
endef
define Package/ipv6helper/postinst
#!/bin/sh
if [ -z "$${IPKG_INSTROOT}" ]; then
chmod 755 /etc/hotplug.d/iface/60-6in4 >/dev/null 2>&1
fi
exit 0
endef
define Package/ipv6helper/install
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
$(INSTALL_BIN) ./files/root/etc/hotplug.d/iface/60-6in4 $(1)/etc/hotplug.d/iface/60-6in4
endef
$(eval $(call BuildPackage,ipv6helper))
@@ -0,0 +1,12 @@
#!/bin/sh
. /lib/functions.sh
if [ "$ACTION" != "ifup" ]; then
exit
fi
config_load network
config_get tunnelid $INTERFACE tunnelid
config_get username $INTERFACE username
config_get password $INTERFACE password
if [ "$tunnelid" != "" ]; then
wget -O - https://$username:$password@ipv4.tunnelbroker.net/nic/update?hostname=$tunnelid --no-check-certificate
fi
+47
View File
@@ -0,0 +1,47 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=k3screenctrl
PKG_VERSION:=0.10
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/updateing/k3screenctrl.git
PKG_SOURCE_VERSION:=dd05ce9a5cb0cb6cebfc6b3b5823c7f6d75796ff
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.xz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_MAINTAINER:=Hamster Tian <haotia@gmail.com>
include $(INCLUDE_DIR)/package.mk
TARGET_CFLAGS+= -D_GNU_SOURCE
define Package/k3screenctrl
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=@(TARGET_bcm53xx_DEVICE_phicomm-k3||TARGET_bcm53xx_generic_DEVICE_phicomm_k3) +@KERNEL_DEVMEM
TITLE:=LCD screen controller on PHICOMM K3
URL:=https://github.com/updateing/k3-screen-ctrl
endef
define Package/k3screenctrl/description
K3 Screen Controller (k3screenctrl) is a program utilizing
the LCD screen on PHICOMM K3 to display some stats.
endef
define Package/k3screenctrl/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_DIR) $(1)/lib/k3screenctrl
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/k3screenctrl $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/k3screenctrl/wan.sh $(1)/lib/k3screenctrl/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/k3screenctrl/wifi.sh $(1)/lib/k3screenctrl/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/k3screenctrl/port.sh $(1)/lib/k3screenctrl/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/k3screenctrl/basic.sh $(1)/lib/k3screenctrl/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/k3screenctrl/host.sh $(1)/lib/k3screenctrl/
$(INSTALL_BIN) ./files/k3screenctrl.init $(1)/etc/init.d/k3screenctrl
endef
$(eval $(call BuildPackage,k3screenctrl))
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh /etc/rc.common
START=99
STOP=99
SCRIPTS_BASE=/lib/k3screenctrl/
start() {
/usr/bin/k3screenctrl &
}
stop() {
killall k3screenctrl
}
+70
View File
@@ -0,0 +1,70 @@
#
# Copyright (C) 2009-2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=libcryptopp
PKG_VERSION:=5.6.4
PKG_RELEASE:=2
PKG_SOURCE:=cryptopp$(subst .,,$(PKG_VERSION)).zip
PKG_SOURCE_URL:=http://www.cryptopp.com/
PKG_MD5SUM:=4ee7e5cdd4a45a14756c169eaf2a77fc
PKG_USE_NINJA:=0
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)
CMAKE_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/libcryptopp
SECTION:=libs
CATEGORY:=Libraries
DEPENDS:=+libpthread +libstdcpp
TITLE:=Free C++ class library of cryptographic schemes
URL:=http://packages.debian.org/sid/libcrypto++-dev
endef
define Package/libcryptopp/description
Crypto++ is library for creating C++ programs which use cryptographic algorithms.
The library uses a Pipes & Filters architecture with heavy use of templates and
abstract base classes.
endef
#CONFIGURE_ARGS += \
# --enable-static \
# --enable-shared
#TARGET_LDFLAGS += \
# -lpthread
CMAKE_OPTIONS += -DCMAKE_CXX_FLAGS="$(FPIC)"
CMAKE_OPTIONS += -DBUILD_STATIC=ON
CMAKE_OPTIONS += -DBUILD_SHARED=ON
UNPACK_CMD=cd $(PKG_BUILD_DIR) && unzip "$(DL_DIR)/$(PKG_SOURCE)"
define Build/Prepare
$(Build/Prepare/Default)
cd $(PKG_BUILD_DIR) && rm -f GNUmakefile GNUmakefile-cross
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/cryptopp
$(CP) $(PKG_INSTALL_DIR)/usr/include/cryptopp/* $(1)/usr/include/cryptopp/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcryptopp.{a,so*} $(1)/usr/lib/
endef
define Package/libcryptopp/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcryptopp.so* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libcryptopp))
+18
View File
@@ -0,0 +1,18 @@
# Copyright (C) 2020 Openwrt.org
#
# This is free software, licensed under the Apache License, Version 2.0 .
#
include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for Adbyby
LUCI_DEPENDS:=+adbyby +uclient-fetch +ipset +dnsmasq-full
LUCI_PKGARCH:=all
PKG_NAME:=luci-app-adbyby-plus
PKG_VERSION:=2.0
PKG_RELEASE:=77
include $(TOPDIR)/feeds/luci/luci.mk
# call BuildPackage - OpenWrt buildroot signature
@@ -0,0 +1,86 @@
module("luci.controller.adbyby", package.seeall)
function index()
if not nixio.fs.access("/etc/config/adbyby") then
return
end
entry({"admin", "services", "adbyby"}, alias("admin", "services", "adbyby", "base"), _("ADBYBY Plus +"), 9).dependent = true
entry({"admin", "services", "adbyby", "base"}, cbi("adbyby/base"), _("Base Setting"), 10).leaf = true
entry({"admin", "services", "adbyby", "advanced"}, cbi("adbyby/advanced"), _("Advance Setting"), 20).leaf = true
entry({"admin", "services", "adbyby", "help"}, form("adbyby/help"), _("Plus+ Domain List"), 30).leaf = true
entry({"admin", "services", "adbyby", "esc"}, form("adbyby/esc"), _("Bypass Domain List"), 40).leaf = true
entry({"admin", "services", "adbyby", "black"}, form("adbyby/black"), _("Block Domain List"), 50).leaf = true
entry({"admin", "services", "adbyby", "block"}, form("adbyby/block"), _("Block IP List"), 60).leaf = true
entry({"admin", "services", "adbyby", "user"}, form("adbyby/user"), _("User-defined Rule"), 70).leaf = true
entry({"admin", "services", "adbyby", "refresh"}, call("refresh_data"))
entry({"admin", "services", "adbyby", "run"}, call("act_status")).leaf = true
end
function act_status()
local e = {}
e.running = luci.sys.call("pgrep adbyby >/dev/null") == 0
luci.http.prepare_content("application/json")
luci.http.write_json(e)
end
function refresh_data()
local set = luci.http.formvalue("set")
local icount = 0
if set == "rule_data" then
luci.sys.exec("/usr/share/adbyby/rule-update")
icount = luci.sys.exec("/usr/share/adbyby/rule-count '/tmp/rules/'")
if tonumber(icount)>0 then
if nixio.fs.access("/usr/share/adbyby/rules/") then
oldcount = luci.sys.exec("/usr/share/adbyby/rule-count '/usr/share/adbyby/rules/'")
else
oldcount=0
end
else
retstring ="-1"
end
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("rm -f /usr/share/adbyby/rules/data/* /usr/share/adbyby/rules/host/* && cp -a /tmp/rules /usr/share/adbyby/")
luci.sys.exec("/etc/init.d/adbyby restart &")
retstring=tostring(math.ceil(tonumber(icount)))
else
retstring ="0"
end
else
refresh_cmd = "uclient-fetch -q --no-check-certificate -O - 'https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt' > /tmp/adnew.conf"
sret = luci.sys.call(refresh_cmd .. " 2>/dev/null")
if sret== 0 then
luci.sys.call("/usr/share/adbyby/ad-update")
icount = luci.sys.exec("cat /tmp/ad.conf | wc -l")
if tonumber(icount)>0 then
if nixio.fs.access("/usr/share/adbyby/dnsmasq.adblock") then
oldcount = luci.sys.exec("cat /usr/share/adbyby/dnsmasq.adblock | wc -l")
else
oldcount=0
end
if tonumber(icount) ~= tonumber(oldcount) then
luci.sys.exec("cp -f /tmp/ad.conf /usr/share/adbyby/dnsmasq.adblock")
luci.sys.exec("cp -f /tmp/ad.conf /tmp/etc/dnsmasq-adbyby.d/adblock")
luci.sys.exec("/etc/init.d/adbyby restart &")
retstring=tostring(math.ceil(tonumber(icount)))
else
retstring ="0"
end
else
retstring ="-1"
end
luci.sys.exec("rm -f /tmp/ad.conf")
else
retstring ="-1"
end
end
luci.http.prepare_content("application/json")
luci.http.write_json({ ret=retstring ,retcount=icount})
end
@@ -0,0 +1,67 @@
local SYS = require "luci.sys"
local ND = SYS.exec("cat /usr/share/adbyby/dnsmasq.adblock | wc -l")
local ad_count=0
if nixio.fs.access("/usr/share/adbyby/dnsmasq.adblock") then
ad_count=tonumber(SYS.exec("cat /usr/share/adbyby/dnsmasq.adblock | wc -l"))
end
local rule_count=0
if nixio.fs.access("/usr/share/adbyby/rules/") then
rule_count=tonumber(SYS.exec("/usr/share/adbyby/rule-count '/usr/share/adbyby/rules/'"))
end
m = Map("adbyby")
s = m:section(TypedSection, "adbyby")
s.anonymous = true
o = s:option(Flag, "block_ios")
o.title = translate("Block Apple iOS OTA update")
o.default = 0
o.rmempty = false
o = s:option(Flag, "block_cnshort")
o.title = translate("Block CNshort APP and Website")
o.default = 0
o.rmempty = false
o = s:option(Flag, "cron_mode")
o.title = translate("Update the rule at 6 a.m. every morning and restart adbyby")
o.default = 0
o.rmempty = false
o=s:option(DummyValue,"ad_data",translate("Adblock Plus Data"))
o.rawhtml = true
o.template = "adbyby/refresh"
o.value =ad_count .. " " .. translate("Records")
o=s:option(DummyValue,"rule_data",translate("Subscribe 3rd Rules Data"))
o.rawhtml = true
o.template = "adbyby/refresh"
o.value =rule_count .. " " .. translate("Records")
o.description = translate("AdGuardHome / Host / DNSMASQ rules auto-convert")
o = s:option(Button,"delete",translate("Delete All Subscribe Rules"))
o.inputstyle = "reset"
o.write = function()
SYS.exec("rm -f /usr/share/adbyby/rules/data/* /usr/share/adbyby/rules/host/*")
SYS.exec("/etc/init.d/adbyby restart 2>&1 &")
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "adbyby", "advanced"))
end
o = s:option(DynamicList, "subscribe_url", translate("Anti-AD Rules Subscribe"))
o:value("https://cdn.jsdelivr.net/gh/cjx82630/cjxlist/cjx-annoyance.txt", translate("cjx-annoyance"))
o:value("https://easylist-downloads.adblockplus.org/easylistchina.txt", translate("easylistchina"))
o:value("https://easylist-downloads.adblockplus.org/easyprivacy.txt", translate("easyprivacy"))
o:value("https://easylist-downloads.adblockplus.org/easylist.txt", translate("easylist"))
o:value("https://raw.githubusercontent.com/Spam404/lists/master/adblock-list.txt", translate("adblock-list"))
o:value("https://raw.githubusercontent.com/bongochong/CombinedPrivacyBlockLists/master/cpbl-abp-list.txt", translate("cpbl-abp-list"))
o:value("https://anti-ad.net/easylist.txt", translate("anti-ad"))
o:value("https://anti-ad.net/anti-ad-for-dnsmasq.conf", translate("anti-ad-for-dnsmasq"))
o:value("https://raw.githubusercontent.com/hoshsadiq/adblock-nocoin-list/master/nocoin.txt", translate("nocoin"))
o:value("https://easylist-downloads.adblockplus.org/abp-filters-anti-cv.txt", translate("abp-filters-anti-cv"))
o.rmempty = true
return m
@@ -0,0 +1,66 @@
local NXFS = require "nixio.fs"
local SYS = require "luci.sys"
local HTTP = require "luci.http"
local DISP = require "luci.dispatcher"
local DL = SYS.exec("head -1 /tmp/adbyby/data/lazy.txt | awk -F' ' '{print $3,$4}'") or ""
local DV = SYS.exec("head -1 /tmp/adbyby/data/video.txt | awk -F' ' '{print $3,$4}'") or ""
local NR = SYS.exec("grep -v '^!' /usr/share/adbyby/data/rules.txt | wc -l")
local NU = SYS.exec("cat /usr/share/adbyby/data/user.txt | wc -l")
local UD = NXFS.readfile("/tmp/adbyby.updated") or "1970-01-01 00:00:00"
m = Map("adbyby")
m.title = translate("Adbyby Plus + Settings")
m.description = translate("Adbyby Plus + can filter all kinds of banners, popups, video ads, and prevent tracking, privacy theft and a variety of malicious websites<br /><font color=\"red\">Plus + version combination mode can operation with Adblock Plus Host,filtering ads without losing bandwidth</font>")
m:section(SimpleSection).template = "adbyby/adbyby_status"
s = m:section(TypedSection, "adbyby")
s.anonymous = true
o = s:option(Flag, "enable", translate("Enable"))
o.default = 0
o.rmempty = false
o = s:option(ListValue, "wan_mode", translate("Running Mode"))
o:value("0", translate("Global Mode (The slowest and the best effects)"))
o:value("1", translate("Plus + Mode (Filter domain name list and blacklist website.Recommended)"))
o:value("2", translate("No filter Mode (Must set in Client Filter Mode Settings manually)"))
o.default = 1
o.rmempty = false
o = s:option(Button, "restart", translate("Adbyby and Rule state"))
o.inputtitle = translate("Update Adbyby Rules Manually")
o.description = string.format("<strong>"..translate("Last Update Checked")..":</strong> %s<br /><strong>"..translate("Lazy Rule")..":</strong>%s <br /><strong>"..translate("Video Rule")..":</strong>%s", UD, DL, DV)
o.inputstyle = "reload"
o.write = function()
SYS.call("rm -rf /tmp/adbyby.updated /tmp/adbyby/admd5.json && /usr/share/adbyby/adbybyupdate.sh > /tmp/adupdate.log 2>&1 &")
SYS.call("sleep 5")
HTTP.redirect(DISP.build_url("admin", "services", "adbyby"))
end
t = m:section(TypedSection, "acl_rule", translate("<strong>Client Filter Mode Settings</strong>"))
t.description = translate("Filter mode settings can be set to specific LAN clients ( <font color=blue> No filter , Global filter </font> ) . Does not need to be set by default.")
t.template = "cbi/tblsection"
t.sortable = true
t.anonymous = true
t.addremove = true
e = t:option(Value, "ipaddr", translate("IP Address"))
e.width = "40%"
e.datatype = "ip4addr"
e.placeholder = "0.0.0.0/0"
luci.ip.neighbors({ family = 4 }, function(entry)
if entry.reachable then
e:value(entry.dest:string())
end
end)
e = t:option(ListValue, "filter_mode", translate("Filter Mode"))
e.width = "40%"
e.default = "disable"
e.rmempty = false
e:value("disable", translate("No filter"))
e:value("global", translate("Global filter"))
return m
@@ -0,0 +1,23 @@
local fs = require "nixio.fs"
local conffile = "/usr/share/adbyby/adblack.conf"
f = SimpleForm("custom")
t = f:field(TextValue, "conf")
t.rmempty = true
t.rows = 13
function t.cfgvalue()
return fs.readfile(conffile) or ""
end
function f.handle(self, state, data)
if state == FORM_VALID then
if data.conf then
fs.writefile(conffile, data.conf:gsub("\r\n", "\n"))
luci.sys.call("/etc/init.d/adbyby restart")
end
end
return true
end
return f
@@ -0,0 +1,23 @@
local fs = require "nixio.fs"
local conffile = "/usr/share/adbyby/blockip.conf"
f = SimpleForm("custom")
t = f:field(TextValue, "conf")
t.rmempty = true
t.rows = 13
function t.cfgvalue()
return fs.readfile(conffile) or ""
end
function f.handle(self, state, data)
if state == FORM_VALID then
if data.conf then
fs.writefile(conffile, data.conf:gsub("\r\n", "\n"))
luci.sys.call("/etc/init.d/adbyby restart")
end
end
return true
end
return f
@@ -0,0 +1,23 @@
local fs = require "nixio.fs"
local conffile = "/usr/share/adbyby/adesc.conf"
f = SimpleForm("custom")
t = f:field(TextValue, "conf")
t.rmempty = true
t.rows = 13
function t.cfgvalue()
return fs.readfile(conffile) or ""
end
function f.handle(self, state, data)
if state == FORM_VALID then
if data.conf then
fs.writefile(conffile, data.conf:gsub("\r\n", "\n"))
luci.sys.call("/etc/init.d/adbyby restart")
end
end
return true
end
return f
Loaded 100 of 1284 files, more files were not shown because too many files have changed in this diff. Show more