From 7cfa4c804b45b90f8a8b0aeb66e5cf63e96babf6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 31 Dec 2023 23:35:31 +0800 Subject: [PATCH] update 2023-12-31 23:35:31 --- luci-app-natter/Makefile | 4 +- .../luasrc/model/cbi/natter/base.lua | 13 +- .../luasrc/model/cbi/natter/ports.lua | 2 +- luci-app-natter/po/zh-cn/natter.po | 18 ++- luci-app-natter/po/zh_Hans | 1 - luci-app-natter/po/zh_Hans/natter.po | 120 ++++++++++++++++++ luci-app-natter/root/etc/init.d/natter | 16 ++- sing-box/Makefile | 4 +- 8 files changed, 157 insertions(+), 21 deletions(-) delete mode 120000 luci-app-natter/po/zh_Hans create mode 100644 luci-app-natter/po/zh_Hans/natter.po diff --git a/luci-app-natter/Makefile b/luci-app-natter/Makefile index 2d3281016..71d10d099 100755 --- a/luci-app-natter/Makefile +++ b/luci-app-natter/Makefile @@ -1,10 +1,10 @@ -# Copyright (C) 2020-2023 Hyy2001X +# Copyright (C) 2020-2024 Hyy2001X include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-natter PKG_VERSION:=1.1 -PKG_RELEASE:=4 +PKG_RELEASE:=5 LUCI_TITLE:=LuCI Support for Natter LUCI_PKGARCH:=all diff --git a/luci-app-natter/luasrc/model/cbi/natter/base.lua b/luci-app-natter/luasrc/model/cbi/natter/base.lua index 8e7f16cfa..4b1778568 100755 --- a/luci-app-natter/luasrc/model/cbi/natter/base.lua +++ b/luci-app-natter/luasrc/model/cbi/natter/base.lua @@ -60,17 +60,14 @@ enable_port = s:option(Flag, "enable_port", translate("Enable")) enable_port.default = 1 enable_port.width = "5%" -id = s:option(DummyValue, "id", translate("ID")) -id.width = "8%" - remarks = s:option(DummyValue, "remarks", translate("Remarks")) -remarks.width = "10%" +remarks.width = "8%" -forward_mode = s:option(DummyValue, "forward_mode", translate("Forward Mode")) -forward_mode.width = "8%" +external_port_tcp = s:option(DummyValue, "external_port_tcp", translate("External TCP Port")) +external_port_tcp.width = "12%" -external_port = s:option(DummyValue, "external_port", translate("External Port")) -external_port.width = "12%" +external_port_udp = s:option(DummyValue, "external_port_udp", translate("External UDP Port")) +external_port_udp.width = "12%" enable_forward = s:option(Flag, "enable_forward", translate("Forward")) enable_forward.default = 0 diff --git a/luci-app-natter/luasrc/model/cbi/natter/ports.lua b/luci-app-natter/luasrc/model/cbi/natter/ports.lua index fcd2030ef..ee6aee607 100755 --- a/luci-app-natter/luasrc/model/cbi/natter/ports.lua +++ b/luci-app-natter/luasrc/model/cbi/natter/ports.lua @@ -17,7 +17,7 @@ remarks.rmempty = false forward_mode = s:option(ListValue, "forward_mode", translate("Forward Mode")) forward_mode:value('1', translate("1 - Natter")) forward_mode:value('2', translate("2 - Firewall")) -forward_mode.default = 2 +forward_mode.default = 1 external_port = s:option(Value, "external_port", translate("External Port"), translate("Specify the port opened by Natter")) external_port.datatype = "port" diff --git a/luci-app-natter/po/zh-cn/natter.po b/luci-app-natter/po/zh-cn/natter.po index 7a6eba3df..1c487042e 100755 --- a/luci-app-natter/po/zh-cn/natter.po +++ b/luci-app-natter/po/zh-cn/natter.po @@ -38,7 +38,7 @@ msgid "Keep Alive Server" msgstr "Keep Alive 服务器" msgid "Directory to save natter logs" -msgstr "Natter 运行日志保存路径 (文件夹)" +msgstr "Natter 运行日志保存路径" msgid "ID" msgstr "标识" @@ -53,14 +53,20 @@ msgid "Internal Port" msgstr "内部端口" msgid "Internal Host IP address" -msgstr "内部主机的 IP 地址" +msgstr "内部主机 IP 地址" msgid "Internal Host Port" -msgstr "内部主机的端口" +msgstr "内部主机端口" msgid "External Port" msgstr "外部端口" +msgid "External TCP Port" +msgstr "外部 TCP 端口" + +msgid "External UDP Port" +msgstr "外部 UDP 端口" + msgid "Specify the port opened by Natter" msgstr "指定 Natter 打开的端口" @@ -74,7 +80,7 @@ msgid "Port Type" msgstr "端口类型" msgid "FullCone NAT" -msgstr "FullCone NAT" +msgstr "完全圆锥型 NAT" msgid "Please DO NOT handle the IP address/domain name/port of the TCP/UDP STUN server (3478) while running proxy" msgstr "请不要使用任何代理软件代理 STUN 服务器地址" @@ -95,10 +101,10 @@ msgid "Forward Mode" msgstr "转发策略" msgid "1 - Natter" -msgstr "1 - Natter 内置" +msgstr "Natter 内置" msgid "2 - Firewall" -msgstr "2 - 防火墙" +msgstr "防火墙" msgid "Delete Logs" msgstr "清除日志" diff --git a/luci-app-natter/po/zh_Hans b/luci-app-natter/po/zh_Hans deleted file mode 120000 index 41451e4a1..000000000 --- a/luci-app-natter/po/zh_Hans +++ /dev/null @@ -1 +0,0 @@ -zh-cn \ No newline at end of file diff --git a/luci-app-natter/po/zh_Hans/natter.po b/luci-app-natter/po/zh_Hans/natter.po new file mode 100644 index 000000000..1c487042e --- /dev/null +++ b/luci-app-natter/po/zh_Hans/natter.po @@ -0,0 +1,120 @@ +msgid "Natter" +msgstr "Natter" + +msgid "Open Port under FullCone NAT (NAT 1)" +msgstr "帮助 Full cone NAT (NAT 1) 用户打开公网端口" + +msgid "Log Path" +msgstr "日志路径" + +msgid "Log Level" +msgstr "日志等级" + +msgid "Base Settings" +msgstr "基础设置" + +msgid "Log" +msgstr "日志" + +msgid "IP Address" +msgstr "IP 地址" + +msgid "Start delay (Seconds)" +msgstr "启动延迟 (秒)" + +msgid "Start delay" +msgstr "启动延迟" + +msgid "Port Settings" +msgstr "端口设置" + +msgid "TCP STUN Server" +msgstr "TCP STUN 服务器" + +msgid "UDP STUN Server" +msgstr "UDP STUN 服务器" + +msgid "Keep Alive Server" +msgstr "Keep Alive 服务器" + +msgid "Directory to save natter logs" +msgstr "Natter 运行日志保存路径" + +msgid "ID" +msgstr "标识" + +msgid "Just keep default, or ensure uniqueness" +msgstr "保持默认即可, 修改时请确保标识的唯一性" + +msgid "Remarks" +msgstr "备注" + +msgid "Internal Port" +msgstr "内部端口" + +msgid "Internal Host IP address" +msgstr "内部主机 IP 地址" + +msgid "Internal Host Port" +msgstr "内部主机端口" + +msgid "External Port" +msgstr "外部端口" + +msgid "External TCP Port" +msgstr "外部 TCP 端口" + +msgid "External UDP Port" +msgstr "外部 UDP 端口" + +msgid "Specify the port opened by Natter" +msgstr "指定 Natter 打开的端口" + +msgid "Enable Port Forward" +msgstr "启用端口转发" + +msgid "Forward opened port to internal host" +msgstr "将打开的端口转发至内部主机" + +msgid "Port Type" +msgstr "端口类型" + +msgid "FullCone NAT" +msgstr "完全圆锥型 NAT" + +msgid "Please DO NOT handle the IP address/domain name/port of the TCP/UDP STUN server (3478) while running proxy" +msgstr "请不要使用任何代理软件代理 STUN 服务器地址" + +msgid "Local IP Address" +msgstr "本地 IP 地址" + +msgid "Natter Listening Address" +msgstr "Natter 监听地址" + +msgid "Please ensure that the address can be connected by Natter" +msgstr "请确保 Keep Alive 服务器地址能被 Natter 连接" + +msgid "Internal IP Address" +msgstr "内部 IP 地址" + +msgid "Forward Mode" +msgstr "转发策略" + +msgid "1 - Natter" +msgstr "Natter 内置" + +msgid "2 - Firewall" +msgstr "防火墙" + +msgid "Delete Logs" +msgstr "清除日志" + +msgid "<%:Delete Logs%>" +msgstr "清除日志" + +msgid "Check NAT Status" +msgstr "NAT 类型检测" + +msgid "Exec" +msgstr "执行" + diff --git a/luci-app-natter/root/etc/init.d/natter b/luci-app-natter/root/etc/init.d/natter index 7daab71b1..3ebbad4fb 100755 --- a/luci-app-natter/root/etc/init.d/natter +++ b/luci-app-natter/root/etc/init.d/natter @@ -160,12 +160,25 @@ iptables -I INPUT -j natter 2> /dev/null done ; unset i ;; esac + uci set natter.@ports[$u].external_port_tcp="WAIT" + uci set natter.@ports[$u].external_port_udp="WAIT" + uci commit natter + { + sleep 10 + external_port_tcp=$(grep "[INFO]" $log_file 2> /dev/null | grep TCP | egrep -o "[0-9]+" | awk 'END{print}') + external_port_udp=$(grep "[INFO]" $log_file 2> /dev/null | grep UDP | egrep -o "[0-9]+" | awk 'END{print}') + [ "${external_port_tcp}" ] || external_port_tcp="none" + [ "${external_port_udp}" ] || external_port_udp="none" + uci set natter.@ports[$u].external_port_tcp="$external_port_tcp" + uci set natter.@ports[$u].external_port_udp="$external_port_udp" + uci commit natter + } & fi for i in $port_list do unset $(echo $i) done ; unset i - unset iptables_type internal_tcp internal_udp external_tcp external_udp + unset iptables_type internal_tcp internal_udp external_tcp external_udp external_port_tcp external_port_udp done ; unset u else echo "Natter is disabled ..." @@ -205,6 +218,7 @@ restart() { stop start } + service_triggers() { procd_add_reload_trigger "natter" } diff --git a/sing-box/Makefile b/sing-box/Makefile index a3c72b959..b78db9506 100644 --- a/sing-box/Makefile +++ b/sing-box/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sing-box -PKG_VERSION:=1.7.6 +PKG_VERSION:=1.7.7 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/SagerNet/sing-box/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=ef048ad69589f7d3aea3ad882befe25eaf1a1f9e04d9ffdde4b5215dcbca5363 +PKG_HASH:=ce182cb2181e898b56ca9b6ce0d5adeaece8e761ac62ce8cde69b3c7219b8430 PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=LICENSE