Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
vernesong committed Jul 6, 2022
2 parents 474b549 + 5af8bed commit fb75551
Show file tree
Hide file tree
Showing 83 changed files with 529 additions and 165 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<a target="_blank" href="https://github.com/Dreamacro/clash/releases/tag/v1.10.6">
<img src="https://img.shields.io/badge/Clash-v1.10.6-blue.svg">
</a>
<a target="_blank" href="https://github.com/vernesong/OpenClash/tree/v0.45.33-beta">
<img src="https://img.shields.io/badge/source code-v0.45.33--beta-green.svg">
<a target="_blank" href="https://github.com/vernesong/OpenClash/tree/v0.45.35-beta">
<img src="https://img.shields.io/badge/source code-v0.45.35--beta-green.svg">
</a>
<a target="_blank" href="https://github.com/vernesong/OpenClash/releases/tag/v0.45.33-beta">
<img src="https://img.shields.io/badge/New Release-v0.45.33--beta-orange.svg">
<a target="_blank" href="https://github.com/vernesong/OpenClash/releases/tag/v0.45.35-beta">
<img src="https://img.shields.io/badge/New Release-v0.45.35--beta-orange.svg">
</a>
</p>

Expand Down
Binary file modified core-lateset/dev/clash-linux-386.tar.gz
Binary file not shown.
Binary file modified core-lateset/dev/clash-linux-amd64-v3.tar.gz
Binary file not shown.
Binary file modified core-lateset/dev/clash-linux-amd64.tar.gz
Binary file not shown.
Binary file modified core-lateset/dev/clash-linux-armv5.tar.gz
Binary file not shown.
Binary file modified core-lateset/dev/clash-linux-armv6.tar.gz
Binary file not shown.
Binary file modified core-lateset/dev/clash-linux-armv7.tar.gz
Binary file not shown.
Binary file modified core-lateset/dev/clash-linux-armv8.tar.gz
Binary file not shown.
Binary file modified core-lateset/dev/clash-linux-mips-hardfloat.tar.gz
Binary file not shown.
Binary file modified core-lateset/dev/clash-linux-mips-softfloat.tar.gz
Binary file not shown.
Binary file modified core-lateset/dev/clash-linux-mips64.tar.gz
Binary file not shown.
Binary file modified core-lateset/dev/clash-linux-mips64le.tar.gz
Binary file not shown.
Binary file modified core-lateset/dev/clash-linux-mipsle-hardfloat.tar.gz
Binary file not shown.
Binary file modified core-lateset/dev/clash-linux-mipsle-softfloat.tar.gz
Binary file not shown.
Binary file modified core-lateset/meta/clash-linux-386.tar.gz
Binary file not shown.
Binary file modified core-lateset/meta/clash-linux-amd64-v3.tar.gz
Binary file not shown.
Binary file modified core-lateset/meta/clash-linux-amd64.tar.gz
Binary file not shown.
Binary file modified core-lateset/meta/clash-linux-armv5.tar.gz
Binary file not shown.
Binary file modified core-lateset/meta/clash-linux-armv6.tar.gz
Binary file not shown.
Binary file modified core-lateset/meta/clash-linux-armv7.tar.gz
Binary file not shown.
Binary file modified core-lateset/meta/clash-linux-armv8.tar.gz
Binary file not shown.
Binary file modified core-lateset/meta/clash-linux-mips-hardfloat.tar.gz
Binary file not shown.
Binary file modified core-lateset/meta/clash-linux-mips-softfloat.tar.gz
Binary file not shown.
Binary file modified core-lateset/meta/clash-linux-mips64.tar.gz
Binary file not shown.
Binary file modified core-lateset/meta/clash-linux-mips64le.tar.gz
Binary file not shown.
Binary file modified core-lateset/meta/clash-linux-mipsle-hardfloat.tar.gz
Binary file not shown.
Binary file modified core-lateset/meta/clash-linux-mipsle-softfloat.tar.gz
Binary file not shown.
Binary file not shown.
Binary file removed core-lateset/premium/clash-linux-386-2022.06.19.gz
Binary file not shown.
Binary file not shown.
Binary file removed core-lateset/premium/clash-linux-amd64-2022.06.19.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed core-lateset/premium/clash-linux-armv6-2022.06.19.gz
Binary file not shown.
Binary file not shown.
Binary file removed core-lateset/premium/clash-linux-armv7-2022.06.19.gz
Binary file not shown.
Binary file not shown.
Binary file removed core-lateset/premium/clash-linux-armv8-2022.06.19.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 3 additions & 3 deletions core_version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
v1.11.0
2022.06.19
alpha-g30a0834
v1.11.0-7-g5497ada
2022.06.19-13-ga45638d
alpha-g503b1ef
2 changes: 1 addition & 1 deletion luci-app-openclash/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=luci-app-openclash
PKG_VERSION:=0.45.33
PKG_VERSION:=0.45.35
PKG_RELEASE:=beta
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>

Expand Down
1 change: 1 addition & 0 deletions luci-app-openclash/luasrc/controller/openclash.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ function index()
entry({"admin", "services", "openclash", "settings"},cbi("openclash/settings"),_("Global Settings"), 30).leaf = true
entry({"admin", "services", "openclash", "servers"},cbi("openclash/servers"),_("Servers and Groups"), 40).leaf = true
entry({"admin", "services", "openclash", "other-rules-edit"},cbi("openclash/other-rules-edit"), nil).leaf = true
entry({"admin", "services", "openclash", "custom-dns-edit"},cbi("openclash/custom-dns-edit"), nil).leaf = true
entry({"admin", "services", "openclash", "other-file-edit"},cbi("openclash/other-file-edit"), nil).leaf = true
entry({"admin", "services", "openclash", "rule-providers-settings"},cbi("openclash/rule-providers-settings"),_("Rule Providers and Groups"), 50).leaf = true
entry({"admin", "services", "openclash", "game-rules-manage"},form("openclash/game-rules-manage"), nil).leaf = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,5 @@ o.write = function()
luci.http.redirect(m.redirect)
end

m:append(Template("openclash/toolbar_show"))
return m
126 changes: 126 additions & 0 deletions luci-app-openclash/luasrc/model/cbi/openclash/custom-dns-edit.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
local m, s, o
local openclash = "openclash"
local uci = luci.model.uci.cursor()
local fs = require "luci.openclash"
local SYS = require "luci.sys"
local sid = arg[1]

font_red = [[<b style=color:red>]]
font_green = [[<b style=color:green>]]
font_off = [[</b>]]
bold_on = [[<strong>]]
bold_off = [[</strong>]]

m = Map(openclash, translate("Add Custom DNS Servers"))
m.pageaction = false
m.redirect = luci.dispatcher.build_url("admin/services/openclash/settings")
if m.uci:get(openclash, sid) ~= "dns_servers" then
luci.http.redirect(m.redirect)
return
end

-- [[ Edit Custom DNS ]] --
s = m:section(NamedSection, sid, "dns_servers")
s.anonymous = true
s.addremove = false

---- group
o = s:option(ListValue, "group", translate("DNS Server Group"))
o.description = font_red..bold_on..translate("NameServer Group Must Be Set")..bold_off..font_off
o:value("nameserver", translate("NameServer"))
o:value("fallback", translate("FallBack"))
o.default = "nameserver"
o.rempty = false

---- IP address
o = s:option(Value, "ip", translate("DNS Server Address"))
o.description = translate("Do Not Add Type Ahead")
o.placeholder = translate("Not Null")
o.datatype = "or(host, string)"
o.rmempty = true

---- port
o = s:option(Value, "port", translate("DNS Server Port"))
o.description = translate("Require When Use Non-Standard Port")
o.datatype = "port"
o.rempty = true

---- type
o = s:option(ListValue, "type", translate("DNS Server Type"))
o.description = translate("Communication protocol")
o:value("udp", translate("UDP"))
o:value("tcp", translate("TCP"))
o:value("tls", translate("TLS"))
o:value("https", translate("HTTPS"))
o:value("quic", translate("QUIC ")..translate("(Only Meta Core)"))
o.default = "udp"
o.rempty = false

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

---- Node Domain Resolve
o = s:option(Flag, "node_resolve", translate("Node Domain Resolve"), translate("Use For Node Domain Resolve")..translate("(Only Meta Core)"))
o.rmempty = false
o.default = o.disbled

---- Proxy group
o = s:option(Value, "specific_group", translate("Specific Group"))
o.description = translate("Group Use For Proxy The DNS")..translate("(Only Meta Core)")
local groupnames,filename
filename = m.uci:get(openclash, "config", "config_path")
if filename then
groupnames = SYS.exec(string.format('ruby -ryaml -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',filename))
if groupnames then
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
if groupname ~= nil and groupname ~= "" then
o:value(groupname)
end
end
end
end

m.uci:foreach("openclash", "groups",
function(s)
if s.name ~= "" and s.name ~= nil then
o:value(s.name)
end
end)

o:value("DIRECT")
o:value("REJECT")
o:value("Disable", translate("Disable"))
o.default = "Disable"
o.rempty = false

local t = {
{Commit, Back}
}
a = m:section(Table, t)

o = a:option(Button,"Commit", " ")
o.inputtitle = translate("Commit Settings")
o.inputstyle = "apply"
o.write = function()
m.uci:commit(openclash)
luci.http.redirect(m.redirect)
end

o = a:option(Button,"Back", " ")
o.inputtitle = translate("Back Settings")
o.inputstyle = "reset"
o.write = function()
m.uci:revert(openclash, sid)
luci.http.redirect(m.redirect)
end

m:append(Template("openclash/toolbar_show"))
return m
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,5 @@ o.write = function()
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "config"))
end

rule_form:append(Template("openclash/toolbar_show"))
return rule_form
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,5 @@ o.write = function()
luci.http.redirect(m.redirect)
end

m:append(Template("openclash/toolbar_show"))
return m
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ o.write = function()
end

m:append(Template("openclash/config_editor"))

m:append(Template("openclash/toolbar_show"))
return m
Original file line number Diff line number Diff line change
Expand Up @@ -403,4 +403,5 @@ o.write = function()
luci.http.redirect(m.redirect)
end

m:append(Template("openclash/toolbar_show"))
return m
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,5 @@ o.write = function()
luci.http.redirect(m.redirect)
end

m:append(Template("openclash/toolbar_show"))
return m
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,5 @@ o.write = function()
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "config"))
end

proxy_form:append(Template("openclash/toolbar_show"))
return proxy_form
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,26 @@ o:value("1", translate("Extended Match"))
o = s:option(ListValue, "group", translate("Set Proxy Group"))
o.description = font_red..bold_on..translate("The Added Proxy Groups Must Exist Except 'DIRECT' & 'REJECT'")..bold_off..font_off
o.rmempty = true
local groupnames,filename
filename = m.uci:get(openclash, "config", "config_path")
if filename then
groupnames = sys.exec(string.format('ruby -ryaml -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',filename))
if groupnames then
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
if groupname ~= nil and groupname ~= "" then
o:value(groupname)
end
end
end
end

m.uci:foreach("openclash", "groups",
function(s)
if s.name ~= "" and s.name ~= nil then
o:value(s.name)
end
end)
function(s)
if s.name ~= "" and s.name ~= nil then
o:value(s.name)
end
end)

o:value("DIRECT")
o:value("REJECT")

Expand All @@ -137,4 +151,5 @@ o.write = function()
luci.http.redirect(m.redirect)
end

m:append(Template("openclash/toolbar_show"))
return m
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,5 @@ o.write = function()
HTTP.redirect(DISP.build_url("admin", "services", "openclash", "config"))
end

rule_form:append(Template("openclash/toolbar_show"))
return rule_form
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,26 @@ o.rmempty = true

---- Proxy Group
o = s:option(ListValue, "group", translate("Select Proxy Group"))
uci:foreach("openclash", "groups",
function(s)
if s.name ~= "" and s.name ~= nil then
o:value(s.name)
local groupnames,filename
filename = m.uci:get(openclash, "config", "config_path")
if filename then
groupnames = SYS.exec(string.format('ruby -ryaml -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',filename))
if groupnames then
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
if groupname ~= nil and groupname ~= "" then
o:value(groupname)
end
end)
end
end
end

uci:foreach("openclash", "groups",
function(s)
if s.name ~= "" and s.name ~= nil then
o:value(s.name)
end
end)

o:value("DIRECT")
o:value("REJECT")
o.rmempty = true
Expand Down Expand Up @@ -155,12 +169,26 @@ o.rmempty = true

---- Proxy Group
o = s:option(ListValue, "group", translate("Select Proxy Group"))
uci:foreach("openclash", "groups",
function(s)
if s.name ~= "" and s.name ~= nil then
o:value(s.name)
local groupnames,filename
filename = m.uci:get(openclash, "config", "config_path")
if filename then
groupnames = SYS.exec(string.format('ruby -ryaml -E UTF-8 -e "YAML.load_file(\'%s\')[\'proxy-groups\'].each do |i| puts i[\'name\']+\'##\' end" 2>/dev/null',filename))
if groupnames then
for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do
if groupname ~= nil and groupname ~= "" then
o:value(groupname)
end
end)
end
end
end

uci:foreach("openclash", "groups",
function(s)
if s.name ~= "" and s.name ~= nil then
o:value(s.name)
end
end)

o:value("DIRECT")
o:value("REJECT")
o.rmempty = true
Expand Down
17 changes: 9 additions & 8 deletions luci-app-openclash/luasrc/model/cbi/openclash/servers-config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -162,24 +162,24 @@ for _, v in ipairs(hysteria_protocols) do o:value(v) end
o.rmempty = false
o:depends("type", "hysteria")

o = s:option(Value, "up_mbps", translate("up_mbps"))
o = s:option(Value, "hysteria_up", translate("up"))
o.rmempty = true
o.datatype = "uinteger"
o.description = translate("Required")
o:depends("type", "hysteria")

o = s:option(Value, "down_mbps", translate("down_mbps"))
o = s:option(Value, "hysteria_down", translate("down"))
o.rmempty = true
o.datatype = "uinteger"
o.description = translate("Required")
o:depends("type", "hysteria")

o = s:option(Value, "hysteria_up", translate("Up"))
o = s:option(Value, "up_mbps", translate("up_mbps"))
o.rmempty = true
o.description = translate("Mutual Exclusion With up_mbps")
o.datatype = "uinteger"
o:depends("type", "hysteria")

o = s:option(Value, "hysteria_down", translate("Down"))
o = s:option(Value, "down_mbps", translate("down_mbps"))
o.rmempty = true
o.description = translate("Mutual Exclusion With down_mbps")
o.datatype = "uinteger"
o:depends("type", "hysteria")

o = s:option(Value, "psk", translate("Psk"))
Expand Down Expand Up @@ -570,4 +570,5 @@ o.write = function()
luci.http.redirect(m.redirect)
end

m:append(Template("openclash/toolbar_show"))
return m
Loading

0 comments on commit fb75551

Please sign in to comment.