From 779ad66f3c958d46b32588310fda23bbb04538fb Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Thu, 3 Feb 2022 19:54:39 +0100 Subject: [PATCH 1/6] Add missing var --- mptcp/files/etc/init.d/mptcp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mptcp/files/etc/init.d/mptcp b/mptcp/files/etc/init.d/mptcp index 0516f773e..d7646364d 100755 --- a/mptcp/files/etc/init.d/mptcp +++ b/mptcp/files/etc/init.d/mptcp @@ -10,7 +10,7 @@ USE_PROCD=1 . /lib/functions/network.sh global_multipath_settings() { - local multipath mptcp_path_manager mptcp_schdeduler mptcp_debug congestion mptcp_checksum mptcp_syn_retries mptcp_fullmesh_num_subflows mptcp_fullmesh_create_on_err mptcp_ndiffports_num_subflows mptcp_rr_cwnd_limited mptcp_rr_num_segments + local multipath mptcp_path_manager mptcp_scheduler mptcp_subflows mptcp_debug mptcp_add_addr_accepted congestion mptcp_checksum mptcp_syn_retries mptcp_fullmesh_num_subflows mptcp_fullmesh_create_on_err mptcp_ndiffports_num_subflows mptcp_rr_cwnd_limited mptcp_rr_num_segments local multipath_status=0 config_load network config_get multipath globals multipath From 2597f7783b5464a6724d6ecde1c6930c5eff1c5c Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Thu, 3 Feb 2022 19:55:31 +0100 Subject: [PATCH 2/6] Remove new line for ping --- openmptcprouter/files/bin/omr-test-speed | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmptcprouter/files/bin/omr-test-speed b/openmptcprouter/files/bin/omr-test-speed index 15666e1e9..618da96fe 100755 --- a/openmptcprouter/files/bin/omr-test-speed +++ b/openmptcprouter/files/bin/omr-test-speed @@ -20,9 +20,9 @@ if [ "$HETZNER" = false ]; then for pinghost in $HOSTLST; do domain=$(echo $pinghost | awk -F/ '{print $3}') if [ -z "$INTERFACE" ]; then - ping=$(ping -c1 -w2 $domain | cut -d "/" -s -f5 | cut -d "." -f1) + ping=$(ping -c1 -w2 $domain | cut -d "/" -s -f5 | cut -d "." -f1 | tr -d '\n') else - ping=$(ping -c1 -w2 -I $INTERFACE -B $domain | cut -d "/" -s -f5 | cut -d "." -f1) + ping=$(ping -c1 -w2 -I $INTERFACE -B $domain | cut -d "/" -s -f5 | cut -d "." -f1 | tr -d '\n') fi echo "host: $domain - ping: $ping" if [ -n "$ping" ] && [ "$ping" -lt "$bestping" ]; then From 58fcea225faec0849f486e9912df2a23090346b3 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 4 Feb 2022 20:44:41 +0100 Subject: [PATCH 3/6] More anonymous config --- luci-app-openmptcprouter/root/bin/anonymous_config.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/luci-app-openmptcprouter/root/bin/anonymous_config.sh b/luci-app-openmptcprouter/root/bin/anonymous_config.sh index 674d01726..65c0813a2 100755 --- a/luci-app-openmptcprouter/root/bin/anonymous_config.sh +++ b/luci-app-openmptcprouter/root/bin/anonymous_config.sh @@ -21,5 +21,6 @@ uci show | \ -e "/vpn\.key=/s/......$/xxxxxx'/" \ -e "/vps\.key=/s/......$/xxxxxx'/" \ -e "/wgkey=/s/......$/xxxxxx'/" \ + -e "/key=/s/......$/xxxxxx'/" \ -e "/ula_prefix=2/s/=.........../='xxxxxxxxxxx/" \ -e "/token=/s/............$/xxxxxx'/" \ No newline at end of file From e0ec6cbd3d8cd6df29d8fd10ce14fd7378f22e89 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 4 Feb 2022 20:45:15 +0100 Subject: [PATCH 4/6] More server for speed test --- openmptcprouter/files/bin/omr-test-speed | 40 ++++++++++------------ openmptcprouter/files/bin/omr-test-speedv6 | 39 ++++++++++----------- 2 files changed, 38 insertions(+), 41 deletions(-) diff --git a/openmptcprouter/files/bin/omr-test-speed b/openmptcprouter/files/bin/omr-test-speed index 618da96fe..71bc4d75c 100755 --- a/openmptcprouter/files/bin/omr-test-speed +++ b/openmptcprouter/files/bin/omr-test-speed @@ -1,9 +1,9 @@ #!/bin/sh # vim: set noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 : -HETZNER=false -if [ "$1" = "hetzner" ]; then - HETZNER=true +FORCEVPS=false +if [ "$1" = "forcevps" ]; then INTERFACE="$2" + FORCEVPS=true else INTERFACE="$1" fi @@ -13,24 +13,22 @@ fi exit 0 } -if [ "$HETZNER" = false ]; then - echo "Select best test server..." - HOSTLST="http://speedtest.frankfurt.linode.com/garbage.php?ckSize=10000 http://speedtest.tokyo2.linode.com/garbage.php?ckSize=10000 http://speedtest.singapore.linode.com/garbage.php?ckSize=10000 http://speedtest.newark.linode.com/garbage.php?ckSize=10000 http://speedtest.atlanta.linode.com/garbage.php?ckSize=10000 http://speedtest.dallas.linode.com/garbage.php?ckSize=10000 http://speedtest.fremont.linode.com/garbage.php?ckSize=10000 http://speedtest.tele2.net/1000GB.zip https://speed.hetzner.de/10GB.bin http://ipv4.bouygues.testdebit.info/10G.iso http://par.download.datapacket.com/10000mb.bin http://nyc.download.datapacket.com/10000mb.bin http://ams.download.datapacket.com/10000mb.bin http://fra.download.datapacket.com/10000mb.bin http://lon.download.datapacket.com/10000mb.bin http://mad.download.datapacket.com/10000mb.bin http://prg.download.datapacket.com/10000mb.bin http://sto.download.datapacket.com/10000mb.bin http://vie.download.datapacket.com/10000mb.bin http://war.download.datapacket.com/10000mb.bin http://atl.download.datapacket.com/10000mb.bin http://chi.download.datapacket.com/10000mb.bin http://lax.download.datapacket.com/10000mb.bin http://mia.download.datapacket.com/10000mb.bin http://nyc.download.datapacket.com/10000mb.bin" - bestping="9999" - for pinghost in $HOSTLST; do - domain=$(echo $pinghost | awk -F/ '{print $3}') - if [ -z "$INTERFACE" ]; then - ping=$(ping -c1 -w2 $domain | cut -d "/" -s -f5 | cut -d "." -f1 | tr -d '\n') - else - ping=$(ping -c1 -w2 -I $INTERFACE -B $domain | cut -d "/" -s -f5 | cut -d "." -f1 | tr -d '\n') - fi - echo "host: $domain - ping: $ping" - if [ -n "$ping" ] && [ "$ping" -lt "$bestping" ]; then - bestping=$ping - HOST=$pinghost - fi - done -fi +echo "Select best test server..." +HOSTLST="http://scaleway.testdebit.info/10G.iso http://bordeaux.testdebit.info/10G.iso http://aix-marseille.testdebit.info/10G.iso http://lyon.testdebit.info/10G.iso http://lille.testdebit.info/10G.iso http://paris.testdebit.info/10G.iso http://appliwave.testdebit.info/10G/10G.iso http://speedtest.frankfurt.linode.com/garbage.php?ckSize=10000 http://speedtest.tokyo2.linode.com/garbage.php?ckSize=10000 http://speedtest.singapore.linode.com/garbage.php?ckSize=10000 http://speedtest.newark.linode.com/garbage.php?ckSize=10000 http://speedtest.atlanta.linode.com/garbage.php?ckSize=10000 http://speedtest.dallas.linode.com/garbage.php?ckSize=10000 http://speedtest.fremont.linode.com/garbage.php?ckSize=10000 https://speed.hetzner.de/10GB.bin http://ipv4.bouygues.testdebit.info/10G.iso http://par.download.datapacket.com/10000mb.bin http://nyc.download.datapacket.com/10000mb.bin http://ams.download.datapacket.com/10000mb.bin http://fra.download.datapacket.com/10000mb.bin http://lon.download.datapacket.com/10000mb.bin http://mad.download.datapacket.com/10000mb.bin http://prg.download.datapacket.com/10000mb.bin http://sto.download.datapacket.com/10000mb.bin http://vie.download.datapacket.com/10000mb.bin http://war.download.datapacket.com/10000mb.bin http://atl.download.datapacket.com/10000mb.bin http://chi.download.datapacket.com/10000mb.bin http://lax.download.datapacket.com/10000mb.bin http://mia.download.datapacket.com/10000mb.bin http://nyc.download.datapacket.com/10000mb.bin" +bestping="9999" +for pinghost in $HOSTLST; do + domain=$(echo $pinghost | awk -F/ '{print $3}') + if [ -z "$INTERFACE" ] || [ "$FORCEVPS" = true ]; then + ping=$(ping -c1 -w2 $domain | cut -d "/" -s -f5 | cut -d "." -f1 | tr -d '\n') + else + ping=$(ping -c1 -w2 -I $INTERFACE -B $domain | cut -d "/" -s -f5 | cut -d "." -f1 | tr -d '\n') + fi + echo "host: $domain - ping: $ping" + if [ -n "$ping" ] && [ "$ping" -lt "$bestping" ]; then + bestping=$ping + HOST=$pinghost + fi +done [ -z "$HOST" ] && HOST="https://speed.hetzner.de/10GB.bin" diff --git a/openmptcprouter/files/bin/omr-test-speedv6 b/openmptcprouter/files/bin/omr-test-speedv6 index 3db10fee9..32269f215 100755 --- a/openmptcprouter/files/bin/omr-test-speedv6 +++ b/openmptcprouter/files/bin/omr-test-speedv6 @@ -1,8 +1,8 @@ #!/bin/sh # vim: set noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 : -HETZNER=false -if [ "$1" = "hetzner" ]; then - HETZNER=true +FORCEVPS=false +if [ "$1" = "forcevps" ]; then + FORCEVPS=true INTERFACE="$2" else INTERFACE="$1" @@ -14,23 +14,22 @@ fi } -if [ "$HETZNER" = false ]; then - echo "Select best test server..." - HOSTLST="http://speedtest.frankfurt.linode.com/garbage.php?ckSize=10000 http://speedtest.tokyo2.linode.com/garbage.php?ckSize=10000 http://speedtest.singapore.linode.com/garbage.php?ckSize=10000 http://speedtest.newark.linode.com/garbage.php?ckSize=10000 http://speedtest.atlanta.linode.com/garbage.php?ckSize=10000 http://speedtest.dallas.linode.com/garbage.php?ckSize=10000 http://speedtest.fremont.linode.com/garbage.php?ckSize=10000 http://speedtest.tele2.net/1000GB.zip https://speed.hetzner.de/10GB.bin http://ipv6.bouygues.testdebit.info/10G.iso http://par.download.datapacket.com/10000mb.bin http://nyc.download.datapacket.com/10000mb.bin http://ams.download.datapacket.com/10000mb.bin http://fra.download.datapacket.com/10000mb.bin http://lon.download.datapacket.com/10000mb.bin http://mad.download.datapacket.com/10000mb.bin http://prg.download.datapacket.com/10000mb.bin http://sto.download.datapacket.com/10000mb.bin http://vie.download.datapacket.com/10000mb.bin http://war.download.datapacket.com/10000mb.bin http://atl.download.datapacket.com/10000mb.bin http://chi.download.datapacket.com/10000mb.bin http://lax.download.datapacket.com/10000mb.bin http://mia.download.datapacket.com/10000mb.bin http://nyc.download.datapacket.com/10000mb.bin" - bestping="9999" - for pinghost in $HOSTLST; do - domain=$(echo $pinghost | awk -F/ '{print $3}') - if [ -z "$INTERFACE" ]; then - ping=$(ping -6 -c1 -w2 $domain | cut -d "/" -s -f5 | cut -d "." -f1) - else - ping=$(ping -6 -c1 -w2 -I $INTERFACE -B $domain | cut -d "/" -s -f5 | cut -d "." -f1) - fi - echo "host: $domain - ping: $ping" - if [ -n "$ping" ] && [ "$ping" -lt "$bestping" ]; then - bestping=$ping - HOST=$pinghost - fi - done +echo "Select best test server..." +HOSTLST="http://scaleway.testdebit.info/10G.iso http://bordeaux.testdebit.info/10G.iso http://aix-marseille.testdebit.info/10G.iso http://lyon.testdebit.info/10G.iso http://lille.testdebit.info/10G.iso http://paris.testdebit.info/10G.iso http://appliwave.testdebit.info/10G/10G.iso http://speedtest.frankfurt.linode.com/garbage.php?ckSize=10000 http://speedtest.tokyo2.linode.com/garbage.php?ckSize=10000 http://speedtest.singapore.linode.com/garbage.php?ckSize=10000 http://speedtest.newark.linode.com/garbage.php?ckSize=10000 http://speedtest.atlanta.linode.com/garbage.php?ckSize=10000 http://speedtest.dallas.linode.com/garbage.php?ckSize=10000 http://speedtest.fremont.linode.com/garbage.php?ckSize=10000 https://speed.hetzner.de/10GB.bin http://ipv6.bouygues.testdebit.info/10G.iso http://par.download.datapacket.com/10000mb.bin http://nyc.download.datapacket.com/10000mb.bin http://ams.download.datapacket.com/10000mb.bin http://fra.download.datapacket.com/10000mb.bin http://lon.download.datapacket.com/10000mb.bin http://mad.download.datapacket.com/10000mb.bin http://prg.download.datapacket.com/10000mb.bin http://sto.download.datapacket.com/10000mb.bin http://vie.download.datapacket.com/10000mb.bin http://war.download.datapacket.com/10000mb.bin http://atl.download.datapacket.com/10000mb.bin http://chi.download.datapacket.com/10000mb.bin http://lax.download.datapacket.com/10000mb.bin http://mia.download.datapacket.com/10000mb.bin http://nyc.download.datapacket.com/10000mb.bin" +bestping="9999" +for pinghost in $HOSTLST; do + domain=$(echo $pinghost | awk -F/ '{print $3}') + if [ -z "$INTERFACE" ] || [ "$FORCEVPS" = true ]; then + ping=$(ping -6 -c1 -w2 $domain | cut -d "/" -s -f5 | cut -d "." -f1) + else + ping=$(ping -6 -c1 -w2 -I $INTERFACE -B $domain | cut -d "/" -s -f5 | cut -d "." -f1) + fi + echo "host: $domain - ping: $ping" + if [ -n "$ping" ] && [ "$ping" -lt "$bestping" ]; then + bestping=$ping + HOST=$pinghost + fi +done fi [ -z "$HOST" ] && HOST="https://speed.hetzner.de/10GB.bin" From 0b7ee45a1a944040f361b933f2abfa70a350582f Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 4 Feb 2022 22:25:38 +0100 Subject: [PATCH 5/6] Force token reset if not working on status --- .../root/usr/libexec/rpcd/openmptcprouter | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter b/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter index e42883f1a..9c9ab517b 100755 --- a/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter +++ b/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter @@ -931,6 +931,11 @@ function interfaces_status() else mArray.openmptcprouter["vps_admin"] = false mArray.openmptcprouter["vps_admin_error_msg"] = "No result" + uci:set("openmptcprouter",s[".name"],"admin_error","1") + mArray.openmptcprouter["vps_admin_error"] = true + uci:delete("openmptcprouter",s[".name"],"token") + uci:save("openmptcprouter",s[".name"]) + uci:commit("openmptcprouter",s[".name"]) end else mArray.openmptcprouter["vps_admin"] = false From fa07ce7e73d938b1dba1e14d002c8fda502fac9d Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 4 Feb 2022 22:26:10 +0100 Subject: [PATCH 6/6] Use speedtestc++ instead of speedtestc --- openmptcprouter-full/Makefile | 2 +- speedtestcpp/Makefile | 42 +++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 speedtestcpp/Makefile diff --git a/openmptcprouter-full/Makefile b/openmptcprouter-full/Makefile index f8b0b483d..e759dc5ee 100644 --- a/openmptcprouter-full/Makefile +++ b/openmptcprouter-full/Makefile @@ -46,7 +46,7 @@ MY_DEPENDS := \ luci-app-openvpn \ shadowsocks-libev-ss-server shadowsocks-libev-ss-tunnel \ omr-6in4 ip6tables-mod-nat luci-proto-ipv6 6to4 6in4 6rd ip6tables \ - speedtestc \ + speedtestcpp \ iftop \ htop \ nano \ diff --git a/speedtestcpp/Makefile b/speedtestcpp/Makefile new file mode 100644 index 000000000..db25f5bb8 --- /dev/null +++ b/speedtestcpp/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2021 Ycarus (Yannick Chabanois) for OpenMPTCProuter project +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=speedtestcpp +PKG_VERSION:=1.12 +PKG_RELEASE:=2 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=a01ae6eb04c5d3f4847aef73bf77849275ccc6eb +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/fmantz/SpeedTest.git + +PKG_MAINTAINER:=Ycarus +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +CMAKE_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/speedtestcpp + SECTION:=net + CATEGORY:=Network + TITLE:=Yet another unofficial speedtest.net client cli interface + URL:=https://github.com/fmantz/SpeedTest + DEPENDS:=+curl +libstdcpp +libopenssl +libxml2 +endef + +define Package/speedtestcpp/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/SpeedTest $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/speedtestJson $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,speedtestcpp)) \ No newline at end of file