Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
vernesong committed Mar 9, 2024
2 parents c38cb9c + d8bcf91 commit 8ebe09e
Show file tree
Hide file tree
Showing 16 changed files with 147 additions and 124 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/clear_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# https://github.com/marketplace/actions/git-changesets
- id: changed_files
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/compile_dev_core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
sudo apt-get -y install git
- name: Clone OpenClash Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: core

Expand All @@ -32,7 +32,7 @@ jobs:
echo "current_id: $(sed -n 1p ./dev/core_version)"
- name: Clone Clash Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: Dreamacro/clash
ref: dev
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
echo "upx=../upx-3.95-amd64_linux/upx" >> $GITHUB_ENV
- name: Clone OpenClash Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: core

Expand All @@ -82,7 +82,7 @@ jobs:
check-latest: true

- name: Clone Clash Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: Dreamacro/clash
ref: dev
Expand All @@ -98,7 +98,7 @@ jobs:
cp -rf "./bin/." "../tmp/bin/"
- name: Clone OpenClash Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: core

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/compile_meta_core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
sudo apt-get -y install git
- name: Clone OpenClash Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: core

Expand All @@ -32,7 +32,7 @@ jobs:
echo "current_id: $(sed -n 3p ./dev/core_version)"
- name: Clone Clash Meta Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: MetaCubeX/mihomo
ref: Alpha
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
echo "upx=../upx-3.95-amd64_linux/upx" >> $GITHUB_ENV
- name: Clone OpenClash Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: core

Expand All @@ -81,7 +81,7 @@ jobs:
check-latest: true

- name: Clone Clash Meta Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: MetaCubeX/mihomo
ref: Alpha
Expand All @@ -96,7 +96,7 @@ jobs:
cp -rf "./bin/." "../tmp/bin/"
- name: Clone OpenClash Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: core

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/compile_new_ipk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
current_version: ${{ steps.current_version.outputs.version }}
steps:
- name: Clone Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}

Expand All @@ -28,7 +28,7 @@ jobs:
echo "New Version: $(grep 'PKG_VERSION:=' ./luci-app-openclash/Makefile |awk -F '=' '{print $2}')"
- name: Clone Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: package

Expand All @@ -44,7 +44,7 @@ jobs:
if: ${{ needs.Get-Version.outputs.version != needs.Get-Version.outputs.current_version }}
steps:
- name: Clone OpenClash dev Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}

Expand All @@ -59,10 +59,10 @@ jobs:
run: |
cd ..
mkdir tmp
curl -SLk --connect-timeout 30 --retry 2 "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" -o "./tmp/SDK.tar.bz2"
curl -SLk --connect-timeout 30 --retry 2 "https://archive.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/OpenWrt-SDK-15.05.1-ar71xx-generic_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar.bz2" -o "./tmp/SDK.tar.bz2"
cd \tmp
tar xjf SDK.tar.bz2
mv "OpenWrt-SDK-ar71xx-generic_gcc-5.3.0_musl-1.1.16.Linux-x86_64" "SDK"
mv "OpenWrt-SDK-15.05.1-ar71xx-generic_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64" "SDK"
- name: Copy OpenClash Source Codes
run: |
Expand All @@ -85,7 +85,7 @@ jobs:
make package/luci-app-openclash/compile V=99
- name: Switch OpenClash Repository to Package
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: package

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/compile_premium_core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
sudo apt-get -y install curl git gzip
- name: Clone OpenClash Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: core

Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
echo "upx=../upx-3.95-amd64_linux/upx" >> $GITHUB_ENV
- name: Clone OpenClash Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: core

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/master_release_sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
sudo apt-get -y install git
- name: Clone OpenClash Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: core

Expand All @@ -39,7 +39,7 @@ jobs:
fi
- name: Clone OpenClash Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: package

Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,13 @@
---


从 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) 编译
从 OpenWrt 的 [SDK](https://archive.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/OpenWrt-SDK-15.05.1-ar71xx-generic_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar.bz2) 编译
```bash
# 解压下载好的 SDK
tar xjf OpenWrt-SDK-ar71xx-generic_gcc-5.3.0_musl-1.1.16.Linux-x86_64.tar.bz2
cd OpenWrt-SDK-ar71xx-*
curl -SLk --connect-timeout 30 --retry 2 "https://archive.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/OpenWrt-SDK-15.05.1-ar71xx-generic_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar.bz2" -o "/tmp/SDK.tar.bz2"
cd \tmp
tar xjf SDK.tar.bz2
cd OpenWrt-SDK-15.05.1-*

# Clone 项目
mkdir package/luci-app-openclash
Expand All @@ -96,7 +98,7 @@ cd ../..
make package/luci-app-openclash/luci-app-openclash/compile V=99

# IPK文件位置
./bin/ar71xx/packages/base/luci-app-openclash_0.39.7-beta_all.ipk
./bin/ar71xx/packages/base/luci-app-openclash_*-beta_all.ipk
```

```bash
Expand Down
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.46.001
PKG_VERSION:=0.46.003
PKG_RELEASE:=beta
PKG_MAINTAINER:=vernesong <https://github.com/vernesong/OpenClash>

Expand Down
8 changes: 5 additions & 3 deletions luci-app-openclash/luasrc/controller/openclash.lua
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ function set_subinfo_url()
end

function sub_info_get()
local filepath, filename, sub_url, sub_info, info, upload, download, total, expire, http_code, len, percent, day_left, day_expire
local filepath, filename, sub_url, sub_info, info, upload, download, total, expire, http_code, len, percent, day_left, day_expire, surplus, used
local info_tb = {}
filename = luci.http.formvalue("filename")
sub_info = ""
Expand Down Expand Up @@ -705,14 +705,14 @@ function sub_info_get()
else
day_left = 0
end

if used and total and used < total then
percent = string.format("%.1f",((total-used)/total)*100) or nil
elseif used == nil or total == nil or total == 0 then
percent = 100
else
percent = 0
end
surplus = fs.filesize(total - used) or "null"
total = fs.filesize(total) or "null"
used = fs.filesize(used) or "null"
sub_info = "Successful"
Expand All @@ -727,6 +727,7 @@ function sub_info_get()
luci.http.write_json({
http_code = http_code,
sub_info = sub_info,
surplus = surplus,
used = used,
total = total,
percent = percent,
Expand Down Expand Up @@ -1071,7 +1072,8 @@ function action_status()
db_forward_ssl = db_foward_ssl(),
web = is_web(),
cn_port = cn_port(),
restricted_mode = restricted_mode();
restricted_mode = restricted_mode(),
core_type = uci:get("openclash", "config", "core_type") or "Dev";
})
end

Expand Down
4 changes: 4 additions & 0 deletions luci-app-openclash/luasrc/model/cbi/openclash/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ o = s:taboption("traffic_control", Flag, "disable_udp_quic", font_red..bold_on..
o.description = translate("Prevent YouTube and Others To Use QUIC Transmission")..", "..font_red..bold_on..translate("REJECT UDP Traffic(Not Include CN) On Port 443")..bold_off..font_off
o.default = 1

o = s:taboption("traffic_control", Flag, "skip_proxy_address", translate("Skip Proxy Address"))
o.description = translate("Bypassing Server Addresses And Preventing Duplicate Proxies")
o.default = 0

o = s:taboption("traffic_control", Value, "common_ports", font_red..bold_on..translate("Common Ports Proxy Mode")..bold_off..font_off)
o.description = translate("Only Common Ports, Prevent BT/P2P Passing")
o:value("0", translate("Disable"))
Expand Down
4 changes: 2 additions & 2 deletions luci-app-openclash/luasrc/view/openclash/status.htm
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,11 @@
if ( x && x.status == 200 ) {
if ( status.restricted_mode != "1" )
{
clash.innerHTML = status.clash ? '<b style=color:green><%:Running%></b>' : '<b style=color:red><%:Not Running%></b>';
clash.innerHTML = status.clash ? '<b style=color:green>' + status.core_type +'&nbsp;&nbsp;&nbsp;<%:Running%></b>' : '<b style=color:red><%:Not Running%></b>';
}
else
{
clash.innerHTML = status.clash ? '<b style=color:green><%:Running%> <%:<Limited State>%></b>' : '<b style=color:red><%:Not Running%></b>';
clash.innerHTML = status.clash ? '<b style=color:green>' + status.core_type +'&nbsp;&nbsp;&nbsp;<%:Running%>&nbsp;&nbsp;&nbsp;<%:<Limited State>%></b>' : '<b style=color:red><%:Not Running%></b>';
}
watchdog.innerHTML = status.watchdog ? '&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<%:Daemons%>:&nbsp;&nbsp;&nbsp;<b style=color:green><%:Running%></b>' : '&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<%:Daemons%>:&nbsp;&nbsp;&nbsp;<b style=color:red><%:Not Running%></b>';
dase.innerHTML = status.dase ? "<b style=color:green>"+status.dase+"</b>" : "<b style=color:red>"+"<%:Not Set%>"+"</b>";
Expand Down
6 changes: 2 additions & 4 deletions luci-app-openclash/luasrc/view/openclash/sub_info_show.htm
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@
retry_<%=idname%> = 0;
localStorage.setItem("<%=filename%>",JSON.stringify(status));
document.getElementById('<%=idname%>').className = "sub_tab_show";
document.getElementById('<%=idname%>').innerHTML = progressbar_<%=idname%>((status.used), (status.total), (status.percent), false, false, (status.expire), (status.day_left));
//document.getElementById('<%=idname%>').innerHTML = "<%:Plan Traffic%>" + ": " + "<span style=color:green>" + status.used + "</span> | <span style=color:green>" + status.total + "</span> <br/> <%:Plan Expiration Time%>: " + "<span style=color:green>" + status.expire + "</span>";
document.getElementById('<%=idname%>').innerHTML = progressbar_<%=idname%>((status.surplus ? status.surplus : status.used), (status.total), (status.percent), false, false, (status.expire), (status.day_left));
}
else if ( x && x.status == 200 && status.sub_info == "No Sub Info Found" ) {
retry_<%=idname%> = 0;
Expand Down Expand Up @@ -110,8 +109,7 @@
document.getElementById('<%=idname%>').innerHTML = "<span><%:No Sub Info Found%></span>";
}
else {
//document.getElementById('<%=idname%>').innerHTML = "<%:Plan Traffic%>" + ": " + "<span style=color:green>" + save_info.used + "</span> | <span style=color:green>" + save_info.total + "</span> <br/> <%:Plan Expiration Time%>: " + "<span style=color:green>" + save_info.expire + "</span>";
document.getElementById('<%=idname%>').innerHTML = progressbar_<%=idname%>((save_info.used), (save_info.total), (save_info.percent ? save_info.percent : 0), false, false, (save_info.expire), (save_info.day_left ? save_info.day_left : 0));
document.getElementById('<%=idname%>').innerHTML = progressbar_<%=idname%>((save_info.surplus ? save_info.surplus : save_info.used), (save_info.total), (save_info.percent ? save_info.percent : 0), false, false, (save_info.expire), (save_info.day_left ? save_info.day_left : 0));
}
}
else {
Expand Down
11 changes: 10 additions & 1 deletion luci-app-openclash/po/zh-cn/openclash.zh-cn.po
Original file line number Diff line number Diff line change
Expand Up @@ -3240,6 +3240,9 @@ msgstr "大陆域名 DNS 服务器"
msgid "Specify DNS Server For CN Domain Lists, Only One IP Server Address Support"
msgstr "指定大陆域名的 DNS 服务器,只支持填写一个IP地址"

msgid "Warning: Dnsmasq Work is Unnormal, Setting The Firewall DNS Hijacking Rules..."
msgstr "警告:检测到 Dnsmasq 工作异常,设置防火墙 DNS 劫持规则..."

msgid "Tip: Dnsmasq Work is Normal, Restore The Firewall DNS Hijacking Rules..."
msgstr "提示:检测到 Dnsmasq 正常工作,还原防火墙 DNS 劫持规则..."

Expand Down Expand Up @@ -3487,4 +3490,10 @@ msgid "Error: Set Fallback DNS Proxy Group Failed,"
msgstr "错误:Fallback DNS 代理策略组设置失败,"

msgid "To Use in Fake-IP Mode, Please Switch The Dns Redirect Mode To Firewall Forwarding"
msgstr "要在 Fake-IP 模式下使用,请将 Dns 重定向模式切换为防火墙转发模式"
msgstr "要在 Fake-IP 模式下使用,请将 Dns 重定向模式切换为防火墙转发模式"

msgid "Skip Proxy Address"
msgstr "绕过服务器地址"

msgid "Bypassing Server Addresses And Preventing Duplicate Proxies"
msgstr "绕过服务器地址,防止重复代理"
1 change: 1 addition & 0 deletions luci-app-openclash/root/etc/uci-defaults/luci-openclash
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ uci -q set network.utun=interface
uci -q set network.utun.proto=none
uci -q set network.utun.ifname=utun
uci -q set network.utun.device=utun
uci -q set network.utun.auto='0'
uci -q commit network

config_load "firewall"
Expand Down
Loading

0 comments on commit 8ebe09e

Please sign in to comment.