Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
vernesong committed Nov 5, 2022
2 parents d6840ac + 1537ad2 commit e475a5d
Show file tree
Hide file tree
Showing 163 changed files with 67,360 additions and 1,275 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ body:
- Linux-armv5
- Linux-armv6
- Linux-armv7
- Linux-armv8
- Linux-arm64
- Linux-mips-hardfloat
- Linux-mips-softfloat
- Linux-mips64
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
</h1>

<p align="center">
<a target="_blank" href="https://github.com/Dreamacro/clash/releases/tag/v1.11.8">
<img src="https://img.shields.io/badge/Clash-v1.11.8-blue.svg">
<a target="_blank" href="https://github.com/Dreamacro/clash/releases/tag/v1.11.12">
<img src="https://img.shields.io/badge/Clash-v1.11.12-blue.svg">
</a>
<a target="_blank" href="https://github.com/vernesong/OpenClash/tree/v0.45.59-beta">
<img src="https://img.shields.io/badge/source code-v0.45.59--beta-green.svg">
<a target="_blank" href="https://github.com/vernesong/OpenClash/tree/v0.45.69-beta">
<img src="https://img.shields.io/badge/source code-v0.45.69--beta-green.svg">
</a>
<a target="_blank" href="https://github.com/vernesong/OpenClash/releases/tag/v0.45.59-beta">
<img src="https://img.shields.io/badge/New Release-v0.45.59--beta-orange.svg">
<a target="_blank" href="https://github.com/vernesong/OpenClash/releases/tag/v0.45.69-beta">
<img src="https://img.shields.io/badge/New Release-v0.45.69--beta-orange.svg">
</a>
</p>

Expand Down Expand Up @@ -46,7 +46,6 @@

* luci
* luci-base
* iptables(iptables)
* dnsmasq-full
* coreutils
* coreutils-nohup
Expand All @@ -55,29 +54,30 @@
* ca-certificates
* ipset
* ip-full
* iptables-mod-tproxy(iptables)
* iptables-mod-extra(iptables)
* libcap
* libcap-bin
* ruby
* ruby-yaml
* unzip
* iptables(iptables)
* kmod-ipt-nat(iptables)
* iptables-mod-tproxy(iptables)
* iptables-mod-extra(iptables)
* kmod-tun(TUN模式)
* luci-compat(Luci >= 19.07)
* ip6tables-mod-nat(iptables-ipv6)
* kmod-inet-diag(PROCESS-NAME)
* kmod-ipt-nat(iptables)
* kmod-nft-tproxy(Firewall4)


编译
---


从 OpenWrt 的 [SDK](http://wiki.openwrt.org/doc/howto/obtain.firmware.sdk) 编译
从 OpenWrt 的 [SDK](https://archive.openwrt.org/snapshots/trunk/ar71xx/generic/OpenWrt-SDK-ar71xx-generic_gcc-5.3.0_musl-1.1.16.Linux-x86_64.tar.bz2) 编译
```bash
# 解压下载好的 SDK
tar xjf OpenWrt-SDK-ar71xx-for-linux-x86_64-gcc-4.8-linaro_uClibc-0.9.33.2.tar.bz2
tar xjf OpenWrt-SDK-ar71xx-generic_gcc-5.3.0_musl-1.1.16.Linux-x86_64.tar.bz2
cd OpenWrt-SDK-ar71xx-*

# Clone 项目
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 added core-lateset/dev/clash-linux-arm64.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-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 added core-lateset/meta/clash-linux-arm64.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-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 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.8-3-g4f291fa
2022.08.26-3-ge16bdd2
alpha-g9b89ff9
v1.11.12-1-gde264c4
2022.08.26-16-gb4d832d
alpha-g4c5853e
3 changes: 2 additions & 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.59
PKG_VERSION:=0.45.69
PKG_RELEASE:=beta
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>

Expand Down Expand Up @@ -123,6 +123,7 @@ define Package/$(PKG_NAME)/postrm
rm -rf /tmp/dnsmasq.d/dnsmasq_openclash_custom_domain.conf >/dev/null 2>&1
rm -rf /tmp/dnsmasq.d/dnsmasq_openclash_chnroute_pass.conf >/dev/null 2>&1
rm -rf /tmp/dnsmasq.d/dnsmasq_openclash_chnroute6_pass.conf >/dev/null 2>&1
rm -rf /tmp/dnsmasq.d/dnsmasq_accelerated-domains.china.conf >/dev/null 2>&1
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
Expand Down
80 changes: 49 additions & 31 deletions luci-app-openclash/luasrc/controller/openclash.lua
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ local function db_foward_ssl()
end

local function check_lastversion()
luci.sys.exec("sh /usr/share/openclash/openclash_version.sh 2>/dev/null")
luci.sys.exec("bash /usr/share/openclash/openclash_version.sh 2>/dev/null")
return luci.sys.exec("sed -n '/^https:/,$p' /tmp/openclash_last_version 2>/dev/null")
end

Expand All @@ -223,7 +223,7 @@ local function coremodel()
if opkg and opkg.info("libc") and opkg.info("libc")["libc"] then
return opkg.info("libc")["libc"]["Architecture"]
else
return luci.sys.exec("opkg status libc 2>/dev/null |grep 'Architecture' |awk -F ': ' '{print $2}' 2>/dev/null")
return luci.sys.exec("rm -f /var/lock/opkg.lock && opkg status libc 2>/dev/null |grep 'Architecture' |awk -F ': ' '{print $2}' 2>/dev/null")
end
end

Expand Down Expand Up @@ -252,7 +252,7 @@ local function coremetacv()
end

local function corelv()
luci.sys.call("sh /usr/share/openclash/clash_version.sh")
luci.sys.call("bash /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")
local core_meta_lv = luci.sys.exec("sed -n 3p /tmp/clash_last_version 2>/dev/null")
Expand All @@ -263,26 +263,26 @@ local function opcv()
if opkg and opkg.info("luci-app-openclash") and opkg.info("luci-app-openclash")["luci-app-openclash"] then
return "v" .. opkg.info("luci-app-openclash")["luci-app-openclash"]["Version"]
else
return luci.sys.exec("opkg status luci-app-openclash 2>/dev/null |grep 'Version' |awk -F 'Version: ' '{print \"v\"$2}'")
return luci.sys.exec("rm -f /var/lock/opkg.lock && opkg status luci-app-openclash 2>/dev/null |grep 'Version' |awk -F 'Version: ' '{print \"v\"$2}'")
end
end

local function oplv()
local new = luci.sys.call(string.format("sh /usr/share/openclash/openclash_version.sh"))
local new = luci.sys.call(string.format("bash /usr/share/openclash/openclash_version.sh"))
local oplv = luci.sys.exec("sed -n 1p /tmp/openclash_last_version 2>/dev/null")
return oplv .. "," .. new
end

local function opup()
luci.sys.call("rm -rf /tmp/*_last_version 2>/dev/null && sh /usr/share/openclash/openclash_version.sh >/dev/null 2>&1")
return luci.sys.call("sh /usr/share/openclash/openclash_update.sh >/dev/null 2>&1 &")
luci.sys.call("rm -rf /tmp/*_last_version 2>/dev/null && bash /usr/share/openclash/openclash_version.sh >/dev/null 2>&1")
return luci.sys.call("bash /usr/share/openclash/openclash_update.sh >/dev/null 2>&1 &")
end

local function coreup()
uci:set("openclash", "config", "enable", "1")
uci:commit("openclash")
local type = luci.http.formvalue("core_type")
luci.sys.call("rm -rf /tmp/*_last_version 2>/dev/null && sh /usr/share/openclash/clash_version.sh >/dev/null 2>&1")
luci.sys.call("rm -rf /tmp/*_last_version 2>/dev/null && bash /usr/share/openclash/clash_version.sh >/dev/null 2>&1")
return luci.sys.call(string.format("/usr/share/openclash/openclash_core.sh '%s' >/dev/null 2>&1 &", type))
end

Expand Down Expand Up @@ -378,7 +378,7 @@ function action_remove_all_core()
end

function action_one_key_update()
return luci.sys.call("sh /usr/share/openclash/openclash_update.sh 'one_key_update' >/dev/null 2>&1 &")
return luci.sys.call("bash /usr/share/openclash/openclash_update.sh 'one_key_update' >/dev/null 2>&1 &")
end

local function dler_login_info_save()
Expand Down Expand Up @@ -1145,31 +1145,49 @@ function action_refresh_log()
line = log_tb[i]:reverse()
line_trans = line
ex_match = false
core_match = false
time_format = false
while true do
ex_keys = {"UDP%-Receive%-Buffer%-Size", "^Sec%-Fetch%-Mode", "^User%-Agent", "^Access%-Control", "^Accept", "^Origin", "^Referer", "^Connection", "^Pragma", "^Cache-"}
for key=1, #ex_keys do
if string.find (line, ex_keys[key]) then
ex_match = true
break
end
end
if ex_match then break end
if not string.find (line, "level=") then
if not string.find (line, "") or not string.find (line, "") then
line_trans = trans_line_nolabel(line)
for key=1, #ex_keys do
if string.find (line, ex_keys[key]) then
ex_match = true
break
end
end
if ex_match then break end

core_keys = {" DBG ", " INF ", "level=", " WRN ", " ERR "}
for key=1, #core_keys do
if string.find(string.sub(line, 0, 13), core_keys[key]) or (string.find(line, core_keys[key]) and core_keys[key] == "level=") then
core_match = true
if core_keys[key] ~= "level=" then
time_format = true
end
break
end
end
if time_format then
if string.match(string.sub(line, 0, 8), "%d%d:%d%d:%d%d") then
line_trans = '"'..os.date("%Y-%m-%d %H:%M:%S", tonumber(string.sub(line, 0, 8)))..'"'..string.sub(line, 9, -1)
end
end
if not core_match then
if not string.find (line, "") or not string.find (line, "") then
line_trans = trans_line_nolabel(line)
else
line_trans = trans_line(line)
end
end
if data == "" then
data = line_trans
elseif log_len == 0 and i == limit then
data = data .."\n" .. line_trans .. "\n..."
else
line_trans = trans_line(line)
data = data .."\n" .. line_trans
end
end
if data == "" then
data = line_trans
elseif log_len == 0 and i == limit then
data = data .."\n" .. line_trans .. "\n..."
else
data = data .."\n" .. line_trans
end
break
end
break
end
end
luci.http.write_json({
len = len,
Expand Down Expand Up @@ -1551,7 +1569,7 @@ function all_proxies_stream_test()
end

function trans_line_nolabel(data)
local line_trans = "data"
local line_trans = ""
if string.match(string.sub(data, 0, 19), "%d%d%d%d%-%d%d%-%d%d %d%d:%d%d:%d%d") then
line_trans = string.sub(data, 0, 20)..luci.i18n.translate(string.sub(data, 21, -1))
else
Expand Down
29 changes: 27 additions & 2 deletions luci-app-openclash/luasrc/model/cbi/openclash/servers-config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,31 @@ o:depends("type", "socks5")
o:depends("type", "trojan")
o:depends({type = "snell", snell_version = "3"})

o = s:option(ListValue, "xudp", translate("XUDP Enable")..translate("(Only Meta Core)"))
o.rmempty = true
o.default = "false"
o:value("true")
o:value("false")
o:depends({type = "vmess", udp = "true"})

o = s:option(Value, "packet_encoding", translate("Packet-Encoding")..translate("(Only Meta Core)"))
o.rmempty = true
o:depends("type", "vmess")

o = s:option(ListValue, "global_padding", translate("Global-Padding")..translate("(Only Meta Core)"))
o.rmempty = true
o.default = "false"
o:value("true")
o:value("false")
o:depends("type", "vmess")

o = s:option(ListValue, "authenticated_length", translate("Authenticated-Length")..translate("(Only Meta Core)"))
o.rmempty = true
o.default = "false"
o:value("true")
o:value("false")
o:depends("type", "vmess")

o = s:option(ListValue, "obfs", translate("obfs-mode"))
o.rmempty = true
o.default = "none"
Expand Down Expand Up @@ -449,9 +474,9 @@ o:value("http/1.1")
o:depends("type", "trojan")

-- [[ alpn ]]--
o = s:option(Value, "hysteria_alpn", translate("alpn"))
o = s:option(DynamicList, "hysteria_alpn", translate("alpn"))
o.rmempty = false
o.default = "h3"
o:value("h3")
o:depends("type", "hysteria")

-- [[ grpc ]]--
Expand Down
Loading

0 comments on commit e475a5d

Please sign in to comment.