Skip to content

Commit ab5a8bd

Browse files
authored
Merge pull request #217 from frainzy1477/test
merge
2 parents e0df72a + 9144322 commit ab5a8bd

45 files changed

Lines changed: 311 additions & 342 deletions

Some content is hidden

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

Makefile

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

33
PKG_NAME:=luci-app-clash
4-
PKG_VERSION:=1.6.3
4+
PKG_VERSION:=1.6.4
55
PKG_MAINTAINER:=frainzy1477
66

77

@@ -12,7 +12,7 @@ define Package/luci-app-clash
1212
CATEGORY:=LuCI
1313
SUBMENU:=2. Clash
1414
TITLE:=LuCI app for clash
15-
DEPENDS:=+luci +luci-base +wget +iptables +coreutils-base64 +coreutils +coreutils-nohup +bash +ipset +libustream-openssl +libopenssl +openssl-util +curl +jsonfilter +ca-certificates +iptables-mod-tproxy
15+
DEPENDS:=+luci +luci-base +wget +iptables +coreutils-base64 +coreutils +coreutils-nohup +bash +ipset +libustream-openssl +openssl-util +curl +jsonfilter +ca-certificates +iptables-mod-tproxy
1616
PKGARCH:=all
1717
MAINTAINER:=frainzy1477
1818
endef
@@ -141,10 +141,10 @@ define Package/$(PKG_NAME)/install
141141
$(INSTALL_BIN) ./root/usr/share/clash/clash.txt $(1)/usr/share/clash/
142142

143143
$(INSTALL_BIN) ./root/usr/share/clash/dashboard/index.html $(1)/usr/share/clash/dashboard/
144-
$(INSTALL_BIN) ./root/usr/share/clash/dashboard/main.9ba3dbeae71a3cb9926b.css $(1)/usr/share/clash/dashboard/
144+
$(INSTALL_BIN) ./root/usr/share/clash/dashboard/main.ad0717ae3407e246a9ab.css $(1)/usr/share/clash/dashboard/
145145
$(INSTALL_BIN) ./root/usr/share/clash/dashboard/img/33343e6117c37aaef8886179007ba6b5.png $(1)/usr/share/clash/dashboard/img/
146-
$(INSTALL_BIN) ./root/usr/share/clash/dashboard/js/1.bundle.9ba3dbeae71a3cb9926b.min.js $(1)/usr/share/clash/dashboard/js/
147-
$(INSTALL_BIN) ./root/usr/share/clash/dashboard/js/bundle.9ba3dbeae71a3cb9926b.min.js $(1)/usr/share/clash/dashboard/js/
146+
$(INSTALL_BIN) ./root/usr/share/clash/dashboard/js/1.bundle.ad0717ae3407e246a9ab.min.js $(1)/usr/share/clash/dashboard/js/
147+
$(INSTALL_BIN) ./root/usr/share/clash/dashboard/js/bundle.ad0717ae3407e246a9ab.min.js $(1)/usr/share/clash/dashboard/js/
148148
$(INSTALL_BIN) ./root/usr/share/clash/yacd/* $(1)/usr/share/clash/yacd/
149149

150150
$(INSTALL_DATA) ./luasrc/clash.lua $(1)/usr/lib/lua/luci/

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
A rule based custom proxy for Openwrt based on <a href="https://github.com/Dreamacro/clash" target="_blank">Clash</a>.
99
</p>
1010
<p align="center">
11-
<a target="_blank" href="https://github.com/frainzy1477/luci-app-clash/releases/tag/v1.6.3">
12-
<img src="https://img.shields.io/badge/luci%20for%20clash-v1.6.3-blue.svg">
11+
<a target="_blank" href="https://github.com/frainzy1477/luci-app-clash/releases/tag/v1.6.4">
12+
<img src="https://img.shields.io/badge/luci%20for%20clash-v1.6.4-blue.svg">
1313
</a>
1414
<!-- <a href="https://github.com/frainzy1477/luci-app-clash/releases" target="_blank">
1515
<img src="https://img.shields.io/github/downloads/frainzy1477/luci-app-clash/total.svg?style=flat-square"/>
@@ -22,8 +22,8 @@
2222

2323
- cd /tmp
2424
- opkg update
25-
- opkg install luci-app-clash_1.6.3_all.ipk
26-
- opkg install luci-app-clash_1.6.3_all.ipk --force-depends
25+
- opkg install luci-app-clash_1.6.4_all.ipk
26+
- opkg install luci-app-clash_1.6.4_all.ipk --force-depends
2727

2828
## Features
2929

@@ -32,6 +32,8 @@
3232
- Iptables udp redirect
3333
- IP Query / Website Access Check
3434
- DNS Forwarding
35+
- Support Trojan
36+
- Support SSR
3537
- Ping Custom proxy servers
3638
- Create v2ray & ssr clash config from subscription url
3739
- Create Custom Clash Config

luasrc/controller/clash.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ end
334334
function act_ping()
335335
local e={}
336336
e.index=luci.http.formvalue("index")
337-
e.ping=luci.sys.exec("ping -c 1 -W 1 -w 10 %q 2>&1 | grep -o 'time=[0-9]*.[0-9]' | awk -F '=' '{print$2}'"%luci.http.formvalue("domain"))
337+
e.ping=luci.sys.exec("ping -c 1 -W 1 -w 5 %q 2>&1 | grep -o 'time=[0-9]*.[0-9]' | awk -F '=' '{print$2}'"%luci.http.formvalue("domain"))
338338
luci.http.prepare_content("application/json")
339339
luci.http.write_json(e)
340340
end

luasrc/model/cbi/clash/client.lua

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ o:value("4", translate("Clash(dTun)"))
2929
end
3030
o.description = translate("Select core, clashr support ssr while clash does not.")
3131

32-
33-
o = s:option(ListValue, "new_conf", translate("New Config(Rename fields)"))
34-
o:value("0", translate("Disable"))
35-
o:value("1", translate("Enable"))
36-
o.description = translate("https://github.com/Dreamacro/clash/commit/88d8f937938d7aba774b1af638df6910b1a1a14d")
37-
3832
o = s:option(ListValue, "g_rules", translate("Game Rules"))
3933
o.default = "0"
4034
o:value("0", translate("Disable"))

luasrc/model/cbi/clash/create.lua

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,6 @@ o.title = translate("Config Name")
7171
o.rmempty = true
7272
o.description = translate("Give a name for your config")
7373

74-
o = s:option(ListValue, "new_conff", translate("New Config(Rename fields)"))
75-
o:value("0", translate("Disable"))
76-
o:value("1", translate("Enable"))
77-
o.description = translate("https://github.com/Dreamacro/clash/commit/88d8f937938d7aba774b1af638df6910b1a1a14d")
78-
7974
cc = s:option(Flag, "same_tag", translate("Force Same Name"))
8075
cc.default = 1
8176
cc.description = translate("Enable to overwrite config file")

luasrc/model/cbi/clash/dns.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ deldns.description = translate("Remove Lan custom DNS Servers when client is dis
3737
cdns = s:option(Flag, "culan", translate("Enable Lan DNS"))
3838
cdns.default = 1
3939
cdns.description = translate("Enabling will set custom DNS Servers for Lan")
40-
cdns:depends("dnsforwader", 0)
40+
4141

4242
dns = s:option(DynamicList, "landns", translate("Lan DNS servers"))
4343
dns.description = translate("Set custom DNS Servers for Lan")

luasrc/model/cbi/clash/groups.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ o:value("select", translate("Select"))
2727
o:value("url-test", translate("URL-Test"))
2828
o:value("fallback", translate("Fallback"))
2929
o:value("load-balance", translate("Load-Balance"))
30+
o:value("relay", translate("Relay"))
3031

3132
o = s:option(Value, "name", translate("Group Name"))
3233
o.rmempty = false

luasrc/model/cbi/clash/import.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ sul =ko:section(TypedSection, "clash", translate("Upload Config"))
8787
sul.anonymous = true
8888
sul.addremove=false
8989
o = sul:option(FileUpload, "")
90-
o.description = translate("NB: Only upload file with name .yaml.It recommended to rename each upload file name to avoid overwrite")
90+
--o.description = translate("NB: Only upload file with name .yaml.It recommended to rename each upload file name to avoid overwrite")
9191
o.title = translate(" ")
9292
o.template = "clash/clash_upload"
9393
um = sul:option(DummyValue, "", nil)
@@ -96,6 +96,7 @@ um.template = "clash/clash_dvalue"
9696
local dir, fd
9797
dir = "/usr/share/clash/config/upload/"
9898
http.setfilehandler(
99+
99100
function(meta, chunk, eof)
100101
if not fd then
101102
if not meta then return end
@@ -113,9 +114,15 @@ http.setfilehandler(
113114
if eof and fd then
114115
fd:close()
115116
fd = nil
117+
local e=string.lower(string.sub(meta.file,-4,-1))
118+
local yml2=string.lower(string.sub(meta.file,0,-5))
119+
if e == '.yml' then
116120
local yml=string.lower(string.sub(meta.file,0,-5))
117121
local c=fs.rename(dir .. meta.file,"/usr/share/clash/config/upload/".. yml .. ".yaml")
118122
um.value = translate("File saved to") .. ' "/usr/share/clash/config/upload/'..yml..'.yaml"'
123+
else
124+
um.value = translate("File saved to") .. ' "/usr/share/clash/config/upload/'..yml2..'yaml"'
125+
end
119126

120127
end
121128
end

luasrc/model/cbi/clash/other.lua

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,10 @@ end
6262

6363

6464
w = Map("clash")
65-
s = w:section(TypedSection, "clash" , translate("New Config(Rename fields)"))
65+
s = w:section(TypedSection, "clash" , translate("Load Groups)"))
6666
s.anonymous = true
6767

6868

69-
o = s:option(ListValue, "new_conff", translate("New Config(Rename fields)"))
70-
o:value("0", translate("Disable"))
71-
o:value("1", translate("Enable"))
72-
o.description = translate("https://github.com/Dreamacro/clash/commit/88d8f937938d7aba774b1af638df6910b1a1a14d")
73-
74-
o=s:option(Button,"nwewcf")
75-
o.inputtitle = translate("Save & Apply")
76-
o.title = translate("Save & Apply")
77-
o.inputstyle = "reload"
78-
o.write = function()
79-
w.uci:commit("clash")
80-
end
81-
8269
o = s:option(Button, "Load")
8370
o.inputtitle = translate("Load Groups")
8471
o.title = translate("Load Groups")

luasrc/model/cbi/clash/provider-config.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ o = s:option(DynamicList, "groups", translate("Policy Group"))
132132
o.rmempty = true
133133
m.uci:foreach("clash", "groups",
134134
function(s)
135-
o:value(s.name)
135+
if s.name ~= "" and s.name ~= nil and s.type ~= "relay" then
136+
o:value(s.name)
137+
end
136138
end)
137139

138140

0 commit comments

Comments
 (0)