update-10.07

This commit is contained in:
github-actions[bot] 2021-10-07 09:03:40 +08:00
parent 4f86e9c65d
commit b99ad56714
12 changed files with 152 additions and 125 deletions

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=aliyundrive-webdav
PKG_VERSION:=0.4.1
PKG_VERSION:=0.4.2
PKG_RELEASE:=1
PKG_LICENSE:=MIT

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-aliyundrive-webdav
PKG_VERSION:=0.4.1
PKG_VERSION:=0.4.2
PKG_RELEASE:=1
PKG_PO_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)

View File

@ -283,11 +283,12 @@ end
local function historychecktime()
local CONFIG_FILE = uci:get("openclash", "config", "config_path")
if not CONFIG_FILE then return "0" end
local HISTORY_PATH = "/etc/openclash/history/" .. fs.filename(fs.basename(CONFIG_FILE))
if not nixio.fs.access(HISTORY_PATH) then
local HISTORY_PATH_OLD = "/etc/openclash/history/" .. fs.filename(fs.basename(CONFIG_FILE))
local HISTORY_PATH = "/etc/openclash/history/" .. fs.filename(fs.basename(CONFIG_FILE)) .. ".db"
if not nixio.fs.access(HISTORY_PATH) and not nixio.fs.access(HISTORY_PATH_OLD) then
return "0"
else
return os.date("%Y-%m-%d %H:%M:%S",fs.mtime(HISTORY_PATH))
return os.date("%Y-%m-%d %H:%M:%S",fs.mtime(HISTORY_PATH)) or os.date("%Y-%m-%d %H:%M:%S",fs.mtime(HISTORY_PATH_OLD))
end
end

View File

@ -1318,37 +1318,48 @@ firewall_rule_exclude()
return
fi
dest_port=$(echo $dest_port |sed "s/-/:/g" 2>/dev/null)
if [ -z "$family" ] || [ "$family" == "ipv4" ]; then
if [ -z "$en_mode_tun" ] || [ "$en_mode_tun" -eq 3 ]; then
for i in $dest_port; do
if $e_tcp ; then
iptables -t nat -I openclash_output -p tcp --sport "$dest_port" -j RETURN >/dev/null 2>&1
iptables -t nat -I openclash_output -p tcp --sport "$i" -j RETURN >/dev/null 2>&1
iptables -t nat -I openclash -p tcp --dport "$i" -j RETURN >/dev/null 2>&1
fi
if $e_udp ; then
iptables -t mangle -I openclash_output -p udp --sport "$dest_port" -j RETURN >/dev/null 2>&1
iptables -t mangle -I openclash -p udp --dport "$dest_port" -j RETURN >/dev/null 2>&1
iptables -t mangle -I openclash_output -p udp --sport "$i" -j RETURN >/dev/null 2>&1
iptables -t mangle -I openclash -p udp --dport "$i" -j RETURN >/dev/null 2>&1
fi
done
elif [ "$en_mode_tun" -ne 3 ]; then
for i in $dest_port; do
if $e_tcp ; then
iptables -t mangle -I openclash_output -p tcp --sport "$dest_port" -j RETURN >/dev/null 2>&1
iptables -t mangle -I openclash -p tcp --dport "$dest_port" -j RETURN >/dev/null 2>&1
iptables -t mangle -I openclash_output -p tcp --sport "$i" -j RETURN >/dev/null 2>&1
iptables -t mangle -I openclash -p tcp --dport "$i" -j RETURN >/dev/null 2>&1
fi
if $e_udp ; then
iptables -t mangle -I openclash_output -p udp --sport "$dest_port" -j RETURN >/dev/null 2>&1
iptables -t mangle -I openclash -p udp --dport "$dest_port" -j RETURN >/dev/null 2>&1
iptables -t mangle -I openclash_output -p udp --sport "$i" -j RETURN >/dev/null 2>&1
iptables -t mangle -I openclash -p udp --dport "$i" -j RETURN >/dev/null 2>&1
fi
done
fi
fi
if [ "$ipv6_enable" -eq 1 ] && [ -n "$(ip6tables -t mangle -L 2>&1 | grep -o 'Chain')" ]; then
if [ -z "$family" ] || [ "$family" == "ipv6" ]; then
for i in $dest_port; do
if $e_tcp ; then
ip6tables -t mangle -I openclash -p tcp --sport "$dest_port" -j RETURN >/dev/null 2>&1
ip6tables -t mangle -I openclash_output -p tcp --sport "$dest_port" -j RETURN >/dev/null 2>&1
ip6tables -t mangle -I openclash -p tcp --sport "$i" -j RETURN >/dev/null 2>&1
ip6tables -t mangle -I openclash -p tcp --dport "$i" -j RETURN >/dev/null 2>&1
ip6tables -t mangle -I openclash_output -p tcp --sport "$i" -j RETURN >/dev/null 2>&1
fi
if $e_udp ; then
ip6tables -t mangle -I openclash -p udp --sport "$dest_port" -j RETURN >/dev/null 2>&1
ip6tables -t mangle -I openclash_output -p udp --sport "$dest_port" -j RETURN >/dev/null 2>&1
ip6tables -t mangle -I openclash -p udp --sport "$i" -j RETURN >/dev/null 2>&1
ip6tables -t mangle -I openclash -p udp --dport "$i" -j RETURN >/dev/null 2>&1
ip6tables -t mangle -I openclash_output -p udp --sport "$i" -j RETURN >/dev/null 2>&1
fi
done
fi
fi
}

View File

@ -22,8 +22,8 @@ yml_other_set()
Value_1 = YAML.load_file(i)
if Value_1 != false then
if Value_1.class.to_s == 'Hash' then
if Value_1['script'] then
if Value.key?('script') and not Value['script'].to_a.empty? then
if Value_1['script'] and Value_1['script'].class.to_s != 'Array' then
if Value.key?('script') and not Value_1['script'].to_a.empty? then
if Value['script'].key?('code') and Value_1['script'].key?('code') then
Value['script']['code'].merge!(Value_1['script']['code']).uniq
elsif Value_1['script'].key?('code') then
@ -48,10 +48,10 @@ yml_other_set()
Value_1 = YAML.load_file('/etc/openclash/custom/openclash_custom_rules.list')
if Value_1 != false then
if Value_1.class.to_s == 'Hash' then
if not Value_1['rules'].to_a.empty? then
if not Value_1['rules'].to_a.empty? and Value_1['rules'].class.to_s == 'Array' then
Value_2 = Value_1['rules'].to_a.reverse!
end
else
elsif Value_1.class.to_s == 'Array'
Value_2 = Value_1.reverse!
end
if defined? Value_2 then
@ -66,10 +66,10 @@ yml_other_set()
ruby_add_index = Value['rules'].index(Value['rules'].grep(/(GEOIP|MATCH|FINAL)/).first)
ruby_add_index ||= -1
if Value_3.class.to_s == 'Hash' then
if not Value_3['rules'].to_a.empty? then
if not Value_3['rules'].to_a.empty? and Value_3['rules'].class.to_s == 'Array' then
Value_4 = Value_3['rules'].to_a.reverse!
end
else
elsif Value_3.class.to_s == 'Array'
Value_4 = Value_3.reverse!
end
if defined? Value_4 then
@ -83,44 +83,47 @@ yml_other_set()
Value_1 = YAML.load_file('/etc/openclash/custom/openclash_custom_rules.list')
if Value_1 != false then
if Value_1.class.to_s == 'Hash' then
if not Value_1['rules'].to_a.empty? then
if not Value_1['rules'].to_a.empty? and Value_1['rules'].class.to_s == 'Array' then
Value['rules'] = Value_1['rules']
end
else
Value['rules'] = Value_1
end
Value['rules'] = Value['rules'].uniq
end
elsif Value_1.class.to_s == 'Array'
Value['rules'] = Value_1
Value['rules'] = Value['rules'].uniq
end
end
end
if File::exist?('/etc/openclash/custom/openclash_custom_rules_2.list') then
Value_2 = YAML.load_file('/etc/openclash/custom/openclash_custom_rules_2.list')
if Value_2 != false then
if Value['rules'].to_a.empty? then
if Value_2.class.to_s == 'Hash' then
if not Value_2['rules'].to_a.empty? then
if not Value_2['rules'].to_a.empty? and Value_2['rules'].class.to_s == 'Array' then
Value['rules'] = Value_2['rules']
Value['rules'] = Value['rules'].uniq
end
else
elsif Value_2.class.to_s == 'Array'
Value['rules'] = Value_2
Value['rules'] = Value['rules'].uniq
end
else
ruby_add_index = Value['rules'].index(Value['rules'].grep(/(GEOIP|MATCH|FINAL)/).first)
ruby_add_index ||= -1
if Value_2.class.to_s == 'Hash' then
if not Value_2['rules'].to_a.empty? then
if not Value_2['rules'].to_a.empty? and Value_2['rules'].class.to_s == 'Array' then
Value_3 = Value_2['rules'].to_a.reverse!
end
else
elsif Value_2.class.to_s == 'Array'
Value_3 = Value_2.reverse!
end
if defined? Value_3 then
Value_3.each{|x| Value['rules'].insert(ruby_add_index,x)}
end
end
Value['rules'] = Value['rules'].uniq
end
end
end
end
end
end;
rescue Exception => e
puts '${LOGTIME} Error: Set Custom Rules Error,【' + e.message + '】'

View File

@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-passwall
PKG_VERSION:=4.36
PKG_VERSION:=4.37
PKG_RELEASE:=1
#20210928

View File

@ -4,6 +4,7 @@ local api = require "luci.model.cbi.passwall.api.api"
local var = api.get_args(arg)
local node_section = var["-node"]
local proto = var["-proto"]
local proxy_way = var["-proxy_way"]
local redir_port = var["-redir_port"]
local local_socks_address = var["-local_socks_address"] or "0.0.0.0"
local local_socks_port = var["-local_socks_port"]
@ -261,6 +262,7 @@ if node_section then
port = tonumber(redir_port),
protocol = "dokodemo-door",
settings = {network = proto, followRedirect = true},
streamSettings = {sockopt = {tproxy = proxy_way}},
sniffing = {enabled = true, destOverride = {"http", "tls"}}
})
end

View File

@ -91,6 +91,22 @@ if os.execute("lsmod | grep -i REDIRECT >/dev/null") == 0 and os.execute("lsmod
o.default = "redirect"
o:value("redirect", "REDIRECT")
o:value("tproxy", "TPROXY")
o:depends("ipv6_tproxy", false)
function o.formvalue(self, section)
local ipv6_tproxy = ListValue.formvalue(o_ipv6_tproxy, section)
if ipv6_tproxy == "1" then
return "tproxy"
end
return ListValue.formvalue(self, section)
end
---- IPv6 TProxy
o_ipv6_tproxy = s:option(Flag, "ipv6_tproxy", translate("IPv6 TProxy"),
"<font color='red'>" .. translate(
"Experimental feature. Make sure that your node supports IPv6.") ..
"</font>")
o_ipv6_tproxy.default = 0
o_ipv6_tproxy.rmempty = false
end
--[[
@ -118,14 +134,6 @@ s = m:section(TypedSection, "global_other", translate("Other Settings"))
s.anonymous = true
s.addremove = false
---- IPv6 TProxy
o = s:option(Flag, "ipv6_tproxy", translate("IPv6 TProxy"),
"<font color='red'>" .. translate(
"Experimental feature.Make sure that your node supports IPv6.") ..
"</font>")
o.default = 0
o.rmempty = false
o = s:option(MultiValue, "status", translate("Status info"))
o:value("big_icon", translate("Big icon")) -- 大图标
o:value("show_check_port", translate("Show node check")) -- 显示节点检测

View File

@ -1168,7 +1168,7 @@ msgstr "目前最多只能设置%s个节点用于给访问控制使用。"
msgid "IPv6 TProxy"
msgstr "IPv6透明代理(TProxy)"
msgid "Experimental feature.Make sure that your node supports IPv6."
msgid "Experimental feature. Make sure that your node supports IPv6."
msgstr "实验特性请确保你的节点支持IPv6"
msgid "Status info"

View File

@ -33,11 +33,11 @@ config global_forwarding
option udp_redir_ports '1:65535'
option accept_icmp '0'
option tcp_proxy_way 'redirect'
option ipv6_tproxy '0'
config global_other
option status 'big_icon show_check_port show_ip111'
option nodes_ping 'auto_ping tcping'
option ipv6_tproxy '0'
config global_rules
option auto_update '0'

View File

@ -308,7 +308,7 @@ load_config() {
[ -z "${DEFAULT_DNS}" ] && DEFAULT_DNS=$(echo -n $(sed -n 's/^nameserver[ \t]*\([^ ]*\)$/\1/p' "${RESOLVFILE}" | grep -v -E "0.0.0.0|127.0.0.1|::" | head -2) | tr ' ' ',')
LOCAL_DNS="${DEFAULT_DNS:-119.29.29.29}"
PROXY_IPV6=$(config_t_get global_other ipv6_tproxy 0)
PROXY_IPV6=$(config_t_get global_forwarding ipv6_tproxy 0)
export V2RAY_LOCATION_ASSET=$(config_t_get global_rules v2ray_location_asset "/usr/share/xray/")
export XRAY_LOCATION_ASSET=$V2RAY_LOCATION_ASSET
@ -337,7 +337,7 @@ run_ipt2socks() {
}
run_v2ray() {
local flag node redir_type redir_port socks_address socks_port socks_username socks_password http_address http_port http_username http_password log_file config_file
local flag node proxy_way redir_type redir_port socks_address socks_port socks_username socks_password http_address http_port http_username http_password log_file config_file
local _extra_param=""
local proto="tcp,udp"
eval_set_val $@
@ -352,13 +352,15 @@ run_v2ray() {
UDP)
flag="${flag}_UDP"
proto="udp"
proxy_way="tproxy"
;;
TCP)
flag="${flag}_TCP"
proto="tcp"
proxy_way=$tcp_proxy_way
;;
esac
lua $API_GEN_V2RAY -node $node -proto $proto -redir_port $redir_port -local_socks_address $socks_address -local_socks_port $socks_port -local_http_address $http_address -local_http_port $http_port ${_extra_param} > $config_file
lua $API_GEN_V2RAY -node $node -proto $proto -redir_port $redir_port -proxy_way $proxy_way -local_socks_address $socks_address -local_socks_port $socks_port -local_http_address $http_address -local_http_port $http_port ${_extra_param} > $config_file
ln_start_bin "$(first_type $(config_t_get global_app ${type}_file) ${type})" ${type} $log_file -config="$config_file"
}
@ -563,7 +565,7 @@ run_redir() {
v2ray|\
xray)
local loglevel=$(config_t_get global loglevel "warning")
lua $API_GEN_V2RAY -node $node -proto udp -redir_port $local_port -loglevel $loglevel > $config_file
lua $API_GEN_V2RAY -node $node -proto udp -redir_port $local_port -proxy_way tproxy -loglevel $loglevel > $config_file
ln_start_bin "$(first_type $(config_t_get global_app ${type}_file) ${type})" ${type} $log_file -config="$config_file"
;;
trojan-go)
@ -675,7 +677,7 @@ run_redir() {
UDP_NODE="nil"
}
_extra_param="${_extra_param} ${proto}"
lua $API_GEN_V2RAY -node $node -redir_port $local_port -loglevel $loglevel ${_extra_param} > $config_file
lua $API_GEN_V2RAY -node $node -redir_port $local_port -proxy_way $tcp_proxy_way -loglevel $loglevel ${_extra_param} > $config_file
ln_start_bin "$(first_type $(config_t_get global_app ${type}_file) ${type})" ${type} $log_file -config="$config_file"
;;
trojan-go)

View File

@ -411,11 +411,11 @@ load_acl() {
$ipt_m -A PSW $(comment "$remarks") -p udp $(factor $ip "-s") $(factor $mac "-m mac --mac-source") $(factor $udp_redir_ports "-m multiport --dport") $(dst $IPSET_BLACKLIST) $(REDIRECT $udp_port TPROXY)
$ipt_m -A PSW $(comment "$remarks") -p udp $(factor $ip "-s") $(factor $mac "-m mac --mac-source") $(factor $udp_redir_ports "-m multiport --dport") $(get_redirect_ipt $udp_proxy_mode $udp_port TPROXY)
if [ "$PROXY_IPV6" == "1" ]; then
$ip6t_m -A PSW $(comment "$remarks") -p udp $(factor $ip "-s") $(factor $mac "-m mac --mac-source") $(factor $udp_redir_ports "-m multiport --dport") $(dst $IPSET_SHUNTLIST6) $(REDIRECT $udp_port TPROXY) 2>/dev/null
$ip6t_m -A PSW $(comment "$remarks") -p udp $(factor $ip "-s") $(factor $mac "-m mac --mac-source") $(factor $udp_redir_ports "-m multiport --dport") $(dst $IPSET_BLACKLIST6) $(REDIRECT $udp_port TPROXY) 2>/dev/null
$ip6t_m -A PSW $(comment "$remarks") -p udp $(factor $ip "-s") $(factor $mac "-m mac --mac-source") $(factor $udp_redir_ports "-m multiport --dport") $(get_redirect_ip6t $udp_proxy_mode $udp_port TPROXY) 2>/dev/null
fi
# if [ "$PROXY_IPV6" == "1" ]; then
# $ip6t_m -A PSW $(comment "$remarks") -p udp $(factor $ip "-s") $(factor $mac "-m mac --mac-source") $(factor $udp_redir_ports "-m multiport --dport") $(dst $IPSET_SHUNTLIST6) $(REDIRECT $udp_port TPROXY) 2>/dev/null
# $ip6t_m -A PSW $(comment "$remarks") -p udp $(factor $ip "-s") $(factor $mac "-m mac --mac-source") $(factor $udp_redir_ports "-m multiport --dport") $(dst $IPSET_BLACKLIST6) $(REDIRECT $udp_port TPROXY) 2>/dev/null
# $ip6t_m -A PSW $(comment "$remarks") -p udp $(factor $ip "-s") $(factor $mac "-m mac --mac-source") $(factor $udp_redir_ports "-m multiport --dport") $(get_redirect_ip6t $udp_proxy_mode $udp_port TPROXY) 2>/dev/null
# fi
else
msg2="${msg}不代理UDP"
fi
@ -494,11 +494,11 @@ load_acl() {
$ipt_m -A PSW $(comment "默认") -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(dst $IPSET_BLACKLIST) $(REDIRECT $UDP_REDIR_PORT TPROXY)
$ipt_m -A PSW $(comment "默认") -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(get_redirect_ipt $UDP_PROXY_MODE $UDP_REDIR_PORT TPROXY)
if [ "$PROXY_IPV6" == "1" ]; then
$ip6t_m -A PSW $(comment "默认") -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(dst $IPSET_SHUNTLIST6) $(REDIRECT $UDP_REDIR_PORT TPROXY)
$ip6t_m -A PSW $(comment "默认") -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(dst $IPSET_BLACKLIST6) $(REDIRECT $UDP_REDIR_PORT TPROXY)
$ip6t_m -A PSW $(comment "默认") -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(get_redirect_ip6t $UDP_PROXY_MODE $UDP_REDIR_PORT TPROXY)
fi
# if [ "$PROXY_IPV6" == "1" ]; then
# $ip6t_m -A PSW $(comment "默认") -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(dst $IPSET_SHUNTLIST6) $(REDIRECT $UDP_REDIR_PORT TPROXY)
# $ip6t_m -A PSW $(comment "默认") -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(dst $IPSET_BLACKLIST6) $(REDIRECT $UDP_REDIR_PORT TPROXY)
# $ip6t_m -A PSW $(comment "默认") -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(get_redirect_ip6t $UDP_PROXY_MODE $UDP_REDIR_PORT TPROXY)
# fi
echolog "${msg}"
}
@ -946,16 +946,16 @@ add_firewall_rule() {
$ipt_m -A PSW $(comment "本机") -p udp -i lo $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(get_redirect_ipt $LOCALHOST_UDP_PROXY_MODE $UDP_REDIR_PORT TPROXY)
$ipt_m -A PSW $(comment "本机") -p udp -i lo -j RETURN
if [ "$PROXY_IPV6" == "1" ]; then
$ip6t_m -A PSW_OUTPUT -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(dst $IPSET_SHUNTLIST6) $(REDIRECT 1 MARK)
$ip6t_m -A PSW_OUTPUT -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(dst $IPSET_BLACKLIST6) $(REDIRECT 1 MARK)
$ip6t_m -A PSW_OUTPUT -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(get_redirect_ip6t $LOCALHOST_UDP_PROXY_MODE 1 MARK)
# if [ "$PROXY_IPV6" == "1" ]; then
# $ip6t_m -A PSW_OUTPUT -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(dst $IPSET_SHUNTLIST6) $(REDIRECT 1 MARK)
# $ip6t_m -A PSW_OUTPUT -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(dst $IPSET_BLACKLIST6) $(REDIRECT 1 MARK)
# $ip6t_m -A PSW_OUTPUT -p udp $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(get_redirect_ip6t $LOCALHOST_UDP_PROXY_MODE 1 MARK)
$ip6t_m -A PSW $(comment "本机") -p udp -i lo $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(dst $IPSET_SHUNTLIST6) $(REDIRECT $UDP_REDIR_PORT $is_tproxy)
$ip6t_m -A PSW $(comment "本机") -p udp -i lo $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(dst $IPSET_BLACKLIST6) $(REDIRECT $UDP_REDIR_PORT $is_tproxy)
$ip6t_m -A PSW $(comment "本机") -p udp -i lo $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(get_redirect_ip6t $LOCALHOST_UDP_PROXY_MODE $UDP_REDIR_PORT $is_tproxy)
$ip6t_m -A PSW $(comment "本机") -p udp -i lo -j RETURN
fi
# $ip6t_m -A PSW $(comment "本机") -p udp -i lo $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(dst $IPSET_SHUNTLIST6) $(REDIRECT $UDP_REDIR_PORT $is_tproxy)
# $ip6t_m -A PSW $(comment "本机") -p udp -i lo $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(dst $IPSET_BLACKLIST6) $(REDIRECT $UDP_REDIR_PORT $is_tproxy)
# $ip6t_m -A PSW $(comment "本机") -p udp -i lo $(factor $UDP_REDIR_PORTS "-m multiport --dport") $(get_redirect_ip6t $LOCALHOST_UDP_PROXY_MODE $UDP_REDIR_PORT $is_tproxy)
# $ip6t_m -A PSW $(comment "本机") -p udp -i lo -j RETURN
# fi
fi
# 加载ACLS