mirror of
https://github.com/kenzok8/small-package.git
synced 2026-02-06 23:08:07 +08:00
update 2025-08-13 09:53:25
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=easytier
|
||||
PKG_VERSION:=2.4.0
|
||||
PKG_VERSION:=2.4.2
|
||||
|
||||
ifeq ($(ARCH),mipsel)
|
||||
APP_ARCH:=mipsel
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_VERSION:=2.4.0
|
||||
PKG_VERSION:=2.4.2
|
||||
PKG_RELEASE:=1
|
||||
|
||||
LUCI_TITLE:=LuCI support for EasyTier
|
||||
|
||||
@@ -249,6 +249,18 @@ disable_encryption = s:taboption("privacy", Flag, "disable_encryption", translat
|
||||
.. "If encryption is disabled, all other nodes must also have encryption disabled (-u parameter)"))
|
||||
disable_encryption:depends("etcmd", "etcmd")
|
||||
|
||||
encryption_algorithm = s:taboption("privacy", ListValue, "encryption_algorithm", translate("Encryption Algorithm"),
|
||||
translate("encryption algorithm to use, supported: xor, chacha20, aes-gcm, aes-gcm-256, openssl-aes128-gcm, openssl-aes256-gcm, openssl-chacha20. default (aes-gcm) (--encryption-algorithm parameter)"))
|
||||
encryption_algorithm.default = "aes-gcm"
|
||||
encryption_algorithm:value("xor",translate("xor"))
|
||||
encryption_algorithm:value("chacha20",translate("chacha20"))
|
||||
encryption_algorithm:value("aes-gcm",translate("aes-gcm"))
|
||||
encryption_algorithm:value("aes-gcm-256",translate("aes-gcm-256"))
|
||||
encryption_algorithm:value("openssl-aes128-gcm",translate("openssl-aes128-gcm"))
|
||||
encryption_algorithm:value("openssl-aes256-gcm",translate("openssl-aes256-gcm"))
|
||||
encryption_algorithm:value("openssl-chacha20",translate("openssl-chacha20"))
|
||||
encryption_algorithm:depends("etcmd", "etcmd")
|
||||
|
||||
multi_thread = s:taboption("privacy", Flag, "multi_thread", translate("Enable Multithreading"),
|
||||
translate("Enable multithreaded operation; single-threaded by default (--multi-thread parameter)"))
|
||||
multi_thread:depends("etcmd", "etcmd")
|
||||
@@ -786,27 +798,6 @@ html_port = s:option(Value, "html_port", translate("Web Interface Port"),
|
||||
html_port.datatype = "range(1,65535)"
|
||||
html_port.default = "11211"
|
||||
|
||||
local router_ip = luci.sys.exec("uci -q get network.lan.ipaddr"):gsub("\n", "")
|
||||
local default_api_port = api_port.default or "11211"
|
||||
api_host = s:option(Value, "api_host", translate("Default API Server URL"),
|
||||
translate("The URL of the API server, used for connecting the web frontend. (--api-host parameter)<br>"
|
||||
.. "Example: http://[current device IP or resolved domain name]:[API port]"))
|
||||
api_host.placeholder = "http://" .. router_ip .. ":" .. default_api_port
|
||||
api_host.default = "http://" .. router_ip .. ":" .. default_api_port
|
||||
api_host.validate = function(self, value, section)
|
||||
local port_val = api_port:formvalue(section) or default_api_port
|
||||
if not port_val or port_val == "" then
|
||||
port_val = default_api_port
|
||||
end
|
||||
local port_in_api_host = string.match(value, ":(%d+)$")
|
||||
if port_in_api_host ~= port_val then
|
||||
local new_value = string.gsub(value, ":%d+$", "")
|
||||
new_value = new_value .. ":" .. port_val
|
||||
return new_value
|
||||
end
|
||||
return value
|
||||
end
|
||||
|
||||
geoip_db = s:option(Value, "geoip_db", translate("GEOIP_DB Path"),
|
||||
translate("GeoIP2 database file path used to locate the client. Defaults to an embedded file (country-level information only)."
|
||||
.. "<br>Recommended: https://github.com/P3TERX/GeoLite.mmdb (--geoip-db parameter)"))
|
||||
|
||||
@@ -15,6 +15,21 @@ local dsp = require "luci.dispatcher"
|
||||
}
|
||||
);
|
||||
}
|
||||
function downloadLog() {
|
||||
var log_textarea = document.getElementById('log_textarea');
|
||||
var logContent = log_textarea.value || log_textarea.innerText || log_textarea.innerHTML;
|
||||
var blob = new Blob([logContent], {type: 'text/plain;charset=utf-8'});
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
var a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = 'easytier-core_log.txt';
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
setTimeout(function() {
|
||||
document.body.removeChild(a);
|
||||
window.URL.revokeObjectURL(url);
|
||||
}, 0);
|
||||
}
|
||||
XHR.poll(2, '<%=dsp.build_url("admin/vpn/easytier/get_log")%>', null,
|
||||
function(x, data) {
|
||||
if(x && x.status == 200 && document.getElementById("checkbox1").checked == true) {
|
||||
@@ -29,5 +44,6 @@ local dsp = require "luci.dispatcher"
|
||||
<fieldset class="cbi-section" id="_log_fieldset">
|
||||
<input type="checkbox" id="checkbox1" style="vertical-align:middle;height: auto;"checked><%:Auto Refresh%></input>
|
||||
<input class="cbi-button cbi-input-remove" type="button" onclick="clearlog()" value="<%:Clear Logs%>" />
|
||||
<input class="cbi-button cbi-input-apply" type="button" onclick="downloadLog()" value="<%:Download Log%>" />
|
||||
<textarea id="log_textarea" class="cbi-input-textarea" style="width: 100%;margin-top: 10px;" data-update="change" rows="30" wrap="off" readonly="readonly"></textarea>
|
||||
</fieldset>
|
||||
|
||||
@@ -15,6 +15,21 @@ local dsp = require "luci.dispatcher"
|
||||
}
|
||||
);
|
||||
}
|
||||
function downloadLog() {
|
||||
var log_textarea = document.getElementById('log_textarea');
|
||||
var logContent = log_textarea.value || log_textarea.innerText || log_textarea.innerHTML;
|
||||
var blob = new Blob([logContent], {type: 'text/plain;charset=utf-8'});
|
||||
var url = window.URL.createObjectURL(blob);
|
||||
var a = document.createElement('a');
|
||||
a.href = url;
|
||||
a.download = 'easytier-web_log.txt';
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
setTimeout(function() {
|
||||
document.body.removeChild(a);
|
||||
window.URL.revokeObjectURL(url);
|
||||
}, 0);
|
||||
}
|
||||
XHR.poll(2, '<%=dsp.build_url("admin/vpn/easytier/get_wlog")%>', null,
|
||||
function(x, data) {
|
||||
if(x && x.status == 200 && document.getElementById("checkbox1").checked == true) {
|
||||
@@ -29,5 +44,6 @@ local dsp = require "luci.dispatcher"
|
||||
<fieldset class="cbi-section" id="_log_fieldset">
|
||||
<input type="checkbox" id="checkbox1" style="vertical-align:middle;height: auto;"checked><%:Auto Refresh%></input>
|
||||
<input class="cbi-button cbi-input-remove" type="button" onclick="clearlog()" value="<%:Clear Logs%>" />
|
||||
<input class="cbi-button cbi-input-apply" type="button" onclick="downloadLog()" value="<%:Download Log%>" />
|
||||
<textarea id="log_textarea" class="cbi-input-textarea" style="width: 100%;margin-top: 10px;" data-update="change" rows="30" wrap="off" readonly="readonly"></textarea>
|
||||
</fieldset>
|
||||
|
||||
@@ -102,6 +102,9 @@ msgstr ""
|
||||
msgid "Clear Logs"
|
||||
msgstr ""
|
||||
|
||||
msgid "Download Log"
|
||||
msgstr ""
|
||||
|
||||
#: applications/luci-app-easytier/luasrc/model/cbi/easytier.lua:469
|
||||
msgid "Click the button to refresh and view STUN information"
|
||||
msgstr ""
|
||||
@@ -1022,4 +1025,9 @@ msgstr ""
|
||||
msgid "Click the button to refresh and view manage mapped listeners"
|
||||
msgstr ""
|
||||
|
||||
msgid "Encryption Algorithm"
|
||||
msgstr ""
|
||||
|
||||
msgid "encryption algorithm to use, supported: xor, chacha20, aes-gcm, aes-gcm-256, openssl-aes128-gcm, openssl-aes256-gcm, openssl-chacha20. default (aes-gcm) (--encryption-algorithm parameter)"
|
||||
msgstr "使用的加密算法,支持:xor、chacha20、aes-gcm、aes-gcm-256、openssl-aes128-gcm、openssl-aes256-gcm、openssl-chacha20。默认(aes-gcm)(--encryption-algorithm 参数)"
|
||||
|
||||
|
||||
@@ -105,6 +105,9 @@ msgstr "检测更新"
|
||||
msgid "Clear Logs"
|
||||
msgstr "清除日志"
|
||||
|
||||
msgid "Download Log"
|
||||
msgstr "下载日志"
|
||||
|
||||
#: applications/luci-app-easytier/luasrc/model/cbi/easytier.lua:469
|
||||
msgid "Click the button to refresh and view STUN information"
|
||||
msgstr "点击按钮刷新,执行 STUN 测试"
|
||||
@@ -1058,4 +1061,10 @@ msgstr "Mapped listener信息"
|
||||
msgid "Click the button to refresh and view manage mapped listeners"
|
||||
msgstr "点击按钮刷新,查看管理映射的监听器"
|
||||
|
||||
msgid "Encryption Algorithm"
|
||||
msgstr "加密算法"
|
||||
|
||||
msgid "encryption algorithm to use, supported: xor, chacha20, aes-gcm, aes-gcm-256, openssl-aes128-gcm, openssl-aes256-gcm, openssl-chacha20. default (aes-gcm) (--encryption-algorithm parameter)"
|
||||
msgstr "使用的加密算法,支持:xor、chacha20、aes-gcm、aes-gcm-256、openssl-aes128-gcm、openssl-aes256-gcm、openssl-chacha20。默认(aes-gcm)(--encryption-algorithm 参数)"
|
||||
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ check_bin() {
|
||||
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 )"
|
||||
[ -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 )"
|
||||
fi
|
||||
[ -z "$tag"] && tag=v2.3.2
|
||||
[ -z "$tag"] && tag=v2.4.2
|
||||
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
|
||||
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
|
||||
mkdir -p "$path"
|
||||
@@ -138,11 +138,11 @@ check_config() {
|
||||
{
|
||||
while true; do
|
||||
LOG_SIZE=\$(ls -l /tmp/easytier.log | awk '{print int(\$5/1024)}')
|
||||
if [ \$LOG_SIZE -gt 100 ]; then
|
||||
tail -n 100 /tmp/easytier.log > /tmp/easytier.log.tmp
|
||||
if [ \$LOG_SIZE -gt 5120 ]; then
|
||||
tail -n 500 /tmp/easytier.log > /tmp/easytier.log.tmp
|
||||
mv /tmp/easytier.log.tmp /tmp/easytier.log
|
||||
fi
|
||||
sleep 3600
|
||||
sleep 300
|
||||
done
|
||||
} &
|
||||
LOG_MANAGEMENT_PID=\$!
|
||||
@@ -208,6 +208,7 @@ get_etconfig() {
|
||||
quic_input="$(uci -q get easytier.@easytier[0].quic_input || echo 0)"
|
||||
foreign_relay_bps_limit="$(uci -q get easytier.@easytier[0].foreign_relay_bps_limit)"
|
||||
extra_args="$(uci -q get easytier.@easytier[0].extra_args)"
|
||||
encryption_algorithm="$(uci -q get easytier.@easytier[0].encryption_algorithm)"
|
||||
}
|
||||
|
||||
set_firewall() {
|
||||
@@ -509,6 +510,9 @@ start_et() {
|
||||
[ "$quic_proxy" = "0" ] || core_cmd="${core_cmd} --enable-quic-proxy"
|
||||
[ "$quic_input" = "0" ] || core_cmd="${core_cmd} --disable-quic-input"
|
||||
[ -z "$foreign_relay_bps_limit" ] || core_cmd="${core_cmd} --foreign-relay-bps-limit $foreign_relay_bps_limit"
|
||||
if [ -n "$encryption_algorithm" ] && [ "$encryption_algorithm" != "aes-gcm" ]; then
|
||||
core_cmd="${core_cmd} --encryption-algorithm ${encryption_algorithm}"
|
||||
fi
|
||||
[ -z "$extra_args" ] || core_cmd="${core_cmd} $extra_args"
|
||||
fi
|
||||
if [ "$etcmd" = "web" ] ; then
|
||||
@@ -530,11 +534,11 @@ start_et() {
|
||||
{
|
||||
while true; do
|
||||
LOG_SIZE=\$(ls -l /tmp/easytier.log | awk '{print int(\$5/1024)}')
|
||||
if [ \$LOG_SIZE -gt 100 ]; then
|
||||
tail -n 100 /tmp/easytier.log > /tmp/easytier.log.tmp
|
||||
if [ \$LOG_SIZE -gt 5120 ]; then
|
||||
tail -n 500 /tmp/easytier.log > /tmp/easytier.log.tmp
|
||||
mv /tmp/easytier.log.tmp /tmp/easytier.log
|
||||
fi
|
||||
sleep 3600
|
||||
sleep 300
|
||||
done
|
||||
} &
|
||||
LOG_MANAGEMENT_PID=\$!
|
||||
@@ -626,11 +630,11 @@ start_web() {
|
||||
{
|
||||
while true; do
|
||||
LOG_SIZE=\$(ls -l /tmp/easytierweb.log | awk '{print int(\$5/1024)}')
|
||||
if [ \$LOG_SIZE -gt 100 ]; then
|
||||
tail -n 100 /tmp/easytierweb.log > /tmp/easytierweb.log.tmp
|
||||
if [ \$LOG_SIZE -gt 5120 ]; then
|
||||
tail -n 500 /tmp/easytierweb.log > /tmp/easytierweb.log.tmp
|
||||
mv /tmp/easytierweb.log.tmp /tmp/easytierweb.log
|
||||
fi
|
||||
sleep 3600
|
||||
sleep 300
|
||||
done
|
||||
} &
|
||||
LOG_MANAGEMENT_PID=\$!
|
||||
|
||||
Reference in New Issue
Block a user