Skip to content

Commit 5f9594f

Browse files
authored
Merge pull request #334 from frainzy1477/test
Test
2 parents 9359f15 + ee969e9 commit 5f9594f

57 files changed

Lines changed: 157 additions & 130 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/x86-64_gcc.yml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
on:
22
push:
3-
tags:
4-
- 'v*.*.*.*'
3+
branches:
4+
- test
55

66
name: luci-app-clash
77
jobs:
@@ -14,15 +14,8 @@ jobs:
1414

1515
steps:
1616
- name: Checkout - ${{ github.ref }}
17-
uses: actions/checkout@v2
18-
19-
- name: Checkout tag
20-
run: |
21-
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
22-
tag_name="${GITHUB_REF##*/}"
23-
echo Tag $tag_name
24-
git checkout $tag_name
25-
17+
uses: actions/checkout@v1
18+
2619
- name: Prepare SDK ENV
2720
run: |
2821
wget -q "${URL}"
@@ -63,19 +56,11 @@ jobs:
6356
- name: Build target
6457
env:
6558
DEBIAN_FRONTEND: noninteractive
66-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6759
run: |
6860
make package/${PKGN}/compile -j$(nproc) V=s
6961
mkdir ../bin
7062
find bin/ -type f -name "*${PKGN}*" | xargs -t -i mv -vf {} ../bin
71-
assets=()
72-
for asset in ../bin/*.ipk; do
73-
assets+=("-a" "$asset")
74-
done
75-
tag_name="${GITHUB_REF##*/}"
76-
hub release create -p -d "${assets[@]}" -m "$tag_name" "$tag_name"
7763
78-
7964
- name: Upload - push to artifact file
8065
uses: actions/upload-artifact@v1
8166
with:

Makefile

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

33
PKG_NAME:=luci-app-clash
4-
PKG_VERSION:=v1.7.5.5
4+
PKG_VERSION:=v1.7.5.6
55
PKG_MAINTAINER:=frainzy1477
66

77
include $(INCLUDE_DIR)/package.mk
88

99
define Package/$(PKG_NAME)
1010
SECTION:=luci
1111
CATEGORY:=LuCI
12-
SUBMENU:=2. Clash
12+
SUBMENU:=2. Clash For OpenWRT
1313
TITLE:=LuCI app for clash
1414
DEPENDS:=+luci-base +wget +iptables +coreutils-base64 +coreutils +coreutils-nohup +bash +ipset +libustream-openssl +curl +jsonfilter +ca-certificates +iptables-mod-tproxy +kmod-tun
1515
PKGARCH:=all
@@ -39,12 +39,12 @@ define Package/$(PKG_NAME)/prerm
3939
# check if we are on real system
4040
if [ -z "$${IPKG_INSTROOT}" ]; then
4141
echo "Removing rc.d symlink for clash"
42-
/etc/init.d/clash disable
43-
/etc/init.d/clash stop
42+
/etc/init.d/clash disable
43+
/etc/init.d/clash stop
4444
echo "Removing firewall rule for clash"
45-
uci -q batch <<-EOF >/dev/null
46-
delete firewall.clash
47-
commit firewall
45+
uci -q batch <<-EOF >/dev/null
46+
delete firewall.clash
47+
commit firewall
4848
EOF
4949
fi
5050

@@ -53,7 +53,7 @@ endef
5353

5454
define Package/$(PKG_NAME)/preinst
5555
#!/bin/sh
56-
56+
/etc/init.d/clash disable 2>/dev/null
5757
if [ -z "$${IPKG_INSTROOT}" ]; then
5858
rm -rf /tmp/dnsmasq.d/custom_list.conf 2>/dev/null
5959
rm -rf /tmp/dnsmasq.clash 2>/dev/null
@@ -70,6 +70,7 @@ if [ -z "$${IPKG_INSTROOT}" ]; then
7070
mv /usr/share/clash/rule.yaml /usr/share/clashbackup/rule.bak 2>/dev/null
7171
fi
7272

73+
7374
exit 0
7475
endef
7576

@@ -85,6 +86,7 @@ if [ -z "$${IPKG_INSTROOT}" ]; then
8586
mv /usr/share/clashbackup/rule.bak /usr/share/clash/rule.yaml 2>/dev/null
8687
/etc/init.d/clash disable 2>/dev/null
8788
fi
89+
/etc/init.d/clash disable 2>/dev/null
8890

8991
exit 0
9092
endef
@@ -147,10 +149,10 @@ define Package/$(PKG_NAME)/install
147149
$(INSTALL_BIN) ./root/usr/share/clash/clash.txt $(1)/usr/share/clash
148150

149151
$(INSTALL_BIN) ./root/usr/share/clash/dashboard/index.html $(1)/etc/clash/dashboard
150-
$(INSTALL_BIN) ./root/usr/share/clash/dashboard/main.3f7e8457ba9e97b6d7c9.css $(1)/etc/clash/dashboard
152+
$(INSTALL_BIN) ./root/usr/share/clash/dashboard/main.658aa6a6e3feec8f168b.css $(1)/etc/clash/dashboard
151153
$(INSTALL_BIN) ./root/usr/share/clash/dashboard/img/ffac0fa1d89f15922b4594863b8b32e9.png $(1)/etc/clash/dashboard/img
152-
$(INSTALL_BIN) ./root/usr/share/clash/dashboard/js/1.bundle.3f7e8457ba9e97b6d7c9.min.js $(1)/etc/clash/dashboard/js
153-
$(INSTALL_BIN) ./root/usr/share/clash/dashboard/js/bundle.3f7e8457ba9e97b6d7c9.min.js $(1)/etc/clash/dashboard/js
154+
$(INSTALL_BIN) ./root/usr/share/clash/dashboard/js/1.bundle.658aa6a6e3feec8f168b.min.js $(1)/etc/clash/dashboard/js
155+
$(INSTALL_BIN) ./root/usr/share/clash/dashboard/js/bundle.658aa6a6e3feec8f168b.min.js $(1)/etc/clash/dashboard/js
154156
$(INSTALL_BIN) ./root/usr/share/clash/yacd/* $(1)/usr/share/clash/yacd
155157

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

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<h2 align="center">
22
<img src="https://cdn.jsdelivr.net/gh/Dreamacro/clash/docs/logo.png" alt="Clash" width="200">
3-
<br>Luci For Clash <br>
3+
<br>Luci App For Clash <br>
44
</h2>
55

66
<p align="center">
7-
A rule based custom proxy for Openwrt based on <a href="https://github.com/Dreamacro/clash" target="_blank">Clash</a>.
7+
A rule based custom proxy client for Openwrt based on <a href="https://github.com/Dreamacro/clash" target="_blank">Clash</a>.
88
</p>
99
<p align="center">
10-
<a target="_blank" href="https://github.com/frainzy1477/luci-app-clash/releases/tag/v1.7.5.5">
11-
<img src="https://img.shields.io/badge/luci%20for%20clash-v1.7.5.5-blue.svg">
10+
<a target="_blank" href="https://github.com/frainzy1477/luci-app-clash/releases/tag/v1.7.5.6">
11+
<img src="https://img.shields.io/badge/luci%20for%20clash-v1.7.5.6-blue.svg">
1212
</a>
1313
<a href="https://github.com/frainzy1477/luci-app-clash/releases" target="_blank">
1414
<img src="https://img.shields.io/github/downloads/frainzy1477/luci-app-clash/total.svg?style=flat-square"/>
@@ -20,30 +20,32 @@
2020
- Upload ipk file to tmp folder
2121
- cd /tmp
2222
- opkg update
23-
- opkg install luci-app-clash_v1.7.5.5_all.ipk
24-
- opkg install luci-app-clash_v1.7.5.5_all.ipk --force-depends
23+
- opkg install luci-app-clash_v1.7.5.6_all.ipk
24+
- opkg install luci-app-clash_v1.7.5.6_all.ipk --force-depends
2525

2626
## Uninstall
2727
- opkg remove luci-app-clash
2828
- opkg remove luci-app-clash --force-remove
2929

3030
## Features
31-
- Suport Subscription Config
32-
- Support Config Upload
33-
- Support Create Config
31+
- Subscription Config
32+
- Config Upload
33+
- Create Config
3434
- GeoIP Database Update
3535
- TProxy UDP
3636
- IP Query
3737
- DNS Forwarding
38-
- Support Trojan
38+
- Support Trojan(Trojan-GFW & Trojan-Go)
3939
- Support SSR
40+
- Support SS
4041
- Support V2ray
42+
- Support Snell
4143
- Ping Custom Proxy Servers
4244
- Tun Support
4345
- Access Control
4446
- Support Provider,
4547
- Game Rules
46-
- Auto Restore Config
48+
- Restore Config
4749

4850
## Dependency
4951

@@ -57,7 +59,6 @@
5759
- luci-base
5860
- wget
5961
- libustream-openssl
60-
- libopenssl
6162
- curl
6263
- jsonfilter
6364
- ca-certificates
@@ -98,6 +99,6 @@
9899
```
99100

100101
## License
101-
Luci For Clash - OpenWrt is released under the GPL v3.0 License - see detailed [LICENSE](https://github.com/frainzy1477/luci-app-clash/blob/master/LICENSE) .
102+
Luci App For Clash - OpenWrt is released under the GPL v3.0 License - see detailed [LICENSE](https://github.com/frainzy1477/luci-app-clash/blob/master/LICENSE) .
102103

103104

luasrc/controller/clash.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ function index()
5656
entry({"admin", "services", "clash", "doupdate"}, call("do_update")).leaf=true
5757
entry({"admin", "services", "clash", "start"}, call("do_start")).leaf=true
5858
entry({"admin", "services", "clash", "stop"}, call("do_stop")).leaf=true
59+
entry({"admin", "services", "clash", "reload"}, call("do_reload")).leaf=true
5960
entry({"admin", "services", "clash", "geo"}, call("geoip_check")).leaf=true
6061
entry({"admin", "services", "clash", "geoipupdate"}, call("geoip_update")).leaf=true
6162
entry({"admin", "services", "clash", "check_geoip"}, call("check_geoip_log")).leaf=true
@@ -121,11 +122,6 @@ local function in_use()
121122
end
122123

123124

124-
local function ping_enable()
125-
return luci.sys.exec("uci get clash.config.ping_enable")
126-
end
127-
128-
129125
local function conf_path()
130126
if nixio.fs.access(string.sub(luci.sys.exec("uci get clash.config.use_config"), 1, -2)) then
131127
return fss.basename(string.sub(luci.sys.exec("uci get clash.config.use_config"), 1, -2))
@@ -389,6 +385,12 @@ function do_stop()
389385
luci.sys.exec("/etc/init.d/clash stop 2>&1 &")
390386
end
391387

388+
function do_reload()
389+
if luci.sys.call("pidof clash >/dev/null") == 0 then
390+
luci.sys.exec("/etc/init.d/clash reload 2>&1 &")
391+
end
392+
end
393+
392394
function check_update_log()
393395
luci.http.prepare_content("text/plain; charset=utf-8")
394396
local fdp=tonumber(fs.readfile("/var/run/clashlog")) or 0

luasrc/model/cbi/clash/client/client.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ o:value("1", translate("Enable"))
3333
o.description = translate("Set rules under Setting=>Game Rules, will take effect when client start")
3434

3535

36-
o = s:option(ListValue, "append_rules", translate("Append Customs Rules"))
36+
o = s:option(ListValue, "append_rules", translate("Customs Rules"))
3737
o.default = "0"
3838
o:value("0", translate("Disable"))
3939
o:value("1", translate("Enable"))

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ local encrypt_methods_ssr = {
4545
"aes-256-ctr",
4646
"rc4-md5",
4747
"chacha20-ietf",
48+
"xchacha20",
4849

4950
}
5051

luasrc/model/cbi/clash/geoip/geoip.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ o.description = translate("NB: Upload GEOIP Database file Country.mmdb")
2525
.."<br />"
2626
..translate("https://github.com/Dreamacro/maxmind-geoip/releases")
2727
.."<br />"
28-
..translate("https://static.clash.to/GeoIP2/GeoIP2-Country.tar.gz")
29-
.."<br />"
30-
..translate("https://geolite.clash.dev/Country.mmdb")
28+
..translate("https://raw.githubusercontent.com/alecthw/mmdb_china_ip_list/release/Country.mmdb")
3129

3230
o.title = translate(" ")
3331
o.template = "clash/clash_upload"
@@ -118,11 +116,15 @@ update_time = SYS.exec("ls -l --full-time /etc/clash/Country.mmdb|awk '{print $6
118116
o.description = translate("Update Time")..'- ' ..font_red..bold_on..update_time..bold_off..font_off..' '
119117
o:depends("up_time", "monthly")
120118

119+
o = s:option(ListValue, "geoip_source", translate("GeoIP Source"))
120+
o:value("1", translate("MaxMind"))
121+
o:value("2", translate("Github"))
121122

122123
o = s:option(Value, "license_key")
123124
o.title = translate("License Key")
124125
o.description = translate("MaxMind License Key")..translate(" https://www.maxmind.com/en/geolite2/signup")
125126
o.rmempty = true
127+
o:depends("geoip_source", "1")
126128

127129
o=s:option(Button,"update_geoip")
128130
o.inputtitle = translate("Save & Apply")

luasrc/view/clash/start_stop.htm

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<%+cbi/valueheader%>
22

3-
<input type="button" class="cbi-button cbi-button-apply" value="<%:Start Client%>" onclick=" return start() "/>
4-
<input type="button" class="cbi-button cbi-button-apply" style="background-color:#ea4368;" value="<%:Stop Client%>" onclick=" return stop() "/>
3+
<input type="button" class="cbi-button cbi-button-apply" value="<%:Start%>" onclick=" return start() "/>
4+
<input type="button" class="cbi-button cbi-button-apply" value="<%:Stop%>" onclick=" return stop() "/>
5+
<input type="button" class="cbi-button cbi-button-apply" value="<%:Reload%>" onclick=" return reload() "/>
56

67
<script type="text/javascript">
78
//<![CDATA[
@@ -19,6 +20,14 @@
1920
window.setTimeout("location.href='/cgi-bin/luci/admin/services/clash/'", 500);
2021
return
2122
}
23+
24+
function reload(){
25+
XHR.get('<%=url([[admin]], [[services]], [[clash]], [[reload]])%>',null,function(x, data){}
26+
);
27+
window.setTimeout("location.href='/cgi-bin/luci/admin/services/clash/'", 500);
28+
return
29+
}
30+
2231
//]]>
2332
</script>
2433

po/zh-cn/clash.po

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,15 @@ msgstr "启用/启动/重新启动客户端"
8686
msgid "Disable/Stop Client"
8787
msgstr "禁用/停止客户端"
8888

89-
msgid "Stop Client"
89+
msgid "Stop"
9090
msgstr "停用客户端"
9191

92-
msgid "Start Client"
92+
msgid "Start"
9393
msgstr "启用客户端"
9494

95+
msgid "Reload"
96+
msgstr "重装客户端"
97+
9598
msgid "enabled"
9699
msgstr "启用"
97100

@@ -990,8 +993,8 @@ msgstr "选择类型"
990993
msgid "Set custom rules under Setting=>Others , will take effect when client start"
991994
msgstr "在“设置”=>“其他”下设置自定义规则,将在客户端启动时生效"
992995

993-
msgid "Append Customs Rules"
994-
msgstr "附加自定义规则"
996+
msgid "Customs Rules"
997+
msgstr "自定义规则"
995998

996999
msgid "Edit Custom Rule & Group"
9971000
msgstr "编辑自定义规则组"
@@ -1270,4 +1273,7 @@ msgid "Download Update"
12701273
msgstr "下载最新版本客户端"
12711274

12721275
msgid "No Protocol"
1273-
msgstr "不带协议"
1276+
msgstr "不带协议"
1277+
1278+
msgid "GeoIP Source"
1279+
msgstr "GeoIP下载连接"

root/etc/init.d/clash

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,6 @@ if [ -f $CONFIG_YAML ] && [ "$(ls -l $CONFIG_YAML|awk '{print int($5)}')" -ne
624624
echo "设置 Clash iptables" >$REAL_LOG
625625
fi
626626

627-
628627
rules >/dev/null 2>&1
629628

630629
if [ "${lang}" == "en" ] || [ $lang == "auto" ];then
@@ -928,16 +927,22 @@ restart(){
928927
if pidof clash >/dev/null; then
929928
stop >/dev/null 2>&1
930929
start >/dev/null 2>&1
930+
echo "Clash Successfully Restarted"
931931
else
932932
start >/dev/null 2>&1
933+
echo "Clash Successfully Started"
933934
fi
934935
#===========================================================================================================================
935936
}
936937

937938
reload()
938939
{
939-
if pidof clash >/dev/null; then
940+
if pidof clash >/dev/null; then
940941
remove_mark 2>/dev/null
941-
rules 2>/dev/null
942-
fi
943-
}
942+
yml_dns_change 2>/dev/null
943+
rules 2>/dev/null
944+
sleep 5
945+
echo "Clash for OpenWRT" >$REAL_LOG
946+
echo "Clash Reload Completed"
947+
fi
948+
}

0 commit comments

Comments
 (0)