update 04-25 23:45:26
This commit is contained in:
parent
638b30c5a5
commit
1ba186d613
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -9,7 +9,7 @@ LUCI_TITLE:=LuCI support for Weburl From Koolshare
|
||||||
LUCI_DEPENDS:=+iptables-mod-filter +kmod-ipt-filter
|
LUCI_DEPENDS:=+iptables-mod-filter +kmod-ipt-filter
|
||||||
LUCI_PKGARCH:=all
|
LUCI_PKGARCH:=all
|
||||||
PKG_VERSION:=1.0
|
PKG_VERSION:=1.0
|
||||||
PKG_RELEASE:=3-20220406
|
PKG_RELEASE:=3-20220422
|
||||||
|
|
||||||
include $(TOPDIR)/feeds/luci/luci.mk
|
include $(TOPDIR)/feeds/luci/luci.mk
|
||||||
|
|
||||||
|
|
|
@ -9,16 +9,8 @@
|
||||||
|
|
||||||
START=99
|
START=99
|
||||||
|
|
||||||
CONFIG=weburl
|
WEBURL_ENABLE=0
|
||||||
|
WEBURL_ALGOS=
|
||||||
uci_get_by_type() {
|
|
||||||
local index=0
|
|
||||||
if [ -n $4 ]; then
|
|
||||||
index=$4
|
|
||||||
fi
|
|
||||||
local ret=$(uci get $CONFIG.@$1[$index].$2 2>/dev/null)
|
|
||||||
echo ${ret:=$3}
|
|
||||||
}
|
|
||||||
|
|
||||||
is_true() {
|
is_true() {
|
||||||
case $1 in
|
case $1 in
|
||||||
|
@ -27,63 +19,90 @@ is_true() {
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
load_config() {
|
get_algo_mode(){
|
||||||
ENABLED=$(uci_get_by_type basic enable)
|
if [ "x$1" = "x1" ]; then
|
||||||
return $(is_true $ENABLED)
|
echo "kmp"
|
||||||
|
else
|
||||||
|
echo "bm"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
get_algo_mode(){
|
iptables_w(){
|
||||||
case "$1" in
|
iptables -w 1 "$@"
|
||||||
0)
|
|
||||||
echo "bm"
|
|
||||||
;;
|
|
||||||
1)
|
|
||||||
echo "kmp"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
}
|
}
|
||||||
|
|
||||||
add_rule(){
|
add_rule(){
|
||||||
algos=$(uci_get_by_type basic algos)
|
local settime
|
||||||
for i in $(seq 0 100)
|
local macaddr
|
||||||
do
|
local enable
|
||||||
enable=$(uci_get_by_type macbind enable '' $i)
|
local timeon
|
||||||
macaddr=$(uci_get_by_type macbind macaddr '' $i)
|
local timeoff
|
||||||
timeon=$(uci_get_by_type macbind timeon '' $i)
|
local keyword
|
||||||
timeoff=$(uci_get_by_type macbind timeoff '' $i)
|
config_get enable "$1" enable "0"
|
||||||
keyword=$(uci_get_by_type macbind keyword '' $i)
|
config_get macaddr "$1" macaddr
|
||||||
if [ -z $enable ] || [ -z $keyword ]; then
|
config_get timeon "$1" timeon
|
||||||
break
|
config_get timeoff "$1" timeoff
|
||||||
fi
|
config_get keyword "$1" keyword
|
||||||
|
|
||||||
if [ -z $timeon ] || [ -z $timeoff ]; then
|
if [ -z "$enable" ] || [ $enable = 0 ] || [ -z "$keyword" ]; then
|
||||||
settime=""
|
return
|
||||||
else
|
fi
|
||||||
settime="-m time --kerneltz --timestart $timeon --timestop $timeoff"
|
|
||||||
fi
|
if [ -z "$timeon" ] || [ -z "$timeoff" ]; then
|
||||||
|
settime=""
|
||||||
if [ "$enable" == "1" ]; then
|
else
|
||||||
if [ -z $macaddr ]; then
|
settime="-m time --kerneltz --timestart $timeon --timestop $timeoff"
|
||||||
iptables -t filter -I WEBURL $settime -m string --string "$keyword" --algo $(get_algo_mode $algos) -j DROP
|
fi
|
||||||
else
|
|
||||||
iptables -t filter -I WEBURL $settime -m mac --mac-source $macaddr -m string --string "$keyword" --algo $(get_algo_mode $algos) -j DROP
|
if [ -z $macaddr ]; then
|
||||||
unset macaddr
|
iptables_w -t filter -I WEBURL_RULES $settime -m string --string "$keyword" --algo $WEBURL_ALGOS -j WEBURL_REJECT
|
||||||
fi
|
else
|
||||||
fi
|
iptables_w -t filter -I WEBURL_RULES $settime -m mac --mac-source $macaddr -m string --string "$keyword" --algo $WEBURL_ALGOS -j WEBURL_REJECT
|
||||||
done
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
weburl_header() {
|
||||||
|
local algos
|
||||||
|
config_get WEBURL_ENABLE "$1" enable "0"
|
||||||
|
config_get algos "$1" algos "0"
|
||||||
|
WEBURL_ALGOS=$(get_algo_mode $algos)
|
||||||
}
|
}
|
||||||
|
|
||||||
start(){
|
start(){
|
||||||
! load_config && exit 0
|
config_load weburl
|
||||||
iptables -L FORWARD | grep -c WEBURL 2>/dev/null && [ $? -eq 0 ] && exit 0;
|
config_foreach weburl_header basic
|
||||||
iptables -t filter -N WEBURL
|
[ "x`is_true $WEBURL_ENABLE`" = "x0" ] || return 0
|
||||||
iptables -t filter -I FORWARD -m comment --comment "Rule For Control" -j WEBURL
|
iptables_w -L FORWARD | grep -c WEBURL 2>/dev/null && [ $? -eq 0 ] && return 0;
|
||||||
add_rule
|
# resolve interface
|
||||||
iptables -t filter -I WEBURL -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
|
local interface=$(
|
||||||
}
|
. /lib/functions/network.sh
|
||||||
stop(){
|
|
||||||
iptables -t filter -D FORWARD -m comment --comment "Rule For Control" -j WEBURL
|
network_is_up "lan" && network_get_device device "lan"
|
||||||
iptables -t filter -F WEBURL
|
echo "${device:-br-lan}"
|
||||||
iptables -t filter -X WEBURL
|
)
|
||||||
|
iptables_w -t filter -N WEBURL_REJECT
|
||||||
|
iptables_w -t filter -F 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 -F WEBURL_RULES
|
||||||
|
config_foreach add_rule macbind
|
||||||
|
iptables_w -t filter -N WEBURL
|
||||||
|
iptables_w -t filter -F 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 -m comment --comment "Rule For Control" -j WEBURL
|
||||||
|
logger -t weburl "weburl filter on $interface"
|
||||||
|
}
|
||||||
|
|
||||||
|
stop(){
|
||||||
|
iptables_w -t filter -D FORWARD -m comment --comment "Rule For Control" -j WEBURL
|
||||||
|
iptables_w -t filter -F WEBURL
|
||||||
|
iptables_w -t filter -X WEBURL
|
||||||
|
iptables_w -t filter -F WEBURL_RULES
|
||||||
|
iptables_w -t filter -X WEBURL_RULES
|
||||||
|
iptables_w -t filter -F WEBURL_REJECT
|
||||||
|
iptables_w -t filter -X WEBURL_REJECT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -191,6 +191,7 @@ ac_rule() {
|
||||||
else
|
else
|
||||||
for name in $Interface; do
|
for name in $Interface; do
|
||||||
local IFNAME=$(uci -P /var/state get network.$name.ifname 2>/dev/null)
|
local IFNAME=$(uci -P /var/state get network.$name.ifname 2>/dev/null)
|
||||||
|
[ -z "$IFNAME" ] && IFNAME=$(uci -P /var/state get network.$name.device 2>/dev/null)
|
||||||
[ -n "$IFNAME" ] && $IPT -I PREROUTING 1 ${IFNAME:+-i $IFNAME} -p tcp $EXT_ARGS $MATCH_SET -m comment --comment "$TAG" -j SS_SPEC_WAN_AC
|
[ -n "$IFNAME" ] && $IPT -I PREROUTING 1 ${IFNAME:+-i $IFNAME} -p tcp $EXT_ARGS $MATCH_SET -m comment --comment "$TAG" -j SS_SPEC_WAN_AC
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
@ -262,6 +263,7 @@ tp_rule() {
|
||||||
else
|
else
|
||||||
for name in $Interface; do
|
for name in $Interface; do
|
||||||
local IFNAME=$(uci -P /var/state get network.$name.ifname 2>/dev/null)
|
local IFNAME=$(uci -P /var/state get network.$name.ifname 2>/dev/null)
|
||||||
|
[ -z "$IFNAME" ] && IFNAME=$(uci -P /var/state get network.$name.device 2>/dev/null)
|
||||||
[ -n "$IFNAME" ] && $ipt -I PREROUTING 1 ${IFNAME:+-i $IFNAME} -p udp $EXT_ARGS $MATCH_SET -m comment --comment "$TAG" -j SS_SPEC_TPROXY
|
[ -n "$IFNAME" ] && $ipt -I PREROUTING 1 ${IFNAME:+-i $IFNAME} -p udp $EXT_ARGS $MATCH_SET -m comment --comment "$TAG" -j SS_SPEC_TPROXY
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -10,12 +10,12 @@ LUCI_DESCRIPTION:=luci-app-store is a ipk store developed by LinkEase team
|
||||||
LUCI_DEPENDS:=+curl +opkg +luci-base +tar +coreutils +coreutils-stat +libuci-lua +mount-utils
|
LUCI_DEPENDS:=+curl +opkg +luci-base +tar +coreutils +coreutils-stat +libuci-lua +mount-utils
|
||||||
LUCI_PKGARCH:=all
|
LUCI_PKGARCH:=all
|
||||||
|
|
||||||
PKG_VERSION:=0.1.8-8
|
PKG_VERSION:=0.1.9-1
|
||||||
# PKG_RELEASE MUST be empty for luci.mk
|
# PKG_RELEASE MUST be empty for luci.mk
|
||||||
PKG_RELEASE:=
|
PKG_RELEASE:=
|
||||||
|
|
||||||
ISTORE_UI_VERSION:=1.0
|
ISTORE_UI_VERSION:=1.0
|
||||||
ISTORE_UI_RELEASE:=12
|
ISTORE_UI_RELEASE:=13
|
||||||
PKG_HASH:=skip
|
PKG_HASH:=skip
|
||||||
|
|
||||||
PKG_SOURCE_URL_FILE:=v$(ISTORE_UI_VERSION)-$(ISTORE_UI_RELEASE).tar.gz
|
PKG_SOURCE_URL_FILE:=v$(ISTORE_UI_VERSION)-$(ISTORE_UI_RELEASE).tar.gz
|
||||||
|
|
|
@ -219,6 +219,11 @@ backup() {
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -d "${BACKUP_PATH}" ] && ! mkdir -p "${BACKUP_PATH}" ; then
|
||||||
|
echo "invalid backup path, can not backup ipk"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
#write all installed package list to file
|
#write all installed package list to file
|
||||||
opkg_list_installed_packages "allinstalled" 2>/dev/null | sort -u > ${IS_ROOT}/all_installed_package.list
|
opkg_list_installed_packages "allinstalled" 2>/dev/null | sort -u > ${IS_ROOT}/all_installed_package.list
|
||||||
|
|
||||||
|
@ -249,12 +254,7 @@ backup() {
|
||||||
[ -n "${IS_DEBUG}" ] && echo -e "appdep_list_all:\n""${appdep_list_all}"
|
[ -n "${IS_DEBUG}" ] && echo -e "appdep_list_all:\n""${appdep_list_all}"
|
||||||
echo "${appdep_list_all}" > ${IS_ROOT}/appdep.list
|
echo "${appdep_list_all}" > ${IS_ROOT}/appdep.list
|
||||||
|
|
||||||
|
|
||||||
#3.rebuild all istore installed package to ipk and backup to userdata partation
|
#3.rebuild all istore installed package to ipk and backup to userdata partation
|
||||||
if [ ! -d "${BACKUP_PATH}" ];then
|
|
||||||
echo "invalid backup path, can not backup ipk"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 4. create dir
|
# 4. create dir
|
||||||
date=$(date +%Y-%m%d-%H%M)
|
date=$(date +%Y-%m%d-%H%M)
|
||||||
|
|
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||||
LUCI_TITLE:=Argon Theme
|
LUCI_TITLE:=Argon Theme
|
||||||
LUCI_DEPENDS:=+curl +jsonfilter
|
LUCI_DEPENDS:=+curl +jsonfilter
|
||||||
PKG_VERSION:=2.2.9.4
|
PKG_VERSION:=2.2.9.4
|
||||||
PKG_RELEASE:=20220421
|
PKG_RELEASE:=20220425
|
||||||
|
|
||||||
include $(TOPDIR)/feeds/luci/luci.mk
|
include $(TOPDIR)/feeds/luci/luci.mk
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
local util = require "luci.util"
|
local util = require "luci.util"
|
||||||
local http = require "luci.http"
|
local http = require "luci.http"
|
||||||
local disp = require "luci.dispatcher"
|
local disp = require "luci.dispatcher"
|
||||||
local ver = require "luci.version"
|
local ver = require "luci.version"
|
||||||
|
|
||||||
local boardinfo = util.ubus("system", "board")
|
local boardinfo = util.ubus("system", "board")
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
local util = require "luci.util"
|
local util = require "luci.util"
|
||||||
local http = require "luci.http"
|
local http = require "luci.http"
|
||||||
local disp = require "luci.dispatcher"
|
local disp = require "luci.dispatcher"
|
||||||
local ver = require "luci.version"
|
local ver = require "luci.version"
|
||||||
|
|
||||||
local boardinfo = util.ubus("system", "board")
|
local boardinfo = util.ubus("system", "board")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue