Skip to content

Commit 2d230d8

Browse files
committed
v2.4.5
1 parent ea35ebb commit 2d230d8

File tree

5 files changed

+82
-30
lines changed

5 files changed

+82
-30
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ jobs:
9696

9797
- name: Create compress files
9898
run: |
99+
sudo timedatectl set-timezone "Asia/Shanghai"
100+
echo "build_time=$(TZ=UTC-8 date '+%Y年%m月%d日%H:%M:%S' | jq -sRr @uri)" >> $GITHUB_ENV
99101
#tar -zcvf EasyTier-${{ matrix.sdk }}-${{ matrix.arch }}.tar.gz -C bin/packages/${{ matrix.arch }}/ packages_ci
100-
zip -j EasyTier-${{ matrix.arch }}-${{ matrix.sdk }}.zip bin/packages/${{ matrix.arch }}/packages_ci/*
102+
zip -j EasyTier-${{ env.TAG }}-${{ matrix.arch }}-${{ matrix.sdk }}.zip bin/packages/${{ matrix.arch }}/packages_ci/*
101103
102104
- name: Release
103105
if: ${{ github.event.inputs.tag != '' }}
@@ -106,13 +108,15 @@ jobs:
106108
token: ${{ secrets.GITHUB_TOKEN }}
107109
body: |
108110
109-
- 其中 **`openwrt-22.03`** 里面是ipk安装包 **`SNAPSHOT`** 里面是apk安装包
111+
> ### ![](https://img.shields.io/badge/%E7%BC%96%E8%AF%91%E6%97%B6%E9%97%B4-${{ env.build_time }}-easytier?logo=github&labelColor=%E9%A1%BB)![](https://img.shields.io/github/downloads/${{ github.repository }}/${{ env.TAG }}/total?label=%E4%B8%8B%E8%BD%BD%E6%AC%A1%E6%95%B0&logo=github)
112+
113+
- 其中 **`22.03.7`** 里面是ipk安装包 **`SNAPSHOT`** 里面是apk安装包
110114
111115
- **`*.apk` 是OpenWrt新版的APK包** 对于apk包跳过证书命令
112116
`apk add --allow-untrusted luci-app-easytier.apk`
113117
114118
${{ github.event.inputs.text }}
115119
116120
tag_name: ${{ env.TAG }}
117-
files: EasyTier-${{ matrix.arch }}-${{ matrix.sdk }}.zip
121+
files: EasyTier-${{ env.TAG }}-${{ matrix.arch }}-${{ matrix.sdk }}.zip
118122

easytier/Makefile

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

33
PKG_NAME:=easytier
4-
PKG_VERSION:=2.4.4
4+
PKG_VERSION:=2.4.5
55

66
ifeq ($(ARCH),mipsel)
77
APP_ARCH:=mipsel

luci-app-easytier/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
include $(TOPDIR)/rules.mk
88

9-
PKG_VERSION:=2.4.4
9+
PKG_VERSION:=2.4.5
1010
PKG_RELEASE:=1
1111

1212
LUCI_TITLE:=LuCI support for EasyTier

luci-app-easytier/luasrc/model/cbi/easytier.lua

Lines changed: 71 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,9 +1022,53 @@ btn11info = s:taboption("infos", DummyValue, "btn11info")
10221022
btn11info.rawhtml = true
10231023
btn11info.cfgvalue = function(self, section)
10241024
local content = nixio.fs.readfile("/tmp/easytier-cli_stats") or ""
1025-
content = luci.util.trim(content or "")
1025+
content = luci.util.trim(content or "")
1026+
1027+
local translate_map = {
1028+
["Metric Name"] = "指标名称",
1029+
["Value"] = "",
1030+
["Labels"] = "标签",
1031+
["compression_bytes_rx_after"] = "接收压缩后字节数",
1032+
["compression_bytes_rx_before"] = "接收压缩前字节数",
1033+
["compression_bytes_tx_after"] = "发送压缩后字节数",
1034+
["compression_bytes_tx_before"] = "发送压缩前字节数",
1035+
["peer_rpc_client_rx"] = "客户端 RPC 接收数",
1036+
["peer_rpc_client_tx"] = "客户端 RPC 发送数",
1037+
["peer_rpc_duration_ms"] = "RPC 时长 (毫秒)",
1038+
["peer_rpc_server_rx"] = "服务端 RPC 接收数",
1039+
["peer_rpc_server_tx"] = "服务端 RPC 发送数",
1040+
["traffic_bytes_rx"] = "接收字节数",
1041+
["traffic_bytes_self_rx"] = "自身接收字节数",
1042+
["traffic_bytes_self_tx"] = "自身发送字节数",
1043+
["traffic_bytes_tx"] = "发送字节数",
1044+
["traffic_packets_rx"] = "接收包数",
1045+
["traffic_packets_self_rx"] = "自身接收包数",
1046+
["traffic_packets_self_tx"] = "自身发送包数",
1047+
["traffic_packets_tx"] = "发送包数",
1048+
["network_name"] = "网络名称",
1049+
["dst_peer_id"] = "目标节点ID",
1050+
["src_peer_id"] = "源节点ID",
1051+
["method_name"] = "方法名称",
1052+
["service_name"] = "服务名称",
1053+
["status"] = "状态",
1054+
["success"] = "成功",
1055+
["get_global_peer_map"] = "获取全局节点映射",
1056+
["PeerCenterRpc"] = "节点中心RPC",
1057+
["report_peers"] = "上报节点",
1058+
["sync_route_info"] = "同步路由信息",
1059+
["OspfRouteRpc"] = "OSPF路由RPC"
1060+
}
1061+
1062+
local function escape_lua_pattern(s)
1063+
return s:gsub("(%W)","%%%1")
1064+
end
1065+
1066+
local html = {}
1067+
table.insert(html, [[
1068+
<div style="overflow:auto; max-width:100%;">
1069+
<table style="border-collapse:collapse;width:100%;font-family:monospace;">
1070+
]])
10261071

1027-
local html = {}
10281072
local lines = {}
10291073
for line in content:gmatch("[^\r\n]+") do
10301074
table.insert(lines, line)
@@ -1039,32 +1083,36 @@ btn11info.cfgvalue = function(self, section)
10391083
for cell in line:gmatch("|%s*([^|]+)%s*") do
10401084
local value = luci.util.trim(cell)
10411085
if rowIndex == 1 then
1042-
if value == "Metric Name" then
1043-
value = "指标名称"
1044-
elseif value == "Value" then
1045-
value = ""
1046-
elseif value == "Labels" then
1047-
value = "标签"
1086+
if translate_map[value] then
1087+
value = translate_map[value]
1088+
else
1089+
for k, v in pairs(translate_map) do
1090+
local k_esc = escape_lua_pattern(k)
1091+
value = value:gsub(k_esc, v)
1092+
end
10481093
end
1094+
else
1095+
for k, v in pairs(translate_map) do
1096+
local k_esc = escape_lua_pattern(k)
1097+
value = value:gsub(k_esc, v)
1098+
end
10491099
end
1050-
table.insert(cells, value)
1100+
table.insert(cells, value)
10511101
end
10521102

10531103
if #cells > 0 then
10541104
parsed = true
10551105
local tr = {}
10561106
for i, c in ipairs(cells) do
1057-
local tag = rowIndex == 1 and "th" or "td"
1107+
local tag = (rowIndex == 1) and "th" or "td"
10581108
local style = "padding:4px;text-align:left;white-space:nowrap;border:1px solid #ccc;"
1059-
10601109
if tag == "th" then
1061-
style = "padding:6px;text-align:center;white-space:nowrap;border:1px solid #ccc;background:#f0f0f0;"
1110+
style = "padding:6px;text-align:center;white-space:nowrap;border:1px solid #ccc;background:#f0f0f0;"
10621111
elseif rowIndex % 2 == 0 then
10631112
style = style .. "background:#fafafa;"
1064-
else
1113+
else
10651114
style = style .. "background:#ffffff;"
10661115
end
1067-
10681116
table.insert(tr, string.format("<%s style='%s'>%s</%s>", tag, style, luci.util.pcdata(c), tag))
10691117
end
10701118
table.insert(tableRows, "<tr>" .. table.concat(tr) .. "</tr>")
@@ -1073,17 +1121,16 @@ btn11info.cfgvalue = function(self, section)
10731121
end
10741122

10751123
if parsed then
1076-
table.insert(html, [[
1077-
<div style="overflow:auto; max-width:100%;">
1078-
<table style="border-collapse:collapse;width:100%;font-family:monospace;">
1079-
]])
1080-
for _, row in ipairs(tableRows) do
1081-
table.insert(html, row)
1082-
end
1124+
for _, rowHtml in ipairs(tableRows) do
1125+
table.insert(html, rowHtml)
1126+
end
10831127
table.insert(html, "</table></div>")
10841128
return table.concat(html, "\n")
10851129
else
1086-
return string.format("<pre style='background:#f9f9f9;padding:8px;border:1px solid #ccc;white-space:pre-wrap;'>%s</pre>", luci.util.pcdata(content))
1130+
return string.format(
1131+
"<pre style='background:#f9f9f9;border:1px solid #ccc;padding:8px;white-space:pre-wrap;'>%s</pre>",
1132+
luci.xml.pcdata(content)
1133+
)
10871134
end
10881135
end
10891136

@@ -1202,7 +1249,8 @@ http.setfilehandler(
12021249

12031250
os.execute("chmod +x /tmp/easytier-core")
12041251
os.execute("chmod +x /tmp/easytier-cli")
1205-
os.execute("chmod +x /tmp/easytier-web-embed")
1252+
os.execute("chmod +x /tmp/easytier-web-embed")
1253+
12061254
end
12071255
end
12081256
)

luci-app-easytier/root/etc/init.d/easytier

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ check_bin() {
7878
tag="$( curl -k --connect-timeout 3 --user-agent "$user_agent" https://api.github.com/repos/EasyTier/EasyTier/releases/latest 2>&1 | grep 'tag_name' | cut -d\" -f4 )"
7979
[ -z "$tag" ] && tag="$( curl -Lk --connect-timeout 3 --user-agent "$user_agent" -s https://api.github.com/repos/EasyTier/EasyTier/releases/latest 2>&1 | grep 'tag_name' | cut -d\" -f4 )"
8080
fi
81-
[ -z "$tag"] && tag=v2.4.4
81+
[ -z "$tag"] && tag=v2.4.5
8282
echo "$(date '+%Y-%m-%d %H:%M:%S') easytier : 开始在线下载${tag}版本,${proxy}https://github.com/EasyTier/EasyTier/releases/download/${tag}/easytier-linux-${cpucore}-${tag}.zip下载较慢耐心等候" >>/tmp/easytier.log
8383
echo "$(date '+%Y-%m-%d %H:%M:%S') easytier : 开始在线下载${tag}版本,${proxy}https://github.com/EasyTier/EasyTier/releases/download/${tag}/easytier-linux-${cpucore}-${tag}.zip下载较慢耐心等候" >>/tmp/easytierweb.log
8484
mkdir -p "$path"
@@ -760,7 +760,7 @@ reload_service() {
760760

761761
service_triggers() {
762762
procd_add_reload_trigger "easytier"
763-
#如果任意网络接口上线则触发重新启动easytier
763+
#如果WAN网络接口上线则触发重新启动easytier
764764
procd_add_interface_trigger "interface.*.up" wan /etc/init.d/easytier reload
765765
}
766766

0 commit comments

Comments
 (0)