From 7d5f6b5380a96bfa8aaab40dacd8202437023cfc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 1 Oct 2023 23:35:13 +0800 Subject: [PATCH] update 2023-10-01 23:35:13 --- luci-app-iperf3-server/Makefile | 6 ++--- .../root/etc/init.d/iperf3-server | 20 +++++++------- .../luasrc/view/mosdns/mosdns_flush_cache.htm | 2 +- .../luasrc/view/mosdns/mosdns_geo_update.htm | 2 +- .../luasrc/view/mosdns/mosdns_log.htm | 2 +- .../resources/view/xray/preview.js | 27 ++++++++++++------- 6 files changed, 33 insertions(+), 26 deletions(-) diff --git a/luci-app-iperf3-server/Makefile b/luci-app-iperf3-server/Makefile index dab9ad26b..ad850e14d 100755 --- a/luci-app-iperf3-server/Makefile +++ b/luci-app-iperf3-server/Makefile @@ -1,12 +1,12 @@ -# Copyright (C) 2020-2021 Hyy2001X +# Copyright (C) 2020-2023 Hyy2001X include $(TOPDIR)/rules.mk -LUCI_TITLE:=LuCI support for iPerf3 +LUCI_TITLE:=LuCI support for iPerf3 server LUCI_DEPENDS:=+iperf3 LUCI_PKGARCH:=all PKG_VERSION:=2.0 -PKG_RELEASE:=3 +PKG_RELEASE:=4 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/luci-app-iperf3-server/root/etc/init.d/iperf3-server b/luci-app-iperf3-server/root/etc/init.d/iperf3-server index 4999dc54c..81252f182 100755 --- a/luci-app-iperf3-server/root/etc/init.d/iperf3-server +++ b/luci-app-iperf3-server/root/etc/init.d/iperf3-server @@ -1,11 +1,9 @@ #!/bin/sh /etc/rc.common START=99 -USE_PROCD=1 LOGGER="logger -t [iPerf3-Server]" -start_service() { - stop_service +start() { local basic_list="main_enable" local server_list="port delay extra_options enable_server" for i in $(echo $basic_list) @@ -18,7 +16,6 @@ start_service() { # server_number=$(uci show iperf3-server 2> /dev/null | egrep -o '@servers\[[0-9]\]+=servers' | awk 'END {print}' | egrep -o "[0-9]") for u in $(seq 0 $((${server_number} - 1))) do - { for i in $server_list do eval ${i}=$(uci_get_by_type servers $u $i) @@ -27,14 +24,15 @@ start_service() { then sleep $delay $LOGGER "Starting iPerf3 Server [$u] with Port [$port] ..." - # $(command -v iperf3) -s -D -p $port $extra_options - procd_open_instance - procd_set_param command sleep $delay ; $(command -v iperf3) -s -D -p $port $extra_options - procd_set_param respawn 3000 3 10 - procd_close_instance + old_process="$(ps -efww | grep 'iperf3 -s -D -p $port' | grep -v 'grep' | awk '{print $1}')" + [ "$old_process" ] && kill -9 "$old_process" 2> /dev/null + $(command -v iperf3) -s -D -p $port $extra_options + #procd_open_instance + #procd_set_param command sleep $delay ; $(command -v iperf3) -s -D -p $port $extra_options + #procd_set_param respawn 3000 3 10 + #procd_close_instance fi unset enable_server delay - } & done ; unset u else $LOGGER "iPerf3 Server is disabled ..." @@ -42,7 +40,7 @@ start_service() { fi } -stop_service() { +stop() { $LOGGER "Stopping iPerf3 Server ..." ps -efww | grep 'iperf3 -s -D' | grep -v 'grep' | awk '{print $1}' | xargs kill -9 } diff --git a/luci-app-mosdns/luasrc/view/mosdns/mosdns_flush_cache.htm b/luci-app-mosdns/luasrc/view/mosdns/mosdns_flush_cache.htm index 71267544f..6734fbf0d 100644 --- a/luci-app-mosdns/luasrc/view/mosdns/mosdns_flush_cache.htm +++ b/luci-app-mosdns/luasrc/view/mosdns/mosdns_flush_cache.htm @@ -29,6 +29,6 @@ return false; } //]]> - + <%=self.value%> <%+cbi/valuefooter%> diff --git a/luci-app-mosdns/luasrc/view/mosdns/mosdns_geo_update.htm b/luci-app-mosdns/luasrc/view/mosdns/mosdns_geo_update.htm index 660311c31..813b3b530 100644 --- a/luci-app-mosdns/luasrc/view/mosdns/mosdns_geo_update.htm +++ b/luci-app-mosdns/luasrc/view/mosdns/mosdns_geo_update.htm @@ -29,6 +29,6 @@ return false; } //]]> - + <%=self.value%> <%+cbi/valuefooter%> diff --git a/luci-app-mosdns/luasrc/view/mosdns/mosdns_log.htm b/luci-app-mosdns/luasrc/view/mosdns/mosdns_log.htm index 6839302f4..9698f6917 100644 --- a/luci-app-mosdns/luasrc/view/mosdns/mosdns_log.htm +++ b/luci-app-mosdns/luasrc/view/mosdns/mosdns_log.htm @@ -28,6 +28,6 @@ //]]>
- +
diff --git a/luci-app-xray/core/root/www/luci-static/resources/view/xray/preview.js b/luci-app-xray/core/root/www/luci-static/resources/view/xray/preview.js index 152c8a85a..f17dd11b5 100644 --- a/luci-app-xray/core/root/www/luci-static/resources/view/xray/preview.js +++ b/luci-app-xray/core/root/www/luci-static/resources/view/xray/preview.js @@ -47,34 +47,42 @@ return view.extend({ let tproxy_port_tcp_f4 = s.taboption('fake_dns', form.Value, 'tproxy_port_tcp_f4', _('Transparent proxy port (TCP4)')); tproxy_port_tcp_f4.datatype = 'port'; tproxy_port_tcp_f4.placeholder = 1086; - - let tproxy_port_udp_f4 = s.taboption('fake_dns', form.Value, 'tproxy_port_udp_f4', _('Transparent proxy port (UDP4)')); - tproxy_port_udp_f4.datatype = 'port'; - tproxy_port_udp_f4.placeholder = 1087; + tproxy_port_tcp_f4.rmempty = true; let tproxy_port_tcp_f6 = s.taboption('fake_dns', form.Value, 'tproxy_port_tcp_f6', _('Transparent proxy port (TCP6)')); tproxy_port_tcp_f6.datatype = 'port'; - tproxy_port_tcp_f6.placeholder = 1088; + tproxy_port_tcp_f6.placeholder = 1087; + tproxy_port_tcp_f6.rmempty = true; + + let tproxy_port_udp_f4 = s.taboption('fake_dns', form.Value, 'tproxy_port_udp_f4', _('Transparent proxy port (UDP4)')); + tproxy_port_udp_f4.datatype = 'port'; + tproxy_port_udp_f4.placeholder = 1088; + tproxy_port_udp_f4.rmempty = true; let tproxy_port_udp_f6 = s.taboption('fake_dns', form.Value, 'tproxy_port_udp_f6', _('Transparent proxy port (UDP6)')); tproxy_port_udp_f6.datatype = 'port'; tproxy_port_udp_f6.placeholder = 1089; + tproxy_port_udp_f6.rmempty = true; let pool_v4 = s.taboption('fake_dns', form.Value, 'pool_v4', _('Address Pool (IPv4)')); pool_v4.datatype = 'ip4addr'; pool_v4.placeholder = "198.18.0.0/15"; + pool_v4.rmempty = true; let pool_v4_size = s.taboption('fake_dns', form.Value, 'pool_v4_size', _('Address Pool Size (IPv4)')); pool_v4_size.datatype = 'integer'; pool_v4_size.placeholder = 65535; + pool_v4_size.rmempty = true; let pool_v6 = s.taboption('fake_dns', form.Value, 'pool_v6', _('Address Pool (IPv6)')); pool_v6.datatype = 'ip6addr'; pool_v6.placeholder = "fc00::/18"; + pool_v6.rmempty = true; let pool_v6_size = s.taboption('fake_dns', form.Value, 'pool_v6_size', _('Address Pool Size (IPv6)')); pool_v6_size.datatype = 'integer'; pool_v6_size.placeholder = 65535; + pool_v6_size.rmempty = true; let fake_dns_timeout = s.taboption('fake_dns', form.Value, 'fake_dns_timeout', _('Connection Idle Timeout'), _('Policy: Close connection if no data is transferred within given timeout. See here for help.')); fake_dns_timeout.datatype = 'uinteger'; @@ -127,6 +135,7 @@ return view.extend({ destination.depends("specify_outbound", "1"); destination.datatype = "uciname"; destination.textvalue = destination_format("destination"); + destination.rmempty = false; const servers = uci.sections(config_data, "servers"); if (servers.length == 0) { @@ -250,10 +259,10 @@ return view.extend({ s.tab('dynamic_direct', _('Dynamic Direct')); - s.taboption('dynamic_direct', form.Flag, 'dynamic_direct_tcp4', _('Enable for IPv4 TCP'), _("Recommended.")); - s.taboption('dynamic_direct', form.Flag, 'dynamic_direct_tcp6', _('Enable for IPv4 UDP'), _("Recommended.")); - s.taboption('dynamic_direct', form.Flag, 'dynamic_direct_udp4', _('Enable for IPv6 TCP'), _("Not recommended.")); - s.taboption('dynamic_direct', form.Flag, 'dynamic_direct_udp6', _('Enable for IPv6 UDP'), _("Not recommended.")); + s.taboption('dynamic_direct', form.Flag, 'dynamic_direct_tcp4', _('Enable for IPv4 TCP'), _("This should improve performance with large number of connections.")); + s.taboption('dynamic_direct', form.Flag, 'dynamic_direct_tcp6', _('Enable for IPv4 UDP'), _("This may cause problems but worth a try.")); + s.taboption('dynamic_direct', form.Flag, 'dynamic_direct_udp4', _('Enable for IPv6 TCP'), _("This may not be very useful but it should be good enouth for a try.")); + s.taboption('dynamic_direct', form.Flag, 'dynamic_direct_udp6', _('Enable for IPv6 UDP'), _("This may cause problems and is not very useful at the same time. Not recommended.")); let dynamic_direct_timeout = s.taboption('dynamic_direct', form.Value, 'dynamic_direct_timeout', _('Dynamic Direct Timeout'), _("Larger value consumes more memory and performs generally better. Unit in seconds.")); dynamic_direct_timeout.datatype = 'uinteger';