update 04-13 09:13
This commit is contained in:
parent
a4e1a1794b
commit
e59cf6afb2
|
@ -20404,6 +20404,7 @@ explore.studyperth.com.au
|
|||
exploreholidayexcellent.com
|
||||
explosivesnarlproprietor.com
|
||||
expmediadirect.com
|
||||
expmediadirect1.com
|
||||
expo123.net
|
||||
expocrack.com
|
||||
exponderle.pro
|
||||
|
@ -23622,6 +23623,7 @@ grursusy.com
|
|||
gruschiwere.com
|
||||
grvmedia.com
|
||||
grvsrdlowot.xyz
|
||||
grychiphidu.com
|
||||
grygrothapi.pro
|
||||
gryshathepe.pro
|
||||
gs.getui.com
|
||||
|
@ -52787,6 +52789,7 @@ track-east.mobileadtrading.com
|
|||
track-re01.com
|
||||
track-server-100.com
|
||||
track-srv.vietnamnet.vn
|
||||
track-tracingkit394853.com
|
||||
track-victoriadates.com
|
||||
track-web.net
|
||||
track.58.com
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=luci-app-openclash
|
||||
PKG_VERSION:=0.44.42
|
||||
PKG_VERSION:=0.45.02
|
||||
PKG_RELEASE:=beta
|
||||
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>
|
||||
|
||||
|
@ -100,6 +100,7 @@ define Package/$(PKG_NAME)/postrm
|
|||
rm -rf /tmp/dler* >/dev/null 2>&1
|
||||
rm -rf /tmp/etc/openclash >/dev/null 2>&1
|
||||
rm -rf /tmp/openclash_edit_file_name >/dev/null 2>&1
|
||||
sed -i '/OpenClash Append/,/OpenClash Append End/d' "/usr/lib/lua/luci/model/network.lua" >/dev/null 2>&1
|
||||
uci -q delete firewall.openclash
|
||||
uci -q commit firewall
|
||||
uci -q delete ucitrack.@openclash[-1]
|
||||
|
|
|
@ -22,6 +22,7 @@ function index()
|
|||
entry({"admin", "services", "openclash", "update_subscribe"},call("action_update_subscribe"))
|
||||
entry({"admin", "services", "openclash", "update_other_rules"},call("action_update_other_rules"))
|
||||
entry({"admin", "services", "openclash", "update_geoip"},call("action_update_geoip"))
|
||||
entry({"admin", "services", "openclash", "update_geosite"},call("action_update_geosite"))
|
||||
entry({"admin", "services", "openclash", "currentversion"},call("action_currentversion"))
|
||||
entry({"admin", "services", "openclash", "lastversion"},call("action_lastversion"))
|
||||
entry({"admin", "services", "openclash", "save_corever_branch"},call("action_save_corever_branch"))
|
||||
|
@ -94,9 +95,11 @@ local core_path_mode = uci:get("openclash", "config", "small_flash_memory")
|
|||
if core_path_mode ~= "1" then
|
||||
dev_core_path="/etc/openclash/core/clash"
|
||||
tun_core_path="/etc/openclash/core/clash_tun"
|
||||
meta_core_path="/etc/openclash/core/clash_meta"
|
||||
else
|
||||
dev_core_path="/tmp/etc/openclash/core/clash"
|
||||
tun_core_path="/tmp/etc/openclash/core/clash_tun"
|
||||
meta_core_path="/tmp/etc/openclash/core/clash_meta"
|
||||
end
|
||||
|
||||
local function is_running()
|
||||
|
@ -127,6 +130,10 @@ local function ipdb()
|
|||
return os.date("%Y-%m-%d %H:%M:%S",fs.mtime("/etc/openclash/Country.mmdb"))
|
||||
end
|
||||
|
||||
local function geosite()
|
||||
return os.date("%Y-%m-%d %H:%M:%S",fs.mtime("/etc/openclash/GeoSite.dat"))
|
||||
end
|
||||
|
||||
local function lhie1()
|
||||
return os.date("%Y-%m-%d %H:%M:%S",fs.mtime("/usr/share/openclash/res/lhie1.yaml"))
|
||||
end
|
||||
|
@ -140,7 +147,11 @@ local function ConnersHua_return()
|
|||
end
|
||||
|
||||
local function chnroute()
|
||||
return os.date("%Y-%m-%d %H:%M:%S",fs.mtime("/etc/openclash/rule_provider/ChinaIP.yaml"))
|
||||
return os.date("%Y-%m-%d %H:%M:%S",fs.mtime("/etc/openclash/china_ip_route.ipset"))
|
||||
end
|
||||
|
||||
local function chnroutev6()
|
||||
return os.date("%Y-%m-%d %H:%M:%S",fs.mtime("/etc/openclash/china_ip6_route.ipset"))
|
||||
end
|
||||
|
||||
local function daip()
|
||||
|
@ -210,11 +221,20 @@ else
|
|||
end
|
||||
end
|
||||
|
||||
local function coremetacv()
|
||||
if not nixio.fs.access(meta_core_path) then
|
||||
return "0"
|
||||
else
|
||||
return luci.sys.exec(string.format("%s -v 2>/dev/null |awk -F ' ' '{print $3}'",meta_core_path))
|
||||
end
|
||||
end
|
||||
|
||||
local function corelv()
|
||||
luci.sys.call("sh /usr/share/openclash/clash_version.sh")
|
||||
local core_lv = luci.sys.exec("sed -n 1p /tmp/clash_last_version 2>/dev/null")
|
||||
local core_tun_lv = luci.sys.exec("sed -n 2p /tmp/clash_last_version 2>/dev/null")
|
||||
return core_lv .. "," .. core_tun_lv
|
||||
local core_meta_lv = luci.sys.exec("sed -n 3p /tmp/clash_last_version 2>/dev/null")
|
||||
return core_lv .. "," .. core_tun_lv .. "," .. core_meta_lv
|
||||
end
|
||||
|
||||
local function opcv()
|
||||
|
@ -396,7 +416,11 @@ local function dler_login()
|
|||
fs.unlink(sub_path)
|
||||
fs.unlink("/tmp/dler_checkin")
|
||||
fs.unlink("/tmp/dler_info")
|
||||
return "402"
|
||||
if info and info.msg then
|
||||
return info.msg
|
||||
else
|
||||
return "login faild"
|
||||
end
|
||||
end
|
||||
else
|
||||
uci:delete("openclash", "config", "dler_token")
|
||||
|
@ -404,7 +428,7 @@ local function dler_login()
|
|||
fs.unlink(sub_path)
|
||||
fs.unlink("/tmp/dler_checkin")
|
||||
fs.unlink("/tmp/dler_info")
|
||||
return "402"
|
||||
return "email or passwd is wrong"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -427,10 +451,14 @@ local function dler_logout()
|
|||
fs.unlink("/tmp/dler_info")
|
||||
return info.ret
|
||||
else
|
||||
return "403"
|
||||
if info and info.msg then
|
||||
return info.msg
|
||||
else
|
||||
return "logout faild"
|
||||
end
|
||||
end
|
||||
else
|
||||
return "403"
|
||||
return "logout faild"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -876,7 +904,9 @@ function action_state()
|
|||
ConnersHua = ConnersHua(),
|
||||
ConnersHua_return = ConnersHua_return(),
|
||||
ipdb = ipdb(),
|
||||
geosite = geosite(),
|
||||
historychecktime = historychecktime(),
|
||||
chnroutev6 = chnroutev6(),
|
||||
chnroute = chnroute();
|
||||
})
|
||||
end
|
||||
|
@ -908,6 +938,7 @@ function action_update()
|
|||
coremodel = coremodel(),
|
||||
corecv = corecv(),
|
||||
coretuncv = coretuncv(),
|
||||
coremetacv = coremetacv(),
|
||||
opcv = opcv(),
|
||||
corever = corever(),
|
||||
release_branch = release_branch(),
|
||||
|
@ -961,6 +992,10 @@ function action_update_geoip()
|
|||
return luci.sys.call("/usr/share/openclash/openclash_ipdb.sh >/dev/null 2>&1")
|
||||
end
|
||||
|
||||
function action_update_geosite()
|
||||
return luci.sys.call("/usr/share/openclash/openclash_geosite.sh >/dev/null 2>&1")
|
||||
end
|
||||
|
||||
function act_ping()
|
||||
local e={}
|
||||
e.index=luci.http.formvalue("index")
|
||||
|
|
|
@ -95,6 +95,7 @@ o.description = font_red..bold_on..translate("Note: There is A Risk of Privacy L
|
|||
o:depends("sub_convert", "1")
|
||||
o:value("https://api.dler.io/sub", translate("api.dler.io")..translate("(Default)"))
|
||||
o:value("https://subconverter.herokuapp.com/sub", translate("subconverter.herokuapp.com")..translate("(Default)"))
|
||||
o:value("https://v.id9.cc/sub", translate("https://v.id9.cc/sub")..translate("(Support Vless By Pinyun)"))
|
||||
o:value("https://sub.id9.cc/sub", translate("sub.id9.cc"))
|
||||
o:value("https://api.wcc.best/sub", translate("api.wcc.best"))
|
||||
o.default = "https://api.dler.io/sub"
|
||||
|
|
|
@ -94,7 +94,7 @@ HTTP.setfilehandler(
|
|||
if meta and chunk then fd = nixio.open(proxy_pro_dir .. meta.file, "w") end
|
||||
elseif fp == "rule-provider" then
|
||||
if meta and chunk then fd = nixio.open(rule_pro_dir .. meta.file, "w") end
|
||||
elseif fp == "clash" or fp == "clash_tun" then
|
||||
elseif fp == "clash" or fp == "clash_tun" or fp == "clash_meta" then
|
||||
create_core_dir=fs.mkdir(core_dir)
|
||||
if meta and chunk then fd = nixio.open(core_dir .. meta.file, "w") end
|
||||
elseif fp == "backup-file" then
|
||||
|
@ -132,7 +132,7 @@ HTTP.setfilehandler(
|
|||
um.value = translate("File saved to") .. ' "/etc/openclash/proxy_provider/"'
|
||||
elseif fp == "rule-provider" then
|
||||
um.value = translate("File saved to") .. ' "/etc/openclash/rule_provider/"'
|
||||
elseif fp == "clash" or fp == "clash_tun" then
|
||||
elseif fp == "clash" or fp == "clash_tun" or fp == "clash_meta" then
|
||||
if string.lower(string.sub(meta.file, -7, -1)) == ".tar.gz" then
|
||||
os.execute(string.format("tar -C '/etc/openclash/core/core' -xzf %s >/dev/null 2>&1", (core_dir .. meta.file)))
|
||||
fs.unlink(core_dir .. meta.file)
|
||||
|
|
|
@ -14,7 +14,7 @@ m.pageaction = false
|
|||
m.description=translate("Attention:")..
|
||||
"<br/>"..translate("The game proxy is a test function and does not guarantee the availability of rules")..
|
||||
"<br/>"..translate("Preparation steps:")..
|
||||
"<br/>"..translate("1. In the <server and policy group management> page, create the policy group and node you are going to use, and apply the configuration (when adding nodes, you must select the policy group you want to join). Policy group type suggestion: fallback, game nodes must support UDP")..
|
||||
"<br/>"..translate("1. In the <server and policy group management> page, create the policy group and node you are going to use, and apply the configuration (when adding nodes, you must select the policy group you want to join). Policy group type suggestion: fallback, game nodes must be support UDP and not a Vmess")..
|
||||
"<br/>"..translate("2. Click the <manage third party game rules> or <manage third party rule set> button to enter the rule list and download the rules you want to use")..
|
||||
"<br/>"..translate("3. On this page, set the corresponding configuration file and policy group of the rule you have downloaded, and save the settings")..
|
||||
"<br/>"..translate("4. Install the TUN core")..
|
||||
|
|
|
@ -117,6 +117,7 @@ o = s:option(ListValue, "type", translate("Server Node Type"))
|
|||
o:value("ss", translate("Shadowsocks"))
|
||||
o:value("ssr", translate("ShadowsocksR"))
|
||||
o:value("vmess", translate("Vmess"))
|
||||
o:value("vless", translate("Vless"))
|
||||
o:value("trojan", translate("trojan"))
|
||||
o:value("snell", translate("Snell"))
|
||||
o:value("socks5", translate("Socks5"))
|
||||
|
@ -162,6 +163,7 @@ o:depends("type", "ss")
|
|||
|
||||
o = s:option(ListValue, "cipher_ssr", translate("Encrypt Method"))
|
||||
for _, v in ipairs(encrypt_methods_ssr) do o:value(v) end
|
||||
o:value("dummy", "none")
|
||||
o.rmempty = true
|
||||
o:depends("type", "ssr")
|
||||
|
||||
|
@ -194,10 +196,11 @@ o.rmempty = true
|
|||
o:depends("type", "vmess")
|
||||
|
||||
-- VmessId
|
||||
o = s:option(Value, "uuid", translate("VmessId (UUID)"))
|
||||
o = s:option(Value, "uuid", translate("UUID"))
|
||||
o.rmempty = true
|
||||
o.default = uuid
|
||||
o:depends("type", "vmess")
|
||||
o:depends("type", "vless")
|
||||
|
||||
o = s:option(ListValue, "udp", translate("UDP Enable"))
|
||||
o.rmempty = true
|
||||
|
@ -207,6 +210,7 @@ o:value("false")
|
|||
o:depends("type", "ss")
|
||||
o:depends("type", "ssr")
|
||||
o:depends("type", "vmess")
|
||||
o:depends("type", "vless")
|
||||
o:depends("type", "socks5")
|
||||
o:depends("type", "trojan")
|
||||
o:depends({type = "snell", snell_version = "3"})
|
||||
|
@ -228,6 +232,14 @@ o:value("tls")
|
|||
o:value("http")
|
||||
o:depends("type", "snell")
|
||||
|
||||
o = s:option(ListValue, "obfs_vless", translate("obfs-mode"))
|
||||
o.rmempty = true
|
||||
o.default = "none"
|
||||
o:value("none")
|
||||
o:value("ws", translate("websocket (ws)"))
|
||||
o:value("grpc", translate("grpc"))
|
||||
o:depends("type", "vless")
|
||||
|
||||
o = s:option(ListValue, "obfs_vmess", translate("obfs-mode"))
|
||||
o.rmempty = true
|
||||
o.default = "none"
|
||||
|
@ -288,11 +300,13 @@ o = s:option(Value, "ws_opts_path", translate("ws-opts-path"))
|
|||
o.rmempty = true
|
||||
o.placeholder = translate("/path")
|
||||
o:depends("obfs_vmess", "websocket")
|
||||
o:depends("obfs_vless", "ws")
|
||||
|
||||
o = s:option(DynamicList, "ws_opts_headers", translate("ws-opts-headers"))
|
||||
o.rmempty = true
|
||||
o.placeholder = translate("Host: v2ray.com")
|
||||
o:depends("obfs_vmess", "websocket")
|
||||
o:depends("obfs_vless", "ws")
|
||||
|
||||
o = s:option(Value, "max_early_data", translate("max-early-data"))
|
||||
o.rmempty = true
|
||||
|
@ -317,6 +331,7 @@ o:depends("obfs_vmess", "grpc")
|
|||
o:depends("type", "socks5")
|
||||
o:depends("type", "http")
|
||||
o:depends("type", "trojan")
|
||||
o:depends("type", "vless")
|
||||
|
||||
-- [[ TLS ]]--
|
||||
o = s:option(ListValue, "tls", translate("tls"))
|
||||
|
@ -326,6 +341,7 @@ o:value("true")
|
|||
o:value("false")
|
||||
o:depends("obfs", "websocket")
|
||||
o:depends("type", "vmess")
|
||||
o:depends("type", "vless")
|
||||
o:depends("type", "socks5")
|
||||
o:depends("type", "http")
|
||||
|
||||
|
@ -336,6 +352,14 @@ o.placeholder = translate("example.com")
|
|||
o:depends({obfs_vmess = "websocket", tls = "true"})
|
||||
o:depends({obfs_vmess = "grpc", tls = "true"})
|
||||
o:depends({obfs_vmess = "none", tls = "true"})
|
||||
o:depends("type", "vless")
|
||||
|
||||
o = s:option(Value, "vless_flow", translate("flow"))
|
||||
o.rmempty = true
|
||||
o.default = "xtls-rprx-direct"
|
||||
o:value("xtls-rprx-direct")
|
||||
o:value("xtls-rprx-origin")
|
||||
o:depends("obfs_vless", "none")
|
||||
|
||||
o = s:option(Value, "keep_alive", translate("keep-alive"))
|
||||
o.rmempty = true
|
||||
|
@ -386,6 +410,7 @@ o.datatype = "host"
|
|||
o.placeholder = translate("example")
|
||||
o:depends("obfs_trojan", "grpc")
|
||||
o:depends("obfs_vmess", "grpc")
|
||||
o:depends("obfs_vless", "grpc")
|
||||
|
||||
-- [[ trojan-ws-path ]]--
|
||||
o = s:option(Value, "trojan_ws_path", translate("Path"))
|
||||
|
|
|
@ -16,11 +16,17 @@ bold_off = [[</strong>]]
|
|||
|
||||
local op_mode = string.sub(luci.sys.exec('uci get openclash.config.operation_mode 2>/dev/null'),0,-2)
|
||||
if not op_mode then op_mode = "redir-host" end
|
||||
local lan_ip=SYS.exec("uci -q get network.lan.ipaddr |awk -F '/' '{print $1}' 2>/dev/null |tr -d '\n' || ip addr show 2>/dev/null | grep -w 'inet' | grep 'global' | grep 'brd' | grep -Eo 'inet [0-9\.]+' | awk '{print $2}' | head -n 1 | tr -d '\n'")
|
||||
local lan_ip = SYS.exec("uci -q get network.lan.ipaddr |awk -F '/' '{print $1}' 2>/dev/null |tr -d '\n' || ip address show $(uci -q -p /tmp/state get network.lan.ifname) | grep -w 'inet' 2>/dev/null |grep -Eo 'inet [0-9\.]+' | awk '{print $2}' | tr -d '\n' || ip addr show 2>/dev/null | grep -w 'inet' | grep 'global' | grep 'brd' | grep -Eo 'inet [0-9\.]+' | awk '{print $2}' | head -n 1 | tr -d '\n'")
|
||||
|
||||
m = Map("openclash", translate("Global Settings(Will Modify The Config File Or Subscribe According To The Settings On This Page)"))
|
||||
m.pageaction = false
|
||||
m.description=translate("To restore the default configuration, try accessing:").." <a href='javascript:void(0)' onclick='javascript:restore_config(this)'>http://"..lan_ip.."/cgi-bin/luci/admin/services/openclash/restore</a>"
|
||||
m.description = translate("Note: To restore the default configuration, try accessing:").." <a href='javascript:void(0)' onclick='javascript:restore_config(this)'>http://"..lan_ip.."/cgi-bin/luci/admin/services/openclash/restore</a>"..
|
||||
"<br/>"..translate("Note: It is not recommended to enable IPv6 and related services for routing. Most of the network connection problems reported so far are related to it")..
|
||||
"<br/>"..font_green..translate("Note: Turning on secure DNS in the browser will cause abnormal shunting, please be careful to turn it off")..font_off..
|
||||
"<br/>"..font_green..translate("Note: Some software will modify the device HOSTS, which will cause abnormal shunt, please pay attention to check")..font_off..
|
||||
"<br/>"..font_green..translate("Note: Game proxy please use nodes except Vmess")..font_off..
|
||||
"<br/>"..translate("Note: The default proxy routes local traffic, BT, PT download, etc., please use redir mode as much as possible and pay attention to traffic avoidance")..
|
||||
"<br/>"..translate("Note: If the connection is abnormal, please follow the steps on this page to check first")..": ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://github.com/vernesong/OpenClash/wiki/%E7%BD%91%E7%BB%9C%E8%BF%9E%E6%8E%A5%E5%BC%82%E5%B8%B8%E6%97%B6%E6%8E%92%E6%9F%A5%E5%8E%9F%E5%9B%A0\")'>"..translate("Click to the page").."</a>"
|
||||
|
||||
s = m:section(TypedSection, "openclash")
|
||||
s.anonymous = true
|
||||
|
@ -28,6 +34,7 @@ s.anonymous = true
|
|||
s:tab("op_mode", translate("Operation Mode"))
|
||||
s:tab("settings", translate("General Settings"))
|
||||
s:tab("dns", translate("DNS Setting"))
|
||||
s:tab("meta", translate("Meta Settings"))
|
||||
s:tab("stream_enhance", translate("Streaming Enhance"))
|
||||
s:tab("lan_ac", translate("Access Control"))
|
||||
if op_mode == "fake-ip" then
|
||||
|
@ -37,7 +44,7 @@ s:tab("rules", translate("Rules Setting"))
|
|||
end
|
||||
s:tab("dashboard", translate("Dashboard Settings"))
|
||||
s:tab("rules_update", translate("Rules Update"))
|
||||
s:tab("geo_update", translate("GEOIP Update"))
|
||||
s:tab("geo_update", translate("GEO Update"))
|
||||
s:tab("chnr_update", translate("Chnroute Update"))
|
||||
s:tab("auto_restart", translate("Auto Restart"))
|
||||
s:tab("version_update", translate("Version Update"))
|
||||
|
@ -362,6 +369,118 @@ function custom_domain_dns_policy.write(self, section, value)
|
|||
end
|
||||
end
|
||||
|
||||
-- Meta
|
||||
o = s:taboption("meta", Flag, "enable_meta_core", font_red..bold_on..translate("Enable Meta Core")..bold_off..font_off)
|
||||
o.description = font_red..bold_on..translate("Some Premium Core Features are Unavailable, For Other More Useful Functions Go Wiki:")..bold_off..font_off.." ".."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://clashmeta.gitbook.io/meta/\")'>https://clashmeta.gitbook.io/meta/</a>"
|
||||
o.default = 0
|
||||
|
||||
o = s:taboption("meta", Flag, "enable_meta_sniffer", font_red..bold_on..translate("Enable Sniffer")..bold_off..font_off)
|
||||
o.description = font_red..bold_on..translate("Sniffer Will Prevent Domain Name Proxy and DNS Hijack Failure")..bold_off..font_off
|
||||
o.default = 1
|
||||
o:depends("enable_meta_core", "1")
|
||||
|
||||
o = s:taboption("meta", Flag, "enable_meta_sniffer_force", translate("Force Sniffer"))
|
||||
o.description = translate("Override All Dns Query")
|
||||
o.default = 0
|
||||
o:depends("enable_meta_sniffer", "1")
|
||||
|
||||
o = s:taboption("meta", ListValue, "geodata_loader", translate("Geodata Loader Mode"))
|
||||
o:value("memconservative", translate("Memconservative"))
|
||||
o:value("standard", translate("Standard"))
|
||||
o.default = "memconservative"
|
||||
o:depends("enable_meta_core", "1")
|
||||
|
||||
o = s:taboption("meta", Flag, "enable_geoip_dat", translate("Enable GeoIP Dat"))
|
||||
o.description = translate("Replace GEOIP MMDB With GEOIP Dat, Large Size File, Need Download First")
|
||||
o.default = 0
|
||||
o:depends("enable_meta_core", "1")
|
||||
|
||||
o = s:taboption("meta", Flag, "geoip_auto_update", translate("Auto Update GeoIP Dat"))
|
||||
o.default = 0
|
||||
o:depends("enable_geoip_dat", "1")
|
||||
|
||||
o = s:taboption("meta", ListValue, "geoip_update_week_time", translate("Update Time (Every Week)"))
|
||||
o:value("*", translate("Every Day"))
|
||||
o:value("1", translate("Every Monday"))
|
||||
o:value("2", translate("Every Tuesday"))
|
||||
o:value("3", translate("Every Wednesday"))
|
||||
o:value("4", translate("Every Thursday"))
|
||||
o:value("5", translate("Every Friday"))
|
||||
o:value("6", translate("Every Saturday"))
|
||||
o:value("0", translate("Every Sunday"))
|
||||
o.default = "1"
|
||||
o:depends("geoip_auto_update", "1")
|
||||
|
||||
o = s:taboption("meta", ListValue, "geoip_update_day_time", translate("Update time (every day)"))
|
||||
for t = 0,23 do
|
||||
o:value(t, t..":00")
|
||||
end
|
||||
o.default = "0"
|
||||
o:depends("geoip_auto_update", "1")
|
||||
|
||||
o = s:taboption("meta", Value, "geoip_custom_url")
|
||||
o.title = translate("Custom GeoIP Dat URL")
|
||||
o.rmempty = true
|
||||
o.description = translate("Custom GeoIP Dat URL, Click Button Below To Refresh After Edit")
|
||||
o:value("https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat", translate("Loyalsoldier-Version")..translate("(Default)"))
|
||||
o.default = "https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat"
|
||||
o:depends("geoip_auto_update", "1")
|
||||
|
||||
o = s:taboption("meta", Button, translate("GEOIP Dat Update"))
|
||||
o.title = translate("Update GeoIP Dat")
|
||||
o.inputtitle = translate("Check And Update")
|
||||
o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
m.uci:set("openclash", "config", "enable", 1)
|
||||
m.uci:commit("openclash")
|
||||
SYS.call("/usr/share/openclash/openclash_geoip.sh >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
o:depends("geoip_auto_update", "1")
|
||||
|
||||
o = s:taboption("meta", Flag, "geosite_auto_update", translate("Auto Update GeoSite Database"))
|
||||
o.default = 0
|
||||
o:depends("enable_meta_core", "1")
|
||||
|
||||
o = s:taboption("meta", ListValue, "geosite_update_week_time", translate("Update Time (Every Week)"))
|
||||
o:value("*", translate("Every Day"))
|
||||
o:value("1", translate("Every Monday"))
|
||||
o:value("2", translate("Every Tuesday"))
|
||||
o:value("3", translate("Every Wednesday"))
|
||||
o:value("4", translate("Every Thursday"))
|
||||
o:value("5", translate("Every Friday"))
|
||||
o:value("6", translate("Every Saturday"))
|
||||
o:value("0", translate("Every Sunday"))
|
||||
o.default = "1"
|
||||
o:depends("geosite_auto_update", "1")
|
||||
|
||||
o = s:taboption("meta", ListValue, "geosite_update_day_time", translate("Update time (every day)"))
|
||||
for t = 0,23 do
|
||||
o:value(t, t..":00")
|
||||
end
|
||||
o.default = "0"
|
||||
o:depends("geosite_auto_update", "1")
|
||||
|
||||
o = s:taboption("meta", Value, "geosite_custom_url")
|
||||
o.title = translate("Custom GeoSite URL")
|
||||
o.rmempty = true
|
||||
o.description = translate("Custom GeoSite Data URL, Click Button Below To Refresh After Edit")
|
||||
o:value("https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat", translate("Loyalsoldier-Version")..translate("(Default)"))
|
||||
o.default = "https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat"
|
||||
o:depends("geosite_auto_update", "1")
|
||||
|
||||
o = s:taboption("meta", Button, translate("GEOSITE Update"))
|
||||
o.title = translate("Update GeoSite Database")
|
||||
o.inputtitle = translate("Check And Update")
|
||||
o.inputstyle = "reload"
|
||||
o.write = function()
|
||||
m.uci:set("openclash", "config", "enable", 1)
|
||||
m.uci:commit("openclash")
|
||||
SYS.call("/usr/share/openclash/openclash_geosite.sh >/dev/null 2>&1 &")
|
||||
HTTP.redirect(DISP.build_url("admin", "services", "openclash"))
|
||||
end
|
||||
o:depends("geosite_auto_update", "1")
|
||||
|
||||
---- Access Control
|
||||
if op_mode == "redir-host" then
|
||||
o = s:taboption("lan_ac", ListValue, "lan_ac_mode", translate("LAN Access Control Mode"))
|
||||
|
@ -467,7 +586,7 @@ end
|
|||
|
||||
--Stream Enhance
|
||||
o = s:taboption("stream_enhance", Flag, "stream_domains_prefetch", font_red..bold_on..translate("Prefetch Netflix, Disney Plus Domains")..bold_off..font_off)
|
||||
o.description = translate("Prevent Some Devices From Directly Using IP Access To Cause Unlocking Failure")
|
||||
o.description = translate("Prevent Some Devices From Directly Using IP Access To Cause Unlocking Failure, Recommend Use meta Sniffer Function")
|
||||
o.default = 0
|
||||
|
||||
o = s:taboption("stream_enhance", Value, "stream_domains_prefetch_interval", translate("Domains Prefetch Interval(min)"))
|
||||
|
@ -508,7 +627,7 @@ o:depends("stream_auto_select_netflix", "1")
|
|||
o = s:taboption("stream_enhance", Value, "stream_auto_select_region_key_netflix", translate("Unlock Region Filter"))
|
||||
o.default = ""
|
||||
o.placeholder = "HK|SG|TW"
|
||||
o.description = translate("It Will Be Selected Region According To The Regex")
|
||||
o.description = translate("It Will Be Selected Region(Country Shortcode) According To The Regex")
|
||||
o:depends("stream_auto_select_netflix", "1")
|
||||
|
||||
o = s:taboption("stream_enhance", Value, "stream_auto_select_node_key_netflix", translate("Unlock Nodes Filter"))
|
||||
|
@ -536,7 +655,7 @@ o:depends("stream_auto_select_disney", "1")
|
|||
o = s:taboption("stream_enhance", Value, "stream_auto_select_region_key_disney", translate("Unlock Region Filter"))
|
||||
o.default = ""
|
||||
o.placeholder = "HK|SG|TW"
|
||||
o.description = translate("It Will Be Selected Region According To The Regex")
|
||||
o.description = translate("It Will Be Selected Region(Country Shortcode) According To The Regex")
|
||||
o:depends("stream_auto_select_disney", "1")
|
||||
|
||||
o = s:taboption("stream_enhance", Value, "stream_auto_select_node_key_disney", translate("Unlock Nodes Filter"))
|
||||
|
@ -564,7 +683,7 @@ o:depends("stream_auto_select_ytb", "1")
|
|||
o = s:taboption("stream_enhance", Value, "stream_auto_select_region_key_ytb", translate("Unlock Region Filter"))
|
||||
o.default = ""
|
||||
o.placeholder = "HK|US"
|
||||
o.description = translate("It Will Be Selected Region According To The Regex")
|
||||
o.description = translate("It Will Be Selected Region(Country Shortcode) According To The Regex")
|
||||
o:depends("stream_auto_select_ytb", "1")
|
||||
|
||||
o = s:taboption("stream_enhance", Value, "stream_auto_select_node_key_ytb", translate("Unlock Nodes Filter"))
|
||||
|
@ -592,7 +711,7 @@ o:depends("stream_auto_select_prime_video", "1")
|
|||
o = s:taboption("stream_enhance", Value, "stream_auto_select_region_key_prime_video", translate("Unlock Region Filter"))
|
||||
o.default = ""
|
||||
o.placeholder = "HK|US|SG"
|
||||
o.description = translate("It Will Be Selected Region According To The Regex")
|
||||
o.description = translate("It Will Be Selected Region(Country Shortcode) According To The Regex")
|
||||
o:depends("stream_auto_select_prime_video", "1")
|
||||
|
||||
o = s:taboption("stream_enhance", Value, "stream_auto_select_node_key_prime_video", translate("Unlock Nodes Filter"))
|
||||
|
@ -642,7 +761,7 @@ o:depends("stream_auto_select_hbo_max", "1")
|
|||
o = s:taboption("stream_enhance", Value, "stream_auto_select_region_key_hbo_max", translate("Unlock Region Filter"))
|
||||
o.default = ""
|
||||
o.placeholder = "US"
|
||||
o.description = translate("It Will Be Selected Region According To The Regex")
|
||||
o.description = translate("It Will Be Selected Region(Country Shortcode) According To The Regex")
|
||||
o:depends("stream_auto_select_hbo_max", "1")
|
||||
|
||||
o = s:taboption("stream_enhance", Value, "stream_auto_select_node_key_hbo_max", translate("Unlock Nodes Filter"))
|
||||
|
@ -670,7 +789,7 @@ o:depends("stream_auto_select_hbo_go_asia", "1")
|
|||
o = s:taboption("stream_enhance", Value, "stream_auto_select_region_key_hbo_go_asia", translate("Unlock Region Filter"))
|
||||
o.default = ""
|
||||
o.placeholder = "HK|SG|TW"
|
||||
o.description = translate("It Will Be Selected Region According To The Regex")
|
||||
o.description = translate("It Will Be Selected Region(Country Shortcode) According To The Regex")
|
||||
o:depends("stream_auto_select_hbo_go_asia", "1")
|
||||
|
||||
o = s:taboption("stream_enhance", Value, "stream_auto_select_node_key_hbo_go_asia", translate("Unlock Nodes Filter"))
|
||||
|
@ -698,7 +817,7 @@ o:depends("stream_auto_select_tvb_anywhere", "1")
|
|||
o = s:taboption("stream_enhance", Value, "stream_auto_select_region_key_tvb_anywhere", translate("Unlock Region Filter"))
|
||||
o.default = ""
|
||||
o.placeholder = "HK|SG|TW"
|
||||
o.description = translate("It Will Be Selected Region According To The Regex")
|
||||
o.description = translate("It Will Be Selected Region(Country Shortcode) According To The Regex")
|
||||
o:depends("stream_auto_select_tvb_anywhere", "1")
|
||||
|
||||
o = s:taboption("stream_enhance", Value, "stream_auto_select_node_key_tvb_anywhere", translate("Unlock Nodes Filter"))
|
||||
|
@ -726,7 +845,7 @@ o:depends("stream_auto_select_dazn", "1")
|
|||
o = s:taboption("stream_enhance", Value, "stream_auto_select_region_key_dazn", translate("Unlock Region Filter"))
|
||||
o.default = ""
|
||||
o.placeholder = "DE"
|
||||
o.description = translate("It Will Be Selected Region According To The Regex")
|
||||
o.description = translate("It Will Be Selected Region(Country Shortcode) According To The Regex")
|
||||
o:depends("stream_auto_select_dazn", "1")
|
||||
|
||||
o = s:taboption("stream_enhance", Value, "stream_auto_select_node_key_dazn", translate("Unlock Nodes Filter"))
|
||||
|
@ -754,7 +873,7 @@ o:depends("stream_auto_select_paramount_plus", "1")
|
|||
o = s:taboption("stream_enhance", Value, "stream_auto_select_region_key_paramount_plus", translate("Unlock Region Filter"))
|
||||
o.default = ""
|
||||
o.placeholder = "US"
|
||||
o.description = translate("It Will Be Selected Region According To The Regex")
|
||||
o.description = translate("It Will Be Selected Region(Country Shortcode) According To The Regex")
|
||||
o:depends("stream_auto_select_paramount_plus", "1")
|
||||
|
||||
o = s:taboption("stream_enhance", Value, "stream_auto_select_node_key_paramount_plus", translate("Unlock Nodes Filter"))
|
||||
|
@ -782,7 +901,7 @@ o:depends("stream_auto_select_discovery_plus", "1")
|
|||
o = s:taboption("stream_enhance", Value, "stream_auto_select_region_key_discovery_plus", translate("Unlock Region Filter"))
|
||||
o.default = ""
|
||||
o.placeholder = "US"
|
||||
o.description = translate("It Will Be Selected Region According To The Regex")
|
||||
o.description = translate("It Will Be Selected Region(Country Shortcode) According To The Regex")
|
||||
o:depends("stream_auto_select_discovery_plus", "1")
|
||||
|
||||
o = s:taboption("stream_enhance", Value, "stream_auto_select_node_key_discovery_plus", translate("Unlock Nodes Filter"))
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -57,6 +57,9 @@
|
|||
}
|
||||
else {
|
||||
s.innerHTML ="<font color='red'><strong>"+"<%:Dler Cloud Login Faild%>"+"</strong></font>";
|
||||
if (status.dler_login) {
|
||||
alert("<%:Dler Cloud Login Faild%>: "+status.dler_login)
|
||||
}
|
||||
window.location.href='<%="settings?tab.openclash.config=dlercloud"%>';
|
||||
}
|
||||
}
|
||||
|
@ -79,6 +82,9 @@
|
|||
}
|
||||
else {
|
||||
s.innerHTML ="<font color='red'><strong>"+"<%:Dler Cloud Logout Faild%>"+"</strong></font>";
|
||||
if (status.dler_logout) {
|
||||
alert("<%:Dler Cloud Logout Faild%>: "+status.dler_logout)
|
||||
}
|
||||
}
|
||||
}
|
||||
btn.disabled = false;
|
||||
|
|
|
@ -197,7 +197,7 @@ function import_ssr_url(btn, urlname, sid) {
|
|||
document.getElementsByName('cbid.openclash.' + sid + '.server')[0].value = ssm[1];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.port')[0].value = ssm[2];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.protocol')[0].value = ssm[3];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.cipher_ssr')[0].value = ssm[4];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.cipher_ssr')[0].value = (ssm[4] == "none" ? "dummy" : ssm[4]);
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_ssr')[0].value = ssm[5];
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.password')[0].value = b64decsafe(ssm[6]);
|
||||
document.getElementsByName('cbid.openclash.' + sid + '.obfs_param')[0].value = dictvalue(pdict, 'obfsparam');
|
||||
|
|
|
@ -155,12 +155,14 @@
|
|||
<tr id="hid_2">
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_close_all_connection"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_reload_firewall"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_flush_fakeip_cache"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_update_subscribe"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_one_key_update"><%:Collecting data...%></p></td>
|
||||
</tr>
|
||||
<tr id="hid_3">
|
||||
<td width="50%" colspan="2" align="center"><p style="margin: 10px 0; text-align: center" id="_update_other_rules"><%:Collecting data...%></p></td>
|
||||
<td width="50%" colspan="2" align="center"><p style="margin: 10px 0; text-align: center" id="_update_geoip"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_update_other_rules"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_update_geoip"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_update_geosite"><%:Collecting data...%></p></td>
|
||||
<td width="25%" align="center"><p style="margin: 10px 0; text-align: center" id="_one_key_update"><%:Collecting data...%></p></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
@ -173,7 +175,8 @@
|
|||
</td></tr>
|
||||
<tr><td width="25%"><%:Node Select Backup%></td><td width="25%" align="left" id="_historychecktime"><%:Collecting data...%></td><td width="25%"><%:lhie1 Rule Update%></td><td width="25%" align="left" id="_lhie1"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"><%:ConnersHua Rule Update%></td><td width="25%" align="left" id="_ConnersHua"><%:Collecting data...%></td><td width="25%"><%:ConnersHua Return Rule Update%></td><td width="25%" align="left" id="_ConnersHua_return"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"><%:Mainland IP Update%></td><td width="25%" align="left" id="_chnroute"><%:Collecting data...%></td><td width="25%"><%:GEOIP(By MaxMind)Data Update%></td><td width="25%" align="left" id="_ipdb"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"><%:Mainland IP Update%></td><td width="25%" align="left" id="_chnroute"><%:Collecting data...%></td><td width="25%"><%: Mainland IPv6 Update%></td><td width="25%" align="left" id="_chnroutev6"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"><%:GEOIP Data Update%></td><td width="25%" align="left" id="_ipdb"><%:Collecting data...%></td><td width="25%"><%:GeoSite Data Update%></td><td width="25%" align="left" id="_geosite"><%:Collecting data...%></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
|
@ -192,11 +195,15 @@
|
|||
var update_subscribe = document.getElementById('_update_subscribe');
|
||||
var update_other_rules = document.getElementById('_update_other_rules');
|
||||
var update_geoip = document.getElementById('_update_geoip');
|
||||
var update_geosite = document.getElementById('_update_geosite');
|
||||
var flush_fakeip_cache= document.getElementById('_flush_fakeip_cache');
|
||||
var ipdb = document.getElementById('_ipdb');
|
||||
var geosite = document.getElementById('_geosite');
|
||||
var lhie1 = document.getElementById('_lhie1');
|
||||
var ConnersHua = document.getElementById('_ConnersHua');
|
||||
var ConnersHua_return = document.getElementById('_ConnersHua_return');
|
||||
var chnroute = document.getElementById('_chnroute');
|
||||
var chnroutev6 = document.getElementById('_chnroutev6');
|
||||
var historychecktime = document.getElementById('_historychecktime');
|
||||
var hid_1 = document.getElementById("hid_1");
|
||||
var hid_2 = document.getElementById("hid_2");
|
||||
|
@ -245,10 +252,12 @@
|
|||
webo.innerHTML = status.web ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Open Panel%>" onclick="return net_dashboard(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
close_all_connection.innerHTML = status.clash ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Close All Connections%>" onclick="return b_close_all_connection(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
reload_firewall.innerHTML = status.clash ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Reload Firewall Rules%>" onclick="return b_reload_firewall(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
flush_fakeip_cache.innerHTML = status.clash ? '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Flush Fake-IP Cache%>" onclick="return b_flush_fakeip_cache(this)"/>' : '<b style=color:red><%:Not Running%></b>';
|
||||
one_key_update.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check All Components Update%>" onclick="return all_one_key_update(this)"/>';
|
||||
update_subscribe.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check Config Update%>" onclick="return b_update_subscribe(this)"/>';
|
||||
update_other_rules.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check Third Party Rules Update%>" onclick="return b_update_other_rules(this)"/>';
|
||||
update_geoip.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check GEOIP Data Update%>" onclick="return b_update_geoip(this)"/>';
|
||||
update_geosite.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check GeoSite Data Update%>" onclick="return b_update_geosite(this)"/>';
|
||||
if (status.daip && window.location.hostname == status.daip) {
|
||||
daip.innerHTML = status.daip ? "<b style=color:green>"+status.daip+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
dapo.innerHTML = status.cn_port ? "<b style=color:green>"+status.cn_port+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
|
||||
|
@ -389,10 +398,12 @@
|
|||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "state")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
ipdb.innerHTML = status.ipdb ? "<b style=color:green>"+status.ipdb+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
geosite.innerHTML = status.geosite ? "<b style=color:green>"+status.geosite+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
lhie1.innerHTML = status.lhie1 ? "<b style=color:green>"+status.lhie1+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
ConnersHua.innerHTML = status.ConnersHua ? "<b style=color:green>"+status.ConnersHua+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
ConnersHua_return.innerHTML = status.ConnersHua_return ? "<b style=color:green>"+status.ConnersHua_return+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
chnroute.innerHTML = status.chnroute ? "<b style=color:green>"+status.chnroute+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
chnroutev6.innerHTML = status.chnroutev6 ? "<b style=color:green>"+status.chnroutev6+"</b>" : "<b style=color:red>"+"<%:File Not Exist%>"+"</b>";
|
||||
if ( status.historychecktime != "0" ) {
|
||||
historychecktime.innerHTML = "<b style=color:green>"+status.historychecktime+"</b>";
|
||||
}
|
||||
|
@ -568,6 +579,51 @@
|
|||
});
|
||||
};
|
||||
|
||||
function b_update_geosite(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Checking...%>';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "update_geosite")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Check GeoSite Data Update%>';
|
||||
}
|
||||
else {
|
||||
btn.disabled = false;
|
||||
btn.value = '<%:Check GeoSite Data Update%>';
|
||||
}
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
function b_flush_fakeip_cache(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
btn.value = '<%:Flushing...%> ';
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash","flush_fakeip_cache")%>',
|
||||
null,
|
||||
function(x,status)
|
||||
{
|
||||
if ( x && x.status == 200 ) {
|
||||
if(status.flush_status == "0" || status.flush_status != "")
|
||||
{
|
||||
btn.value = '<%:Flush Failed%>';
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
btn.value = '<%:Flush Successful%>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
btn.value = '<%:Flush Timeout%>';
|
||||
}
|
||||
}
|
||||
);
|
||||
btn.disabled = false;
|
||||
return false;
|
||||
};
|
||||
|
||||
function b_update_subscribe(btn)
|
||||
{
|
||||
btn.disabled = true;
|
||||
|
@ -732,7 +788,7 @@
|
|||
XHR.poll(6, '<%=luci.dispatcher.build_url("admin", "services", "openclash", "startlog")%>', null, function(x, status) {
|
||||
if ( x && x.status == 200 ) {
|
||||
if ( status.startlog == "\n" || status.startlog == "" ) {
|
||||
var rdmdl=Math.floor(Math.random()*12)+1;
|
||||
var rdmdl=Math.floor(Math.random()*16)+1;
|
||||
if(rdmdl==1)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: You can modify the profile on the profile page (for content that is not taken over)%></font></b>';
|
||||
|
@ -781,6 +837,22 @@
|
|||
{
|
||||
startlog.innerHTML = '<b><font><%:Tip: you can update the version in the global settings page%></font></b>';
|
||||
}
|
||||
if(rdmdl==13)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Note: It is not recommended to enable IPv6 and related services for routing. Most of the network connection problems reported so far are related to it%></font></b>';
|
||||
}
|
||||
if(rdmdl==14)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Note: Turning on secure DNS in the browser will cause abnormal shunting, please be careful to turn it off%></font></b>';
|
||||
}
|
||||
if(rdmdl==15)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Note: Some software will modify the device HOSTS, which will cause abnormal shunt, please pay attention to check%></font></b>';
|
||||
}
|
||||
if(rdmdl==16)
|
||||
{
|
||||
startlog.innerHTML = '<b><font><%:Note: The default proxy routes local traffic, BT, PT download, etc., please use redir mode as much as possible and pay attention to traffic avoidance%></font></b>';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
.sub_tab{
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
color: black;
|
||||
font-size: 12px;
|
||||
text-align: left;
|
||||
margin-top: 5px;
|
||||
|
@ -13,7 +12,6 @@
|
|||
.sub_tab_show{
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
color: black;
|
||||
font-size: 12px;
|
||||
margin-top: 5px;
|
||||
text-align: left;
|
||||
|
@ -38,51 +36,46 @@
|
|||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
|
||||
var new_sub_info_get_<%=idname%> = true;
|
||||
sub_info_get_<%=idname%>();
|
||||
|
||||
function sub_info_get_<%=idname%>()
|
||||
{
|
||||
|
||||
if (document.getElementById('<%=idname%>').innerHTML != "" && ! new_sub_info_get_<%=idname%>) {
|
||||
clearTimeout(s_<%=idname%>);
|
||||
return
|
||||
}
|
||||
else {
|
||||
if (localStorage.getItem("<%=filename%>")) {
|
||||
var save_info = JSON.parse(localStorage.getItem("<%=filename%>"));
|
||||
document.getElementById('<%=idname%>').className = "sub_tab_show";
|
||||
if (save_info.sub_info == "No Sub Info Found") {
|
||||
document.getElementById('<%=idname%>').innerHTML = "<span><%:No Sub Info Found%></span>";
|
||||
}
|
||||
else {
|
||||
document.getElementById('<%=idname%>').innerHTML = "<%:Plan Traffic%>" + ": " + "<span style=color:green>" + save_info.used + "</span> | <span style=color:green>" + save_info.total + "</span> <br/> <%:Plan Expiration Time%>: " + "<span style=color:green>" + save_info.expire + "</span>";
|
||||
}
|
||||
if (localStorage.getItem("<%=filename%>")) {
|
||||
var save_info = JSON.parse(localStorage.getItem("<%=filename%>"));
|
||||
document.getElementById('<%=idname%>').className = "sub_tab_show";
|
||||
if (save_info.sub_info == "No Sub Info Found") {
|
||||
document.getElementById('<%=idname%>').innerHTML = "<span><%:No Sub Info Found%></span>";
|
||||
}
|
||||
else {
|
||||
document.getElementById('<%=idname%>').innerHTML = "<%:Plan Traffic%>" + ": " + "<span style=color:green>" + save_info.used + "</span> | <span style=color:green>" + save_info.total + "</span> <br/> <%:Plan Expiration Time%>: " + "<span style=color:green>" + save_info.expire + "</span>";
|
||||
}
|
||||
};
|
||||
|
||||
if (s_<%=idname%>) { clearTimeout(s_<%=idname%>); };
|
||||
|
||||
XHR.get('<%=luci.dispatcher.build_url("admin", "services", "openclash", "sub_info_get")%>', {filename: "<%=filename%>"}, function(x, status) {
|
||||
if (x && x.status == 200 && status.sub_info != "" && status.sub_info != "No Sub Info Found") {
|
||||
localStorage.setItem("<%=filename%>",JSON.stringify(status));
|
||||
new_sub_info_get_<%=idname%> = false;
|
||||
document.getElementById('<%=idname%>').className = "sub_tab_show";
|
||||
document.getElementById('<%=idname%>').innerHTML = "<%:Plan Traffic%>" + ": " + "<span style=color:green>" + status.used + "</span> | <span style=color:green>" + status.total + "</span> <br/> <%:Plan Expiration Time%>: " + "<span style=color:green>" + status.expire + "</span>";
|
||||
}
|
||||
else if ( x && x.status == 200 && status.sub_info == "No Sub Info Found" ) {
|
||||
localStorage.setItem("<%=filename%>",JSON.stringify(status));
|
||||
new_sub_info_get_<%=idname%> = false;
|
||||
document.getElementById('<%=idname%>').className = "sub_tab_show";
|
||||
document.getElementById('<%=idname%>').innerHTML = "<span><%:No Sub Info Found%></span>";
|
||||
clearTimeout(s_<%=idname%>);
|
||||
return
|
||||
}
|
||||
else {
|
||||
document.getElementById('<%=idname%>').className = "sub_tab_show";
|
||||
document.getElementById('<%=idname%>').innerHTML = "<span style=color:red><%:Sub Info Get Error%></span>";
|
||||
if (document.getElementById('<%=idname%>').innerHTML == "") {
|
||||
document.getElementById('<%=idname%>').className = "sub_tab_show";
|
||||
document.getElementById('<%=idname%>').innerHTML = "<span style=color:red><%:Sub Info Get Error%></span>";
|
||||
}
|
||||
var s_<%=idname%> = setTimeout("sub_info_get_<%=idname%>()",1000*120);
|
||||
return
|
||||
};
|
||||
});
|
||||
|
||||
var s_<%=idname%> = setTimeout("sub_info_get_<%=idname%>()",1000*600);
|
||||
var s_<%=idname%> = setTimeout("sub_info_get_<%=idname%>()",1000*1800);
|
||||
};
|
||||
|
||||
//]]></script>
|
||||
|
|
|
@ -47,6 +47,13 @@
|
|||
</td></tr>
|
||||
<tr><td width="25%">[TUN] <%:Current Core%></td><td width="25%" align="left" id="CORE_TUN_CV"><%:Collecting data...%></td><td width="25%">[TUN] <%:Latest Core%></td><td width="25%" align="left" id="CORE_TUN_LV"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"><%:Update Core%></td><td width="25%" align="left" id="core_tun_up"><%:Collecting data...%></td><td width="25%"><%:Download Latest Core%></td><td width="25%" align="left" id="ma_core_tun_up"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="100%" colspan="4">
|
||||
<p align="center">
|
||||
<b><%:Core path:%>/etc/openclash/core/clash_meta</b>
|
||||
</p>
|
||||
</td></tr>
|
||||
<tr><td width="25%">[Meta] <%:Current Core%></td><td width="25%" align="left" id="CORE_META_CV"><%:Collecting data...%></td><td width="25%">[Meta] <%:Latest Core%></td><td width="25%" align="left" id="CORE_META_LV"><%:Collecting data...%></td></tr>
|
||||
<tr><td width="25%"><%:Update Core%></td><td width="25%" align="left" id="core_meta_up"><%:Collecting data...%></td><td width="25%"><%:Download Latest Core%></td><td width="25%" align="left" id="ma_core_meta_up"><%:Collecting data...%></td></tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<fieldset class="cbi-section">
|
||||
|
@ -95,14 +102,18 @@
|
|||
var core_lv = document.getElementById('CORE_LV');
|
||||
var core_tun_cv = document.getElementById('CORE_TUN_CV');
|
||||
var core_tun_lv = document.getElementById('CORE_TUN_LV');
|
||||
var core_meta_cv = document.getElementById('CORE_META_CV');
|
||||
var core_meta_lv = document.getElementById('CORE_META_LV');
|
||||
var op_cv = document.getElementById('OP_CV');
|
||||
var op_lv = document.getElementById('OP_LV');
|
||||
var core_up = document.getElementById('core_up');
|
||||
var core_tun_up = document.getElementById('core_tun_up');
|
||||
var core_meta_up = document.getElementById('core_meta_up');
|
||||
var op_up = document.getElementById('op_up');
|
||||
var update_tip = document.getElementById('update_tip');
|
||||
var ma_core_up = document.getElementById('ma_core_up');
|
||||
var ma_core_tun_up = document.getElementById('ma_core_tun_up');
|
||||
var ma_core_meta_up = document.getElementById('ma_core_meta_up');
|
||||
var ma_op_up = document.getElementById('ma_op_up');
|
||||
var restore = document.getElementById('restore');
|
||||
var backup = document.getElementById('backup');
|
||||
|
@ -154,10 +165,20 @@
|
|||
else {
|
||||
core_tun_cv.innerHTML = "<b style=color:red><%:Unknown%></b>";
|
||||
}
|
||||
if ( status.coremetacv == "0" ) {
|
||||
core_meta_cv.innerHTML = "<b><font color=red><%:File Not Exist%></font></b>";
|
||||
}
|
||||
else if (status.coremetacv != "") {
|
||||
core_meta_cv.innerHTML = "<b><font color=green>"+status.coremetacv+"</font></b>";
|
||||
}
|
||||
else {
|
||||
core_meta_cv.innerHTML = "<b><font color=red><%:Unknown%></font></b>";
|
||||
}
|
||||
var corelv = status.corelv;
|
||||
var arr_core = corelv.split(",");
|
||||
var corelvis = arr_core[0];
|
||||
var coretunlvis = arr_core[1];
|
||||
var coremetalvis = arr_core[2];
|
||||
if (corelvis != status.corecv && corelvis != "") {
|
||||
core_lv.innerHTML = "<b style=color:green>"+corelvis+"<%:<New>%></b>";
|
||||
}
|
||||
|
@ -176,6 +197,15 @@
|
|||
else {
|
||||
core_tun_lv.innerHTML = "<b style=color:red><%:Unknown%></b>";
|
||||
}
|
||||
if (coremetalvis != status.coremetacv && coremetalvis != "") {
|
||||
core_meta_lv.innerHTML = "<b><font color=green>"+coremetalvis+"<%:<New>%></font></b>";
|
||||
}
|
||||
else if (coremetalvis != "" && coremetalvis == status.coremetacv) {
|
||||
core_meta_lv.innerHTML = "<b><font color=green>"+coremetalvis+"</font></b>";
|
||||
}
|
||||
else {
|
||||
core_meta_lv.innerHTML = "<b><font color=red><%:Unknown%></font></b>";
|
||||
}
|
||||
var oplv = status.oplv;
|
||||
var arr_op = oplv.split(",");
|
||||
var oplvis = arr_op[0];
|
||||
|
@ -195,9 +225,11 @@
|
|||
|
||||
core_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check And Update%>" onclick="return core_update(this,\'Dev\')"/>';
|
||||
core_tun_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check And Update%>" onclick="return core_update(this,\'TUN\')"/>';
|
||||
core_meta_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check And Update%>" onclick="return core_update(this,\'Meta\')"/>';
|
||||
op_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Check And Update%>" onclick="return op_update(this)"/>';
|
||||
ma_core_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Download%>" onclick="return ma_core_update(this,\'Dev\')"/>';
|
||||
ma_core_tun_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Download%>" onclick="return ma_core_update(this,\'TUN\')"/>';
|
||||
ma_core_meta_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Download%>" onclick="return ma_core_update(this,\'Meta\')"/>';
|
||||
ma_op_up.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reload" value="<%:Download%>" onclick="return ma_op_update(this)"/>';
|
||||
restore.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:Restore Default Config%>" onclick="return restore_config(this)"/>';
|
||||
one_key_update.innerHTML = '<input type="button" class="btn cbi-button cbi-button-reset" value="<%:One Click Check Update%>" onclick="return all_one_key_update(this)"/>';
|
||||
|
@ -260,6 +292,10 @@
|
|||
alert('<%:Failed to get the latest version. Please try again later!%>')
|
||||
}
|
||||
}
|
||||
if (type == "Meta") {
|
||||
url4='https://raw.githubusercontent.com/vernesong/OpenClash/'+r+'/core-lateset/meta/clash-'+status.corever+'.tar.gz';
|
||||
window.location.href=url4;
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert('<%:No Compiled Version is Selected, Please Select on The Top and Try Again!%>')
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
<option value="rule-provider"><%:Rule Provider File%></option>
|
||||
<option value="clash">[Dev] <%:Core File%></option>
|
||||
<option value="clash_tun">[TUN] <%:Core File%></option>
|
||||
<option value="clash_meta">[Meta] <%:Core File%></option>
|
||||
<option value="backup-file"><%:Backup File%></option>
|
||||
</select>
|
||||
<input class="cbi-input-file" style="width: 30%" type="file" id="ulfile" name="ulfile" />
|
||||
|
|
|
@ -36,7 +36,7 @@ msgid "General Settings"
|
|||
msgstr "常规设置"
|
||||
|
||||
msgid "DNS Setting"
|
||||
msgstr "DNS设置"
|
||||
msgstr "DNS 设置"
|
||||
|
||||
msgid "Config Update"
|
||||
msgstr "配置文件订阅"
|
||||
|
@ -50,9 +50,6 @@ msgstr "第三方规则订阅"
|
|||
msgid "Dashboard Settings"
|
||||
msgstr "外部控制"
|
||||
|
||||
msgid "GEOIP数据库订阅"
|
||||
msgstr "外部控制"
|
||||
|
||||
msgid "Enable"
|
||||
msgstr "启用"
|
||||
|
||||
|
@ -432,14 +429,20 @@ msgstr "管理页面映射端口"
|
|||
msgid "Port For Dashboard Login From Public Network"
|
||||
msgstr "设置映射端口,便于从公网访问时自动登录"
|
||||
|
||||
msgid "GEOIP Update"
|
||||
msgstr "GEOIP数据库订阅"
|
||||
msgid "GEO Update"
|
||||
msgstr "GEO 数据库订阅"
|
||||
|
||||
msgid "Auto Update GEOIP Database"
|
||||
msgstr "自动更新GEOIP数据库"
|
||||
msgstr "自动更新 GEOIP 数据库"
|
||||
|
||||
msgid "Update GEOIP Database"
|
||||
msgstr "更新GEOIP数据库"
|
||||
msgstr "更新 GEOIP 数据库"
|
||||
|
||||
msgid "Auto Update GeoSite Database"
|
||||
msgstr "自动更新 GeoSite 数据库"
|
||||
|
||||
msgid "Update GeoSite Database"
|
||||
msgstr "更新 GeoSite 数据库"
|
||||
|
||||
msgid "Auto Update Chnroute Lists"
|
||||
msgstr "自动更新大陆白名单"
|
||||
|
@ -1116,7 +1119,7 @@ msgid "Small Flash Memory"
|
|||
msgstr "小闪存模式"
|
||||
|
||||
msgid "Move Core And GEOIP Data File To /tmp/etc/openclash For Small Flash Memory Device"
|
||||
msgstr "针对闪存空间不够的设备,移动内核和GEOIP数据库文件到 /tmp/etc/openclash 文件夹"
|
||||
msgstr "针对闪存空间不够的设备,移动内核和 GEOIP 数据库等文件到 /tmp/etc/openclash 文件夹"
|
||||
|
||||
msgid "Round-robin"
|
||||
msgstr "轮询(轮流使用全部代理)"
|
||||
|
@ -1172,14 +1175,20 @@ msgstr "ConnersHua 规则更新日期"
|
|||
msgid "Mainland IP Update"
|
||||
msgstr "大陆IP白名单 更新日期"
|
||||
|
||||
msgid "Mainland IPv6 Update"
|
||||
msgstr "大陆IPv6白名单 更新日期"
|
||||
|
||||
msgid "lhie1 Rule Update"
|
||||
msgstr "lhie1 规则更新日期"
|
||||
|
||||
msgid "ConnersHua Return Rule Update"
|
||||
msgstr "ConnersHua 回国规则更新日期"
|
||||
|
||||
msgid "GEOIP(By MaxMind)Data Update"
|
||||
msgstr "GEOIP(By MaxMind)数据库日期"
|
||||
msgid "GEOIP Data Update"
|
||||
msgstr "GEOIP 数据库日期"
|
||||
|
||||
msgid "GeoSite Data Update"
|
||||
msgstr "GeoSite 数据库日期"
|
||||
|
||||
msgid "No Backup"
|
||||
msgstr "暂未备份"
|
||||
|
@ -1224,7 +1233,10 @@ msgid "Check Third Party Rules Update"
|
|||
msgstr "第三方规则检查更新"
|
||||
|
||||
msgid "Check GEOIP Data Update"
|
||||
msgstr "GEOIP数据库检查更新"
|
||||
msgstr "GEOIP 数据库检查更新"
|
||||
|
||||
msgid "Check GeoSite Data Update"
|
||||
msgstr "GeoSite 数据库检查更新"
|
||||
|
||||
msgid "Check and update all Cores and plug-ins?"
|
||||
msgstr "确定要一键检查并更新所有内核及插件吗?"
|
||||
|
@ -1425,7 +1437,10 @@ msgid ",Try Enable If Network Loopback"
|
|||
msgstr ", 如发生回环死机请尝试启用"
|
||||
|
||||
msgid "Custom GEOIP URL"
|
||||
msgstr "GEOIP数据库更新URL"
|
||||
msgstr "GEOIP 数据库更新URL"
|
||||
|
||||
msgid "Custom GeoSite URL"
|
||||
msgstr "GeoSite 数据库更新URL"
|
||||
|
||||
msgid "Custom Chnroute6 Lists URL"
|
||||
msgstr "大陆IPv6段更新URL"
|
||||
|
@ -1434,7 +1449,10 @@ msgid "Custom Chnroute Lists URL"
|
|||
msgstr "大陆IP段更新URL"
|
||||
|
||||
msgid "Custom GEOIP Data URL, Click Button Below To Refresh After Edit"
|
||||
msgstr "自定义GEOIP数据库的更新来源,编辑后点击下方按钮生效"
|
||||
msgstr "自定义 GEOIP 数据库的更新来源,编辑后点击下方按钮生效"
|
||||
|
||||
msgid "Custom GeoSite Data URL, Click Button Below To Refresh After Edit"
|
||||
msgstr "自定义 GeoSite 数据库的更新来源,编辑后点击下方按钮生效"
|
||||
|
||||
msgid "Custom Chnroute Lists URL, Click Button Below To Refresh After Edit"
|
||||
msgstr "自定义大陆IP段的更新来源,编辑后点击下方按钮生效"
|
||||
|
@ -1730,6 +1748,42 @@ msgstr "大陆IP白名单下载失败,请检查网络或稍后再试..."
|
|||
msgid "Chnroute6 Cidr List Update Error, Please Try Again Later..."
|
||||
msgstr "大陆IPv6白名单下载失败,请检查网络或稍后再试..."
|
||||
|
||||
msgid "Start Downloading GeoSite Database..."
|
||||
msgstr "开始下载 GeoSite 数据库..."
|
||||
|
||||
msgid "GeoSite Database Download Success, Check Updated..."
|
||||
msgstr "GeoSite 数据库下载成功,检查数据库版本是否更新..."
|
||||
|
||||
msgid "GeoSite Database Has Been Updated, Starting To Replace The Old Version..."
|
||||
msgstr "GeoSite 数据库版本有更新,开始替换数据库版本..."
|
||||
|
||||
msgid "GeoSite Database Update Successful!"
|
||||
msgstr "GeoSite 数据库更新成功!"
|
||||
|
||||
msgid "Updated GeoSite Database No Change, Do Nothing..."
|
||||
msgstr "GeoSite 数据库版本没有更新,停止继续操作..."
|
||||
|
||||
msgid "GeoSite Database Update Error, Please Try Again Later..."
|
||||
msgstr "GeoSite 数据库下载失败,请检查网络或稍后再试..."
|
||||
|
||||
msgid "Start Downloading GeoIP Dat..."
|
||||
msgstr "开始下载 GeoIP Dat 数据库..."
|
||||
|
||||
msgid "GeoIP Dat Download Success, Check Updated..."
|
||||
msgstr "GeoIP Dat 数据库下载成功,检查数据库版本是否更新..."
|
||||
|
||||
msgid "GeoIP Dat Has Been Updated, Starting To Replace The Old Version..."
|
||||
msgstr "GeoIP Dat 数据库版本有更新,开始替换数据库版本..."
|
||||
|
||||
msgid "GeoIP Dat Update Successful!"
|
||||
msgstr "GeoIP Dat 数据库更新成功!"
|
||||
|
||||
msgid "Updated GeoIP Dat No Change, Do Nothing..."
|
||||
msgstr "GeoIP Dat 数据库版本没有更新,停止继续操作..."
|
||||
|
||||
msgid "GeoIP Dat Update Error, Please Try Again Later..."
|
||||
msgstr "GeoIP Dat 数据库下载失败,请检查网络或稍后再试..."
|
||||
|
||||
msgid "Start Downloading Geoip Database..."
|
||||
msgstr "开始下载 GEOIP 数据库..."
|
||||
|
||||
|
@ -1743,7 +1797,7 @@ msgid "Geoip Database Update Successful!"
|
|||
msgstr "GEOIP 数据库更新成功!"
|
||||
|
||||
msgid "Updated Geoip Database No Change, Do Nothing..."
|
||||
msgstr "数据库版本没有更新,停止继续操作..."
|
||||
msgstr "GEOIP 数据库版本没有更新,停止继续操作..."
|
||||
|
||||
msgid "Geoip Database Update Error, Please Try Again Later..."
|
||||
msgstr "GEOIP 数据库下载失败,请检查网络或稍后再试..."
|
||||
|
@ -1865,20 +1919,26 @@ msgstr "错误:配置文件格式校验失败..."
|
|||
msgid "Tip: Detected The Exclusive Function of The TUN Core, Use TUN Core to Start..."
|
||||
msgstr "提示: 检测到配置了 TUN 内核专属功能,调用 TUN 内核启动..."
|
||||
|
||||
msgid "Tip: Detected The Exclusive Function of The Meta Core, Use Meta Core to Start..."
|
||||
msgstr "提示: 检测到配置了 Meta 内核专属功能,调用 Meta 内核启动..."
|
||||
|
||||
msgid "Tip: No Special Configuration Detected, Use Dev Core to Start..."
|
||||
msgstr "提示: 未检测到特殊配置,调用 Dev 内核启动..."
|
||||
|
||||
msgid "Tip: Detected that the Dev Core is not Installed, Use TUN Core to Start..."
|
||||
msgstr "提示: 检测到 Dev 内核未安装,调用 TUN 内核启动..."
|
||||
|
||||
msgid "Tip: Detected that the Dev Core is not Installed, Use Game Core to Start..."
|
||||
msgstr "提示: 检测到 Dev 内核未安装,调用 Game 内核启动..."
|
||||
|
||||
msgid "Tip: Detected that the Dev Core is not Installed, Use Game Core to Start..."
|
||||
msgstr "提示: 检测到 Dev 内核未安装,调用 Game 内核启动..."
|
||||
msgid "Tip: Detected that the Dev Core is not Installed, Use Meta Core to Start..."
|
||||
msgstr "提示: 检测到 Dev 内核未安装,调用 Meta 内核启动..."
|
||||
|
||||
msgid "Tip: Detected that the GEOIP Database is not Installed, Ready to Download..."
|
||||
msgstr "提示: 检测到GEOIP数据库文件不存在,准备开始下载..."
|
||||
msgstr "提示: 检测到 GEOIP 数据库文件不存在,准备开始下载..."
|
||||
|
||||
msgid "Tip: Detected that the GEOSITE Database is not Installed, Ready to Download..."
|
||||
msgstr "提示: 检测到 GEOSITE 数据库文件不存在,准备开始下载..."
|
||||
|
||||
msgid "Tip: Detected that the GEOIP Dat is not Installed, Ready to Download..."
|
||||
msgstr "提示: 检测到 GEOIP Dat 数据库文件不存在,准备开始下载..."
|
||||
|
||||
msgid "Tip: Detected that the Core is not Installed, Ready to Download..."
|
||||
msgstr "提示: 检测到内核文件不存在,准备开始下载..."
|
||||
|
@ -2030,8 +2090,8 @@ msgstr "游戏代理为测试功能,不保证规则可用性"
|
|||
msgid "Preparation steps:"
|
||||
msgstr "准备步骤:"
|
||||
|
||||
msgid "1. In the <server and policy group management> page, create the policy group and node you are going to use, and apply the configuration (when adding nodes, you must select the policy group you want to join). Policy group type suggestion: fallback, game nodes must support UDP"
|
||||
msgstr "1、在《服务器与策略组管理》页面创建您准备使用的策略组和节点,并应用配置(节点添加时必须选择要加入的策略组),策略组类型建议:FallBack,游戏节点必须支持UDP"
|
||||
msgid "1. In the <server and policy group management> page, create the policy group and node you are going to use, and apply the configuration (when adding nodes, you must select the policy group you want to join). Policy group type suggestion: fallback, game nodes must be support UDP and not a Vmess"
|
||||
msgstr "1、在《服务器与策略组管理》页面创建您准备使用的策略组和节点,并应用配置(节点添加时必须选择要加入的策略组),策略组类型建议:FallBack,游戏节点必须支持UDP且不是Vmess节点"
|
||||
|
||||
msgid "2. Click the <manage third party game rules> or <manage third party rule set> button to enter the rule list and download the rules you want to use"
|
||||
msgstr "2、点击《管理第三方游戏规则》或者《管理第三方规则集》按钮进入规则列表下载您要使用的规则"
|
||||
|
@ -2057,8 +2117,8 @@ msgstr "如需自定义外部配置文件(订阅转换模板),请按照说明
|
|||
msgid "If you have a recommended external configuration file (subscription conversion template), you can modify by following The file format of /usr/share/opencrash/res/sub_ini.list and pr"
|
||||
msgstr "如您有值得推荐的外部配置文件(订阅转换模板),可以按照 /usr/share/openclash/res/sub_ini.list 的文件格式修改后提交PR"
|
||||
|
||||
msgid "To restore the default configuration, try accessing:"
|
||||
msgstr "如遇到配置丢失或者需要还原默认配置,请尝试访问地址:"
|
||||
msgid "Note: To restore the default configuration, try accessing:"
|
||||
msgstr "注意: 如遇到配置丢失或者需要还原默认配置,请尝试访问地址:"
|
||||
|
||||
msgid "Take Effect If Fallback DNS Setted, Prevent DNS Pollution"
|
||||
msgstr "只有在配置文件设置了 Fallback 组的DNS时才会生效,正确设置可以有效防止DNS污染"
|
||||
|
@ -2234,8 +2294,8 @@ msgstr "错误:设置自定义规则失败,"
|
|||
msgid "Error: Set BT/P2P DIRECT Rules Failed,"
|
||||
msgstr "错误:设置仅代理命中规则流量(BT/P2P直连)失败,"
|
||||
|
||||
msgid "Error: Set 198.18.0.1/16 REJECT Rule Failed,"
|
||||
msgstr "错误:设置198.18.0.1/16(REJECT)规则失败,"
|
||||
msgid "Error: Set Loop Protect Rules Failed,"
|
||||
msgstr "错误:设置防回环规则失败,"
|
||||
|
||||
msgid "Error: Set lhie1 Rules Failed,"
|
||||
msgstr "错误:设置第三方规则(lhie1)失败,"
|
||||
|
@ -2387,8 +2447,8 @@ msgstr "点击更新规则"
|
|||
msgid "Prefetch Netflix, Disney Plus Domains"
|
||||
msgstr "实验性:预解析 Netflix、Disney Plus 域名"
|
||||
|
||||
msgid "Prevent Some Devices From Directly Using IP Access To Cause Unlocking Failure"
|
||||
msgstr "防止部分设备直接使用IP访问导致DNS解锁失败"
|
||||
msgid "Prevent Some Devices From Directly Using IP Access To Cause Unlocking Failure, Recommend Use meta Sniffer Function"
|
||||
msgstr "防止部分设备直接使用IP访问导致DNS解锁失败,建议换用 meta 内核的探测功能"
|
||||
|
||||
msgid "Update Preset Domains List"
|
||||
msgstr "更新预置域名列表"
|
||||
|
@ -2579,11 +2639,11 @@ msgstr "解锁检测失败!开始进行解锁节点自动选择..."
|
|||
msgid "It Will Be Searched According To The Regex When Auto Search Group Fails"
|
||||
msgstr "策略组自动获取失败时将会根据正则表达式进行匹配"
|
||||
|
||||
msgid "It Will Be Selected Region According To The Regex"
|
||||
msgstr "解锁区域将会根据正则表达式进行匹配"
|
||||
msgid "It Will Be Selected Region(Country Shortcode) According To The Regex"
|
||||
msgstr "解锁区域(国家简码)将会根据正则表达式进行匹配"
|
||||
|
||||
msgid "It Will Be Selected Nodes According To The Regex"
|
||||
msgstr "解锁节点将会根据正则表达式进行匹配"
|
||||
msgstr "解锁节点的名字将会根据正则表达式进行匹配"
|
||||
|
||||
msgid "not support unlock!"
|
||||
msgstr "不支持解锁!"
|
||||
|
@ -2748,4 +2808,91 @@ msgid "Only Supported for Rule Mode, ALL Functions In Stream Enhance Tag Will No
|
|||
msgstr "仅支持规则(Rule)模式,其他模式默认分流,禁用后将无法使用流媒体增强标签中的所有功能"
|
||||
|
||||
msgid "Error: Set Router Self Proxy Rule Failed,"
|
||||
msgstr "错误:修改路由自身代理规则失败,"
|
||||
msgstr "错误:修改路由自身代理规则失败,"
|
||||
|
||||
msgid "Error: Streaming Unlock Now Disabled, Need Start From Luci Page, Exiting..."
|
||||
msgstr "错误:流媒体解锁处于禁用状态,请在LUCI界面启用,退出..."
|
||||
|
||||
msgid "Error: Streaming Unlock Has No Parameter of Type, Exiting..."
|
||||
msgstr "错误:流媒体解锁没有指定需要检测的流媒体类型,退出..."
|
||||
|
||||
msgid "Error: Streaming Unlock Could not Work Because of Router-Self Proxy Disabled, Exiting..."
|
||||
msgstr "错误:因为禁用了代理路由器自身流量,流媒体解锁无法工作,退出..."
|
||||
|
||||
msgid "Error: Multiple Scripts Running, Exiting..."
|
||||
msgstr "错误:多个脚本运行中,退出..."
|
||||
|
||||
msgid "Error: Streaming DNS Prefetch Could not Work Because of Router-Self Proxy Disabled, Exiting..."
|
||||
msgstr "错误:因为禁用了代理路由器自身流量,预解析无法工作,退出..."
|
||||
|
||||
msgid "Enable Meta Core"
|
||||
msgstr "使用 Meta 内核"
|
||||
|
||||
msgid "Some Premium Core Features are Unavailable, For Other More Useful Functions Go Wiki:"
|
||||
msgstr "Meta 内核还未支持 Premium 内核的全部功能,要了解其独有功能,请前往Wiki:"
|
||||
|
||||
msgid "Enable Sniffer"
|
||||
msgstr "*启用流量(域名)探测"
|
||||
|
||||
msgid "Sniffer Will Prevent Domain Name Proxy and DNS Hijack Failure"
|
||||
msgstr "流量(域名)探测能有效防止域名分流异常和DNS劫持失败"
|
||||
|
||||
msgid "Force Sniffer"
|
||||
msgstr "强制流量(域名)探测"
|
||||
|
||||
msgid "Override All Dns Query"
|
||||
msgstr "启用后将尽可能的覆盖DNS查询到的域名"
|
||||
|
||||
msgid "(Support Vless By Pinyun)"
|
||||
msgstr "(由品云提供,支持 Vless)"
|
||||
|
||||
msgid "Meta Settings"
|
||||
msgstr "Meta 设置"
|
||||
|
||||
msgid "Geodata Loader Mode"
|
||||
msgstr "Geodata 数据加载方式"
|
||||
|
||||
msgid "Memconservative"
|
||||
msgstr "小内存模式"
|
||||
|
||||
msgid "Standard"
|
||||
msgstr "标准模式"
|
||||
|
||||
msgid "Enable GeoIP Dat"
|
||||
msgstr "启用 GeoIP Dat 版数据库"
|
||||
|
||||
msgid "Replace GEOIP MMDB With GEOIP Dat, Large Size File, Need Download First"
|
||||
msgstr "使用 Geoip Dat 替换 GEOIP MMDB 数据库, 文件体积较大且无内置,启动后会自动下载"
|
||||
|
||||
msgid "Auto Update GeoIP Dat"
|
||||
msgstr "自动更新 GeoIP Dat 数据库"
|
||||
|
||||
msgid "Custom GeoIP Dat URL"
|
||||
msgstr "GeoIP Dat 数据库更新URL"
|
||||
|
||||
msgid "Custom GeoIP Dat URL, Click Button Below To Refresh After Edit"
|
||||
msgstr "自定义 GeoIP Dat 数据库的更新来源,编辑后点击下方按钮生效"
|
||||
|
||||
msgid "Update GeoIP Dat"
|
||||
msgstr "更新 GeoIP Dat 数据库"
|
||||
|
||||
msgid "Note: It is not recommended to enable IPv6 and related services for routing. Most of the network connection problems reported so far are related to it"
|
||||
msgstr "注意: 路由不建议开启 IPV6 和相关服务,目前反馈的网络连接问题多数与它有关"
|
||||
|
||||
msgid "Note: Turning on secure DNS in the browser will cause abnormal shunting, please be careful to turn it off"
|
||||
msgstr "注意: 浏览器开启安全 DNS,会导致分流异常,请注意关闭"
|
||||
|
||||
msgid "Note: Some software will modify the device HOSTS, which will cause abnormal shunt, please pay attention to check"
|
||||
msgstr "注意: 部分软件会修改设备 HOSTS,会导致分流异常,请注意检查"
|
||||
|
||||
msgid "Note: The default proxy routes local traffic, BT, PT download, etc., please use redir mode as much as possible and pay attention to traffic avoidance"
|
||||
msgstr "注意: 默认代理路由本机流量,BT、PT 下载等请尽量使用 redir 模式并注意进行流量规避"
|
||||
|
||||
msgid "Note: Game proxy please use nodes except Vmess"
|
||||
msgstr "注意: 游戏代理请使用 Vmess 以外的节点"
|
||||
|
||||
msgid "Note: If the connection is abnormal, please follow the steps on this page to check first"
|
||||
msgstr "注意: 连接异常时请按照此页步骤先进行检查"
|
||||
|
||||
msgid "Click to the page"
|
||||
msgstr "点击前往"
|
|
@ -53,7 +53,10 @@ config openclash 'config'
|
|||
option delay_start '0'
|
||||
option router_self_proxy '1'
|
||||
option release_branch 'master'
|
||||
option enable_meta_core '0'
|
||||
option geo_custom_url 'https://cdn.jsdelivr.net/gh/alecthw/mmdb_china_ip_list@release/lite/Country.mmdb'
|
||||
option geosite_custom_url 'https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat'
|
||||
option geoip_custom_url 'https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat'
|
||||
option chnr_custom_url 'https://ispip.clang.cn/all_cn.txt'
|
||||
option chnr6_custom_url 'https://ispip.clang.cn/all_cn_ipv6.txt'
|
||||
|
||||
|
|
|
@ -52,6 +52,12 @@ add_cron()
|
|||
[ -z "$(grep "openclash_ipdb.sh" "$CRON_FILE" 2>/dev/null)" ] && {
|
||||
[ "$(uci -q get openclash.config.geo_auto_update)" -eq 1 ] && echo "0 $(uci -q get openclash.config.geo_update_day_time) * * $(uci -q get openclash.config.geo_update_week_time) /usr/share/openclash/openclash_ipdb.sh" >> $CRON_FILE
|
||||
}
|
||||
[ -z "$(grep "openclash_geosite.sh" "$CRON_FILE" 2>/dev/null)" ] && {
|
||||
[ "$(uci -q get openclash.config.geosite_auto_update)" -eq 1 ] && echo "0 $(uci -q get openclash.config.geosite_update_day_time) * * $(uci -q get openclash.config.geosite_update_week_time) /usr/share/openclash/openclash_geosite.sh" >> $CRON_FILE
|
||||
}
|
||||
[ -z "$(grep "openclash_geoip.sh" "$CRON_FILE" 2>/dev/null)" ] && {
|
||||
[ "$(uci -q get openclash.config.geoip_auto_update)" -eq 1 ] && echo "0 $(uci -q get openclash.config.geoip_update_day_time) * * $(uci -q get openclash.config.geoip_update_week_time) /usr/share/openclash/openclash_geoip.sh" >> $CRON_FILE
|
||||
}
|
||||
[ -z "$(grep "openclash_chnroute.sh" "$CRON_FILE" 2>/dev/null)" ] && {
|
||||
[ "$(uci -q get openclash.config.chnr_auto_update)" -eq 1 ] && echo "0 $(uci -q get openclash.config.chnr_update_day_time) * * $(uci -q get openclash.config.chnr_update_week_time) /usr/share/openclash/openclash_chnroute.sh" >> $CRON_FILE
|
||||
}
|
||||
|
@ -67,6 +73,8 @@ del_cron()
|
|||
sed -i '/openclash.sh/d' $CRON_FILE 2>/dev/null
|
||||
sed -i '/openclash_rule.sh/d' $CRON_FILE 2>/dev/null
|
||||
sed -i '/openclash_ipdb.sh/d' $CRON_FILE 2>/dev/null
|
||||
sed -i '/openclash_geoip.sh/d' $CRON_FILE 2>/dev/null
|
||||
sed -i '/openclash_geosite.sh/d' $CRON_FILE 2>/dev/null
|
||||
sed -i '/openclash_chnroute.sh/d' $CRON_FILE 2>/dev/null
|
||||
sed -i '/\/etc\/init.d\/openclash/d' $CRON_FILE 2>/dev/null
|
||||
/etc/init.d/cron restart
|
||||
|
@ -191,6 +199,7 @@ kill_clash()
|
|||
for clash_pid in $clash_pids; do
|
||||
kill -9 "$clash_pid" 2>/dev/null
|
||||
done >/dev/null 2>&1
|
||||
sleep 1
|
||||
}
|
||||
|
||||
start_fail()
|
||||
|
@ -1153,7 +1162,7 @@ yml_other_rules_get()
|
|||
check_run_quick()
|
||||
{
|
||||
quick_start=true
|
||||
check_file="$RAW_CONFIG_FILE /etc/openclash/custom/openclash_custom_domain_dns.list /etc/openclash/custom/openclash_custom_domain_dns_policy.list /etc/openclash/custom/openclash_custom_fake_filter.list /etc/openclash/custom/openclash_custom_fallback_filter.yaml /etc/openclash/custom/openclash_custom_hosts.list /etc/openclash/custom/openclash_custom_rules.list /etc/openclash/custom/openclash_custom_rules_2.list $dev_core_path $tun_core_path $geoip_path $chnr_path $chnr6_path /usr/share/openclash/res/ConnersHua.yaml /usr/share/openclash/res/ConnersHua_return.yaml /usr/share/openclash/res/lhie1.yaml /usr/share/openclash/res/openclash_version /tmp/openclash_fake_filter.list"
|
||||
check_file="$RAW_CONFIG_FILE /etc/openclash/custom/openclash_custom_domain_dns.list /etc/openclash/custom/openclash_custom_domain_dns_policy.list /etc/openclash/custom/openclash_custom_fake_filter.list /etc/openclash/custom/openclash_custom_fallback_filter.yaml /etc/openclash/custom/openclash_custom_hosts.list /etc/openclash/custom/openclash_custom_rules.list /etc/openclash/custom/openclash_custom_rules_2.list $dev_core_path $tun_core_path $meta_core_path $ipdb_path $geosite_path $geoip_path $chnr_path $chnr6_path /usr/share/openclash/res/ConnersHua.yaml /usr/share/openclash/res/ConnersHua_return.yaml /usr/share/openclash/res/lhie1.yaml /usr/share/openclash/res/openclash_version /tmp/openclash_fake_filter.list"
|
||||
if [ ! -f "$CONFIG_FILE" ] || [ ! -f "/tmp/openclash_config.tmp" ] || [ ! -f "/tmp/openclash.change" ]; then
|
||||
quick_start=false
|
||||
return
|
||||
|
@ -1240,12 +1249,17 @@ do_run_file()
|
|||
if [ "$small_flash_memory" != "1" ]; then
|
||||
dev_core_path="/etc/openclash/core/clash"
|
||||
tun_core_path="/etc/openclash/core/clash_tun"
|
||||
geoip_path="/etc/openclash/Country.mmdb"
|
||||
meta_core_path="/etc/openclash/core/clash_meta"
|
||||
ipdb_path="/etc/openclash/Country.mmdb"
|
||||
chnr_path="/etc/openclash/china_ip_route.ipset"
|
||||
chnr6_path="/etc/openclash/china_ip6_route.ipset"
|
||||
mv "/tmp/etc/openclash/Country.mmdb" "$geoip_path" 2>/dev/null
|
||||
geosite_path="/etc/openclash/GeoSite.dat"
|
||||
geoip_path="/etc/openclash/GeoIP.dat"
|
||||
mv "/tmp/etc/openclash/Country.mmdb" "$ipdb_path" 2>/dev/null
|
||||
mv "/tmp/etc/openclash/china_ip_route.ipset" "$chnr_path" 2>/dev/null
|
||||
mv "/tmp/etc/openclash/china_ip6_route.ipset" "$chnr6_path" 2>/dev/null
|
||||
mv "/tmp/etc/openclash/GeoSite.dat" "$geosite_path" 2>/dev/null
|
||||
mv "/tmp/etc/openclash/GeoIP.dat" "$geoip_path" 2>/dev/null
|
||||
mv "/tmp/etc/openclash/core/" "/etc/openclash" 2>/dev/null
|
||||
if [ "$CACHE_PATH" != "/tmp/etc/openclash/cache.db" ]; then
|
||||
rm -rf "/tmp/etc/openclash" 2>/dev/null
|
||||
|
@ -1253,64 +1267,82 @@ do_run_file()
|
|||
else
|
||||
dev_core_path="/tmp/etc/openclash/core/clash"
|
||||
tun_core_path="/tmp/etc/openclash/core/clash_tun"
|
||||
geoip_path="/tmp/etc/openclash/Country.mmdb"
|
||||
meta_core_path="/tmp/etc/openclash/core/clash_meta"
|
||||
ipdb_path="/tmp/etc/openclash/Country.mmdb"
|
||||
chnr_path="/tmp/etc/openclash/china_ip_route.ipset"
|
||||
chnr6_path="/tmp/etc/openclash/china_ip6_route.ipset"
|
||||
[ ! -h "/etc/openclash/Country.mmdb" ] && mv "/etc/openclash/Country.mmdb" "$geoip_path" 2>/dev/null
|
||||
geosite_path="/tmp/etc/openclash/GeoSite.dat"
|
||||
geoip_path="/tmp/etc/openclash/GeoIP.dat"
|
||||
[ ! -h "/etc/openclash/Country.mmdb" ] && mv "/etc/openclash/Country.mmdb" "$ipdb_path" 2>/dev/null
|
||||
[ ! -h "/etc/openclash/china_ip_route.ipset" ] && mv "/etc/openclash/china_ip_route.ipset" "$chnr_path" 2>/dev/null
|
||||
[ ! -h "/etc/openclash/china_ip6_route.ipset" ] && mv "/etc/openclash/china_ip6_route.ipset" "$chnr6_path" 2>/dev/null
|
||||
[ ! -h "/etc/openclash/GeoSite.dat" ] && mv "/etc/openclash/GeoSite.dat" "$geosite_path" 2>/dev/null
|
||||
[ ! -h "/etc/openclash/GeoIP.dat" ] && mv "/etc/openclash/GeoIP.dat" "$geoip_path" 2>/dev/null
|
||||
mv "/etc/openclash/core/" "/tmp/etc/openclash" 2>/dev/null
|
||||
fi
|
||||
|
||||
rm -rf "/etc/openclash/cache.db" 2>/dev/null
|
||||
rm -rf "/etc/openclash/clash" 2>/dev/null
|
||||
|
||||
if [ -n "$en_mode_tun" ]; then
|
||||
ln -s "$tun_core_path" /etc/openclash/clash 2>/dev/null
|
||||
core_type="TUN"
|
||||
core_start_log="Tip: Detected The Exclusive Function of The TUN Core, Use TUN Core to Start..."
|
||||
fi
|
||||
|
||||
if [ "$rule_source" != "0" ]; then
|
||||
config_load "openclash"
|
||||
config_foreach yml_other_rules_get "other_rules" "$CONFIG_NAME"
|
||||
fi
|
||||
|
||||
config_load "openclash"
|
||||
config_set_custom_rule_provider=0
|
||||
for i in "rule_provider_config" "rule_provider_config" "rule_providers" "game_config"; do
|
||||
config_foreach custom_rule_provider "$i"
|
||||
if [ "$config_set_custom_rule_provider" -eq 1 ]; then
|
||||
break
|
||||
fi
|
||||
done 2>/dev/null
|
||||
|
||||
if [ "$proxy_mode" = "script" ] || [ "$config_set_custom_rule_provider" -eq 1 ] || [ "$rule_name" = "ConnersHua" ] || [ "$rule_name" = "lhie1" ] || [ -n "$(ruby_read "$RAW_CONFIG_FILE" "['rules'].grep(/(^RULE-SET,|^SCRIPT,)/)")" ] || [ -n "$(ruby_read "/etc/openclash/custom/openclash_custom_rules.list" "['rules'].grep(/(^RULE-SET,|^SCRIPT,)/)")" ] || [ -n "$(ruby_read "/etc/openclash/custom/openclash_custom_rules_2.list" "['rules'].grep(/(^RULE-SET,|^SCRIPT,)/)")" ]; then
|
||||
if [ -z "$en_mode_tun" ]; then
|
||||
rm -rf "/etc/openclash/clash"
|
||||
if [ "$enable_meta_core" != "1" ]; then
|
||||
if [ -n "$en_mode_tun" ]; then
|
||||
ln -s "$tun_core_path" /etc/openclash/clash 2>/dev/null
|
||||
core_type="TUN"
|
||||
core_start_log="Tip: Detected The Exclusive Function of The TUN Core, Use TUN Core to Start..."
|
||||
fi
|
||||
|
||||
if [ "$rule_source" != "0" ]; then
|
||||
config_load "openclash"
|
||||
config_foreach yml_other_rules_get "other_rules" "$CONFIG_NAME"
|
||||
fi
|
||||
|
||||
config_load "openclash"
|
||||
config_set_custom_rule_provider=0
|
||||
for i in "rule_provider_config" "rule_provider_config" "rule_providers" "game_config"; do
|
||||
config_foreach custom_rule_provider "$i"
|
||||
if [ "$config_set_custom_rule_provider" -eq 1 ]; then
|
||||
break
|
||||
fi
|
||||
done 2>/dev/null
|
||||
|
||||
if [ "$proxy_mode" = "script" ] || [ "$config_set_custom_rule_provider" -eq 1 ] || [ "$rule_name" = "ConnersHua" ] || [ "$rule_name" = "lhie1" ] || [ -n "$(ruby_read "$RAW_CONFIG_FILE" "['rules'].grep(/(^RULE-SET,|^SCRIPT,)/)")" ] || [ -n "$(ruby_read "/etc/openclash/custom/openclash_custom_rules.list" "['rules'].grep(/(^RULE-SET,|^SCRIPT,)/)")" ] || [ -n "$(ruby_read "/etc/openclash/custom/openclash_custom_rules_2.list" "['rules'].grep(/(^RULE-SET,|^SCRIPT,)/)")" ]; then
|
||||
if [ -z "$en_mode_tun" ]; then
|
||||
ln -s "$tun_core_path" /etc/openclash/clash 2>/dev/null
|
||||
core_type="TUN"
|
||||
core_start_log="Tip: Detected The Exclusive Function of The TUN Core, Use TUN Core to Start..."
|
||||
fi
|
||||
fi
|
||||
else
|
||||
ln -s "$meta_core_path" /etc/openclash/clash 2>/dev/null
|
||||
core_type="Meta"
|
||||
core_start_log="Tip: Detected The Exclusive Function of The Meta Core, Use Meta Core to Start..."
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -f "/etc/openclash/clash" ] && [ -f "$dev_core_path" ] && [ -z "$core_type" ]; then
|
||||
ln -s "$dev_core_path" /etc/openclash/clash 2>/dev/null
|
||||
core_start_log="Tip: No Special Configuration Detected, Use Dev Core to Start..."
|
||||
fi
|
||||
|
||||
if [ ! -f "/etc/openclash/clash" ] && [ -f "$tun_core_path" ]; then
|
||||
if [ ! -f "/etc/openclash/clash" ] && [ -f "$tun_core_path" ] && [ -z "$core_type" ]; then
|
||||
ln -s "$tun_core_path" /etc/openclash/clash 2>/dev/null
|
||||
core_type="TUN"
|
||||
core_start_log="Tip: Detected that the Dev Core is not Installed, Use TUN Core to Start..."
|
||||
fi
|
||||
|
||||
if [ ! -f "/etc/openclash/clash" ] && [ -f "$meta_core_path" ] && [ -z "$core_type" ]; then
|
||||
ln -s "$meta_core_path" /etc/openclash/clash 2>/dev/null
|
||||
core_type="Meta"
|
||||
core_start_log="Tip: Detected that the Dev Core is not Installed, Use Meta Core to Start..."
|
||||
fi
|
||||
|
||||
[ ! -f "$CLASH" ] && {
|
||||
LOG_OUT "Tip: Detected that the Core is not Installed, Ready to Download..."
|
||||
rm -rf "/tmp/clash_last_version"
|
||||
/usr/share/openclash/openclash_core.sh "$core_type"
|
||||
if [ "$core_type" == "TUN" ] && [ ! -f "$tun_core_path" ]; then
|
||||
start_fail
|
||||
elif [ "$core_type" == "Meta" ] && [ ! -f "$meta_core_path" ]; then
|
||||
start_fail
|
||||
elif [ -z "$core_type" ] && [ ! -f "$dev_core_path" ]; then
|
||||
start_fail
|
||||
else
|
||||
|
@ -1320,11 +1352,21 @@ do_run_file()
|
|||
fi
|
||||
}
|
||||
|
||||
[ ! -f "$geoip_path" ] && {
|
||||
[ ! -f "$ipdb_path" ] && {
|
||||
LOG_OUT "Tip: Detected that the GEOIP Database is not Installed, Ready to Download..."
|
||||
/usr/share/openclash/openclash_ipdb.sh
|
||||
}
|
||||
|
||||
[ ! -f "$geosite_path" ] && {
|
||||
LOG_OUT "Tip: Detected that the GEOSITE Database is not Installed, Ready to Download..."
|
||||
/usr/share/openclash/openclash_geosite.sh
|
||||
}
|
||||
|
||||
[ ! -f "$geoip_path" ] && [ "$enable_geoip_dat" == "1" ] && {
|
||||
LOG_OUT "Tip: Detected that the GEOIP Dat is not Installed, Ready to Download..."
|
||||
/usr/share/openclash/openclash_geoip.sh
|
||||
}
|
||||
|
||||
if [ "$china_ip_route" = "1" ] || [ "$china_ip6_route" = "1" ] || [ "$disable_udp_quic" = "1" ]; then
|
||||
if [ ! -f "$chnr_path" ] || [ ! -f "$chnr6_path" ]; then
|
||||
LOG_OUT "Tip: Detected that the Chnroute Cidr List is not Installed, Ready to Download..."
|
||||
|
@ -1332,12 +1374,17 @@ do_run_file()
|
|||
fi
|
||||
fi
|
||||
|
||||
if [ ! -f "$chnr_path" ] || [ ! -f "$chnr6_path" ] || [ ! -f "$geoip_path" ]; then
|
||||
if [ ! -f "$chnr_path" ] || [ ! -f "$chnr6_path" ] || [ ! -f "$ipdb_path" ] || [ ! -f "$geosite_path" ]; then
|
||||
start_fail
|
||||
fi
|
||||
|
||||
if [ "$enable_geoip_dat" == "1" ] && [ ! -f "$geoip_path" ]; then
|
||||
start_fail
|
||||
fi
|
||||
|
||||
[ ! -x "$tun_core_path" ] && chmod 4755 "$tun_core_path" 2>/dev/null
|
||||
[ ! -x "$dev_core_path" ] && chmod 4755 "$dev_core_path" 2>/dev/null
|
||||
[ ! -x "$meta_core_path" ] && chmod 4755 "$meta_core_path" 2>/dev/null
|
||||
|
||||
#fake_ip_filter
|
||||
if [ "$3" = "fake-ip" ]; then
|
||||
|
@ -1350,8 +1397,16 @@ do_run_file()
|
|||
fi
|
||||
fi
|
||||
|
||||
[ -f "$ipdb_path" ] && [ "$small_flash_memory" = "1" ] && {
|
||||
ln -s "$ipdb_path" /etc/openclash/Country.mmdb 2>/dev/null
|
||||
}
|
||||
|
||||
[ -f "$geosite_path" ] && [ "$small_flash_memory" = "1" ] && {
|
||||
ln -s "$geosite_path" /etc/openclash/GeoSite.dat 2>/dev/null
|
||||
}
|
||||
|
||||
[ -f "$geoip_path" ] && [ "$small_flash_memory" = "1" ] && {
|
||||
ln -s "$geoip_path" /etc/openclash/Country.mmdb 2>/dev/null
|
||||
ln -s "$geoip_path" /etc/openclash/GeoIP.dat 2>/dev/null
|
||||
}
|
||||
|
||||
[ -f "$chnr_path" ] && [ "$small_flash_memory" = "1" ] && {
|
||||
|
@ -1450,7 +1505,7 @@ start_run_core()
|
|||
rm -rf "$TMP_CONFIG_FILE" 2>/dev/null
|
||||
fi
|
||||
config_reload=$(uci -q get openclash.config.config_reload)
|
||||
if [ -n "$(pidof clash)" ] && [ "$core_type" != "TUN" ] && [ "$config_reload" != "0" ]; then
|
||||
if [ -n "$(pidof clash)" ] && [ "$core_type" != "TUN" ] && [ "$core_type" != "Meta" ] && [ "$config_reload" != "0" ]; then
|
||||
curl -s --connect-timeout 5 -m 5 -H 'Content-Type: application/json' -H "Authorization: Bearer ${da_password}" -XPUT http://"$lan_ip":"$cn_port"/configs -d "{\"path\": \"$CONFIG_FILE\"}" 2>/dev/null
|
||||
else
|
||||
kill_clash
|
||||
|
@ -2029,6 +2084,10 @@ if [ -n "$en_mode_tun" ]; then
|
|||
ip route replace default dev utun table "$PROXY_ROUTE_TABLE"
|
||||
ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE"
|
||||
|
||||
if [ "$enable_meta_core" == "1" ]; then
|
||||
route add -net 198.18.0.0/16 dev utun
|
||||
fi
|
||||
|
||||
#设置防火墙
|
||||
if [ "$en_mode" = "fake-ip" ]; then
|
||||
iptables -t mangle -N openclash_output
|
||||
|
@ -2288,7 +2347,7 @@ get_config()
|
|||
http_port=$(uci -q get openclash.config.http_port)
|
||||
socks_port=$(uci -q get openclash.config.socks_port)
|
||||
enable_redirect_dns=$(uci -q get openclash.config.enable_redirect_dns)
|
||||
lan_ip=$(uci -q get network.lan.ipaddr |awk -F '/' '{print $1}' 2>/dev/null || ip addr show 2>/dev/null | grep -w 'inet' | grep 'global' | grep 'brd' | grep -Eo 'inet [0-9\.]+' | awk '{print $2}' | head -n 1)
|
||||
lan_ip=$(uci -q get network.lan.ipaddr |awk -F '/' '{print $1}' 2>/dev/null || ip address show $(uci -q -p /tmp/state get network.lan.ifname) | grep -w "inet" 2>/dev/null |grep -Eo 'inet [0-9\.]+' | awk '{print $2}' || ip addr show 2>/dev/null | grep -w 'inet' | grep 'global' | grep 'brd' | grep -Eo 'inet [0-9\.]+' | awk '{print $2}' | head -n 1)
|
||||
lan_ip_cidrs=$(ip route | grep "/" | awk '{print $1}' | grep -vE "^198.18" 2>/dev/null)
|
||||
wan_ip4s=$(ifconfig | grep 'inet addr' | awk '{print $2}' | cut -d: -f2 | grep -vE "(^198.18|^192.168|^127.0)" 2>/dev/null)
|
||||
wan_ip6s=$(ifconfig | grep 'inet6 addr' | awk '{print $3}' 2>/dev/null)
|
||||
|
@ -2318,6 +2377,11 @@ get_config()
|
|||
core_version=$(uci -q get openclash.config.core_version || echo 0)
|
||||
github_address_mod=$(uci -q get openclash.config.github_address_mod || echo 0)
|
||||
router_self_proxy=$(uci -q get openclash.config.router_self_proxy || echo 1)
|
||||
enable_meta_core=$(uci -q get openclash.config.enable_meta_core || echo 0)
|
||||
enable_meta_sniffer=$(uci -q get openclash.config.enable_meta_sniffer || echo 0)
|
||||
enable_meta_sniffer_force=$(uci -q get openclash.config.enable_meta_sniffer_force || echo 0)
|
||||
geodata_loader=$(uci -q get openclash.config.geodata_loader || echo "memconservative")
|
||||
enable_geoip_dat=$(uci -q get openclash.config.enable_geoip_dat || echo 0)
|
||||
_koolshare=$(cat /usr/lib/os-release 2>/dev/null |grep OPENWRT_RELEASE 2>/dev/null |grep -i koolshare 2>/dev/null)
|
||||
[ -z "$dns_port" ] && dns_port=7874 && uci -q set openclash.config.dns_port=7874
|
||||
uci -q set openclash.config.restricted_mode=0 && uci -q commit openclash
|
||||
|
@ -2350,8 +2414,8 @@ start()
|
|||
config_foreach yml_auth_get "authentication"
|
||||
yml_auth_custom "$TMP_CONFIG_FILE"
|
||||
yml_dns_custom "$enable_custom_dns" "$TMP_CONFIG_FILE" "$append_wan_dns" "$ipv6_dns"
|
||||
/usr/share/openclash/yml_change.sh 2>/dev/null "$en_mode" "$da_password" "$cn_port" "$proxy_port" "$TMP_CONFIG_FILE" "$ipv6_enable" "$http_port" "$socks_port" "$log_level" "$proxy_mode" "$en_mode_tun" "$stack_type" "$dns_port" "$mixed_port" "$tproxy_port" "$ipv6_dns" "$store_fakeip" "$stream_domains_prefetch" "$dns_remote"
|
||||
/usr/share/openclash/yml_rules_change.sh 2>/dev/null "$rule_source" "$enable_custom_clash_rules" "$TMP_CONFIG_FILE" "$enable_rule_proxy" "$CONFIG_NAME" "$router_self_proxy" "$lan_ip"
|
||||
/usr/share/openclash/yml_change.sh 2>/dev/null "$en_mode" "$da_password" "$cn_port" "$proxy_port" "$TMP_CONFIG_FILE" "$ipv6_enable" "$http_port" "$socks_port" "$log_level" "$proxy_mode" "$en_mode_tun" "$stack_type" "$dns_port" "$mixed_port" "$tproxy_port" "$ipv6_dns" "$store_fakeip" "$stream_domains_prefetch" "$dns_remote" "$enable_meta_core" "$enable_meta_sniffer" "$enable_meta_sniffer_force" "$enable_geoip_dat" "$geodata_loader"
|
||||
/usr/share/openclash/yml_rules_change.sh 2>/dev/null "$rule_source" "$enable_custom_clash_rules" "$TMP_CONFIG_FILE" "$enable_rule_proxy" "$CONFIG_NAME" "$router_self_proxy" "$lan_ip" "$proxy_port" "$tproxy_port"
|
||||
yml_custom_rule_provider "$TMP_CONFIG_FILE"
|
||||
yml_game_custom "$TMP_CONFIG_FILE"
|
||||
yml_provider_path "$TMP_CONFIG_FILE" "proxy-providers" "proxy_provider" "$github_address_mod"
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -33,27 +33,6 @@ cat > "/lib/upgrade/keep.d/luci-app-openclash" <<-EOF
|
|||
/etc/openclash/
|
||||
EOF
|
||||
|
||||
if [ -f "/tmp/openclash.bak" ]; then
|
||||
mv -f "/tmp/openclash.bak" "/etc/config/openclash" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash/." "/etc/openclash/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_config/." "/etc/openclash/config/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_core/." "/etc/openclash/core/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_history/." "/etc/openclash/history/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_proxy_provider/." "/etc/openclash/proxy_provider/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_rule_provider/." "/etc/openclash/rule_provider/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_game_rules/." "/etc/openclash/game_rules/" >/dev/null 2>&1
|
||||
mv -f "/tmp/openclash_custom_rules.list.bak" "/etc/openclash/custom/openclash_custom_rules.list" >/dev/null 2>&1
|
||||
mv -f "/tmp/openclash_custom_rules_2.list.bak" "/etc/openclash/custom/openclash_custom_rules_2.list" >/dev/null 2>&1
|
||||
mv -f "/tmp/openclash_custom_hosts.list.bak" "/etc/openclash/custom/openclash_custom_hosts.list" >/dev/null 2>&1
|
||||
mv -f "/tmp/openclash_custom_fake_filter.list.bak" "/etc/openclash/custom/openclash_custom_fake_filter.list" >/dev/null 2>&1
|
||||
mv -f "/tmp/openclash_custom_domain_dns.list.bak" "/etc/openclash/custom/openclash_custom_domain_dns.list" >/dev/null 2>&1
|
||||
rm -rf "/etc/openclash/openclash" >/dev/null 2>&1
|
||||
rm -rf "/etc/openclash/fake_filter.list" >/dev/null 2>&1
|
||||
rm -rf "/etc/openclash/openclash_servers_fake_filter.conf" >/dev/null 2>&1
|
||||
rm -rf "/tmp/openclash" >/dev/null 2>&1
|
||||
rm -rf "/tmp/openclash.bak" >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
source "/etc/openwrt_release"
|
||||
case "${DISTRIB_ARCH}" in
|
||||
aarch64_*)
|
||||
|
@ -93,6 +72,81 @@ if [ -n "$(uci -q get dhcp.@dnsmasq[0].resolvfile)" ]; then
|
|||
uci -q set openclash.config.default_resolvfile=$(uci -q get dhcp.@dnsmasq[0].resolvfile)
|
||||
fi
|
||||
|
||||
if [ -f "/tmp/openclash.bak" ]; then
|
||||
mv -f "/tmp/openclash.bak" "/etc/config/openclash" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash/." "/etc/openclash/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_config/." "/etc/openclash/config/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_core/." "/etc/openclash/core/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_history/." "/etc/openclash/history/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_proxy_provider/." "/etc/openclash/proxy_provider/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_rule_provider/." "/etc/openclash/rule_provider/" >/dev/null 2>&1
|
||||
cp -rf "/tmp/openclash_game_rules/." "/etc/openclash/game_rules/" >/dev/null 2>&1
|
||||
mv -f "/tmp/openclash_custom_rules.list.bak" "/etc/openclash/custom/openclash_custom_rules.list" >/dev/null 2>&1
|
||||
mv -f "/tmp/openclash_custom_rules_2.list.bak" "/etc/openclash/custom/openclash_custom_rules_2.list" >/dev/null 2>&1
|
||||
mv -f "/tmp/openclash_custom_hosts.list.bak" "/etc/openclash/custom/openclash_custom_hosts.list" >/dev/null 2>&1
|
||||
mv -f "/tmp/openclash_custom_fake_filter.list.bak" "/etc/openclash/custom/openclash_custom_fake_filter.list" >/dev/null 2>&1
|
||||
mv -f "/tmp/openclash_custom_domain_dns.list.bak" "/etc/openclash/custom/openclash_custom_domain_dns.list" >/dev/null 2>&1
|
||||
rm -rf "/etc/openclash/openclash" >/dev/null 2>&1
|
||||
rm -rf "/etc/openclash/fake_filter.list" >/dev/null 2>&1
|
||||
rm -rf "/etc/openclash/openclash_servers_fake_filter.conf" >/dev/null 2>&1
|
||||
rm -rf "/tmp/openclash" >/dev/null 2>&1
|
||||
rm -rf "/tmp/openclash.bak" >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [ -f "/usr/lib/lua/luci/model/network.lua" ]; then
|
||||
sed -i '/OpenClash Append/,/OpenClash Append End/d' "/usr/lib/lua/luci/model/network.lua" >/dev/null 2>&1
|
||||
cat >> "/usr/lib/lua/luci/model/network.lua" << EOF
|
||||
-------------- OpenClash Append --------------
|
||||
|
||||
function get_all_wan_networks(self)
|
||||
local k, v
|
||||
local wan_nets = { }
|
||||
local route_statuses = self:get_all_status_by_route("0.0.0.0", 0)
|
||||
|
||||
for k, v in pairs(route_statuses) do
|
||||
wan_nets[#wan_nets+1] = network(k, v.proto)
|
||||
end
|
||||
|
||||
return wan_nets
|
||||
end
|
||||
|
||||
function get_all_wan6_networks(self)
|
||||
local k, v
|
||||
local wan6_nets = { }
|
||||
local route_statuses = self:get_all_status_by_route("::", 0)
|
||||
|
||||
for k, v in pairs(route_statuses) do
|
||||
wan6_nets[#wan6_nets+1] = network(k, v.proto)
|
||||
end
|
||||
|
||||
return wan6_nets
|
||||
end
|
||||
|
||||
function get_all_status_by_route(self, addr, mask)
|
||||
local route_statuses = { }
|
||||
local _, object
|
||||
for _, object in ipairs(utl.ubus()) do
|
||||
local net = object:match("^network%.interface%.(.+)")
|
||||
if net then
|
||||
local s = utl.ubus(object, "status", {})
|
||||
if s and s.route then
|
||||
local rt
|
||||
for _, rt in ipairs(s.route) do
|
||||
if not rt.table and rt.target == addr and rt.mask == mask then
|
||||
route_statuses[net] = s
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return route_statuses
|
||||
end
|
||||
|
||||
-------------- OpenClash Append End --------------
|
||||
EOF
|
||||
fi
|
||||
|
||||
uci -q set openclash.config.enable=0
|
||||
uci -q commit openclash
|
||||
|
||||
|
|
|
@ -22,10 +22,12 @@ fi
|
|||
if [ "$small_flash_memory" != "1" ]; then
|
||||
dev_core_path="/etc/openclash/core/clash"
|
||||
tun_core_path="/etc/openclash/core/clash_tun"
|
||||
meta_core_path="/etc/openclash/core/clash_meta"
|
||||
mkdir -p /etc/openclash/core
|
||||
else
|
||||
dev_core_path="/tmp/etc/openclash/core/clash"
|
||||
tun_core_path="/tmp/etc/openclash/core/clash_tun"
|
||||
meta_core_path="/tmp/etc/openclash/core/clash_meta"
|
||||
mkdir -p /tmp/etc/openclash/core
|
||||
fi
|
||||
|
||||
|
@ -40,6 +42,10 @@ case $CORE_TYPE in
|
|||
exit 0
|
||||
fi
|
||||
;;
|
||||
"Meta")
|
||||
CORE_CV=$($meta_core_path -v 2>/dev/null |awk -F ' ' '{print $3}')
|
||||
CORE_LV=$(sed -n 3p /tmp/clash_last_version 2>/dev/null)
|
||||
;;
|
||||
*)
|
||||
CORE_CV=$($dev_core_path -v 2>/dev/null |awk -F ' ' '{print $2}')
|
||||
CORE_LV=$(sed -n 1p /tmp/clash_last_version 2>/dev/null)
|
||||
|
@ -65,6 +71,21 @@ if [ "$CORE_CV" != "$CORE_LV" ] || [ -z "$CORE_CV" ]; then
|
|||
curl -sL -m 30 --speed-time 15 --speed-limit 1 --retry 2 https://mirrors.tuna.tsinghua.edu.cn/osdn/storage/g/o/op/openclash/"$RELEASE_BRANCH"/core-lateset/premium/clash-"$CPU_MODEL"-"$CORE_LV".gz -o /tmp/clash_tun.gz >/dev/null 2>&1
|
||||
fi
|
||||
;;
|
||||
"Meta")
|
||||
LOG_OUT "【Meta】Core Downloading, Please Try to Download and Upload Manually If Fails"
|
||||
if [ "$github_address_mod" != "0" ]; then
|
||||
if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ]; then
|
||||
curl -sL -m 30 --speed-time 15 --speed-limit 1 https://cdn.jsdelivr.net/gh/vernesong/OpenClash@"$RELEASE_BRANCH"/core-lateset/meta/clash-"$CPU_MODEL".tar.gz -o /tmp/clash_meta.tar.gz >/dev/null 2>&1
|
||||
else
|
||||
curl -sL -m 30 --speed-time 15 --speed-limit 1 "$github_address_mod"https://raw.githubusercontent.com/vernesong/OpenClash/"$RELEASE_BRANCH"/core-lateset/meta/clash-"$CPU_MODEL".tar.gz -o /tmp/clash_meta.tar.gz >/dev/null 2>&1
|
||||
fi
|
||||
else
|
||||
curl -sL -m 30 --speed-time 15 --speed-limit 1 https://raw.githubusercontent.com/vernesong/OpenClash/"$RELEASE_BRANCH"/core-lateset/meta/clash-"$CPU_MODEL".tar.gz -o /tmp/clash_meta.tar.gz >/dev/null 2>&1
|
||||
fi
|
||||
if [ "$?" != "0" ]; then
|
||||
curl -sL -m 30 --speed-time 15 --speed-limit 1 --retry 2 https://mirrors.tuna.tsinghua.edu.cn/osdn/storage/g/o/op/openclash/"$RELEASE_BRANCH"/core-lateset/meta/clash-"$CPU_MODEL".tar.gz -o /tmp/clash_meta.tar.gz >/dev/null 2>&1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
LOG_OUT "【Dev】Core Downloading, Please Try to Download and Upload Manually If Fails"
|
||||
if [ "$github_address_mod" != "0" ]; then
|
||||
|
@ -84,20 +105,29 @@ if [ "$CORE_CV" != "$CORE_LV" ] || [ -z "$CORE_CV" ]; then
|
|||
if [ "$?" == "0" ]; then
|
||||
LOG_OUT "【"$CORE_TYPE"】Core Download Successful, Start Update..."
|
||||
case $CORE_TYPE in
|
||||
"TUN")
|
||||
[ -s "/tmp/clash_tun.gz" ] && {
|
||||
gzip -d /tmp/clash_tun.gz >/dev/null 2>&1
|
||||
rm -rf /tmp/clash_tun.gz >/dev/null 2>&1
|
||||
rm -rf "$tun_core_path" >/dev/null 2>&1
|
||||
chmod 4755 /tmp/clash_tun >/dev/null 2>&1
|
||||
}
|
||||
"TUN")
|
||||
[ -s "/tmp/clash_tun.gz" ] && {
|
||||
gzip -d /tmp/clash_tun.gz >/dev/null 2>&1
|
||||
rm -rf /tmp/clash_tun.gz >/dev/null 2>&1
|
||||
rm -rf "$tun_core_path" >/dev/null 2>&1
|
||||
chmod 4755 /tmp/clash_tun >/dev/null 2>&1
|
||||
}
|
||||
;;
|
||||
"Meta")
|
||||
[ -s "/tmp/clash_meta.tar.gz" ] && {
|
||||
rm -rf "$meta_core_path" >/dev/null 2>&1
|
||||
tar zxvf /tmp/clash_meta.tar.gz -C /tmp
|
||||
mv /tmp/clash /tmp/clash_meta >/dev/null 2>&1
|
||||
rm -rf /tmp/clash_meta.tar.gz >/dev/null 2>&1
|
||||
chmod 4755 /tmp/clash_meta >/dev/null 2>&1
|
||||
}
|
||||
;;
|
||||
*)
|
||||
[ -s "/tmp/clash.tar.gz" ] && {
|
||||
[ -s "/tmp/clash.tar.gz" ] && {
|
||||
rm -rf "$dev_core_path" >/dev/null 2>&1
|
||||
tar zxvf /tmp/clash.tar.gz -C /tmp
|
||||
rm -rf /tmp/clash.tar.gz >/dev/null 2>&1
|
||||
chmod 4755 /tmp/clash >/dev/null 2>&1
|
||||
rm -rf /tmp/clash.tar.gz >/dev/null 2>&1
|
||||
chmod 4755 /tmp/clash >/dev/null 2>&1
|
||||
}
|
||||
esac
|
||||
if [ "$?" != "0" ]; then
|
||||
|
@ -105,9 +135,12 @@ if [ "$CORE_CV" != "$CORE_LV" ] || [ -z "$CORE_CV" ]; then
|
|||
case $CORE_TYPE in
|
||||
"TUN")
|
||||
rm -rf /tmp/clash_tun >/dev/null 2>&1
|
||||
;;
|
||||
*)
|
||||
rm -rf /tmp/clash >/dev/null 2>&1
|
||||
;;
|
||||
"Meta")
|
||||
rm -rf /tmp/clash_meta >/dev/null 2>&1
|
||||
;;
|
||||
*)
|
||||
rm -rf /tmp/clash >/dev/null 2>&1
|
||||
esac
|
||||
sleep 3
|
||||
SLOG_CLEAN
|
||||
|
@ -118,7 +151,10 @@ if [ "$CORE_CV" != "$CORE_LV" ] || [ -z "$CORE_CV" ]; then
|
|||
"TUN")
|
||||
mv /tmp/clash_tun "$tun_core_path" >/dev/null 2>&1
|
||||
;;
|
||||
*)
|
||||
"Meta")
|
||||
mv /tmp/clash_meta "$meta_core_path" >/dev/null 2>&1
|
||||
;;
|
||||
*)
|
||||
mv /tmp/clash "$dev_core_path" >/dev/null 2>&1
|
||||
esac
|
||||
|
||||
|
@ -159,6 +195,9 @@ case $CORE_TYPE in
|
|||
"TUN")
|
||||
rm -rf /tmp/clash_tun >/dev/null 2>&1
|
||||
;;
|
||||
"Meta")
|
||||
rm -rf /tmp/clash_meta >/dev/null 2>&1
|
||||
;;
|
||||
*)
|
||||
rm -rf /tmp/clash >/dev/null 2>&1
|
||||
esac
|
|
@ -35,6 +35,7 @@ core_type=$(uci -q get openclash.config.core_version)
|
|||
cpu_model=$(opkg status libc 2>/dev/null |grep 'Architecture' |awk -F ': ' '{print $2}' 2>/dev/null)
|
||||
core_version=$(/etc/openclash/core/clash -v 2>/dev/null |awk -F ' ' '{print $2}' 2>/dev/null)
|
||||
core_tun_version=$(/etc/openclash/core/clash_tun -v 2>/dev/null |awk -F ' ' '{print $2}' 2>/dev/null)
|
||||
core_meta_version=$(/etc/openclash/core/clash_meta -v 2>/dev/null |awk -F ' ' '{print $3}' 2>/dev/null)
|
||||
servers_update=$(uci -q get openclash.config.servers_update)
|
||||
mix_proxies=$(uci -q get openclash.config.mix_proxies)
|
||||
op_version=$(sed -n 1p /usr/share/openclash/res/openclash_version)
|
||||
|
@ -196,6 +197,29 @@ Dev内核运行权限: 正常
|
|||
EOF
|
||||
fi
|
||||
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
Meta内核版本: $core_meta_version
|
||||
EOF
|
||||
|
||||
if [ ! -f "/etc/openclash/core/clash_meta" ]; then
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
Meta内核文件: 不存在
|
||||
EOF
|
||||
else
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
Meta内核文件: 存在
|
||||
EOF
|
||||
fi
|
||||
if [ ! -x "/etc/openclash/core/clash_meta" ]; then
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
Meta内核运行权限: 否
|
||||
EOF
|
||||
else
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
Meta内核运行权限: 正常
|
||||
EOF
|
||||
fi
|
||||
|
||||
cat >> "$DEBUG_LOG" <<-EOF
|
||||
|
||||
#===================== 插件设置 =====================#
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
#!/bin/sh
|
||||
. /usr/share/openclash/openclash_ps.sh
|
||||
. /usr/share/openclash/log.sh
|
||||
|
||||
set_lock() {
|
||||
exec 873>"/tmp/lock/openclash_geoip.lock" 2>/dev/null
|
||||
flock -x 873 2>/dev/null
|
||||
}
|
||||
|
||||
del_lock() {
|
||||
flock -u 873 2>/dev/null
|
||||
rm -rf "/tmp/lock/openclash_geoip.lock"
|
||||
}
|
||||
|
||||
small_flash_memory=$(uci get openclash.config.small_flash_memory 2>/dev/null)
|
||||
GEOIP_CUSTOM_URL=$(uci get openclash.config.geoip_custom_url 2>/dev/null)
|
||||
github_address_mod=$(uci -q get openclash.config.github_address_mod || echo 0)
|
||||
set_lock
|
||||
|
||||
if [ "$small_flash_memory" != "1" ]; then
|
||||
geoip_path="/etc/openclash/GeoIP.dat"
|
||||
mkdir -p /etc/openclash
|
||||
else
|
||||
geoip_path="/tmp/etc/openclash/GeoIP.dat"
|
||||
mkdir -p /tmp/etc/openclash
|
||||
fi
|
||||
LOG_OUT "Start Downloading GeoIP Dat..."
|
||||
if [ -z "$GEOIP_CUSTOM_URL" ]; then
|
||||
if [ "$github_address_mod" != "0" ]; then
|
||||
if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ]; then
|
||||
curl -sL --connect-timeout 5 -m 30 --speed-time 15 --speed-limit 1 --retry 2 https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat -o /tmp/GeoIP.dat >/dev/null 2>&1
|
||||
else
|
||||
curl -sL --connect-timeout 5 -m 30 --speed-time 15 --speed-limit 1 --retry 2 "$github_address_mod"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat -o /tmp/GeoIP.dat >/dev/null 2>&1
|
||||
fi
|
||||
else
|
||||
curl -sL --connect-timeout 5 -m 30 --speed-time 15 --speed-limit 1 --retry 2 https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat -o /tmp/GeoIP.dat >/dev/null 2>&1
|
||||
fi
|
||||
else
|
||||
curl -sL --connect-timeout 5 -m 30 --speed-time 15 --speed-limit 1 --retry 2 "$GEOIP_CUSTOM_URL" -o /tmp/GeoIP.dat >/dev/null 2>&1
|
||||
fi
|
||||
if [ "$?" -eq "0" ] && [ -s "/tmp/GeoIP.dat" ]; then
|
||||
LOG_OUT "GeoIP Dat Download Success, Check Updated..."
|
||||
cmp -s /tmp/GeoIP.dat "$geoip_path"
|
||||
if [ "$?" -ne "0" ]; then
|
||||
LOG_OUT "GeoIP Dat Has Been Updated, Starting To Replace The Old Version..."
|
||||
mv /tmp/GeoIP.dat "$geoip_path" >/dev/null 2>&1
|
||||
LOG_OUT "GeoIP Dat Update Successful!"
|
||||
sleep 3
|
||||
[ "$(unify_ps_prevent)" -eq 0 ] && /etc/init.d/openclash restart >/dev/null 2>&1 &
|
||||
else
|
||||
LOG_OUT "Updated GeoIP Dat No Change, Do Nothing..."
|
||||
sleep 3
|
||||
fi
|
||||
else
|
||||
LOG_OUT "GeoIP Dat Update Error, Please Try Again Later..."
|
||||
sleep 3
|
||||
fi
|
||||
rm -rf /tmp/GeoIP.dat >/dev/null 2>&1
|
||||
SLOG_CLEAN
|
||||
del_lock
|
|
@ -0,0 +1,60 @@
|
|||
#!/bin/sh
|
||||
. /usr/share/openclash/openclash_ps.sh
|
||||
. /usr/share/openclash/log.sh
|
||||
|
||||
set_lock() {
|
||||
exec 874>"/tmp/lock/openclash_geosite.lock" 2>/dev/null
|
||||
flock -x 874 2>/dev/null
|
||||
}
|
||||
|
||||
del_lock() {
|
||||
flock -u 874 2>/dev/null
|
||||
rm -rf "/tmp/lock/openclash_geosite.lock"
|
||||
}
|
||||
|
||||
small_flash_memory=$(uci get openclash.config.small_flash_memory 2>/dev/null)
|
||||
GEOSITE_CUSTOM_URL=$(uci get openclash.config.geosite_custom_url 2>/dev/null)
|
||||
github_address_mod=$(uci -q get openclash.config.github_address_mod || echo 0)
|
||||
set_lock
|
||||
|
||||
if [ "$small_flash_memory" != "1" ]; then
|
||||
geosite_path="/etc/openclash/GeoSite.dat"
|
||||
mkdir -p /etc/openclash
|
||||
else
|
||||
geosite_path="/tmp/etc/openclash/GeoSite.dat"
|
||||
mkdir -p /tmp/etc/openclash
|
||||
fi
|
||||
LOG_OUT "Start Downloading GeoSite Database..."
|
||||
if [ -z "$GEOSITE_CUSTOM_URL" ]; then
|
||||
if [ "$github_address_mod" != "0" ]; then
|
||||
if [ "$github_address_mod" == "https://cdn.jsdelivr.net/" ]; then
|
||||
curl -sL --connect-timeout 5 -m 30 --speed-time 15 --speed-limit 1 --retry 2 https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat -o /tmp/GeoSite.dat >/dev/null 2>&1
|
||||
else
|
||||
curl -sL --connect-timeout 5 -m 30 --speed-time 15 --speed-limit 1 --retry 2 "$github_address_mod"https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat -o /tmp/GeoSite.dat >/dev/null 2>&1
|
||||
fi
|
||||
else
|
||||
curl -sL --connect-timeout 5 -m 30 --speed-time 15 --speed-limit 1 --retry 2 https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat -o /tmp/GeoSite.dat >/dev/null 2>&1
|
||||
fi
|
||||
else
|
||||
curl -sL --connect-timeout 5 -m 30 --speed-time 15 --speed-limit 1 --retry 2 "$GEOSITE_CUSTOM_URL" -o /tmp/GeoSite.dat >/dev/null 2>&1
|
||||
fi
|
||||
if [ "$?" -eq "0" ] && [ -s "/tmp/GeoSite.dat" ]; then
|
||||
LOG_OUT "GeoSite Database Download Success, Check Updated..."
|
||||
cmp -s /tmp/GeoSite.dat "$geosite_path"
|
||||
if [ "$?" -ne "0" ]; then
|
||||
LOG_OUT "GeoSite Database Has Been Updated, Starting To Replace The Old Version..."
|
||||
mv /tmp/GeoSite.dat "$geosite_path" >/dev/null 2>&1
|
||||
LOG_OUT "GeoSite Database Update Successful!"
|
||||
sleep 3
|
||||
[ "$(unify_ps_prevent)" -eq 0 ] && /etc/init.d/openclash restart >/dev/null 2>&1 &
|
||||
else
|
||||
LOG_OUT "Updated GeoSite Database No Change, Do Nothing..."
|
||||
sleep 3
|
||||
fi
|
||||
else
|
||||
LOG_OUT "GeoSite Database Update Error, Please Try Again Later..."
|
||||
sleep 3
|
||||
fi
|
||||
rm -rf /tmp/GeoSite.dat >/dev/null 2>&1
|
||||
SLOG_CLEAN
|
||||
del_lock
|
|
@ -10,14 +10,17 @@ local wan, wan6
|
|||
|
||||
if not type then os.exit(0) end
|
||||
|
||||
if pcall(function() local x = ntm:get_wannet(); local y = ntm:get_wan6net(); end) then
|
||||
if pcall(function() local x = ntm:get_all_wan_networks(); local y = ntm:get_all_wan6_networks(); end) then
|
||||
wan = ntm:get_all_wan_networks()
|
||||
wan6 = ntm:get_all_wan6_networks()
|
||||
elseif pcall(function() local x = ntm:get_wan_networks(); local y = ntm:get_wan6_networks(); end) then
|
||||
wan = ntm:get_wan_networks()
|
||||
wan6 = ntm:get_wan6_networks()
|
||||
elseif pcall(function() local x = ntm:get_wannet(); local y = ntm:get_wan6net(); end) then
|
||||
wan = {}
|
||||
wan6 = {}
|
||||
wan[1] = ntm:get_wannet()
|
||||
wan6[1] = ntm:get_wan6net()
|
||||
elseif pcall(function() local x = ntm:get_wan_networks(); local y = ntm:get_wan6_networks(); end) then
|
||||
wan = ntm:get_wan_networks()
|
||||
wan6 = ntm:get_wan6_networks()
|
||||
else
|
||||
os.exit(0)
|
||||
end
|
||||
|
|
|
@ -19,8 +19,20 @@ local groups = {}
|
|||
local proxies = {}
|
||||
local self_status = luci.sys.exec(string.format('ps -w |grep -v grep |grep -c "openclash_streaming_unlock.lua %s"', type))
|
||||
|
||||
if enable == 0 or not type or router_self_proxy == 0 then os.exit(0) end
|
||||
if tonumber(self_status) > 1 then os.exit(0) end
|
||||
if enable == 0 then
|
||||
print(os.date("%Y-%m-%d %H:%M:%S").." ".."Error: Streaming Unlock Now Disabled, Need Start From Luci Page, Exiting...")
|
||||
os.exit(0)
|
||||
elseif not type then
|
||||
print(os.date("%Y-%m-%d %H:%M:%S").." ".."Error: Streaming Unlock Has No Parameter of Type, Exiting...")
|
||||
os.exit(0)
|
||||
elseif router_self_proxy == 0 then
|
||||
print(os.date("%Y-%m-%d %H:%M:%S").." ".."Error: Streaming Unlock Could not Work Because of Router-Self Proxy Disabled, Exiting...")
|
||||
os.exit(0)
|
||||
elseif tonumber(self_status) > 1 then
|
||||
print(os.date("%Y-%m-%d %H:%M:%S").." ".."Error: Multiple Scripts Running, Exiting...")
|
||||
os.exit(0)
|
||||
end
|
||||
|
||||
if arg[2] == "all" then all_test = true else all_test = false end
|
||||
|
||||
function unlock_auto_select()
|
||||
|
@ -460,6 +472,10 @@ function get_auth_info()
|
|||
passwd = uci:get("openclash", "config", "dashboard_password") or ""
|
||||
ip = luci.sys.exec("uci -q get network.lan.ipaddr |awk -F '/' '{print $1}' 2>/dev/null |tr -d '\n'")
|
||||
|
||||
if not ip or ip == "" then
|
||||
ip = luci.sys.exec("ip address show $(uci -q -p /tmp/state get network.lan.ifname) | grep -w 'inet' 2>/dev/null |grep -Eo 'inet [0-9\.]+' | awk '{print $2}' | tr -d '\n'")
|
||||
end
|
||||
|
||||
if not ip or ip == "" then
|
||||
ip = luci.sys.exec("ip addr show 2>/dev/null | grep -w 'inet' | grep 'global' | grep 'brd' | grep -Eo 'inet [0-9\.]+' | awk '{print $2}' | head -n 1 | tr -d '\n'")
|
||||
end
|
||||
|
@ -789,7 +805,7 @@ function netflix_unlock_test()
|
|||
status = 0
|
||||
local url = "https://www.netflix.com/title/"..filmId
|
||||
local headers = "User-Agent: "..UA
|
||||
local info = luci.sys.exec(string.format('curl -sLI --connect-timeout 5 -m 10 --speed-time 3 --speed-limit 1 --retry 2 -o /dev/null -w %%{json} -H "Content-Type: application/json" -H "%s" -XGET %s', headers, url))
|
||||
local info = luci.sys.exec(string.format('curl -sLI --connect-timeout 5 -m 15 --speed-time 5 --speed-limit 1 --retry 2 -o /dev/null -w %%{json} -H "Content-Type: application/json" -H "%s" -XGET %s', headers, url))
|
||||
local result = {}
|
||||
local region
|
||||
local regex = uci:get("openclash", "config", "stream_auto_select_region_key_netflix") or ""
|
||||
|
@ -824,7 +840,7 @@ function disney_unlock_test()
|
|||
local region, assertion, data, preassertion, disneycookie, tokencontent
|
||||
local regex = uci:get("openclash", "config", "stream_auto_select_region_key_disney") or ""
|
||||
|
||||
preassertion = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 10 --speed-time 3 --speed-limit 1 --retry 2 %s -H 'User-Agent: %s' -H 'content-type: application/json; charset=UTF-8' -d '{\"deviceFamily\":\"browser\",\"applicationRuntime\":\"chrome\",\"deviceProfile\":\"windows\",\"attributes\":{}}' -XPOST %s", auth, UA, url))
|
||||
preassertion = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 15 --speed-time 5 --speed-limit 1 --retry 2 %s -H 'User-Agent: %s' -H 'content-type: application/json; charset=UTF-8' -d '{\"deviceFamily\":\"browser\",\"applicationRuntime\":\"chrome\",\"deviceProfile\":\"windows\",\"attributes\":{}}' -XPOST %s", auth, UA, url))
|
||||
|
||||
if preassertion and json.parse(preassertion) then
|
||||
assertion = json.parse(preassertion).assertion
|
||||
|
@ -833,7 +849,7 @@ function disney_unlock_test()
|
|||
if not assertion then return end
|
||||
|
||||
disneycookie = "grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&latitude=0&longitude=0&platform=browser&subject_token="..assertion.."&subject_token_type=urn%3Abamtech%3Aparams%3Aoauth%3Atoken-type%3Adevice"
|
||||
tokencontent = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 10 --speed-time 3 --speed-limit 1 --retry 2 %s -H 'User-Agent: %s' -d '%s' -XPOST %s", auth, UA, disneycookie, url2))
|
||||
tokencontent = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 15 --speed-time 5 --speed-limit 1 --retry 2 %s -H 'User-Agent: %s' -d '%s' -XPOST %s", auth, UA, disneycookie, url2))
|
||||
|
||||
if tokencontent and json.parse(tokencontent) then
|
||||
if json.parse(tokencontent).error_description then
|
||||
|
@ -842,7 +858,7 @@ function disney_unlock_test()
|
|||
end
|
||||
end
|
||||
|
||||
data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 10 --speed-time 3 --speed-limit 1 --retry 2 %s -H 'User-Agent: %s' -d '%s' -XPOST %s", headers, UA, body, url3))
|
||||
data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 15 --speed-time 5 --speed-limit 1 --retry 2 %s -H 'User-Agent: %s' -d '%s' -XPOST %s", headers, UA, body, url3))
|
||||
|
||||
if data and json.parse(data) then
|
||||
status = 1
|
||||
|
@ -872,7 +888,7 @@ end
|
|||
function hbo_now_unlock_test()
|
||||
status = 0
|
||||
local url = "https://play.hbonow.com/"
|
||||
local data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 10 --speed-time 3 --speed-limit 1 --retry 2 -o /dev/null -w %%{json} -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
local data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 15 --speed-time 5 --speed-limit 1 --retry 2 -o /dev/null -w %%{json} -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
if data then
|
||||
data = json.parse(data)
|
||||
end
|
||||
|
@ -890,7 +906,7 @@ end
|
|||
function hbo_max_unlock_test()
|
||||
status = 0
|
||||
local url = "https://www.hbomax.com/"
|
||||
local data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 10 --speed-time 3 --speed-limit 1 --retry 2 -o /dev/null -w %%{json} -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
local data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 15 --speed-time 5 --speed-limit 1 --retry 2 -o /dev/null -w %%{json} -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
local result = {}
|
||||
local region = ""
|
||||
local regex = uci:get("openclash", "config", "stream_auto_select_region_key_hbo_max") or ""
|
||||
|
@ -919,12 +935,12 @@ end
|
|||
function hbo_go_asia_unlock_test()
|
||||
status = 0
|
||||
local url = "https://api2.hbogoasia.com/v1/geog?lang=undefined&version=0&bundleId=www.hbogoasia.com"
|
||||
local httpcode = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 10 --speed-time 3 --speed-limit 1 --retry 2 -o /dev/null -w %%{http_code} -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
local httpcode = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 15 --speed-time 5 --speed-limit 1 --retry 2 -o /dev/null -w %%{http_code} -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
local regex = uci:get("openclash", "config", "stream_auto_select_region_key_hbo_go_asia") or ""
|
||||
local region = ""
|
||||
if tonumber(httpcode) == 200 then
|
||||
status = 1
|
||||
local data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 10 --speed-time 3 --speed-limit 1 --retry 2 -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
local data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 15 --speed-time 5 --speed-limit 1 --retry 2 -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
if data then
|
||||
data = json.parse(data)
|
||||
end
|
||||
|
@ -947,12 +963,12 @@ end
|
|||
function ytb_unlock_test()
|
||||
status = 0
|
||||
local url = "https://m.youtube.com/premium"
|
||||
local httpcode = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 10 --speed-time 3 --speed-limit 1 --retry 2 -o /dev/null -w %%{http_code} -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
local httpcode = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 15 --speed-time 5 --speed-limit 1 --retry 2 -o /dev/null -w %%{http_code} -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
local region = ""
|
||||
local regex = uci:get("openclash", "config", "stream_auto_select_region_key_ytb") or ""
|
||||
if tonumber(httpcode) == 200 then
|
||||
status = 1
|
||||
local data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 10 --speed-time 3 --speed-limit 1 --retry 2 -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
local data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 15 --speed-time 5 --speed-limit 1 --retry 2 -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
if string.find(data, "is not available in your country") then
|
||||
return
|
||||
end
|
||||
|
@ -975,12 +991,12 @@ end
|
|||
function tvb_anywhere_unlock_test()
|
||||
status = 0
|
||||
local url = "https://uapisfm.tvbanywhere.com.sg/geoip/check/platform/android"
|
||||
local httpcode = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 10 --speed-time 3 --speed-limit 1 --retry 2 -o /dev/null -w %%{http_code} -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
local httpcode = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 15 --speed-time 5 --speed-limit 1 --retry 2 -o /dev/null -w %%{http_code} -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
local region = ""
|
||||
local regex = uci:get("openclash", "config", "stream_auto_select_region_key_tvb_anywhere") or ""
|
||||
if tonumber(httpcode) == 200 then
|
||||
status = 1
|
||||
local data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 10 --speed-time 3 --speed-limit 1 --retry 2 -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
local data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 15 --speed-time 5 --speed-limit 1 --retry 2 -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
if data then
|
||||
data = json.parse(data)
|
||||
end
|
||||
|
@ -1000,12 +1016,12 @@ end
|
|||
function prime_video_unlock_test()
|
||||
status = 0
|
||||
local url = "https://www.primevideo.com"
|
||||
local httpcode = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 10 --speed-time 3 --speed-limit 1 --retry 2 -o /dev/null -w %%{http_code} -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
local httpcode = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 15 --speed-time 5 --speed-limit 1 --retry 2 -o /dev/null -w %%{http_code} -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
local region
|
||||
local regex = uci:get("openclash", "config", "stream_auto_select_region_key_prime_video") or ""
|
||||
if tonumber(httpcode) == 200 then
|
||||
status = 1
|
||||
local data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 10 --speed-time 3 --speed-limit 1 --retry 2 -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
local data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 15 --speed-time 5 --speed-limit 1 --retry 2 -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
if data then
|
||||
region = string.sub(string.match(data, "\"currentTerritory\":\"%a+\""), 21, -2)
|
||||
if region then
|
||||
|
@ -1024,12 +1040,12 @@ function dazn_unlock_test()
|
|||
status = 0
|
||||
local url = "https://www.dazn.com"
|
||||
local url2 = "https://startup.core.indazn.com/misl/v5/Startup"
|
||||
local httpcode = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 10 --speed-time 3 --speed-limit 1 --retry 2 -o /dev/null -w %%{http_code} -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
local httpcode = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 15 --speed-time 5 --speed-limit 1 --retry 2 -o /dev/null -w %%{http_code} -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
local region
|
||||
local regex = uci:get("openclash", "config", "stream_auto_select_region_key_dazn") or ""
|
||||
if tonumber(httpcode) == 200 then
|
||||
status = 1
|
||||
local data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 10 --speed-time 3 --speed-limit 1 --retry 2 -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' -X POST -d '{\"LandingPageKey\":\"generic\",\"Languages\":\"zh-CN,zh,en\",\"Platform\":\"web\",\"PlatformAttributes\":{},\"Manufacturer\":\"\",\"PromoCode\":\"\",\"Version\":\"2\"}' %s", UA, url2))
|
||||
local data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 15 --speed-time 5 --speed-limit 1 --retry 2 -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' -X POST -d '{\"LandingPageKey\":\"generic\",\"Languages\":\"zh-CN,zh,en\",\"Platform\":\"web\",\"PlatformAttributes\":{},\"Manufacturer\":\"\",\"PromoCode\":\"\",\"Version\":\"2\"}' %s", UA, url2))
|
||||
if data then
|
||||
data = json.parse(data)
|
||||
end
|
||||
|
@ -1051,13 +1067,13 @@ function paramount_plus_unlock_test()
|
|||
local url = "https://www.paramountplus.com/"
|
||||
local region
|
||||
local regex = uci:get("openclash", "config", "stream_auto_select_region_key_paramount_plus") or ""
|
||||
local data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 10 --speed-time 3 --speed-limit 1 --retry 2 -o /dev/null -w %%{json} -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
local data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 15 --speed-time 5 --speed-limit 1 --retry 2 -o /dev/null -w %%{json} -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
data = json.parse(data)
|
||||
if data and tonumber(data.http_code) == 200 then
|
||||
status = 1
|
||||
if not string.find(data.url_effective, "intl") then
|
||||
status = 2
|
||||
data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 10 --speed-time 3 --speed-limit 1 --retry 2 -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 15 --speed-time 5 --speed-limit 1 --retry 2 -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s", UA, url))
|
||||
region = string.upper(string.sub(string.match(data, "\"siteEdition\":\"%a+|%a+\""), 19, -1)) or string.upper(string.sub(string.match(data, "property: '%a+'"), 12, -2))
|
||||
if region then
|
||||
if not datamatch(region, regex) then
|
||||
|
@ -1075,12 +1091,12 @@ function discovery_plus_unlock_test()
|
|||
local url1 = "https://us1-prod-direct.discoveryplus.com/users/me"
|
||||
local region
|
||||
local regex = uci:get("openclash", "config", "stream_auto_select_region_key_discovery_plus") or ""
|
||||
local token = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 10 --speed-time 3 --speed-limit 1 --retry 2 -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' '%s'", UA, url))
|
||||
local token = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 15 --speed-time 5 --speed-limit 1 --retry 2 -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' '%s'", UA, url))
|
||||
if token and json.parse(token) and json.parse(token).data and json.parse(token).data.attributes then
|
||||
status = 1
|
||||
token = json.parse(token).data.attributes.token
|
||||
local cookie = string.format("-b \"_gcl_au=1.1.858579665.1632206782; _rdt_uuid=1632206782474.6a9ad4f2-8ef7-4a49-9d60-e071bce45e88; _scid=d154b864-8b7e-4f46-90e0-8b56cff67d05; _pin_unauth=dWlkPU1qWTRNR1ZoTlRBdE1tSXdNaTAwTW1Nd0xUbGxORFV0WWpZMU0yVXdPV1l6WldFeQ; _sctr=1|1632153600000; aam_fw=aam%%3D9354365%%3Baam%%3D9040990; aam_uuid=24382050115125439381416006538140778858; st=%s; gi_ls=0; _uetvid=a25161a01aa711ec92d47775379d5e4d; AMCV_BC501253513148ED0A490D45%%40AdobeOrg=-1124106680%%7CMCIDTS%%7C18894%%7CMCMID%%7C24223296309793747161435877577673078228%%7CMCAAMLH-1633011393%%7C9%%7CMCAAMB-1633011393%%7CRKhpRz8krg2tLO6pguXWp5olkAcUniQYPHaMWWgdJ3xzPWQmdj0y%%7CMCOPTOUT-1632413793s%%7CNONE%%7CvVersion%%7C5.2.0; ass=19ef15da-95d6-4b1d-8fa2-e9e099c9cc38.1632408400.1632406594\"", token)
|
||||
local data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 10 --speed-time 3 --speed-limit 1 --retry 2 -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s %s", UA, cookie, url1))
|
||||
local data = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 15 --speed-time 5 --speed-limit 1 --retry 2 -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' %s %s", UA, cookie, url1))
|
||||
if data and json.parse(data) and json.parse(data).data and json.parse(data).data.attributes and json.parse(data).data.attributes.currentLocationSovereignTerritory then
|
||||
region = string.upper(json.parse(data).data.attributes.currentLocationTerritory) or string.upper(json.parse(data).data.attributes.currentLocationSovereignTerritory)
|
||||
if region then
|
||||
|
|
|
@ -17,6 +17,7 @@ if [ "$1" = "one_key_update" ]; then
|
|||
uci -q commit openclash
|
||||
/usr/share/openclash/openclash_core.sh "$1" >/dev/null 2>&1 &
|
||||
/usr/share/openclash/openclash_core.sh "TUN" "$1" >/dev/null 2>&1 &
|
||||
/usr/share/openclash/openclash_core.sh "Meta" "$1" >/dev/null 2>&1 &
|
||||
wait
|
||||
fi
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ if [ "$enable" -eq 1 ]; then
|
|||
nohup $CLASH -d $CLASH_CONFIG -f "$CONFIG_FILE" >> $LOG_FILE 2>&1 &
|
||||
fi
|
||||
sleep 3
|
||||
if [ "$core_type" = "TUN" ]; then
|
||||
if [ "$core_type" == "TUN" ] || [ "$core_type" == "Meta" ]; then
|
||||
ip route replace default dev utun table "$PROXY_ROUTE_TABLE" 2>/dev/null
|
||||
ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" 2>/dev/null
|
||||
fi
|
||||
|
@ -193,6 +193,8 @@ fi
|
|||
fi
|
||||
fi
|
||||
STREAM_AUTO_SELECT=$(expr "$STREAM_AUTO_SELECT" + 1)
|
||||
elif [ "$router_self_proxy" != "1" ] && [ "$stream_auto_select" -eq 1 ]; then
|
||||
LOG_OUT "Error: Streaming Unlock Could not Work Because of Router-Self Proxy Disabled, Exiting..."
|
||||
fi
|
||||
|
||||
##STREAM_DNS_PREFETCH
|
||||
|
@ -219,6 +221,8 @@ fi
|
|||
fi
|
||||
fi
|
||||
STREAM_DOMAINS_PREFETCH=$(expr "$STREAM_DOMAINS_PREFETCH" + 1)
|
||||
elif [ "$router_self_proxy" != "1" ] && [ "$stream_domains_prefetch" -eq 1 ]; then
|
||||
LOG_OUT "Error: Streaming DNS Prefetch Could not Work Because of Router-Self Proxy Disabled, Exiting..."
|
||||
fi
|
||||
|
||||
SLOG_CLEAN
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -25,6 +25,18 @@ else
|
|||
stack_type=${12}
|
||||
fi
|
||||
|
||||
if [ "${22}" != "1" ]; then
|
||||
sniffer_force="false"
|
||||
else
|
||||
sniffer_force="true"
|
||||
fi
|
||||
|
||||
if [ "${23}" != "1" ]; then
|
||||
enable_geoip_dat="false"
|
||||
else
|
||||
enable_geoip_dat="true"
|
||||
fi
|
||||
|
||||
if [ "$(ruby_read "$5" "['external-controller']")" != "$controller_address:$3" ]; then
|
||||
uci set openclash.config.config_reload=0
|
||||
fi
|
||||
|
@ -53,6 +65,17 @@ begin
|
|||
Value['secret']='$2';
|
||||
Value['bind-address']='*';
|
||||
Value['external-ui']='/usr/share/openclash/dashboard';
|
||||
if ${21} == 1 then
|
||||
Value['geodata-mode']=$enable_geoip_dat;
|
||||
Value['geodata-loader']='${24}';
|
||||
else
|
||||
if Value.key?('geodata-mode') then
|
||||
Value.delete('geodata-mode')
|
||||
end
|
||||
if Value.key?('geodata-loader') then
|
||||
Value.delete('geodata-loader')
|
||||
end
|
||||
end
|
||||
if not Value.key?('dns') then
|
||||
Value_1={'dns'=>{'enable'=>true}}
|
||||
Value['dns']=Value_1['dns']
|
||||
|
@ -80,10 +103,26 @@ else
|
|||
Value['dns'].delete('fake-ip-range')
|
||||
end;
|
||||
Value['dns']['listen']='0.0.0.0:${13}'
|
||||
if ${21} == 1 then
|
||||
Value_sniffer={'sniffer'=>{'enable'=>true}};
|
||||
Value['sniffer']=Value_sniffer['sniffer'];
|
||||
Value['sniffer']['force']=$sniffer_force
|
||||
Value_sniffer={'sniffing'=>['tls']}
|
||||
Value['sniffer'].merge!(Value_sniffer)
|
||||
else
|
||||
if Value.key?('sniffer') then
|
||||
Value.delete('sniffer')
|
||||
end
|
||||
end;
|
||||
Value_2={'tun'=>{'enable'=>true}};
|
||||
if $en_mode_tun != 0 then
|
||||
Value['tun']=Value_2['tun']
|
||||
Value['tun']['stack']='$stack_type'
|
||||
if ${20} == 1 then
|
||||
Value['tun']['device']='utun'
|
||||
end
|
||||
Value['tun']['auto-route']=false
|
||||
Value['tun']['auto-detect-interface']=false
|
||||
Value_2={'dns-hijack'=>['tcp://8.8.8.8:53','tcp://8.8.4.4:53']}
|
||||
Value['tun'].merge!(Value_2)
|
||||
else
|
||||
|
@ -91,6 +130,9 @@ else
|
|||
Value.delete('tun')
|
||||
end
|
||||
end;
|
||||
if Value.key?('iptables') then
|
||||
Value.delete('iptables')
|
||||
end;
|
||||
if not Value.key?('profile') then
|
||||
Value_3={'profile'=>{'store-selected'=>true}}
|
||||
Value['profile']=Value_3['profile']
|
||||
|
|
|
@ -539,7 +539,11 @@ do
|
|||
Thread.new{
|
||||
#cipher
|
||||
if Value['proxies'][$count].key?('cipher') then
|
||||
cipher = '${uci_set}cipher_ssr=' + Value['proxies'][$count]['cipher'].to_s
|
||||
if Value['proxies'][$count]['cipher'].to_s == 'none' then
|
||||
cipher = '${uci_set}cipher_ssr=dummy'
|
||||
else
|
||||
cipher = '${uci_set}cipher_ssr=' + Value['proxies'][$count]['cipher'].to_s
|
||||
end
|
||||
system(cipher)
|
||||
end
|
||||
}.join
|
||||
|
@ -723,6 +727,83 @@ do
|
|||
end
|
||||
}.join
|
||||
end;
|
||||
if '$server_type' == 'vless' then
|
||||
Thread.new{
|
||||
#uuid
|
||||
if Value['proxies'][$count].key?('uuid') then
|
||||
uuid = '${uci_set}uuid=' + Value['proxies'][$count]['uuid'].to_s
|
||||
system(uuid)
|
||||
end
|
||||
}.join
|
||||
|
||||
Thread.new{
|
||||
#tls
|
||||
if Value['proxies'][$count].key?('tls') then
|
||||
tls = '${uci_set}tls=' + Value['proxies'][$count]['tls'].to_s
|
||||
system(tls)
|
||||
end
|
||||
}.join
|
||||
|
||||
Thread.new{
|
||||
#skip-cert-verify
|
||||
if Value['proxies'][$count].key?('skip-cert-verify') then
|
||||
skip_cert_verify = '${uci_set}skip_cert_verify=' + Value['proxies'][$count]['skip-cert-verify'].to_s
|
||||
system(skip_cert_verify)
|
||||
end
|
||||
}.join
|
||||
|
||||
Thread.new{
|
||||
#servername
|
||||
if Value['proxies'][$count].key?('servername') then
|
||||
servername = '${uci_set}servername=\"' + Value['proxies'][$count]['servername'].to_s + '\"'
|
||||
system(servername)
|
||||
end
|
||||
}.join
|
||||
|
||||
Thread.new{
|
||||
#flow
|
||||
if Value['proxies'][$count].key?('flow') then
|
||||
flow = '${uci_set}vless_flow=\"' + Value['proxies'][$count]['flow'].to_s + '\"'
|
||||
system(flow)
|
||||
end
|
||||
}.join
|
||||
|
||||
Thread.new{
|
||||
#network:
|
||||
if Value['proxies'][$count].key?('network') then
|
||||
if Value['proxies'][$count]['network'].to_s == 'ws'
|
||||
system '${uci_set}obfs_vless=ws'
|
||||
#ws-opts-path:
|
||||
if Value['proxies'][$count].key?('ws-opts') then
|
||||
if Value['proxies'][$count]['ws-opts'].key?('path') then
|
||||
ws_opts_path = '${uci_set}ws_opts_path=\"' + Value['proxies'][$count]['ws-opts']['path'].to_s + '\"'
|
||||
system(ws_opts_path)
|
||||
end
|
||||
#ws-opts-headers:
|
||||
if Value['proxies'][$count]['ws-opts'].key?('headers') then
|
||||
system '${uci_del}ws_opts_headers >/dev/null 2>&1'
|
||||
Value['proxies'][$count]['ws-opts']['headers'].keys.each{
|
||||
|v|
|
||||
ws_opts_headers = '${uci_add}ws_opts_headers=\"' + v.to_s + ': '+ Value['proxies'][$count]['ws-opts']['headers'][v].to_s + '\"'
|
||||
system(ws_opts_headers)
|
||||
}
|
||||
end
|
||||
end
|
||||
elsif Value['proxies'][$count]['network'].to_s == 'grpc'
|
||||
#grpc-service-name
|
||||
system '${uci_set}obfs_vless=grpc'
|
||||
if Value['proxies'][$count].key?('grpc-opts') then
|
||||
if Value['proxies'][$count]['grpc-opts'].key?('grpc-service-name') then
|
||||
grpc_service_name = '${uci_set}grpc_service_name=\"' + Value['proxies'][$count]['grpc-opts']['grpc-service-name'].to_s + '\"'
|
||||
system(grpc_service_name)
|
||||
end
|
||||
end
|
||||
else
|
||||
system '${uci_set}obfs_vless=none'
|
||||
end
|
||||
end
|
||||
}.join
|
||||
end;
|
||||
if '$server_type' == 'snell' then
|
||||
Thread.new{
|
||||
if Value['proxies'][$count].key?('obfs-opts') then
|
||||
|
|
|
@ -234,6 +234,8 @@ yml_servers_set()
|
|||
config_get "trojan_ws_headers" "$section" "trojan_ws_headers" ""
|
||||
config_get "interface_name" "$section" "interface_name" ""
|
||||
config_get "routing_mark" "$section" "routing_mark" ""
|
||||
config_get "obfs_vless" "$section" "obfs_vless" ""
|
||||
config_get "vless_flow" "$section" "vless_flow" ""
|
||||
|
||||
if [ "$enabled" = "0" ]; then
|
||||
return
|
||||
|
@ -286,6 +288,10 @@ yml_servers_set()
|
|||
fi
|
||||
LOG_OUT "Start Writing【$CONFIG_NAME - $type - $name】Proxy To Config File..."
|
||||
|
||||
if [ "$cipher_ssr" == "none" ]; then
|
||||
cipher_ssr="dummy"
|
||||
fi
|
||||
|
||||
if [ "$obfs" != "none" ] && [ -n "$obfs" ]; then
|
||||
if [ "$obfs" = "websocket" ]; then
|
||||
obfss="plugin: v2ray-plugin"
|
||||
|
@ -296,6 +302,14 @@ yml_servers_set()
|
|||
obfss=""
|
||||
fi
|
||||
|
||||
if [ "$obfs_vless" = "ws" ]; then
|
||||
obfs_vless="network: ws"
|
||||
fi
|
||||
|
||||
if [ "$obfs_vless" = "grpc" ]; then
|
||||
obfs_vless="network: grpc"
|
||||
fi
|
||||
|
||||
if [ "$obfs_vmess" = "websocket" ]; then
|
||||
obfs_vmess="network: ws"
|
||||
fi
|
||||
|
@ -524,7 +538,73 @@ EOF
|
|||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
#vless
|
||||
if [ "$type" = "vless" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
- name: "$name"
|
||||
type: $type
|
||||
server: "$server"
|
||||
port: $port
|
||||
uuid: $uuid
|
||||
EOF
|
||||
if [ ! -z "$udp" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
udp: $udp
|
||||
EOF
|
||||
fi
|
||||
if [ ! -z "$skip_cert_verify" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
skip-cert-verify: $skip_cert_verify
|
||||
EOF
|
||||
fi
|
||||
if [ ! -z "$tls" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
tls: $tls
|
||||
EOF
|
||||
fi
|
||||
if [ ! -z "$servername" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
servername: "$servername"
|
||||
EOF
|
||||
fi
|
||||
if [ "$obfs_vless" != "none" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
$obfs_vless
|
||||
EOF
|
||||
if [ "$obfs_vless" = "network: ws" ]; then
|
||||
if [ -n "$ws_opts_path" ] || [ -n "$ws_opts_headers" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
ws-opts:
|
||||
EOF
|
||||
if [ -n "$ws_opts_path" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
path: "$ws_opts_path"
|
||||
EOF
|
||||
fi
|
||||
if [ -n "$ws_opts_headers" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
headers:
|
||||
EOF
|
||||
config_list_foreach "$section" "ws_opts_headers" set_ws_headers
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ ! -z "$grpc_service_name" ] && [ "$obfs_vless" = "network: grpc" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
grpc-opts:
|
||||
grpc-service-name: "$grpc_service_name"
|
||||
EOF
|
||||
fi
|
||||
else
|
||||
if [ ! -z "$vless_flow" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
flow: "$vless_flow"
|
||||
EOF
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
#socks5
|
||||
if [ "$type" = "socks5" ]; then
|
||||
cat >> "$SERVER_FILE" <<-EOF
|
||||
|
|
|
@ -245,7 +245,7 @@ yml_other_set()
|
|||
if Value['rules'].to_a.grep(/(?=.*SRC-IP-CIDR,198.18.0.1)/).empty? then
|
||||
Value['rules']=Value['rules'].to_a.insert(0,'SRC-IP-CIDR,198.18.0.1/32,DIRECT')
|
||||
end
|
||||
if Value['rules'].to_a.grep(/(?=.*SRC-IP-CIDR,'$7')/).empty? then
|
||||
if Value['rules'].to_a.grep(/(?=.*SRC-IP-CIDR,'$7')/).empty? and not '$7'.empty? then
|
||||
Value['rules']=Value['rules'].to_a.insert(0,'SRC-IP-CIDR,$7/32,DIRECT')
|
||||
end
|
||||
else
|
||||
|
@ -264,11 +264,17 @@ yml_other_set()
|
|||
if Value['rules'].to_a.grep(/(?=.*198.18.0)(?=.*REJECT)/).empty? then
|
||||
Value['rules']=Value['rules'].to_a.insert(0,'IP-CIDR,198.18.0.1/16,REJECT,no-resolve')
|
||||
end
|
||||
if Value['rules'].to_a.grep(/(?=.*DST-PORT,'$8',REJECT)/).empty? then
|
||||
Value['rules']=Value['rules'].to_a.insert(0,'DST-PORT,$8,REJECT')
|
||||
end
|
||||
if Value['rules'].to_a.grep(/(?=.*DST-PORT,'$9',REJECT)/).empty? then
|
||||
Value['rules']=Value['rules'].to_a.insert(0,'DST-PORT,$9,REJECT')
|
||||
end
|
||||
else
|
||||
Value['rules']=%w(IP-CIDR,198.18.0.1/16,REJECT,no-resolve)
|
||||
Value['rules']=['IP-CIDR,198.18.0.1/16,REJECT,no-resolve','DST-PORT,$8,REJECT','DST-PORT,$9,REJECT']
|
||||
end;
|
||||
rescue Exception => e
|
||||
puts '${LOGTIME} Error: Set 198.18.0.1/16 REJECT Rule Failed,【' + e.message + '】'
|
||||
puts '${LOGTIME} Error: Set Loop Protect Rules Failed,【' + e.message + '】'
|
||||
ensure
|
||||
File.open('$3','w') {|f| YAML.dump(Value, f)}
|
||||
end" 2>/dev/null >> $LOG_FILE
|
||||
|
@ -328,14 +334,14 @@ if [ "$1" != "0" ]; then
|
|||
config_load "openclash"
|
||||
config_foreach yml_other_rules_get "other_rules" "$5"
|
||||
if [ -z "$rule_name" ]; then
|
||||
yml_other_set "$1" "$2" "$3" "$4" "$5" "$6" "$7"
|
||||
yml_other_set "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
|
||||
exit 0
|
||||
#判断策略组是否存在
|
||||
elif [ "$rule_name" = "ConnersHua_return" ]; then
|
||||
if [ -z "$(grep -F "$Proxy" /tmp/Proxy_Group)" ]\
|
||||
|| [ -z "$(grep -F "$Others" /tmp/Proxy_Group)" ];then
|
||||
LOG_OUT "Warning: Because of The Different Porxy-Group's Name, Stop Setting The Other Rules!"
|
||||
yml_other_set "$1" "$2" "$3" "$4" "$5" "$6" "$7"
|
||||
yml_other_set "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
|
||||
exit 0
|
||||
fi
|
||||
elif [ "$rule_name" = "ConnersHua" ]; then
|
||||
|
@ -345,7 +351,7 @@ if [ "$1" != "0" ]; then
|
|||
|| [ -z "$(grep -F "$Others" /tmp/Proxy_Group)" ]\
|
||||
|| [ -z "$(grep -F "$Domestic" /tmp/Proxy_Group)" ]; then
|
||||
LOG_OUT "Warning: Because of The Different Porxy-Group's Name, Stop Setting The Other Rules!"
|
||||
yml_other_set "$1" "$2" "$3" "$4" "$5" "$6" "$7"
|
||||
yml_other_set "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
|
||||
exit 0
|
||||
fi
|
||||
elif [ "$rule_name" = "lhie1" ]; then
|
||||
|
@ -375,13 +381,13 @@ if [ "$1" != "0" ]; then
|
|||
|| [ -z "$(grep -F "$GoogleFCM" /tmp/Proxy_Group)" ]\
|
||||
|| [ -z "$(grep -F "$Domestic" /tmp/Proxy_Group)" ]; then
|
||||
LOG_OUT "Warning: Because of The Different Porxy-Group's Name, Stop Setting The Other Rules!"
|
||||
yml_other_set "$1" "$2" "$3" "$4" "$5" "$6" "$7"
|
||||
yml_other_set "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
if [ -z "$Proxy" ]; then
|
||||
LOG_OUT "Error: Missing Porxy-Group's Name, Stop Setting The Other Rules!"
|
||||
yml_other_set "$1" "$2" "$3" "$4" "$5" "$6" "$7"
|
||||
yml_other_set "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
|
||||
exit 0
|
||||
else
|
||||
#删除原有的部分,防止冲突
|
||||
|
@ -510,4 +516,4 @@ if [ "$1" != "0" ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
yml_other_set "$1" "$2" "$3" "$4" "$5" "$6" "$7"
|
||||
yml_other_set "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
|
||||
|
|
Loading…
Reference in New Issue