Skip to content

Commit cf82ec7

Browse files
committed
Merge branch 'dev'
2 parents 5024f01 + b3c763b commit cf82ec7

147 files changed

Lines changed: 1674 additions & 1408 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/compile_meta_core.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
- name: Setup Go
7878
uses: actions/setup-go@v3
7979
with:
80-
go-version: "1.21"
80+
go-version: "1.22"
8181
check-latest: true
8282

8383
- name: Clone Clash Meta Repository

img/meta.png

12.4 KB
Loading

luci-app-openclash/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include $(TOPDIR)/rules.mk
22

33
PKG_NAME:=luci-app-openclash
4-
PKG_VERSION:=0.45.157
4+
PKG_VERSION:=0.46.001
55
PKG_RELEASE:=beta
66
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>
77

luci-app-openclash/luasrc/controller/openclash.lua

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ function index()
7474
entry({"admin", "services", "openclash", "manual_stream_unlock_test"}, call("manual_stream_unlock_test"))
7575
entry({"admin", "services", "openclash", "all_proxies_stream_test"}, call("all_proxies_stream_test"))
7676
entry({"admin", "services", "openclash", "set_subinfo_url"}, call("set_subinfo_url"))
77+
entry({"admin", "services", "openclash", "check_core"}, call("action_check_core"))
78+
entry({"admin", "services", "openclash", "core_download"}, call("core_download"))
7779
entry({"admin", "services", "openclash", "settings"},cbi("openclash/settings"),_("Plugin Settings"), 30).leaf = true
7880
entry({"admin", "services", "openclash", "config-overwrite"},cbi("openclash/config-overwrite"),_("Overwrite Settings"), 40).leaf = true
7981
entry({"admin", "services", "openclash", "servers"},cbi("openclash/servers"),_("Onekey Create"), 50).leaf = true
@@ -229,6 +231,14 @@ local function coremodel()
229231
end
230232
end
231233

234+
local function check_core()
235+
if not nixio.fs.access(dev_core_path) and not nixio.fs.access(tun_core_path) and not nixio.fs.access(meta_core_path) then
236+
return "0"
237+
else
238+
return "1"
239+
end
240+
end
241+
232242
local function corecv()
233243
if not nixio.fs.access(dev_core_path) then
234244
return "0"
@@ -334,6 +344,24 @@ local function historychecktime()
334344
end
335345
end
336346

347+
function core_download()
348+
if uci:get("openclash", "config", "github_address_mod") == "0" or not uci:get("openclash", "config", "github_address_mod") then
349+
uci:set("openclash", "config", "github_address_mod", "https://testingcf.jsdelivr.net/")
350+
uci:commit("openclash")
351+
luci.sys.call("rm -rf /tmp/clash_last_version 2>/dev/null && bash /usr/share/openclash/clash_version.sh >/dev/null 2>&1")
352+
luci.sys.call("bash /usr/share/openclash/openclash_core.sh 'Dev' >/dev/null 2>&1 &")
353+
luci.sys.call("bash /usr/share/openclash/openclash_core.sh 'TUN' >/dev/null 2>&1 &")
354+
luci.sys.call("bash /usr/share/openclash/openclash_core.sh 'Meta' >/dev/null 2>&1 &")
355+
uci:set("openclash", "config", "github_address_mod", "0")
356+
uci:commit("openclash")
357+
else
358+
luci.sys.call("rm -rf /tmp/clash_last_version 2>/dev/null && bash /usr/share/openclash/clash_version.sh >/dev/null 2>&1")
359+
luci.sys.call("bash /usr/share/openclash/openclash_core.sh 'Dev' >/dev/null 2>&1 &")
360+
luci.sys.call("bash /usr/share/openclash/openclash_core.sh 'TUN' >/dev/null 2>&1 &")
361+
luci.sys.call("bash /usr/share/openclash/openclash_core.sh 'Meta' >/dev/null 2>&1 &")
362+
end
363+
end
364+
337365
function download_rule()
338366
local filename = luci.http.formvalue("filename")
339367
local state = luci.sys.call(string.format('/usr/share/openclash/openclash_download_rule_list.sh "%s" >/dev/null 2>&1',filename))
@@ -375,7 +403,6 @@ function action_restore_config()
375403
luci.sys.call("cp /usr/share/openclash/backup/openclash_sniffing* /etc/openclash/custom/ >/dev/null 2>&1 &")
376404
luci.sys.call("cp /usr/share/openclash/backup/yml_change.sh /usr/share/openclash/yml_change.sh >/dev/null 2>&1 &")
377405
luci.sys.call("rm -rf /etc/openclash/history/* >/dev/null 2>&1 &")
378-
luci.http.redirect(luci.dispatcher.build_url('admin/services/openclash/settings'))
379406
end
380407

381408
function action_remove_all_core()
@@ -875,7 +902,7 @@ function action_toolbar_show()
875902
if not daip or not cn_port then return end
876903
traffic = json.parse(luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/traffic', dase, daip, cn_port)))
877904
connections = json.parse(luci.sys.exec(string.format('curl -sL -m 3 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://"%s":"%s"/connections', dase, daip, cn_port)))
878-
if traffic and connections then
905+
if traffic and connections and connections.connections then
879906
connection = #(connections.connections)
880907
up = s(traffic.up)
881908
down = s(traffic.down)
@@ -1114,6 +1141,13 @@ function action_opupdate()
11141141
})
11151142
end
11161143

1144+
function action_check_core()
1145+
luci.http.prepare_content("application/json")
1146+
luci.http.write_json({
1147+
core_status = check_core();
1148+
})
1149+
end
1150+
11171151
function action_coreupdate()
11181152
luci.http.prepare_content("application/json")
11191153
luci.http.write_json({

luci-app-openclash/luasrc/model/cbi/openclash/config-overwrite.lua

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,27 @@ o = s:taboption("dns", Flag, "enable_custom_dns", font_red..bold_on..translate("
135135
o.description = font_red..bold_on..translate("Set OpenClash Upstream DNS Resolve Server")..bold_off..font_off
136136
o.default = 0
137137

138+
---- Fallback DNS Proxy Group
139+
o = s:taboption("dns", Value, "proxy_dns_group", font_red..bold_on..translate("Fallback DNS Proxy Group (Support Regex)")..bold_off..font_off)
140+
o.description = translate("Group Use For Proxy The Fallback DNS, Preventing DNS Lookup Failures")..translate("(Only Meta Core)")
141+
local groupnames,filename
142+
filename = m.uci:get("openclash", "config", "config_path")
143+
if filename then
144+
groupnames = SYS.exec(string.format('ruby -ryaml -rYAML -I "/usr/share/openclash" -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',filename))
145+
if groupnames then
146+
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
147+
if groupname ~= nil and groupname ~= "" then
148+
o:value(groupname)
149+
end
150+
end
151+
end
152+
end
153+
154+
o:value("DIRECT")
155+
o:value("Disable", translate("Disable"))
156+
o.default = "Disable"
157+
o.rempty = false
158+
138159
o = s:taboption("dns", Flag, "append_wan_dns", translate("Append Upstream DNS"))
139160
o.description = translate("Append The Upstream Assigned DNS And Gateway IP To The Nameserver")
140161
o.default = 1

luci-app-openclash/luasrc/model/cbi/openclash/config-subscribe-edit.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ o:value("https://v.id9.cc/sub", translate("v.id9.cc")..translate("(Support Vless
106106
o:value("https://sub.id9.cc/sub", translate("sub.id9.cc"))
107107
o:value("https://api.wcc.best/sub", translate("api.wcc.best"))
108108
o.default = "https://api.dler.io/sub"
109+
o.placeholder = "https://api.dler.io/sub"
109110

110111
---- Template
111112
o = s:option(ListValue, "template", translate("Template Name"))

luci-app-openclash/luasrc/model/cbi/openclash/settings.lua

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ m.description = translate("Note: To restore the default configuration, try acces
2424
"<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")..
2525
"<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..
2626
"<br/>"..font_green..translate("Note: Some software will modify the device HOSTS, which will cause abnormal shunt, please pay attention to check")..font_off..
27-
"<br/>"..font_green..translate("Note: Game proxy please use nodes except Vmess")..font_off..
28-
"<br/>"..font_green..translate("Note: If you need to perform client access control in Fake-ip mode, please change the DNS hijacking mode to firewall forwarding")..font_off..
29-
"<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")..
27+
"<br/>"..font_green..translate("Note: Game proxy please use nodes except VMess")..font_off..
28+
"<br/>"..font_green..translate("Note: If you need to perform client access control in Fake-IP mode, please change the DNS hijacking mode to firewall forwarding")..font_off..
29+
"<br/>"..translate("Note: The default proxy routes local traffic, BT, PT download, etc., please use Redir-Host mode as much as possible and pay attention to traffic avoidance")..
3030
"<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>"
3131

3232
s = m:section(TypedSection, "openclash")
@@ -79,7 +79,8 @@ o:depends("en_mode", "fake-ip-tun")
7979
o:depends("en_mode", "redir-host-mix")
8080
o:depends("en_mode", "fake-ip-mix")
8181
o:value("system", translate("System "))
82-
o:value("gvisor", translate("Gvisor"))
82+
o:value("gvisor", translate("gVisor"))
83+
o:value("mixed", translate("Mixed")..translate("(Only Meta Core)"))
8384
o.default = "system"
8485

8586
o = s:taboption("op_mode", ListValue, "proxy_mode", translate("Proxy Mode"))
@@ -163,6 +164,7 @@ end
163164

164165
---- Access Control
165166
o = s:taboption("lan_ac", ListValue, "lan_ac_mode", translate("LAN Access Control Mode"))
167+
o.description = font_red..bold_on..translate("To Use in Fake-IP Mode, Please Switch The Dns Redirect Mode To Firewall Forwarding")..bold_off..font_off
166168
o:value("0", translate("Black List Mode"))
167169
o:value("1", translate("White List Mode"))
168170
o.default = "0"
@@ -932,7 +934,6 @@ o.rmempty = true
932934
o.description = translate("Custom GeoIP Dat URL, Click Button Below To Refresh After Edit")
933935
o:value("https://testingcf.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat", translate("Loyalsoldier-testingcf-jsdelivr-Version")..translate("(Default)"))
934936
o:value("https://fastly.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat", translate("Loyalsoldier-fastly-jsdelivr-Version"))
935-
o:value("https://ftp.jaist.ac.jp/pub/sourceforge.jp/storage/g/v/v2/v2raya/dists/v2ray-rules-dat/geoip.dat", translate("OSDN-Version")..translate("(Default)"))
936937
o.default = "https://testingcf.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat"
937938
o:depends("geoip_auto_update", "1")
938939

@@ -976,7 +977,6 @@ o.rmempty = true
976977
o.description = translate("Custom GeoSite Data URL, Click Button Below To Refresh After Edit")
977978
o:value("https://testingcf.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat", translate("Loyalsoldier-testingcf-jsdelivr-Version")..translate("(Default)"))
978979
o:value("https://fastly.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat", translate("Loyalsoldier-fastly-jsdelivr-Version"))
979-
o:value("https://ftp.jaist.ac.jp/pub/sourceforge.jp/storage/g/v/v2/v2raya/dists/v2ray-rules-dat/geosite.dat", translate("OSDN-Version")..translate("(Default)"))
980980
o.default = "https://testingcf.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat"
981981
o:depends("geosite_auto_update", "1")
982982

@@ -1133,7 +1133,8 @@ o.description = translate("Select Stack Type For TUN Mode, According To The Runn
11331133
o:depends({ipv6_mode= "2", en_mode = "redir-host"})
11341134
o:depends({ipv6_mode= "2", en_mode = "fake-ip"})
11351135
o:value("system", translate("System "))
1136-
o:value("gvisor", translate("Gvisor"))
1136+
o:value("gvisor", translate("gVisor"))
1137+
o:value("mixed", translate("Mixed")..translate("(Only Meta Core)"))
11371138
o.default = "system"
11381139

11391140
o = s:taboption("ipv6", Flag, "enable_v6_udp_proxy", translate("Proxy UDP Traffics"))

0 commit comments

Comments
 (0)