diff --git a/luci-app-omr-tracker/htdocs/luci-static/resources/view/omr-tracker/network/server.js b/luci-app-omr-tracker/htdocs/luci-static/resources/view/omr-tracker/network/server.js index a4359aad4..841095f28 100644 --- a/luci-app-omr-tracker/htdocs/luci-static/resources/view/omr-tracker/network/server.js +++ b/luci-app-omr-tracker/htdocs/luci-static/resources/view/omr-tracker/network/server.js @@ -70,12 +70,58 @@ return view.extend({ o.value('5'); o.modalonly = true; -/* o = s.option(form.Flag, 'check_quality', _('Check link quality')); - o.depends('track_method', 'ping'); + o.depends('type', 'ping'); + o.depends('type', 'apiping'); o.default = false; o.modalonly = true; -*/ + + o = s.option(form.Value, 'failure_latency', _('Failure latency [ms]')); + o.depends('check_quality', '1'); + o.default = '1000'; + o.value('25'); + o.value('50'); + o.value('75'); + o.value('100'); + o.value('150'); + o.value('200'); + o.value('250'); + o.value('300'); + o.modalonly = true; + + o = s.option(form.Value, 'failure_loss', _('Failure packet loss [%]')); + o.depends('check_quality', '1'); + o.default = '40'; + o.value('2'); + o.value('5'); + o.value('10'); + o.value('20'); + o.value('25'); + o.modalonly = true; + + o = s.option(form.Value, 'recovery_latency', _('Recovery latency [ms]')); + o.depends('check_quality', '1'); + o.default = '500'; + o.value('25'); + o.value('50'); + o.value('75'); + o.value('100'); + o.value('150'); + o.value('200'); + o.value('250'); + o.value('300'); + o.modalonly = true; + + o = s.option(form.Value, 'recovery_loss', _('Recovery packet loss [%]')); + o.depends('check_quality', '1'); + o.default = '10'; + o.value('2'); + o.value('5'); + o.value('10'); + o.value('20'); + o.value('25'); + o.modalonly = true; + o = s.option(form.ListValue, "timeout", _("Test timeout")); o.default = '4'; o.value('1', _('%d second').format('1')); diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index 3be909445..2c7713fa3 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -1463,6 +1463,10 @@ function settings_add() local status_getip_timeout = luci.http.formvalue("status_getip_timeout") or "1" ucic:set("openmptcprouter","settings","status_getip_timeout",status_getip_timeout) + -- Whois timeout + local status_whois_timeout = luci.http.formvalue("status_whois_timeout") or "2" + ucic:set("openmptcprouter","settings","status_whois_timeout",status_whois_timeout) + -- Enable/disable loop detection local disableloopdetection = luci.http.formvalue("disableloopdetection") or "0" ucic:set("openmptcprouter","settings","disableloopdetection",disableloopdetection) diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/settings.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/settings.htm index 285f62a4b..c858eac44 100644 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/settings.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/settings.htm @@ -286,7 +286,16 @@ - +
+ +
+ "> +
+
+ <%:Timeout for retrieving Whois WANs IP on status pages%> +
+
+
diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm index 1959140a2..cea83f0e1 100644 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm @@ -11,7 +11,13 @@ local ifttyu = nixio.fs.glob("/dev/ttyUSB*") local ifttyc = nixio.fs.glob("/dev/cdc-wdm*") local sqm = luci.sys.exec("opkg list-installed | grep -q luci-app-sqm && echo -n '1' || echo -n '0'") + if sqm == "0" then + sqm = luci.sys.exec("apk list | grep installed | grep -q luci-app-sqm && echo -n '1' || echo -n '0'") + end local qos = luci.sys.exec("opkg list-installed | grep -q luci-app-qos && echo -n '1' || echo -n '0'") + if qos == "0" then + qos = luci.sys.exec("apk list | grep installed | grep -q luci-app-qos && echo -n '1' || echo -n '0'") + end menuentry = uci:get("openmptcprouter","settings","menu") or "openmptcprouter" function device_notvirtual(dev) if dev:match("^eth.*") or dev:match("^wwan.*") or dev:match("^tun.*") or dev:match("/") then diff --git a/luci-app-openmptcprouter/root/etc/uci-defaults/openmptcprouter b/luci-app-openmptcprouter/root/etc/uci-defaults/openmptcprouter index 7d05eda2f..c30836b1d 100755 --- a/luci-app-openmptcprouter/root/etc/uci-defaults/openmptcprouter +++ b/luci-app-openmptcprouter/root/etc/uci-defaults/openmptcprouter @@ -98,6 +98,12 @@ if [ "$(uci -q get openmptcprouter.settings.status_getip_timeout)" = "" ]; then commit openmptcprouter EOF fi +if [ "$(uci -q get openmptcprouter.settings.status_whois_timeout)" = "" ]; then + uci -q batch <<-EOF >/dev/null + set openmptcprouter.settings.status_whois_timeout=2 + commit openmptcprouter + EOF +fi if [ "$(uci -q get openmptcprouter.settings.enable_nodelay)" = "" ]; then uci -q batch <<-EOF >/dev/null set openmptcprouter.settings.enable_nodelay=1 diff --git a/luci-app-shadowsocks-libev/htdocs/luci-static/resources/shadowsocks-libev.js b/luci-app-shadowsocks-libev/htdocs/luci-static/resources/shadowsocks-libev.js index a6460f68d..e2b72a513 100644 --- a/luci-app-shadowsocks-libev/htdocs/luci-static/resources/shadowsocks-libev.js +++ b/luci-app-shadowsocks-libev/htdocs/luci-static/resources/shadowsocks-libev.js @@ -230,6 +230,7 @@ return L.Class.extend({ } }); }, + /* option_install_package: function(s, tab) { var bin = s.sectiontype.replace('_', '-'), opkg_package = 'shadowsocks-libev-' + bin, o; @@ -246,6 +247,7 @@ return L.Class.extend({ '?query=' + opkg_package, '_blank', 'noopener'); }; }, + */ parse_uri: function(uri) { var scheme = 'ss://'; if (uri && uri.indexOf(scheme) === 0) { diff --git a/luci-app-shadowsocks-libev/htdocs/luci-static/resources/view/shadowsocks-libev/instances.js b/luci-app-shadowsocks-libev/htdocs/luci-static/resources/view/shadowsocks-libev/instances.js index 0e5d76317..b739d4dcd 100644 --- a/luci-app-shadowsocks-libev/htdocs/luci-static/resources/view/shadowsocks-libev/instances.js +++ b/luci-app-shadowsocks-libev/htdocs/luci-static/resources/view/shadowsocks-libev/instances.js @@ -76,9 +76,11 @@ return L.view.extend({ s.tab('advanced', _('Advanced Settings')); s.taboption('general', form.Value, 'label', _('Label')); s.taboption('general', form.Flag, 'disabled', _('Disable')); + /* if (!res[0]) { ss.option_install_package(s, 'general'); } + */ ss.options_common(s, 'advanced'); if (stype === 'ss_server') { diff --git a/luci-app-shadowsocks-rust/htdocs/luci-static/resources/shadowsocks-rust.js b/luci-app-shadowsocks-rust/htdocs/luci-static/resources/shadowsocks-rust.js index 238cb10bb..76f6303a9 100644 --- a/luci-app-shadowsocks-rust/htdocs/luci-static/resources/shadowsocks-rust.js +++ b/luci-app-shadowsocks-rust/htdocs/luci-static/resources/shadowsocks-rust.js @@ -213,6 +213,7 @@ return L.Class.extend({ } }); }, + /* option_install_package: function(s, tab) { var bin = s.sectiontype.replace('_', '-'), opkg_package = 'shadowsocks-rust-' + bin, o; @@ -229,6 +230,7 @@ return L.Class.extend({ '?query=' + opkg_package, '_blank', 'noopener'); }; }, + */ parse_uri: function(uri) { var scheme = 'ss://'; if (uri && uri.indexOf(scheme) === 0) { diff --git a/luci-app-shadowsocks-rust/htdocs/luci-static/resources/view/shadowsocks-rust/instances.js b/luci-app-shadowsocks-rust/htdocs/luci-static/resources/view/shadowsocks-rust/instances.js index 419eed46f..b4339bd1f 100644 --- a/luci-app-shadowsocks-rust/htdocs/luci-static/resources/view/shadowsocks-rust/instances.js +++ b/luci-app-shadowsocks-rust/htdocs/luci-static/resources/view/shadowsocks-rust/instances.js @@ -76,9 +76,11 @@ return L.view.extend({ s.tab('advanced', _('Advanced Settings')); s.taboption('general', form.Value, 'label', _('Label')); s.taboption('general', form.Flag, 'disabled', _('Disable')); + /* if (!res[0]) { ss.option_install_package(s, 'general'); } + */ ss.options_common(s, 'advanced'); if (stype === 'ss_server') { diff --git a/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js b/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js index 1dc5c6bff..0c575c416 100644 --- a/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js +++ b/luci-mod-network/htdocs/luci-static/resources/view/network/interfaces.js @@ -330,7 +330,7 @@ return view.extend({ var e = map.querySelector('[id="cbi-network-%s"] .cbi-button-edit'.format(ifc.getName())); if (e) e.disabled = true; - var link = L.url('admin/system/opkg') + '?query=luci-proto'; + var link = L.url('admin/system/package-manager') + '?query=luci-proto'; dom.content(dsc, [ E('em', _('Unsupported protocol type.')), E('br'), E('a', { href: link }, _('Install protocol extensions...')) @@ -371,7 +371,6 @@ return view.extend({ network.getDSLModemType(), network.getDevices(), fs.lines('/etc/iproute2/rt_tables'), - L.resolveDefault(fs.read('/usr/lib/opkg/info/netifd.control')), uci.changes() ]); }, @@ -471,14 +470,10 @@ return view.extend({ }, render: function(data) { - var netifdVersion = (data[3] || '').match(/Version: ([^\n]+)/); - - if (netifdVersion && netifdVersion[1] >= "2021-05-26") { - if (this.interfaceBridgeWithIfnameSections().length) - return this.renderBridgeMigration(); - else if (this.deviceWithIfnameSections().length || this.interfaceWithIfnameSections().length) - return this.renderIfnameMigration(); - } + if (this.interfaceBridgeWithIfnameSections().length) + return this.renderBridgeMigration(); + else if (this.deviceWithIfnameSections().length || this.interfaceWithIfnameSections().length) + return this.renderIfnameMigration(); var dslModemType = data[0], netDevs = data[1], diff --git a/luci-mod-network/root/usr/share/rpcd/acl.d/luci-mod-network.json b/luci-mod-network/root/usr/share/rpcd/acl.d/luci-mod-network.json index 40ad05bc8..96a0d5ccf 100644 --- a/luci-mod-network/root/usr/share/rpcd/acl.d/luci-mod-network.json +++ b/luci-mod-network/root/usr/share/rpcd/acl.d/luci-mod-network.json @@ -8,7 +8,6 @@ "/proc/sys/net/ipv6/conf/*/mtu": [ "read" ], "/proc/sys/net/ipv6/conf/*/hop_limit": [ "read" ], "/usr/libexec/luci-peeraddr": [ "exec" ], - "/usr/lib/opkg/info/netifd.control": [ "read" ], "/proc/sys/net/ipv[46]/conf/*": [ "read" ], "/sys/class/net/*/brport/*": [ "read" ] }, diff --git a/omr-tracker/files/usr/share/omr/post-tracking.d/020-status b/omr-tracker/files/usr/share/omr/post-tracking.d/020-status index a70ac623d..f0e0af08f 100755 --- a/omr-tracker/files/usr/share/omr/post-tracking.d/020-status +++ b/omr-tracker/files/usr/share/omr/post-tracking.d/020-status @@ -50,7 +50,9 @@ if [ -n "$OMR_TRACKER_INTERFACE" ] && { [ "$(uci -q get openmptcprouter.$OMR_TRA if [ "$(uci -q get openmptcprouter.settings.external_check)" != "0" ]; then #asn="$(wget -4 -qO- -T 4 http://api.iptoasn.com/v1/as/ip/$ipaddr | jsonfilter -q -e '@.as_description')" #[ -z "$asn" ] && { - asn="$(timeout 2 whois $ipaddr 2>/dev/null | grep -m 1 -i 'netname' | awk '{print $2}')" + whoistimeout=$(uci -q get openmptcprouter.settings.status_whois_timeout) + [ -z "$whoistimeout" ] && whoistimeout=2 + asn="$(timeout $whoistimeout whois $ipaddr 2>/dev/null | grep -m 1 -i 'netname' | awk '{print $2}')" #} fi [ -z "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE)" ] && { diff --git a/openmptcprouter/files/etc/init.d/sysupgrade b/openmptcprouter/files/etc/init.d/sysupgrade index 44aac9fa8..d9ba5b6bb 100755 --- a/openmptcprouter/files/etc/init.d/sysupgrade +++ b/openmptcprouter/files/etc/init.d/sysupgrade @@ -1,5 +1,5 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2020-2024 Ycarus (Yannick Chabanois) +# Copyright (C) 2020-2025 Ycarus (Yannick Chabanois) # Released under GPL 3. See LICENSE for the full terms. { @@ -11,10 +11,16 @@ start_service() { if [ -f /etc/backup/installed_packages.txt ]; then - opkg -V0 update >/dev/null 2>&1 - if [ -z "$(grep '\toverlay' /etc/backup/installed_packages.txt | cut -f1 | xargs -r opkg -V0 install)" ]; then - rm /etc/backup/installed_packages.txt - fi + if [ -e /usr/bin/apk ]; then + apk update >/dev/null 2>&1 + if [ -z "$(grep '\toverlay' /etc/backup/installed_packages.txt | cut -f1 | xargs -r apk add)" ]; then + rm /etc/backup/installed_packages.txt + fi + else + opkg -V0 update >/dev/null 2>&1 + if [ -z "$(grep '\toverlay' /etc/backup/installed_packages.txt | cut -f1 | xargs -r opkg -V0 install)" ]; then + rm /etc/backup/installed_packages.txt + fi fi }