Skip to content

Commit 1d0e744

Browse files
committed
Merge branch 'dev'
2 parents fc741a8 + 870478a commit 1d0e744

File tree

161 files changed

+31505
-58533
lines changed

Some content is hidden

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

161 files changed

+31505
-58533
lines changed

.github/workflows/compile_meta_core.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
- name: Setup Go
9090
uses: actions/setup-go@v5
9191
with:
92-
go-version: "1.22"
92+
go-version: "1.23"
9393
check-latest: true
9494

9595
- name: Clone Clash Meta Repository

luci-app-openclash/Makefile

+12-5
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.46.033
4+
PKG_VERSION:=0.46.050
55
PKG_RELEASE:=beta
66
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>
77

@@ -27,14 +27,23 @@ define Package/$(PKG_NAME)/config
2727

2828
config PACKAGE_iptables-mod-extra
2929
default y if ! PACKAGE_firewall4
30+
31+
config PACKAGE_dnsmasq_full_ipset
32+
default y if ! PACKAGE_firewall4
33+
34+
config PACKAGE_dnsmasq_full_nftset
35+
default y if PACKAGE_firewall4
36+
37+
config PACKAGE_ipset
38+
default y if ! PACKAGE_firewall4
3039
endef
3140

3241
define Package/$(PKG_NAME)
3342
CATEGORY:=LuCI
3443
SUBMENU:=3. Applications
3544
TITLE:=LuCI support for clash
3645
PKGARCH:=all
37-
DEPENDS:=+dnsmasq-full +coreutils +coreutils-nohup +bash +curl +ca-certificates +ipset +ip-full \
46+
DEPENDS:=+dnsmasq-full +coreutils +coreutils-nohup +bash +curl +ca-certificates +ip-full \
3847
+libcap +libcap-bin +ruby +ruby-yaml +kmod-tun +unzip
3948
MAINTAINER:=vernesong
4049
endef
@@ -64,9 +73,7 @@ define Build/Prepare
6473
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_domain_dns.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_domain_dns.list" >/dev/null 2>&1
6574
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_domain_dns_policy.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_domain_dns_policy.list" >/dev/null 2>&1
6675
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_fallback_filter.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_fallback_filter.yaml" >/dev/null 2>&1
67-
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_force_sniffing_domain.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_force_sniffing_domain.yaml" >/dev/null 2>&1
68-
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_sniffing_domain_filter.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_sniffing_domain_filter.yaml" >/dev/null 2>&1
69-
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_sniffing_ports_filter.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_sniffing_ports_filter.yaml" >/dev/null 2>&1
76+
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_sniffer.yaml" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_sniffer.yaml" >/dev/null 2>&1
7077
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_localnetwork_ipv4.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_localnetwork_ipv4.list" >/dev/null 2>&1
7178
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_localnetwork_ipv6.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_localnetwork_ipv6.list" >/dev/null 2>&1
7279
cp -f "$(PKG_BUILD_DIR)/root/etc/openclash/custom/openclash_custom_chnroute_pass.list" "$(PKG_BUILD_DIR)/root/usr/share/openclash/backup/openclash_custom_chnroute_pass.list" >/dev/null 2>&1

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

+2-6
Original file line numberDiff line numberDiff line change
@@ -830,23 +830,19 @@ end
830830

831831
function action_toolbar_show_sys()
832832
local pid = luci.sys.exec("pidof clash |head -1 |tr -d '\n' 2>/dev/null")
833-
local mem, cpu
833+
local cpu
834834
if pid and pid ~= "" then
835-
mem = tonumber(luci.sys.exec(string.format("cat /proc/%s/status 2>/dev/null |grep -w VmRSS |awk '{print $2}'", pid)))
836835
cpu = luci.sys.exec(string.format("top -b -n1 |grep -E '%s' 2>/dev/null |grep -v grep |awk '{for (i=1;i<=NF;i++) {if ($i ~ /clash/) break; else cpu=i}}; {print $cpu}' 2>/dev/null", pid))
837-
if mem and cpu then
838-
mem = fs.filesize(mem*1024) or "0 KB"
836+
if cpu then
839837
cpu = string.match(cpu, "%d+") or "0"
840838
else
841-
mem = "0 KB"
842839
cpu = "0"
843840
end
844841
else
845842
return
846843
end
847844
luci.http.prepare_content("application/json")
848845
luci.http.write_json({
849-
mem = mem,
850846
cpu = cpu;
851847
})
852848
end

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ for t,o in ipairs(fs.glob("/etc/openclash/config/*"))do
5353
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",a.mtime)
5454
end
5555
if uci:get("openclash", "config", "config_path") and string.sub(uci:get("openclash", "config", "config_path"), 23, -1) == e[t].name then
56-
e[t].state=translate("Enable")
56+
e[t].state=translate("Enabled")
5757
else
58-
e[t].state=translate("Disable")
58+
e[t].state=translate("Disabled")
5959
end
6060
e[t].check=translate(config_check(o))
6161
end
@@ -75,7 +75,7 @@ if a then
7575
ck.template="openclash/cfg_check"
7676
sb.template="openclash/sub_info_show"
7777

78-
btnis=tb:option(Button,"switch",translate("Switch Config"))
78+
btnis=tb:option(Button,"switch",translate("Switch"))
7979
btnis.template="openclash/other_button"
8080
btnis.render=function(o,t,a)
8181
if not e[t] then return false end
@@ -172,4 +172,4 @@ if uci:get("openclash", "config", "dler_token") then
172172
return m, dler, form, s, ap, d
173173
else
174174
return m, form, s, ap, d
175-
end
175+
end

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

+13-61
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ if not lan_ip or lan_ip == "" then
3333
end
3434
m = Map("openclash", translate("Overwrite Settings"))
3535
m.pageaction = false
36-
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>"
36+
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>"..
37+
"<br/>"..font_green..translate("For More Useful Meta Core Functions Go Wiki")..": "..font_off.."<a href='javascript:void(0)' onclick='javascript:return winOpen(\"https://wiki.metacubex.one/\")'>"..translate("https://wiki.metacubex.one/").."</a>"
3738

3839
s = m:section(TypedSection, "openclash")
3940
s.anonymous = true
@@ -147,7 +148,7 @@ o = s:taboption("dns", Flag, "enable_custom_dns", font_red..bold_on..translate("
147148
o.description = font_red..bold_on..translate("Set OpenClash Upstream DNS Resolve Server")..bold_off..font_off
148149
o.default = 0
149150

150-
o = s:taboption("dns", Flag, "enable_respect_rules", font_red..bold_on..translate("Respect Rules")..bold_off..font_off)
151+
o = s:taboption("dns", Flag, "enable_respect_rules", font_red..bold_on..translate("Respect Rules").."(respect-rules)"..bold_off..font_off)
151152
o.description = font_red..bold_on..translate("Whether or not The Connection to the DNS Server Follow the Rules in Config")..bold_off..font_off
152153
o.default = 0
153154

@@ -292,14 +293,6 @@ o = s:taboption("meta", Flag, "enable_unified_delay", font_red..bold_on..transla
292293
o.description = font_red..bold_on..translate("Change The Delay Calculation Method To Remove Extra Delays Such as Handshaking")..bold_off..font_off
293294
o.default = "0"
294295

295-
o = s:taboption("meta", ListValue, "keep_alive_interval", font_red..bold_on..translate("TCP Keep-alive Interval(s)")..bold_off..font_off)
296-
o.description = font_red..bold_on..translate("Change The TCP Keep-alive Interval, Selecting a Larger Value Avoids Abnormal Resource Consumption")..bold_off..font_off
297-
o:value("0", translate("Disable"))
298-
o:value("15")
299-
o:value("1800")
300-
o:value("3600")
301-
o.default = "0"
302-
303296
o = s:taboption("meta", ListValue, "find_process_mode", translate("Enable Process Rule"))
304297
o.description = translate("Whether to Enable Process Rules, If You Are Not Sure, Please Choose off Which Useful in Router Environment")
305298
o:value("0", translate("Disable"))
@@ -347,62 +340,21 @@ o.description = translate("Custom The Force and Skip Sniffing Doamin Lists")
347340
o.default = 0
348341
o:depends("enable_meta_sniffer", "1")
349342

350-
sniffing_domain_force = s:taboption("meta", Value, "sniffing_domain_force")
351-
sniffing_domain_force:depends("enable_meta_sniffer_custom", "1")
352-
sniffing_domain_force.template = "cbi/tvalue"
353-
sniffing_domain_force.description = translate("Will Override Dns Queries If Domains in The List")
354-
sniffing_domain_force.rows = 20
355-
sniffing_domain_force.wrap = "off"
356-
357-
function sniffing_domain_force.cfgvalue(self, section)
358-
return NXFS.readfile("/etc/openclash/custom/openclash_force_sniffing_domain.yaml") or ""
359-
end
360-
function sniffing_domain_force.write(self, section, value)
361-
if value then
362-
value = value:gsub("\r\n?", "\n")
363-
local old_value = NXFS.readfile("/etc/openclash/custom/openclash_force_sniffing_domain.yaml")
364-
if value ~= old_value then
365-
NXFS.writefile("/etc/openclash/custom/openclash_force_sniffing_domain.yaml", value)
366-
end
367-
end
368-
end
369-
370-
sniffing_port_filter = s:taboption("meta", Value, "sniffing_port_filter")
371-
sniffing_port_filter:depends("enable_meta_sniffer_custom", "1")
372-
sniffing_port_filter.template = "cbi/tvalue"
373-
sniffing_port_filter.description = translate("Will Only Sniffing If Ports in The List")
374-
sniffing_port_filter.rows = 20
375-
sniffing_port_filter.wrap = "off"
376-
377-
function sniffing_port_filter.cfgvalue(self, section)
378-
return NXFS.readfile("/etc/openclash/custom/openclash_sniffing_ports_filter.yaml") or ""
379-
end
380-
function sniffing_port_filter.write(self, section, value)
381-
if value then
382-
value = value:gsub("\r\n?", "\n")
383-
local old_value = NXFS.readfile("/etc/openclash/custom/openclash_sniffing_ports_filter.yaml")
384-
if value ~= old_value then
385-
NXFS.writefile("/etc/openclash/custom/openclash_sniffing_ports_filter.yaml", value)
386-
end
387-
end
388-
end
389-
390-
sniffing_domain_filter = s:taboption("meta", Value, "sniffing_domain_filter")
391-
sniffing_domain_filter:depends("enable_meta_sniffer_custom", "1")
392-
sniffing_domain_filter.template = "cbi/tvalue"
393-
sniffing_domain_filter.description = translate("Will Disable Sniffing If Domains(sni) in The List")
394-
sniffing_domain_filter.rows = 20
395-
sniffing_domain_filter.wrap = "off"
343+
sniffer_custom = s:taboption("meta", Value, "sniffer_custom")
344+
sniffer_custom:depends("enable_meta_sniffer_custom", "1")
345+
sniffer_custom.template = "cbi/tvalue"
346+
sniffer_custom.rows = 20
347+
sniffer_custom.wrap = "off"
396348

397-
function sniffing_domain_filter.cfgvalue(self, section)
398-
return NXFS.readfile("/etc/openclash/custom/openclash_sniffing_domain_filter.yaml") or ""
349+
function sniffer_custom.cfgvalue(self, section)
350+
return NXFS.readfile("/etc/openclash/custom/openclash_custom_sniffer.yaml") or ""
399351
end
400-
function sniffing_domain_filter.write(self, section, value)
352+
function sniffer_custom.write(self, section, value)
401353
if value then
402354
value = value:gsub("\r\n?", "\n")
403-
local old_value = NXFS.readfile("/etc/openclash/custom/openclash_sniffing_domain_filter.yaml")
355+
local old_value = NXFS.readfile("/etc/openclash/custom/openclash_custom_sniffer.yaml")
404356
if value ~= old_value then
405-
NXFS.writefile("/etc/openclash/custom/openclash_sniffing_domain_filter.yaml", value)
357+
NXFS.writefile("/etc/openclash/custom/openclash_custom_sniffer.yaml", value)
406358
end
407359
end
408360
end

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,15 @@ o = a:option(Button, "Commit", " ")
121121
o.inputtitle = translate("Commit Settings")
122122
o.inputstyle = "apply"
123123
o.write = function()
124-
fs.unlink("/tmp/Proxy_Group")
124+
fs.unlink("/tmp/Proxy_Group")
125125
m.uci:commit("openclash")
126126
end
127127

128128
o = a:option(Button, "Apply", " ")
129129
o.inputtitle = translate("Update Config")
130130
o.inputstyle = "apply"
131131
o.write = function()
132-
fs.unlink("/tmp/Proxy_Group")
132+
fs.unlink("/tmp/Proxy_Group")
133133
m.uci:set("openclash", "config", "enable", 1)
134134
m.uci:commit("openclash")
135135
uci:foreach("openclash", "config_subscribe",

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ else
177177
e[t].mtime=os.date("%Y-%m-%d %H:%M:%S",a.mtime)
178178
end
179179
if uci:get("openclash", "config", "config_path") and string.sub(uci:get("openclash", "config", "config_path"), 23, -1) == e[t].name then
180-
e[t].state=translate("Enable")
180+
e[t].state=translate("Enabled")
181181
else
182-
e[t].state=translate("Disable")
182+
e[t].state=translate("Disabled")
183183
end
184184
e[t].size=fs.filesize(a.size)
185185
e[t].check=translate(config_check(o))
@@ -201,7 +201,7 @@ st.template="openclash/cfg_check"
201201
ck.template="openclash/cfg_check"
202202
sb.template="openclash/sub_info_show"
203203

204-
btnis=tb:option(Button,"switch",translate("Switch Config"))
204+
btnis=tb:option(Button,"switch",translate("Switch"))
205205
btnis.template="openclash/other_button"
206206
btnis.render=function(o,t,a)
207207
if not e[t] then return false end

luci-app-openclash/luasrc/model/cbi/openclash/custom-dns-edit.lua

+12-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ o.rempty = false
5959

6060
---- interface
6161
o = s:option(Value, "interface", translate("Specific Interface"))
62-
o.description = translate("DNS Lookup Only Through The Specific Interface")..translate("(Only TUN Core)")
62+
o.description = translate("DNS Lookup Only Through The Specific Interface")
6363
local interfaces = SYS.exec("ls -l /sys/class/net/ 2>/dev/null |awk '{print $9}' 2>/dev/null")
6464
for interface in string.gmatch(interfaces, "%S+") do
6565
o:value(interface)
@@ -68,6 +68,11 @@ o:value("Disable", translate("Disable"))
6868
o.default = "Disable"
6969
o.rempty = false
7070

71+
---- direct-nameserver
72+
o = s:option(Flag, "direct_nameserver", translate("Direct Nameserver"), translate("Use For Domain Need Direct")..translate("(Only Meta Core)"))
73+
o.rmempty = false
74+
o.default = o.disbled
75+
7176
---- Node Domain Resolve
7277
o = s:option(Flag, "node_resolve", translate("Node Domain Resolve"), translate("Use For Node Domain Resolve")..translate("(Only Meta Core)"))
7378
o.rmempty = false
@@ -79,6 +84,12 @@ o:depends("type", "https")
7984
o.rmempty = false
8085
o.default = o.disbled
8186

87+
---- Skip-cert-verify
88+
o = s:option(Flag, "skip_cert_verify", translate("skip-cert-verify"), translate("skip-cert-verify")..translate("(Only Meta Core)"))
89+
o:depends("type", "https")
90+
o.rmempty = false
91+
o.default = o.disbled
92+
8293
---- ECS Subnet
8394
o = s:option(Value, "ecs_subnet", translate("ECS Subnet"),translate("Specify the ECS Subnet Address")..translate("(Only Meta Core)"))
8495
o:depends("type", "https")

luci-app-openclash/luasrc/model/cbi/openclash/other-rules-edit.lua

+6-6
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ end
227227
o:value("DIRECT")
228228
o:value("REJECT")
229229

230-
o = s:option(ListValue, "OpenAI", translate("OpenAI"))
230+
o = s:option(ListValue, "AI_Suite", translate("AI Suite"))
231231
o:depends("rule_name", "lhie1")
232232
o.rmempty = true
233233
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
@@ -407,24 +407,24 @@ o:value("REJECT")
407407
end
408408

409409
local t = {
410-
{Commit, Back}
410+
{Commit, Back}
411411
}
412412
a = m:section(Table, t)
413413

414414
o = a:option(Button,"Commit", " ")
415415
o.inputtitle = translate("Commit Settings")
416416
o.inputstyle = "apply"
417417
o.write = function()
418-
m.uci:commit(openclash)
419-
--luci.http.redirect(m.redirect)
418+
m.uci:commit(openclash)
419+
--luci.http.redirect(m.redirect)
420420
end
421421

422422
o = a:option(Button,"Back", " ")
423423
o.inputtitle = translate("Back Settings")
424424
o.inputstyle = "reset"
425425
o.write = function()
426-
m.uci:revert(openclash, sid)
427-
luci.http.redirect(m.redirect)
426+
m.uci:revert(openclash, sid)
427+
luci.http.redirect(m.redirect)
428428
end
429429

430430
m:append(Template("openclash/toolbar_show"))

luci-app-openclash/luasrc/model/cbi/openclash/proxy-provider-file-manage.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ return r
8787
end
8888

8989
local t = {
90-
{Refresh, Create, Delete_all, Apply}
90+
{Refresh, Create, Delete_all, Apply}
9191
}
9292

9393
a = proxy_form:section(Table, t)

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

+2-8
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,6 @@ o = a:option(Button,"Load_Config", " ")
255255
o.inputtitle = translate("Read Config")
256256
o.inputstyle = "apply"
257257
o.write = function()
258-
m.uci:set("openclash", "config", "enable", 0)
259-
m.uci:commit("openclash")
260258
luci.sys.call("/usr/share/openclash/yml_groups_get.sh 2>/dev/null &")
261259
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash"))
262260
end
@@ -265,18 +263,14 @@ o = a:option(Button, "Commit", " ")
265263
o.inputtitle = translate("Commit Settings")
266264
o.inputstyle = "apply"
267265
o.write = function()
268-
fs.unlink("/tmp/Proxy_Group")
269-
m.uci:set("openclash", "config", "enable", 0)
270-
m.uci:commit("openclash")
266+
fs.unlink("/tmp/Proxy_Group")
271267
end
272268

273269
o = a:option(Button, "Apply", " ")
274270
o.inputtitle = translate("Apply Settings")
275271
o.inputstyle = "apply"
276272
o.write = function()
277-
fs.unlink("/tmp/Proxy_Group")
278-
m.uci:set("openclash", "config", "enable", 0)
279-
m.uci:commit("openclash")
273+
fs.unlink("/tmp/Proxy_Group")
280274
luci.sys.call("/usr/share/openclash/yml_groups_set.sh >/dev/null 2>&1 &")
281275
luci.http.redirect(luci.dispatcher.build_url("admin", "services", "openclash"))
282276
end

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

+3
Original file line numberDiff line numberDiff line change
@@ -1101,13 +1101,16 @@ o = s:taboption("ipv6", ListValue, "ipv6_mode", translate("IPv6 Proxy Mode"))
11011101
o:value("0", translate("TProxy Mode"))
11021102
o:value("1", translate("Redirect Mode"))
11031103
o:value("2", translate("TUN Mode")..translate("(Only Meta Core)"))
1104+
o:value("3", translate("Mix Mode")..translate("(Only Meta Core)"))
11041105
o.default = "0"
11051106
o:depends("ipv6_enable", "1")
11061107

11071108
o = s:taboption("ipv6", ListValue, "stack_type_v6", translate("Select Stack Type"))
11081109
o.description = translate("Select Stack Type For TUN Mode, According To The Running Speed on Your Machine")
11091110
o:depends({ipv6_mode= "2", en_mode = "redir-host"})
11101111
o:depends({ipv6_mode= "2", en_mode = "fake-ip"})
1112+
o:depends({ipv6_mode= "3", en_mode = "redir-host"})
1113+
o:depends({ipv6_mode= "3", en_mode = "fake-ip"})
11111114
o:value("system", translate("System "))
11121115
o:value("gvisor", translate("gVisor"))
11131116
o:value("mixed", translate("Mixed")..translate("(Only Meta Core)"))

luci-app-openclash/luasrc/view/openclash/cfg_check.htm

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div>
33
<%
44
local val = self:cfgvalue(section)
5-
if val == translate("Enable") or val == translate("Config Normal") or val == translate("Exist") then
5+
if val == translate("Enable") or val == translate("Enabled") or val == translate("Config Normal") or val == translate("Exist") then
66
%>
77
<div style="color: green; font-weight:bold;">
88
<%

0 commit comments

Comments
 (0)