mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-10 11:09:57 +08:00
luci-app-openclash: bump to 0.40.3
This commit is contained in:
parent
88fdc7e962
commit
a10bc629ef
@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-openclash
|
||||
PKG_VERSION:=0.40.2
|
||||
PKG_VERSION:=0.40.3
|
||||
PKG_RELEASE:=beta
|
||||
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>
|
||||
|
||||
|
@ -988,6 +988,16 @@ lan_ac()
|
||||
|
||||
}
|
||||
|
||||
wan_ac()
|
||||
{
|
||||
if [ -z "$1" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
ipset add "$2" "$1" 2>/dev/null
|
||||
|
||||
}
|
||||
|
||||
firewall_redirect_exclude()
|
||||
{
|
||||
local section="$1"
|
||||
@ -1040,7 +1050,6 @@ CONFIG_NAME=$(echo "$CONFIG_FILE" |awk -F '/' '{print $5}' 2>/dev/null)
|
||||
do_run_mode()
|
||||
{
|
||||
en_mode=$(uci get openclash.config.en_mode 2>/dev/null)
|
||||
proxy_mode=$(uci get openclash.config.proxy_mode 2>/dev/null)
|
||||
|
||||
if [ "$en_mode" = "fake-ip-tun" ]; then
|
||||
en_mode_tun="1"
|
||||
@ -1085,33 +1094,47 @@ do_run_core()
|
||||
if [ "$en_mode_tun" = "1" ] || [ "$en_mode_tun" = "3" ]; then
|
||||
ln -s /etc/openclash/core/clash_tun /etc/openclash/clash 2>/dev/null
|
||||
core_type="Tun"
|
||||
echo "检测到配置了【Tun】内核专属功能,调用【Tun】内核启动..." >$START_LOG
|
||||
sleep 2
|
||||
fi
|
||||
|
||||
if [ "$en_mode_tun" = "2" ]; then
|
||||
ln -s /etc/openclash/core/clash_game /etc/openclash/clash 2>/dev/null
|
||||
core_type="Game"
|
||||
echo "检测到配置了【Game】内核专属功能,调用【Game】内核启动..." >$START_LOG
|
||||
sleep 2
|
||||
fi
|
||||
|
||||
if [ "$proxy_mode" = "script" ] || [ "$rule_source" = "ConnersHua" ] || [ "$rule_source" = "lhie1" ]; then
|
||||
ln -s /etc/openclash/core/clash_tun /etc/openclash/clash 2>/dev/null
|
||||
core_type="Tun"
|
||||
echo "检测到配置了【Tun】内核专属功能,调用【Tun】内核启动..." >$START_LOG
|
||||
sleep 2
|
||||
fi
|
||||
|
||||
if [ -n "$(grep "^ \{0,\}rule-providers:" "$RULE_PROVIDER_FILE" 2>/dev/null)" ] && [ -n "$(grep "^ \{0,\}behavior" "$RULE_PROVIDER_FILE" 2>/dev/null |grep -v "^ \{0,\}#")" ]; then
|
||||
ln -s /etc/openclash/core/clash_tun /etc/openclash/clash 2>/dev/null
|
||||
core_type="Tun"
|
||||
echo "检测到配置了【Tun】内核专属功能,调用【Tun】内核启动..." >$START_LOG
|
||||
sleep 2
|
||||
fi
|
||||
|
||||
if [ ! -f "/etc/openclash/clash" ] && [ -f "/etc/openclash/core/clash" ] && [ -z "$core_type" ]; then
|
||||
ln -s /etc/openclash/core/clash /etc/openclash/clash 2>/dev/null
|
||||
echo "未检测到特殊配置,调用【Dev】内核启动..." >$START_LOG
|
||||
sleep 2
|
||||
fi
|
||||
|
||||
if [ ! -f "/etc/openclash/clash" ] && [ -f "/etc/openclash/core/clash_tun" ] && [ "$core_type" != "Game" ]; then
|
||||
ln -s /etc/openclash/core/clash_tun /etc/openclash/clash 2>/dev/null
|
||||
echo "检测到【Dev】内核未安装,调用【Tun】内核启动..." >$START_LOG
|
||||
sleep 2
|
||||
fi
|
||||
|
||||
if [ ! -f "/etc/openclash/clash" ] && [ -f "/etc/openclash/core/clash_game" ] && [ "$core_type" != "Tun" ]; then
|
||||
ln -s /etc/openclash/core/clash_game /etc/openclash/clash 2>/dev/null
|
||||
echo "检测到【Dev】内核未安装,调用【Game】内核启动..." >$START_LOG
|
||||
sleep 2
|
||||
fi
|
||||
|
||||
#权限检查
|
||||
@ -1183,6 +1206,12 @@ if [ "$operation_mode" = "redir-host" ] && [ "$en_mode" = "redir-host" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$(uci get openclash.config.wan_ac_black_ips 2>/dev/null)" ]; then
|
||||
ipset create wan_ac_black_ips hash:net
|
||||
config_load "openclash"
|
||||
config_list_foreach "config" "wan_ac_black_ips" wan_ac "wan_ac_black_ips"
|
||||
fi
|
||||
|
||||
#local
|
||||
ipset create localnetwork hash:net
|
||||
ipset add localnetwork 0.0.0.0/8
|
||||
@ -1205,6 +1234,7 @@ if [ -z "$en_mode_tun" ] || [ "$en_mode_tun" -eq 3 ]; then
|
||||
iptables -t nat -N openclash
|
||||
iptables -t nat -F openclash
|
||||
iptables -t nat -A openclash -m set --match-set localnetwork dst -j RETURN
|
||||
iptables -t nat -A openclash -m set --match-set wan_ac_black_ips dst -j RETURN >/dev/null 2>&1
|
||||
iptables -t nat -A openclash -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1
|
||||
iptables -t nat -A openclash -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1
|
||||
if [ "$en_mode" = "redir-host" ]; then
|
||||
@ -1223,6 +1253,7 @@ if [ -z "$en_mode_tun" ] || [ "$en_mode_tun" -eq 3 ]; then
|
||||
ip route add local 0.0.0.0/0 dev lo table "$PROXY_ROUTE_TABLE"
|
||||
iptables -t mangle -N openclash
|
||||
iptables -t mangle -A openclash -m set --match-set localnetwork dst -j RETURN
|
||||
iptables -t mangle -A openclash -m set --match-set wan_ac_black_ips dst -j RETURN >/dev/null 2>&1
|
||||
iptables -t mangle -A openclash -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1
|
||||
iptables -t mangle -A openclash -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1
|
||||
if [ "$en_mode" = "redir-host" ]; then
|
||||
@ -1308,6 +1339,7 @@ if [ -n "$en_mode_tun" ]; then
|
||||
config_load "firewall"
|
||||
config_foreach firewall_redirect_exclude "redirect"
|
||||
#其他流量
|
||||
iptables -t mangle -A openclash -m set --match-set wan_ac_black_ips dst -j RETURN >/dev/null 2>&1
|
||||
iptables -t mangle -A openclash -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1
|
||||
iptables -t mangle -A openclash -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1
|
||||
if [ "$en_mode" = "redir-host" ]; then
|
||||
@ -1407,6 +1439,7 @@ revert_firewall()
|
||||
ipset destroy china_ip_route >/dev/null 2>&1
|
||||
ipset destroy lan_ac_white_ips >/dev/null 2>&1
|
||||
ipset destroy lan_ac_black_ips >/dev/null 2>&1
|
||||
ipset destroy wan_ac_black_ips >/dev/null 2>&1
|
||||
}
|
||||
|
||||
get_config()
|
||||
@ -1417,6 +1450,7 @@ get_config()
|
||||
da_password=$(uci get openclash.config.dashboard_password 2>/dev/null)
|
||||
cn_port=$(uci get openclash.config.cn_port 2>/dev/null)
|
||||
proxy_port=$(uci get openclash.config.proxy_port 2>/dev/null)
|
||||
proxy_mode=$(uci get openclash.config.proxy_mode 2>/dev/null)
|
||||
ipv6_enable=$(uci get openclash.config.ipv6_enable 2>/dev/null)
|
||||
http_port=$(uci get openclash.config.http_port 2>/dev/null)
|
||||
socks_port=$(uci get openclash.config.socks_port 2>/dev/null)
|
||||
|
File diff suppressed because one or more lines are too long
@ -102,6 +102,7 @@ o.inputtitle = translate("Delete All File")
|
||||
o.inputstyle = "remove"
|
||||
o.write = function()
|
||||
luci.sys.call("rm -rf /etc/openclash/proxy_provider/* >/dev/null 2>&1")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "proxy-provider-file-manage"))
|
||||
end
|
||||
|
||||
o = a:option(Button, "Apply")
|
||||
|
@ -102,6 +102,7 @@ o.inputtitle = translate("Delete All File")
|
||||
o.inputstyle = "remove"
|
||||
o.write = function()
|
||||
luci.sys.call("rm -rf /etc/openclash/rule_provider/* >/dev/null 2>&1")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-file-manage"))
|
||||
end
|
||||
|
||||
o = a:option(Button, "Apply")
|
||||
|
@ -107,7 +107,7 @@ e.inputstyle="reset"
|
||||
Button.render(e,t,a)
|
||||
end
|
||||
btnrm.write=function(a,t)
|
||||
fs.unlink("/etc/openclash/rule_provider/"..e[t].filename)
|
||||
fs.unlink("/etc/openclash/rule_provider/"..e[t].lfilename)
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "rule-providers-manage"))
|
||||
end
|
||||
|
||||
|
@ -11,18 +11,18 @@ local uci = require "luci.model.uci".cursor()
|
||||
|
||||
m = Map(openclash, translate("Rule Providers and Groups"))
|
||||
m.pageaction = false
|
||||
m.description=translate("注意事项:<br/>游戏代理为测试功能,不保证可用性 \
|
||||
m.description=translate("注意事项:<br/>游戏代理为测试功能,不保证规则可用性 \
|
||||
<br/>准备步骤:\
|
||||
<br/>1、在《服务器与策略组管理》页面创建您准备使用的游戏策略组和游戏节点,并应用配置(节点添加时必须选择要加入的策略组),策略组类型建议:FallBack,游戏节点必须支持UDP \
|
||||
<br/>2、点击《游戏规则管理》按钮进入游戏规则列表下载您要使用的游戏规则 \
|
||||
<br/>3、在此页面上方设置您已下载的游戏规则的对应策略组并保存设置 \
|
||||
<br/>1、在《服务器与策略组管理》页面创建您准备使用的策略组和节点,并应用配置(节点添加时必须选择要加入的策略组),策略组类型建议:FallBack,游戏节点必须支持UDP \
|
||||
<br/>2、点击《管理第三个游戏规则》或者《管理第三方规则集》按钮进入规则列表下载您要使用的规则 \
|
||||
<br/>3、在此页面设置您已下载的规则的对应配置文件、策略组并保存设置 \
|
||||
<br/> \
|
||||
<br/>在普通模式下使用: \
|
||||
<br/>在普通模式下使用(仅游戏规则): \
|
||||
<br/>1、在《全局设置》-《模式设置》-《运行模式》中选择普通模式并启用UDP流量代理,然后重新启动 \
|
||||
<br/> \
|
||||
<br/>在TUN模式下使用: \
|
||||
<br/>1、在全局设置-版本更新标签先下载对应模式内核 \
|
||||
<br/>2、在《全局设置》-《模式设置》-《运行模式》中选择TUN模式或者游戏模式并重新启动 \
|
||||
<br/>1、在全局设置-版本更新标签先下载、安装对应模式内核 \
|
||||
<br/>2、在《全局设置》-《模式设置》-《运行模式》中选择混合模式、TUN模式或者游戏模式并重新启动 \
|
||||
<br/> \
|
||||
<br/>本页设置时如策略组为空,请先到《服务器与策略组管理》页面进行添加 \
|
||||
<br/> \
|
||||
|
@ -167,7 +167,13 @@ end
|
||||
|
||||
o = s:option(DummyValue, "udp", translate("UDP Support"))
|
||||
function o.cfgvalue(...)
|
||||
return Value.cfgvalue(...) or translate("None")
|
||||
if Value.cfgvalue(...) == "true" then
|
||||
return translate("支持")
|
||||
elseif Value.cfgvalue(...) == "false" then
|
||||
return translate("不支持")
|
||||
else
|
||||
return translate("None")
|
||||
end
|
||||
end
|
||||
|
||||
o = s:option(DummyValue,"server",translate("Ping Latency"))
|
||||
|
@ -72,7 +72,7 @@ o:value("gvisor", translate("Gvisor"))
|
||||
o.default = "system"
|
||||
|
||||
o = s:taboption("op_mode", ListValue, "proxy_mode", font_red..bold_on..translate("Proxy Mode")..bold_off..font_off)
|
||||
o.description = translate("Select Proxy Mode")
|
||||
o.description = translate("Select Proxy Mode, Use Script Mode Could Prevent Proxy BT traffics If Rules Support, eg.lhie1's")
|
||||
o:value("rule", translate("Rule Proxy Mode"))
|
||||
o:value("global", translate("Global Proxy Mode"))
|
||||
o:value("direct", translate("Direct Proxy Mode"))
|
||||
@ -243,7 +243,7 @@ end
|
||||
|
||||
---- Access Control
|
||||
if op_mode == "redir-host" then
|
||||
o = s:taboption("lan_ac", ListValue, "lan_ac_mode", translate("Access Control Mode"))
|
||||
o = s:taboption("lan_ac", ListValue, "lan_ac_mode", translate("LAN Access Control Mode"))
|
||||
o:value("0", translate("Black List Mode"))
|
||||
o:value("1", translate("White List Mode"))
|
||||
o.default=0
|
||||
@ -267,6 +267,10 @@ luci.ip.neighbors({ family = 4 }, function(entry)
|
||||
end)
|
||||
end
|
||||
|
||||
o = s:taboption("lan_ac", DynamicList, "wan_ac_black_ips", translate("WAN Bypassed Host List"))
|
||||
o.datatype = "ipaddr"
|
||||
o.description = translate("In The Fake-IP Mode, Only Pure IP Requests Are Supported")
|
||||
|
||||
---- Rules Settings
|
||||
if op_mode == "fake-ip" then
|
||||
o = s:taboption("rules", ListValue, "enable_custom_clash_rules", font_red..bold_on..translate("Custom Clash Rules(Access Control)")..bold_off..font_off)
|
||||
|
@ -134,8 +134,8 @@ msgstr "选择运行模式,Redir-Host模式下无法代理路由器自身流
|
||||
msgid "Proxy Mode"
|
||||
msgstr "*代理模式"
|
||||
|
||||
msgid "Select Proxy Mode"
|
||||
msgstr "选择默认代理模式"
|
||||
msgid "Select Proxy Mode, Use Script Mode Could Prevent Proxy BT traffics If Rules Support, eg.lhie1's"
|
||||
msgstr "选择默认代理模式,如果规则支持,使用脚本模式可以阻止代理BT流量,比如lhie1规则"
|
||||
|
||||
msgid "Rule Proxy Mode"
|
||||
msgstr "Rule【策略代理】"
|
||||
@ -972,8 +972,8 @@ msgstr "切换"
|
||||
msgid "Access Control"
|
||||
msgstr "访问控制"
|
||||
|
||||
msgid "Access Control Mode"
|
||||
msgstr "访问控制模式"
|
||||
msgid "LAN Access Control Mode"
|
||||
msgstr "局域网访问控制模式"
|
||||
|
||||
msgid "Black List Mode"
|
||||
msgstr "黑名单模式"
|
||||
@ -987,6 +987,12 @@ msgstr "不走代理的局域网LAN IP"
|
||||
msgid "LAN Proxied Host List"
|
||||
msgstr "走代理的局域网LAN IP"
|
||||
|
||||
msgid "WAN Bypassed Host List"
|
||||
msgstr "不走代理的WAN IP"
|
||||
|
||||
msgid "In The Fake-IP Mode, Only Pure IP Requests Are Supported"
|
||||
msgstr "在Fake-IP模式下,只支持过滤纯IP类型的请求"
|
||||
|
||||
msgid "Rule Match Proxy Mode"
|
||||
msgstr "*仅代理命中规则流量"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user