update 2023-12-31 23:35:31

This commit is contained in:
github-actions[bot] 2023-12-31 23:35:31 +08:00
parent ace057f885
commit 7cfa4c804b
8 changed files with 157 additions and 21 deletions

View File

@ -1,10 +1,10 @@
# Copyright (C) 2020-2023 Hyy2001X <https://github.com/Hyy2001X>
# Copyright (C) 2020-2024 Hyy2001X <https://github.com/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

View File

@ -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

View File

@ -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"

View File

@ -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 "清除日志"

View File

@ -1 +0,0 @@
zh-cn

View File

@ -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 "执行"

View File

@ -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"
}

View File

@ -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