From 81789e00aceaadaaae1f222915e89bf0df0df8bd Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 24 Apr 2020 16:44:51 +0200 Subject: [PATCH 01/88] Simple restart modemmanager --- .../share/omr/post-tracking.d/post-tracking | 23 ++++++------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/mptcp/files/usr/share/omr/post-tracking.d/post-tracking b/mptcp/files/usr/share/omr/post-tracking.d/post-tracking index 2e19c0fc8..8331a65af 100755 --- a/mptcp/files/usr/share/omr/post-tracking.d/post-tracking +++ b/mptcp/files/usr/share/omr/post-tracking.d/post-tracking @@ -218,22 +218,13 @@ default_gw=$(ip route show default | grep -v "metric" | awk '/default/ {print $3 # An interface in error will never be used in MPTCP if [ "$OMR_TRACKER_STATUS" = "ERROR" ]; then if [ "$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" = "modemmanager" ]; then - timeout 1 mmcli -L | while read MODEM; do - MODEM_ID=$(echo $MODEM | awk -F' ' '{print $1}' | awk -F/ '{print $6}') - MODEM_INFO="$(timeout 1 mmcli -m $MODEM_ID --output-keyvalue)" - if [ -n "$MODEM_INFO" ] && [ "$(echo "$MODEM_INFO" | grep 'modem.generic.device ' | awk -F": " '{print $2}')" = "$(uci -q get network.$OMR_TRACKER_INTERFACE.device)" ]; then - STATE=$(echo "$MODEM_INFO" | grep 'modem.generic.state' | awk -F": " '{print $2}') - if [ "$STATE" = "connected" ] || [ "$STATE" = "disabled" ] || [ "$STATE" = "searching" ] || [ "$STATE" = "registered" ] || [ "$STATE" = "idle" ]; then - _log "No answer from $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE), restart interface" - _log "Set $OMR_TRACKER_INTERFACE down" - ifdown $OMR_TRACKER_INTERFACE - sleep 5 - _log "Set $OMR_TRACKER_INTERFACE up" - ifup $OMR_TRACKER_INTERFACE - sleep 10 - fi - fi - done + _log "No answer from $OMR_TRACKER_INTERFACE ($OMR_TRACKER_DEVICE), restart interface" + _log "Set $OMR_TRACKER_INTERFACE down" + ifdown $OMR_TRACKER_INTERFACE + sleep 5 + _log "Set $OMR_TRACKER_INTERFACE up" + ifup $OMR_TRACKER_INTERFACE + sleep 10 fi if [ "$OMR_TRACKER_PREV_STATUS" = "$OMR_TRACKER_STATUS" ]; then From 9910e61efc547ccbce3ebe4164f8181fee083e42 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Sat, 25 Apr 2020 13:12:15 +0200 Subject: [PATCH 02/88] Add more info for qmi, modemmanger and huawei modems --- .../openmptcprouter/css/wanstatus.css | 6 +++ .../luasrc/view/openmptcprouter/wanstatus.htm | 9 +++- luci-app-openmptcprouter/root/bin/omr-huawei | 45 ++++++++++++++++--- .../root/bin/omr-modemmanager | 3 +- luci-app-openmptcprouter/root/bin/omr-qmi | 2 +- .../root/usr/libexec/rpcd/openmptcprouter | 33 +++++++++----- 6 files changed, 77 insertions(+), 21 deletions(-) diff --git a/luci-app-openmptcprouter/htdocs/luci-static/resources/openmptcprouter/css/wanstatus.css b/luci-app-openmptcprouter/htdocs/luci-static/resources/openmptcprouter/css/wanstatus.css index 04786f927..3ea2fb277 100644 --- a/luci-app-openmptcprouter/htdocs/luci-static/resources/openmptcprouter/css/wanstatus.css +++ b/luci-app-openmptcprouter/htdocs/luci-static/resources/openmptcprouter/css/wanstatus.css @@ -293,6 +293,12 @@ Thanks :)*/ font-weight: 700; color: #333333; } + +.network-node .info .title i { + font-weight: lighter; + font-size: 5px; +} + .network-node .info .status-message { display: block; } diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wanstatus.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wanstatus.htm index f485e4849..610ff3975 100644 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wanstatus.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wanstatus.htm @@ -382,6 +382,7 @@ var operator = mArray.wans[i].operator; var phonenumber = mArray.wans[i].phonenumber; var donglestate = mArray.wans[i].donglestate; + var networktype = mArray.wans[i].networktype; var gateway = mArray.wans[i].gateway; if (anonymize == "true" && testPrivateIP(gateway) == false) { @@ -429,7 +430,7 @@ { content += String.format('%s %s
',_('mtu:'), mtu); } - if (operator !== '' && anonymize !== 'true') + if (operator !== '') { content += String.format('%s %s
',_('operator:'), operator); } @@ -437,7 +438,7 @@ { content += String.format('%s %s
',_('phone number:'), phonenumber); } - if (donglestate !== '' && anonymize !== 'true') + if (donglestate !== '') { content += String.format('%s %s
',_('state:'), donglestate); } @@ -455,6 +456,10 @@ else title += ' '; } + if (networktype !== '') + { + title += String.format(' %s',networktype); + } if(ipaddr == '') { statusMessage += _('No IP defined') + '
'; diff --git a/luci-app-openmptcprouter/root/bin/omr-huawei b/luci-app-openmptcprouter/root/bin/omr-huawei index 0efe8676f..7bb08c162 100755 --- a/luci-app-openmptcprouter/root/bin/omr-huawei +++ b/luci-app-openmptcprouter/root/bin/omr-huawei @@ -1,14 +1,47 @@ #!/bin/sh MODEM_IP=`echo $1 | grep -E '^(192\.168|10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.)'` [ -z "$MODEM_IP" ] && return +INFO=$2 SESTOK=$(curl -s -m 1 -X GET "http://$MODEM_IP/api/webserver/SesTokInfo") [ -z "$SESTOK" ] && return COOKIE=$(echo $SESTOK | sed -ne '/SesInfo/{s/.*\(.*\)<\/SesInfo>.*/\1/p;q;}') COOKIE=$(echo $COOKIE | sed 's:SessionID=::') TOKEN=$(echo $SESTOK | sed -ne '/TokInfo/{s/.*\(.*\)<\/TokInfo>.*/\1/p;q;}') -curl -s -m 1 -X GET "http://$MODEM_IP/api/monitoring/status" -H "Cookie: SessionID=$COOKIE" -H "__RequestVerificationToken: $TOKEN" -H "Content-Type: text/xml" > /tmp/huawei-$1-status -SIGNAL_ICON=$(cat /tmp/huawei-$1-status | grep SignalIcon | sed -e 's/<[^>]*>//g') -MAX_SIGNAL=$(cat /tmp/huawei-$1-status | grep maxsignal | sed -e 's/<[^>]*>//g') -if [ -n "$SIGNAL_ICON" ] && [ -n "$MAX_SIGNAL" ]; then - echo $((100 * ${SIGNAL_ICON} / ${MAX_SIGNAL})) -fi \ No newline at end of file +tmpfile=$(mktemp) +curl -s -m 1 -X GET "http://$MODEM_IP/api/monitoring/status" -H "Cookie: SessionID=$COOKIE" -H "__RequestVerificationToken: $TOKEN" -H "Content-Type: text/xml" > ${tmpfile} +SIGNAL_STRENGTH=$(cat ${tmpfile} | grep SignalStrength | sed -e 's/<[^>]*>//g' | sed 's/[^\x00-\x7F]//g') +if [ "$SIGNAL_STRENGTH" = "" ]; then + SIGNAL_ICON=$(cat ${tmpfile} | grep SignalIcon | sed -e 's/<[^>]*>//g' | sed 's/[^\x00-\x7F]//g') + MAX_SIGNAL=$(cat ${tmpfile} | grep maxsignal | sed -e 's/<[^>]*>//g' | sed 's/[^\x00-\x7F]//g') + if [ -n "$SIGNAL_ICON" ] && [ -n "$MAX_SIGNAL" ]; then + PERCENT=$((100 * ${SIGNAL_ICON} / ${MAX_SIGNAL})) + fi +else + echo "signal" + PERCENT=$SIGNAL_STRENGTH +fi + +STATE="" +CONNECTSTATE=$(cat ${tmpfile} | grep ConnectionStatus | sed -e 's/<[^>]*>//g' | sed 's/[^\x00-\x7F]//g') +[ "$CONNECTSTATE" = "201" ] && STATE="connection failed, bandwidth exceeded" +[ "$CONNECTSTATE" = "900" ] && STATE="connecting" +[ "$CONNECTSTATE" = "901" ] && STATE="connected" +[ "$CONNECTSTATE" = "902" ] && STATE="disconnected" +[ "$CONNECTSTATE" = "903" ] && STATE="disconnecting" +[ "$CONNECTSTATE" = "904" ] && STATE="connection failed or disabled" +TYPE="" +NETWORKTYPE=$(cat ${tmpfile} | grep CurrentNetworkType\> | sed -e 's/<[^>]*>//g' | sed 's/[^\x00-\x7F]//g' | tr -d "\n") +[ "$NETWORKTYPE" = "2" ] || [ "$NETWORKTYPE" = "3" ] && TYPE="2g" +[ "$NETWORKTYPE" = "4" ] || [ "$NETWORKTYPE" = "5" ] || [ "$NETWORKTYPE" = "6" ] || [ "$NETWORKTYPE" = "7" ] || [ "$NETWORKTYPE" = "8" ] || [ "$NETWORKTYPE" = "9" ] || [ "$NETWORKTYPE" = "17" ] || [ "$NETWORKTYPE" = "18" ] || [ "$NETWORKTYPE" = "41" ] || [ "$NETWORKTYPE" = "44" ] || [ "$NETWORKTYPE" = "45" ] || [ "$NETWORKTYPE" = "46" ] || [ "$NETWORKTYPE" = "64" ] || [ "$NETWORKTYPE" = "65" ] && TYPE="3g" +[ "$NETWORKTYPE" = "19" ] || [ "$NETWORKTYPE" = "101" ] && TYPE="lte" +rm -f ${tmpfile} +OPERATOR="" +if [ "$CONNECTSTATE" = "901" ]; then + tmpfile=$(mktemp) + curl -s -m 1 -X GET "http://$MODEM_IP/api/net/current-plmn" -H "Cookie: SessionID=$COOKIE" -H "__RequestVerificationToken: $TOKEN" -H "Content-Type: text/xml" > ${tmpfile} + OPERATOR=$(cat ${tmpfile} | grep FullName | sed -e 's/<[^>]*>//g' | sed 's/[^\x00-\x7F]//g') + rm -f ${tmpfile} +fi +NUMBER="" +[ -z "$INFO" ] && echo "$PERCENT" +[ "$INFO" = "all" ] && echo "$PERCENT;$OPERATOR;$NUMBER;$STATE;$TYPE" diff --git a/luci-app-openmptcprouter/root/bin/omr-modemmanager b/luci-app-openmptcprouter/root/bin/omr-modemmanager index 32ac93481..adb535fb3 100755 --- a/luci-app-openmptcprouter/root/bin/omr-modemmanager +++ b/luci-app-openmptcprouter/root/bin/omr-modemmanager @@ -10,8 +10,9 @@ timeout 1 mmcli -L | while read MODEM; do OPERATOR=$(echo "$MODEM_INFO" | grep 'modem.3gpp.operator-name' | awk -F": " '{print $2}') NUMBER=$(echo "$MODEM_INFO" | grep 'modem.generic.own-numbders.value[1]' | awk -F": " '{print $2}') STATE=$(echo "$MODEM_INFO" | grep 'modem.generic.state' | awk -F": " '{print $2}') + TYPE=$(echo "$MODEM_INFO" | grep 'modem.generic.access-technologies.values[1]' | awk -F": " '{print $2}') [ -z "$INFO" ] && echo $PERCENT - [ "$INFO" = "all" ] && echo "$PERCENT;$OPERATOR;$NUMBER;$STATE" + [ "$INFO" = "all" ] && echo "$PERCENT;$OPERATOR;$NUMBER;$STATE;$TYPE" exit fi done diff --git a/luci-app-openmptcprouter/root/bin/omr-qmi b/luci-app-openmptcprouter/root/bin/omr-qmi index 727250195..1a73d4f37 100755 --- a/luci-app-openmptcprouter/root/bin/omr-qmi +++ b/luci-app-openmptcprouter/root/bin/omr-qmi @@ -26,4 +26,4 @@ fi OPERATOR=$(timeout 1 uqmi -d $MODEM_INTF --get-serving-system | jsonfilter -e '@.plmn_description' | tr -d '\n') NUMBER=$(timeout 1 uqmi -d $MODEM_INTF --msisdn | jsonfilter -e '@' | tr -d '\n') STATE=$(timeout 1 uqmi -d $MODEM_INTF --get-data-status | jsonfilter -e '@' | tr -d '\n') -[ "$INFO" = "all" ] && echo "$PERCENT;$OPERATOR;$NUMBER;$TATE" \ No newline at end of file +[ "$INFO" = "all" ] && echo "$PERCENT;$OPERATOR;$NUMBER;$TATE;$TYPE" \ No newline at end of file diff --git a/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter b/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter index 599410c03..028736fd8 100755 --- a/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter +++ b/luci-app-openmptcprouter/root/usr/libexec/rpcd/openmptcprouter @@ -1040,6 +1040,7 @@ function interfaces_status() local operator = "" local phonenumber = "" local donglestate = "" + local networktype = "" if gateway ~= "" then if uci:get("openmptcprouter", "settings", "disablegwping") ~= "1" and connectivity ~= "ERROR" then local gw_ping_test = ut.trim(sys.exec("ping -w 1 -c 1 " .. gateway .. " | grep '100% packet loss'")) @@ -1051,7 +1052,14 @@ function interfaces_status() end end if uci:get("openmptcprouter", interface, "manufacturer") == "huawei" then - signal = sys.exec("omr-huawei " .. gateway .. " | tr -d '\n'") + intfdata = ut.trim(sys.exec("omr-huawei " .. gateway .. " all")) + if intfdata ~= "" then + signal = ut.trim(sys.exec("echo '".. intfdata .. "' | awk -F';' '{print $1}'")) + operator = ut.trim(sys.exec("echo '".. intfdata .. "' | awk -F';' '{print $2}'")) + phonenumber = ut.trim(sys.exec("echo '".. intfdata .. "' | awk -F';' '{print $3}'")) + donglestate = ut.trim(sys.exec("echo '".. intfdata .. "' | awk -F';' '{print $4}'")) + networktype = ut.trim(sys.exec("echo '".. intfdata .. "' | awk -F';' '{print $5}'")) + end end elseif gateway == "" then gw_ping = "DOWN" @@ -1062,24 +1070,26 @@ function interfaces_status() local proto = section['proto'] if proto == "qmi" then local device = section['device'] - intfdata = sys.exec("omr-qmi " .. device .. " | tr -d '\n'") + intfdata = ut.trim(sys.exec("omr-qmi " .. device .. " all")) if intfdata ~= "" then - signal = sys.exec("echo ".. intfdata .. " | awk -F';' '{print $1}' | tr -d '\n'") - operator = sys.exec("echo ".. intfdata .. " | awk -F';' '{print $2}' | tr -d '\n'") - phonenumber = sys.exec("echo ".. intfdata .. " | awk -F';' '{print $3}' | tr -d '\n'") - donglestate = sys.exec("echo ".. intfdata .. " | awk -F';' '{print $4}' | tr -d '\n'") + signal = ut.trim(sys.exec("echo '".. intfdata .. "' | awk -F';' '{print $1}'")) + operator = ut.trim(sys.exec("echo '".. intfdata .. "' | awk -F';' '{print $2}'")) + phonenumber = ut.trim(sys.exec("echo '".. intfdata .. "' | awk -F';' '{print $3}'")) + donglestate = ut.trim(sys.exec("echo '".. intfdata .. "' | awk -F';' '{print $4}'")) + networktype = ut.trim(sys.exec("echo '".. intfdata .. "' | awk -F';' '{print $5}'")) end elseif proto == "3g" then local device = section['device'] signal = sys.exec("omr-3g " .. device .. " | tr -d '\n'") elseif proto == "modemmanager" then local device = section['device'] - intfdata = sys.exec("omr-modemmanager " .. device .. " | tr -d '\n'") + intfdata = ut.trim(sys.exec("omr-modemmanager " .. device .. " all")) if intfdata ~= "" then - signal = sys.exec("echo ".. intfdata .. " | awk -F';' '{print $1}' | tr -d '\n'") - operator = sys.exec("echo ".. intfdata .. " | awk -F';' '{print $2}' | tr -d '\n'") - phonenumber = sys.exec("echo ".. intfdata .. " | awk -F';' '{print $3}' | tr -d '\n'") - donglestate = sys.exec("echo ".. intfdata .. " | awk -F';' '{print $4}' | tr -d '\n'") + signal = ut.trim(sys.exec("echo '".. intfdata .. "' | awk -F';' '{print $1}'")) + operator = ut.trim(sys.exec("echo '".. intfdata .. "' | awk -F';' '{print $2}'")) + phonenumber = ut.trim(sys.exec("echo '".. intfdata .. "' | awk -F';' '{print $3}'")) + donglestate = ut.trim(sys.exec("echo '".. intfdata .. "' | awk -F';' '{print $4}'")) + networktype = ut.trim(sys.exec("echo '".. intfdata .. "' | awk -F';' '{print $5}'")) end end end @@ -1224,6 +1234,7 @@ function interfaces_status() operator = operator, phonenumber = phonenumber, donglestate = donglestate, + networktype = networktype, } if ifname ~= nil and ifname:match("^tun.*") then table.insert(mArray.tunnels, data); From 85bce00199329162a029d3630a391c5c201d1535 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Sun, 26 Apr 2020 13:21:26 +0200 Subject: [PATCH 03/88] Remove qmi and modemmanager data in config --- .../share/omr/post-tracking.d/post-tracking | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/mptcp/files/usr/share/omr/post-tracking.d/post-tracking b/mptcp/files/usr/share/omr/post-tracking.d/post-tracking index 8331a65af..9ac28f24d 100755 --- a/mptcp/files/usr/share/omr/post-tracking.d/post-tracking +++ b/mptcp/files/usr/share/omr/post-tracking.d/post-tracking @@ -543,18 +543,19 @@ if [ "$(uci -q get openmptcprouter.$OMR_TRACKER_INTERFACE.lc)" = "" ] || [ $(($( uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.lc=$(date +"%s") fi fi - protocol="$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" - if [ "$proto" = "qmi" ]; then - intfdata="$(omr-qmi $OMR_TRACKER_DEVICE all | tr -d '\n')" - uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.operator=$(echo $intfdata | awk -F";" '{print $2}') - uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.number=$(echo $intfdata | awk -F";" '{print $3}') - uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.state=$(echo $intfdata | awk -F";" '{print $4}') - elif [ "$proto" = "modemmanager" ]; then - intfdata="$(omr-modemmanager $OMR_TRACKER_DEVICE all)" - uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.operator=$(echo $intfdata | awk -F";" '{print $2}') - uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.number=$(echo $intfdata | awk -F";" '{print $3}') - uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.state=$(echo $intfdata | awk -F";" '{print $4}') - else + proto="$(uci -q get network.$OMR_TRACKER_INTERFACE.proto)" + #if [ "$proto" = "qmi" ]; then + # intfdata="$(omr-qmi $OMR_TRACKER_DEVICE all | tr -d '\n')" + # uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.operator=$(echo $intfdata | awk -F";" '{print $2}') + # uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.number=$(echo $intfdata | awk -F";" '{print $3}') + # uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.state=$(echo $intfdata | awk -F";" '{print $4}') + #elif [ "$proto" = "modemmanager" ]; then + # intfdata="$(omr-modemmanager $OMR_TRACKER_DEVICE all)" + # uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.operator=$(echo $intfdata | awk -F";" '{print $2}') + # uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.number=$(echo $intfdata | awk -F";" '{print $3}') + # uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.state=$(echo $intfdata | awk -F";" '{print $4}') + #else + if [ "$proto" != "qmi" ] && [ "$proto" != "modemmanager" ]; then if [ -n "$OMR_TRACKER_DEVICE_GATEWAY" ] && [ -n "$(curl -s -m 1 -X GET http://$OMR_TRACKER_DEVICE_GATEWAY/api/webserver/SesTokInfo)" ]; then uci -q set openmptcprouter.$OMR_TRACKER_INTERFACE.manufacturer='huawei' else From 00b4ff906df7e6ed5e19cbf1852d822b1c1b329d Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Mon, 27 Apr 2020 18:31:43 +0200 Subject: [PATCH 04/88] Reset CircleCI cache --- .circleci/config.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 35d0b5d1c..463628fe1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -31,8 +31,8 @@ jobs: - run: name: cache command: | - echo "cache 92 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target - echo "cache 94 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version + echo "cache 93 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target + echo "cache 95 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version - restore_cache: keys: @@ -94,8 +94,8 @@ jobs: - run: name: cache command: | - echo "cache 92 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target - echo "cache 94 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version + echo "cache 93 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target + echo "cache 95 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version - restore_cache: keys: @@ -155,8 +155,8 @@ jobs: - run: name: cache command: | - echo "cache 92 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target - echo "cache 94 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version + echo "cache 93 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target + echo "cache 95 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version - restore_cache: keys: @@ -216,8 +216,8 @@ jobs: - run: name: cache command: | - echo "cache 92 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target - echo "cache 94 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version + echo "cache 93 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target + echo "cache 95 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version - restore_cache: keys: @@ -277,8 +277,8 @@ jobs: - run: name: cache command: | - echo "cache 92 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target - echo "cache 94 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version + echo "cache 93 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target + echo "cache 95 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version - restore_cache: keys: @@ -338,8 +338,8 @@ jobs: - run: name: cache command: | - echo "cache 92 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target - echo "cache 94 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version + echo "cache 93 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target + echo "cache 95 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version - restore_cache: keys: @@ -402,8 +402,8 @@ jobs: - run: name: cache command: | - echo "cache 92 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target - echo "cache 94 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version + echo "cache 93 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target + echo "cache 95 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version - restore_cache: keys: @@ -462,8 +462,8 @@ jobs: - run: name: cache command: | - echo "cache 92 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target - echo "cache 94 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version + echo "cache 93 $OMR_KERNEL $OMR_TARGET" > /tmp/cache-target + echo "cache 95 $OMR_KERNEL $OMR_TARGET $OMR_VERSION" > /tmp/cache-version - restore_cache: keys: From d054fd8423875e77406beed07041a3c01a853baf Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 28 Apr 2020 14:46:01 +0200 Subject: [PATCH 05/88] Fix nginx HA startup --- luci-app-nginx-ha/root/etc/init.d/nginx-ha | 1 - 1 file changed, 1 deletion(-) diff --git a/luci-app-nginx-ha/root/etc/init.d/nginx-ha b/luci-app-nginx-ha/root/etc/init.d/nginx-ha index a33371ef0..34f990de5 100755 --- a/luci-app-nginx-ha/root/etc/init.d/nginx-ha +++ b/luci-app-nginx-ha/root/etc/init.d/nginx-ha @@ -52,7 +52,6 @@ start_instance() { listen ${listen:-0.0.0.0:6666} udp; listen ${listen:-0.0.0.0:6666} so_keepalive=off; proxy_pass ${1}; - proxy_buffering off; } " } From 6ad526f97289997d235bf626fb9613609211e435 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Wed, 29 Apr 2020 16:17:02 +0200 Subject: [PATCH 06/88] Update luci-proto-bonding --- .../luci-static/resources/protocol/bonding.js | 117 ++++++++---------- 1 file changed, 50 insertions(+), 67 deletions(-) diff --git a/luci-proto-bonding/htdocs/luci-static/resources/protocol/bonding.js b/luci-proto-bonding/htdocs/luci-static/resources/protocol/bonding.js index 5b9dc8afd..aadc2306d 100644 --- a/luci-proto-bonding/htdocs/luci-static/resources/protocol/bonding.js +++ b/luci-proto-bonding/htdocs/luci-static/resources/protocol/bonding.js @@ -2,24 +2,30 @@ 'require ui'; 'require uci'; 'require form'; +'require fs'; 'require network'; +'require tools.widgets as widgets'; + function getSelectableSlaves(section_id) { var rv = []; + var NonUsableMac = /^(00:00:00:00:00:00|null)/; var interfaces = uci.sections('network', 'interface'); return network.getDevices().then(function(devices) { for (var i = 0; i < devices.length; i++) { var in_use = false; - if (devices[i].ifname.match(/eth/)) { + var NotUsable = NonUsableMac.test(devices[i].getMAC()); + + // Only "real" interfaces for slaves needed + if (NotUsable == false) { for (var j = 0; j < interfaces.length; j++) { if (uci.get('network', interfaces[j]['.name'], 'proto') == 'bonding') { - var slaves = uci.get('network', interfaces[j]['.name'], 'slaves'); - if (slaves != null) { - for (var k = 0; k < slaves.length; k++) { - if (devices[i].ifname == slaves[k] && interfaces[j]['.name'] != section_id) { - in_use = true; - } + var slaves = L.toArray(uci.get('network', interfaces[j]['.name'], 'slaves')); + + for (var k = 0; k < slaves.length; k++) { + if (devices[i].ifname == slaves[k] && interfaces[j]['.name'] != section_id) { + in_use = true; } } } @@ -43,6 +49,21 @@ function validateEmpty(section, value) { } } +function updatePrimaries(section, value) { + + var opt = this.map.lookupOption('slaves', section); + var selected_slaves = opt[0].formvalue(section); + + var uielem = this.map.lookupOption('primary', section)[0].getUIElement(section); + uielem.clearChoices(); + + for (var i = 0; i < selected_slaves.length; i++) { + uielem.addChoices(selected_slaves[i], selected_slaves[i]); + } + + return true; +} + function validate_arp_policy(section, value) { var opt = this.map.lookupOption('link_monitoring', section); @@ -80,8 +101,6 @@ function validate_arp_ip_targets(section, value) { function validate_primary_interface(section, value) { - var primary_valid = 'false'; - var opt = this.map.lookupOption('bonding_policy', section); var selected_policy = opt[0].formvalue(section); @@ -92,17 +111,9 @@ function validate_primary_interface(section, value) { var selected_primary = opt[0].formvalue(section); if (selected_policy == 'active-backup' || selected_policy == 'balance-tlb' || selected_policy == 'balance-alb') { - - for (var i = 0; i < selected_slaves.length; i++) { - if (selected_slaves[i] == selected_primary) { - primary_valid = 'true'; - } - } - - if (primary_valid == 'false') { + if (selected_slaves.filter(function(slave) { return slave == selected_primary }).length == 0) return _('You must select a primary interface which is included in selected slave interfaces!'); - } - } + } return true; } @@ -151,13 +162,14 @@ return network.registerProtocol('bonding', { _('IPv4 address'), _('The local IPv4 address')); o.datatype = 'ip4addr'; - o.validate = validateEmpty; + o.rmempty = false; o = s.taboption('general', form.Value, 'netmask', _('IPv4 netmask'), _('The local IPv4 netmask')); o.datatype = 'ip4addr'; o.validate = validateEmpty; + o.rmempty = false; o.value("255.255.255.0"); o.value("255.255.0.0"); o.value("255.0.0.0"); @@ -165,7 +177,6 @@ return network.registerProtocol('bonding', { o = s.taboption('advanced', form.MultiValue, 'slaves', _('Slave Interfaces'), _('Specifies which slave interfaces should be attached to this bonding interface')); - o.load = function(section_id) { return getSelectableSlaves(section_id).then(L.bind(function(devices) { for (var i = 0; i < devices.length; i++) { @@ -178,19 +189,11 @@ return network.registerProtocol('bonding', { return ''; } - var if_slaves = uci.get('network', section_id, 'slaves'); - - if (if_slaves != null) { - return if_slaves; - } - - return; + return uci.get('network', section_id, 'slaves'); }, this)); }; - o.cfgvalue = function(section_id) { - return uci.get('network', section_id, 'slaves'); - }; - o.validate = validateEmpty; + o.validate = updatePrimaries; + o.rmempty = false; o = s.taboption('advanced', form.ListValue, 'bonding_policy', _('Bonding Policy'), @@ -204,36 +207,16 @@ return network.registerProtocol('bonding', { o.value('balance-tlb', _('Adaptive transmit load balancing (balance-tlb, 5)')); o.value('balance-alb', _('Adaptive load balancing (balance-alb, 6)')); - o = s.taboption('advanced', form.ListValue, 'primary', + o = s.taboption('advanced', widgets.DeviceSelect, 'primary', _('Primary Slave'), _('Specifies which slave is the primary device. It will always be the active slave while it is available')); o.depends('bonding_policy', 'active-backup'); o.depends('bonding_policy', 'balance-tlb'); o.depends('bonding_policy', 'balance-alb'); - - o.load = function(section_id) { - return getSelectableSlaves(section_id).then(L.bind(function(devices) { - for (var i = 0; i < devices.length; i++) { - this.value(devices[i], devices[i]); - } - - if (devices.length == 0) { - this.placeholder = _('No more primaries available, can not save interface'); - this.value('', ''); - return ''; - } - - var primary = uci.get('network', section_id, 'primary'); - - if (primary != null) { - return primary; - } - - return; - }, this)); - }; - o.cfgvalue = function(section_id) { - return uci.get('network', section_id, 'primary'); + o.filter = function(section_id, value) { + // Never return anything as valid, as the valid possibilities + // will be set in the slaves validate function + return false; }; o.validate = validate_primary_interface; @@ -253,7 +236,7 @@ return network.registerProtocol('bonding', { _('Specifies the minimum number of links that must be active before asserting carrier')); o.datatype = 'uinteger'; o.default = 0; - o.validate = validateEmpty; + o.rmempty = false; o.depends('bonding_policy', '802.3ad'); o = s.taboption('advanced', form.Value, 'ad_actor_sys_prio', @@ -261,7 +244,7 @@ return network.registerProtocol('bonding', { _('Specifies the system priority')); o.datatype = 'range(1,65535)'; o.default = 65535; - o.validate = validateEmpty; + o.rmempty = false; o.depends('bonding_policy', '802.3ad'); o = s.taboption('advanced', form.Value, 'ad_actor_system', @@ -293,7 +276,7 @@ return network.registerProtocol('bonding', { _("Specifies the number of packets to transmit through a slave before moving to the next one")); o.datatype = 'range(0,65535)'; o.default = '1'; - o.validate = validateEmpty; + o.rmempty = false; o.depends('bonding_policy', 'balance-rr'); o = s.taboption('advanced', form.Value, 'lp_interval', @@ -301,7 +284,7 @@ return network.registerProtocol('bonding', { _("Specifies the number of seconds between instances where the bonding driver sends learning packets to each slaves peer switch")); o.datatype = 'range(1,2147483647)'; o.default = '1'; - o.validate = validateEmpty; + o.rmempty = false; o.depends('bonding_policy', 'balance-tlb'); o.depends('bonding_policy', 'balance-alb'); @@ -327,7 +310,7 @@ return network.registerProtocol('bonding', { _("Specifies the number of peer notifications (gratuitous ARPs and unsolicited IPv6 Neighbor Advertisements) to be issued after a failover event")); o.datatype = 'range(0,255)'; o.default = '1'; - o.validate = validateEmpty; + o.rmempty = false; o.depends('bonding_policy', 'active-backup'); o = s.taboption('advanced', form.ListValue, 'xmit_hash_policy', @@ -350,7 +333,7 @@ return network.registerProtocol('bonding', { _("Specifies the number of IGMP membership reports to be issued after a failover event in 200ms intervals")); o.datatype = 'range(0,255)'; o.default = '1'; - o.validate = validateEmpty; + o.rmempty = false; o.depends('bonding_policy', 'balance-tlb'); o.depends('bonding_policy', 'balance-alb'); @@ -375,7 +358,7 @@ return network.registerProtocol('bonding', { _("Specifies the ARP link monitoring frequency in milliseconds")); o.datatype = 'uinteger'; o.default = '0'; - o.validate = validateEmpty; + o.rmempty = false; o.depends('link_monitoring', 'arp'); o = s.taboption('advanced', form.DynamicList, 'arp_ip_target', @@ -412,7 +395,7 @@ return network.registerProtocol('bonding', { _("Specifies the MII link monitoring frequency in milliseconds")); o.datatype = 'uinteger'; o.default = '0'; - o.validate = validateEmpty; + o.rmempty = false; o.depends('link_monitoring', 'mii'); o = s.taboption('advanced', form.Value, 'downdelay', @@ -420,7 +403,7 @@ return network.registerProtocol('bonding', { _("Specifies the time in milliseconds to wait before disabling a slave after a link failure detection")); o.datatype = 'uinteger'; o.default = '0'; - o.validate = validateEmpty; + o.rmempty = false; o.depends('link_monitoring', 'mii'); o = s.taboption('advanced', form.Value, 'updelay', @@ -428,7 +411,7 @@ return network.registerProtocol('bonding', { _("Specifies the time in milliseconds to wait before enabling a slave after a link recovery detection")); o.datatype = 'uinteger'; o.default = '0'; - o.validate = validateEmpty; + o.rmempty = false; o.depends('link_monitoring', 'mii'); o = s.taboption('advanced', form.ListValue, 'use_carrier', From c5c8bd41e3ce545bbefcbb7f9692346566d6357c Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 1 May 2020 11:03:21 +0200 Subject: [PATCH 07/88] Update OpenMPTCProuter theme --- .../luci-static/openmptcprouter/cascade.css | 5 +- .../resources/menu-openmptcprouter.js | 118 +++++++++++++++++ .../view/themes/openmptcprouter/footer.htm | 1 + .../view/themes/openmptcprouter/header.htm | 10 +- .../view/themes/openmptcprouter/json-menu.htm | 119 ------------------ 5 files changed, 121 insertions(+), 132 deletions(-) create mode 100644 luci-theme-openmptcprouter/htdocs/luci-static/resources/menu-openmptcprouter.js delete mode 100644 luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/json-menu.htm diff --git a/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/cascade.css b/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/cascade.css index 7ec2c0d87..523f978db 100644 --- a/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/cascade.css +++ b/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/cascade.css @@ -1792,6 +1792,7 @@ button.btn::-moz-focus-inner, input[type=submit].btn::-moz-focus-inner { background-color: #bfbfbf; border-radius: 3px; text-shadow: none; + margin-left: .4em; } a.label:link, @@ -1822,10 +1823,6 @@ a.label:hover { /* LuCI specific items */ .hidden { display: none } -#xhr_poll_status { - cursor: pointer; -} - form.inline { display: inline; margin-bottom: 0; } /*header .pull-right { padding-top: 8px; }*/ diff --git a/luci-theme-openmptcprouter/htdocs/luci-static/resources/menu-openmptcprouter.js b/luci-theme-openmptcprouter/htdocs/luci-static/resources/menu-openmptcprouter.js new file mode 100644 index 000000000..5400276b0 --- /dev/null +++ b/luci-theme-openmptcprouter/htdocs/luci-static/resources/menu-openmptcprouter.js @@ -0,0 +1,118 @@ +'use strict'; +'require baseclass'; +'require ui'; + +return baseclass.extend({ + __init__: function() { + ui.menu.load().then(L.bind(this.render, this)); + }, + + render: function(tree) { + var node = tree, + url = ''; + + this.renderModeMenu(tree); + + if (L.env.dispatchpath.length >= 3) { + for (var i = 0; i < 3 && node; i++) { + node = node.children[L.env.dispatchpath[i]]; + url = url + (url ? '/' : '') + L.env.dispatchpath[i]; + } + + if (node) + this.renderTabMenu(node, url); + } + + document.addEventListener('poll-start', this.handleBodyMargin); + document.addEventListener('poll-stop', this.handleBodyMargin); + document.addEventListener('uci-new-changes', this.handleBodyMargin); + document.addEventListener('uci-clear-changes', this.handleBodyMargin); + window.addEventListener('resize', this.handleBodyMargin); + + this.handleBodyMargin(); + }, + + renderTabMenu: function(tree, url, level) { + var container = document.querySelector('#tabmenu'), + ul = E('ul', { 'class': 'tabs' }), + children = ui.menu.getChildren(tree), + activeNode = null; + + for (var i = 0; i < children.length; i++) { + var isActive = (L.env.dispatchpath[3 + (level || 0)] == children[i].name), + activeClass = isActive ? ' active' : '', + className = 'tabmenu-item-%s %s'.format(children[i].name, activeClass); + + ul.appendChild(E('li', { 'class': className }, [ + E('a', { 'href': L.url(url, children[i].name) }, [ _(children[i].title) ] )])); + + if (isActive) + activeNode = children[i]; + } + + if (ul.children.length == 0) + return E([]); + + container.appendChild(ul); + container.style.display = ''; + + if (activeNode) + this.renderTabMenu(activeNode, url + '/' + activeNode.name, (level || 0) + 1); + + return ul; + }, + + renderMainMenu: function(tree, url, level) { + var ul = level ? E('ul', { 'class': 'dropdown-menu' }) : document.querySelector('#topmenu'), + children = ui.menu.getChildren(tree); + + if (children.length == 0 || level > 1) + return E([]); + + for (var i = 0; i < children.length; i++) { + var submenu = this.renderMainMenu(children[i], url + '/' + children[i].name, (level || 0) + 1), + subclass = (!level && submenu.firstElementChild) ? 'dropdown' : null, + linkclass = (!level && submenu.firstElementChild) ? 'menu' : null, + linkurl = submenu.firstElementChild ? '#' : L.url(url, children[i].name); + + var li = E('li', { 'class': subclass }, [ + E('a', { 'class': linkclass, 'href': linkurl }, [ _(children[i].title) ]), + submenu + ]); + + ul.appendChild(li); + } + + ul.style.display = ''; + + return ul; + }, + + renderModeMenu: function(tree) { + var ul = document.querySelector('#modemenu'), + children = ui.menu.getChildren(tree); + + for (var i = 0; i < children.length; i++) { + var isActive = (L.env.requestpath.length ? children[i].name == L.env.requestpath[0] : i == 0); + + ul.appendChild(E('li', { 'class': isActive ? 'active' : null }, [ + E('a', { 'href': L.url(children[i].name) }, [ _(children[i].title) ]), + ' ', + E('span', { 'class': 'divider' }, [ '|' ]) + ])); + + if (isActive) + this.renderMainMenu(children[i], children[i].name); + } + + if (ul.children.length > 1) + ul.style.display = ''; + }, + + handleBodyMargin: function(ev) { + var body = document.querySelector('body'), + head = document.querySelector('header'); + + body.style.marginTop = head.offsetHeight + 'px'; + } +}); diff --git a/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/footer.htm b/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/footer.htm index c1aafe071..2c3c4a07b 100644 --- a/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/footer.htm +++ b/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/footer.htm @@ -12,6 +12,7 @@ + diff --git a/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/header.htm b/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/header.htm index 37b208ee5..6bc227f93 100644 --- a/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/header.htm +++ b/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/header.htm @@ -40,9 +40,6 @@ <% end -%> - - - <% include("themes/openmptcprouter/json-menu") %> "> @@ -51,12 +48,7 @@
OMR OpenMPTCProuter -
- -
+
diff --git a/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/json-menu.htm b/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/json-menu.htm deleted file mode 100644 index b38406f65..000000000 --- a/luci-theme-openmptcprouter/luasrc/view/themes/openmptcprouter/json-menu.htm +++ /dev/null @@ -1,119 +0,0 @@ - From 5b14298f47d73655cc40c33e83e6e792e87682a1 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 1 May 2020 11:07:01 +0200 Subject: [PATCH 08/88] Add luci menu json --- .../usr/share/luci/menu.d/luci-app-dsvpn.json | 13 +++++++ .../share/luci/menu.d/luci-app-firewall.json | 1 + .../share/rpcd/acl.d/luci-app-firewall.json | 24 ++++++++++++ .../share/luci/menu.d/luci-app-glorytun.json | 13 +++++++ .../luci/menu.d/luci-app-https-dns-proxy.json | 13 +++++++ .../usr/share/luci/menu.d/luci-app-iperf.json | 13 +++++++ .../share/luci/menu.d/luci-app-macvlan.json | 3 ++ .../usr/share/luci/menu.d/luci-app-mail.json | 13 +++++++ .../usr/share/luci/menu.d/luci-app-mlvpn.json | 13 +++++++ .../usr/share/luci/menu.d/luci-app-mptcp.json | 13 +++++++ .../share/luci/menu.d/luci-app-nginx-ha.json | 13 +++++++ .../luci/menu.d/luci-app-omr-bypass.json | 3 ++ .../share/rpcd/acl.d/luci-app-omr-bypass.json | 2 +- .../share/luci/menu.d/luci-app-omr-dscp.json | 13 +++++++ .../share/luci/menu.d/luci-app-omr-quota.json | 13 +++++++ .../luci/menu.d/luci-app-omr-tracker.json | 13 +++++++ .../luci/menu.d/luci-app-openmptcprouter.json | 13 +++++++ .../menu.d/luci-app-shadowsocks-libev.json | 39 +++++++++++++++++++ .../share/luci/menu.d/luci-app-shutdown.json | 3 ++ .../usr/share/luci/menu.d/luci-app-snmpd.json | 13 +++++++ 20 files changed, 243 insertions(+), 1 deletion(-) create mode 100644 luci-app-dsvpn/root/usr/share/luci/menu.d/luci-app-dsvpn.json create mode 100644 luci-app-firewall/root/usr/share/rpcd/acl.d/luci-app-firewall.json create mode 100644 luci-app-glorytun/root/usr/share/luci/menu.d/luci-app-glorytun.json create mode 100644 luci-app-https-dns-proxy/root/usr/share/luci/menu.d/luci-app-https-dns-proxy.json create mode 100644 luci-app-iperf/root/usr/share/luci/menu.d/luci-app-iperf.json create mode 100644 luci-app-mail/root/usr/share/luci/menu.d/luci-app-mail.json create mode 100644 luci-app-mlvpn/root/usr/share/luci/menu.d/luci-app-mlvpn.json create mode 100644 luci-app-mptcp/root/usr/share/luci/menu.d/luci-app-mptcp.json create mode 100644 luci-app-nginx-ha/root/usr/share/luci/menu.d/luci-app-nginx-ha.json create mode 100644 luci-app-omr-dscp/root/usr/share/luci/menu.d/luci-app-omr-dscp.json create mode 100644 luci-app-omr-quota/root/usr/share/luci/menu.d/luci-app-omr-quota.json create mode 100644 luci-app-omr-tracker/root/usr/share/luci/menu.d/luci-app-omr-tracker.json create mode 100644 luci-app-openmptcprouter/root/usr/share/luci/menu.d/luci-app-openmptcprouter.json create mode 100644 luci-app-shadowsocks-libev/root/usr/share/luci/menu.d/luci-app-shadowsocks-libev.json create mode 100644 luci-app-snmpd/root/usr/share/luci/menu.d/luci-app-snmpd.json diff --git a/luci-app-dsvpn/root/usr/share/luci/menu.d/luci-app-dsvpn.json b/luci-app-dsvpn/root/usr/share/luci/menu.d/luci-app-dsvpn.json new file mode 100644 index 000000000..257a29fab --- /dev/null +++ b/luci-app-dsvpn/root/usr/share/luci/menu.d/luci-app-dsvpn.json @@ -0,0 +1,13 @@ +{ + "admin/vpn/dsvpn": { + "title": "DSVPN", + "order": 10, + "action": { + "type": "cbi", + "path": "dsvpn" + }, + "depends": { + "acl": [ "luci-app-dsvpn" ] + } + } +} diff --git a/luci-app-firewall/root/usr/share/luci/menu.d/luci-app-firewall.json b/luci-app-firewall/root/usr/share/luci/menu.d/luci-app-firewall.json index 35c7c62c4..f8a3553a7 100644 --- a/luci-app-firewall/root/usr/share/luci/menu.d/luci-app-firewall.json +++ b/luci-app-firewall/root/usr/share/luci/menu.d/luci-app-firewall.json @@ -7,6 +7,7 @@ "path": "admin/network/firewall/zones" }, "depends": { + "acl": [ "luci-app-firewall" ], "fs": { "/sbin/fw3": "executable" }, "uci": { "firewall": true } } diff --git a/luci-app-firewall/root/usr/share/rpcd/acl.d/luci-app-firewall.json b/luci-app-firewall/root/usr/share/rpcd/acl.d/luci-app-firewall.json new file mode 100644 index 000000000..17d1fbab1 --- /dev/null +++ b/luci-app-firewall/root/usr/share/rpcd/acl.d/luci-app-firewall.json @@ -0,0 +1,24 @@ +{ + "luci-app-firewall": { + "description": "Grant access to firewall configuration", + "read": { + "file": { + "/etc/firewall.user": [ "read" ] + }, + "ubus": { + "file": [ "read" ], + "luci": [ "getConntrackHelpers" ] + }, + "uci": [ "firewall" ] + }, + "write": { + "file": { + "/etc/firewall.user": [ "write" ] + }, + "ubus": { + "file": [ "write" ] + }, + "uci": [ "firewall" ] + } + } +} diff --git a/luci-app-glorytun/root/usr/share/luci/menu.d/luci-app-glorytun.json b/luci-app-glorytun/root/usr/share/luci/menu.d/luci-app-glorytun.json new file mode 100644 index 000000000..414accf0b --- /dev/null +++ b/luci-app-glorytun/root/usr/share/luci/menu.d/luci-app-glorytun.json @@ -0,0 +1,13 @@ +{ + "admin/vpn/glorytun": { + "title": "Glorytun", + "order": 20, + "action": { + "type": "cbi", + "path": "glorytun" + }, + "depends": { + "acl": [ "luci-app-glorytun" ] + } + } +} diff --git a/luci-app-https-dns-proxy/root/usr/share/luci/menu.d/luci-app-https-dns-proxy.json b/luci-app-https-dns-proxy/root/usr/share/luci/menu.d/luci-app-https-dns-proxy.json new file mode 100644 index 000000000..a2238b5c1 --- /dev/null +++ b/luci-app-https-dns-proxy/root/usr/share/luci/menu.d/luci-app-https-dns-proxy.json @@ -0,0 +1,13 @@ +{ + "admin/services/https-dns-proxy": { + "title": "Proxy DNS Over HTTPS", + "order": 20, + "action": { + "type": "uci", + "path": "https-dns-proxy" + }, + "depends": { + "acl": [ "luci-app-https-dns-proxy" ] + } + } +} diff --git a/luci-app-iperf/root/usr/share/luci/menu.d/luci-app-iperf.json b/luci-app-iperf/root/usr/share/luci/menu.d/luci-app-iperf.json new file mode 100644 index 000000000..fa4f87669 --- /dev/null +++ b/luci-app-iperf/root/usr/share/luci/menu.d/luci-app-iperf.json @@ -0,0 +1,13 @@ +{ + "admin/services/iperf": { + "title": "iPerf", + "order": 10, + "action": { + "type": "uci", + "path": "iperf" + }, + "depends": { + "acl": [ "luci-app-iperf" ] + } + } +} diff --git a/luci-app-macvlan/root/usr/share/luci/menu.d/luci-app-macvlan.json b/luci-app-macvlan/root/usr/share/luci/menu.d/luci-app-macvlan.json index 01c2164ee..3d7041b26 100644 --- a/luci-app-macvlan/root/usr/share/luci/menu.d/luci-app-macvlan.json +++ b/luci-app-macvlan/root/usr/share/luci/menu.d/luci-app-macvlan.json @@ -5,6 +5,9 @@ "action": { "type": "view", "path": "network/macvlan" + }, + "depends": { + "acl": [ "luci-app-macvlan" ] } } } diff --git a/luci-app-mail/root/usr/share/luci/menu.d/luci-app-mail.json b/luci-app-mail/root/usr/share/luci/menu.d/luci-app-mail.json new file mode 100644 index 000000000..089af244c --- /dev/null +++ b/luci-app-mail/root/usr/share/luci/menu.d/luci-app-mail.json @@ -0,0 +1,13 @@ +{ + "admin/services/mail": { + "title": "E-Mail", + "order": 90, + "action": { + "type": "uci", + "path": "mail" + }, + "depends": { + "acl": [ "luci-app-mail" ] + } + } +} diff --git a/luci-app-mlvpn/root/usr/share/luci/menu.d/luci-app-mlvpn.json b/luci-app-mlvpn/root/usr/share/luci/menu.d/luci-app-mlvpn.json new file mode 100644 index 000000000..085d95305 --- /dev/null +++ b/luci-app-mlvpn/root/usr/share/luci/menu.d/luci-app-mlvpn.json @@ -0,0 +1,13 @@ +{ + "admin/vpn/mlvpn": { + "title": "MLVPN", + "order": 30, + "action": { + "type": "cbi", + "path": "mlvpn" + }, + "depends": { + "acl": [ "luci-app-mlvpn" ] + } + } +} diff --git a/luci-app-mptcp/root/usr/share/luci/menu.d/luci-app-mptcp.json b/luci-app-mptcp/root/usr/share/luci/menu.d/luci-app-mptcp.json new file mode 100644 index 000000000..a3e457424 --- /dev/null +++ b/luci-app-mptcp/root/usr/share/luci/menu.d/luci-app-mptcp.json @@ -0,0 +1,13 @@ +{ + "admin/network/mptcp": { + "title": "MPTCP", + "order": 10, + "action": { + "type": "cbi", + "path": "mptcp" + }, + "depends": { + "acl": [ "luci-app-mptcp" ] + } + } +} diff --git a/luci-app-nginx-ha/root/usr/share/luci/menu.d/luci-app-nginx-ha.json b/luci-app-nginx-ha/root/usr/share/luci/menu.d/luci-app-nginx-ha.json new file mode 100644 index 000000000..d9f54cc33 --- /dev/null +++ b/luci-app-nginx-ha/root/usr/share/luci/menu.d/luci-app-nginx-ha.json @@ -0,0 +1,13 @@ +{ + "admin/services/nginx-ha": { + "title": "Nginx High Availability", + "order": 80, + "action": { + "type": "uci", + "path": "nginx-ha" + }, + "depends": { + "acl": [ "luci-app-nginx-ha" ] + } + } +} diff --git a/luci-app-omr-bypass/root/usr/share/luci/menu.d/luci-app-omr-bypass.json b/luci-app-omr-bypass/root/usr/share/luci/menu.d/luci-app-omr-bypass.json index c024c61e0..24cc23af3 100644 --- a/luci-app-omr-bypass/root/usr/share/luci/menu.d/luci-app-omr-bypass.json +++ b/luci-app-omr-bypass/root/usr/share/luci/menu.d/luci-app-omr-bypass.json @@ -5,6 +5,9 @@ "action": { "type": "view", "path": "services/omr-bypass" + }, + "depends": { + "acl": [ "luci-app-omr-bypass" ] } } } diff --git a/luci-app-omr-bypass/root/usr/share/rpcd/acl.d/luci-app-omr-bypass.json b/luci-app-omr-bypass/root/usr/share/rpcd/acl.d/luci-app-omr-bypass.json index 154554d4d..3281f4fca 100644 --- a/luci-app-omr-bypass/root/usr/share/rpcd/acl.d/luci-app-omr-bypass.json +++ b/luci-app-omr-bypass/root/usr/share/rpcd/acl.d/luci-app-omr-bypass.json @@ -4,7 +4,7 @@ "read": { "file": { "/proc/net/xt_ndpi/proto": [ "read" ], - "/proc/net/xt_ndpi/host_proto": [ "read" ], + "/proc/net/xt_ndpi/host_proto": [ "read" ] }, "ubus": { "luci-rpc": [ "getHostHints" ] diff --git a/luci-app-omr-dscp/root/usr/share/luci/menu.d/luci-app-omr-dscp.json b/luci-app-omr-dscp/root/usr/share/luci/menu.d/luci-app-omr-dscp.json new file mode 100644 index 000000000..db602b6ff --- /dev/null +++ b/luci-app-omr-dscp/root/usr/share/luci/menu.d/luci-app-omr-dscp.json @@ -0,0 +1,13 @@ +{ + "admin/network/omr-dscp": { + "title": "OMR-DSCP", + "order": 80, + "action": { + "type": "uci", + "path": "omr-dscp" + }, + "depends": { + "acl": [ "luci-app-omr-dscp" ] + } + } +} diff --git a/luci-app-omr-quota/root/usr/share/luci/menu.d/luci-app-omr-quota.json b/luci-app-omr-quota/root/usr/share/luci/menu.d/luci-app-omr-quota.json new file mode 100644 index 000000000..5b7149b3f --- /dev/null +++ b/luci-app-omr-quota/root/usr/share/luci/menu.d/luci-app-omr-quota.json @@ -0,0 +1,13 @@ +{ + "admin/network/quota": { + "title": "Quota", + "order": 90, + "action": { + "type": "uci", + "path": "quota" + }, + "depends": { + "acl": [ "luci-app-omr-quota" ] + } + } +} diff --git a/luci-app-omr-tracker/root/usr/share/luci/menu.d/luci-app-omr-tracker.json b/luci-app-omr-tracker/root/usr/share/luci/menu.d/luci-app-omr-tracker.json new file mode 100644 index 000000000..102c65c16 --- /dev/null +++ b/luci-app-omr-tracker/root/usr/share/luci/menu.d/luci-app-omr-tracker.json @@ -0,0 +1,13 @@ +{ + "admin/services/omr-tracker": { + "title": "OMR-Tracker", + "order": 10, + "action": { + "type": "uci", + "path": "omr-tracker" + }, + "depends": { + "acl": [ "luci-app-omr-tracker" ] + } + } +} diff --git a/luci-app-openmptcprouter/root/usr/share/luci/menu.d/luci-app-openmptcprouter.json b/luci-app-openmptcprouter/root/usr/share/luci/menu.d/luci-app-openmptcprouter.json new file mode 100644 index 000000000..08c5b6f32 --- /dev/null +++ b/luci-app-openmptcprouter/root/usr/share/luci/menu.d/luci-app-openmptcprouter.json @@ -0,0 +1,13 @@ +{ + "admin/system/openmptcprouter": { + "title": "OpenMPTCProuter", + "order": 1, + "action": { + "type": "uci", + "path": "openmptcprouter/wizard" + }, + "depends": { + "acl": [ "luci-app-openmptcprouter" ] + } + } +} diff --git a/luci-app-shadowsocks-libev/root/usr/share/luci/menu.d/luci-app-shadowsocks-libev.json b/luci-app-shadowsocks-libev/root/usr/share/luci/menu.d/luci-app-shadowsocks-libev.json new file mode 100644 index 000000000..aa29113fe --- /dev/null +++ b/luci-app-shadowsocks-libev/root/usr/share/luci/menu.d/luci-app-shadowsocks-libev.json @@ -0,0 +1,39 @@ +{ + "admin/services/shadowsocks-libev": { + "title": "Shadowsocks-libev", + "order": 59, + "action": { + "type": "firstchild" + }, + "depends": { + "acl": [ "luci-app-shadowsocks-libev" ] + } + }, + + "admin/services/shadowsocks-libev/instances": { + "title": "Local Instances", + "order": 10, + "action": { + "type": "view", + "path": "shadowsocks-libev/instances" + } + }, + + "admin/services/shadowsocks-libev/servers": { + "title": "Remote Servers", + "order": 20, + "action": { + "type": "view", + "path": "shadowsocks-libev/servers" + } + }, + + "admin/services/shadowsocks-libev/rules": { + "title": "Redir Rules", + "order": 30, + "action": { + "type": "view", + "path": "shadowsocks-libev/rules" + } + } +} diff --git a/luci-app-shutdown/root/usr/share/luci/menu.d/luci-app-shutdown.json b/luci-app-shutdown/root/usr/share/luci/menu.d/luci-app-shutdown.json index 128a53a8c..33012645e 100644 --- a/luci-app-shutdown/root/usr/share/luci/menu.d/luci-app-shutdown.json +++ b/luci-app-shutdown/root/usr/share/luci/menu.d/luci-app-shutdown.json @@ -5,6 +5,9 @@ "action": { "type": "view", "path": "system/shutdown" + }, + "depends": { + "acl": [ "luci-app-shutdown" ] } } } diff --git a/luci-app-snmpd/root/usr/share/luci/menu.d/luci-app-snmpd.json b/luci-app-snmpd/root/usr/share/luci/menu.d/luci-app-snmpd.json new file mode 100644 index 000000000..5df5fa97a --- /dev/null +++ b/luci-app-snmpd/root/usr/share/luci/menu.d/luci-app-snmpd.json @@ -0,0 +1,13 @@ +{ + "admin/network/snmpd": { + "title": "SNMPd", + "order": 91, + "action": { + "type": "uci", + "path": "snmpd" + }, + "depends": { + "acl": [ "luci-app-snmpd" ] + } + } +} From 5bfdf1648e88411c81c3af65332c156b39afb154 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 1 May 2020 11:07:25 +0200 Subject: [PATCH 09/88] Fix Luci OMR ByPass --- .../resources/view/services/omr-bypass.js | 39 ++++++++++++++----- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/luci-app-omr-bypass/htdocs/luci-static/resources/view/services/omr-bypass.js b/luci-app-omr-bypass/htdocs/luci-static/resources/view/services/omr-bypass.js index 3ab345321..729c8a8ee 100644 --- a/luci-app-omr-bypass/htdocs/luci-static/resources/view/services/omr-bypass.js +++ b/luci-app-omr-bypass/htdocs/luci-static/resources/view/services/omr-bypass.js @@ -27,11 +27,14 @@ return L.view.extend({ s.addremove = true; s.anonymous = true; - o = s.option(form.Value, 'domain', _('Domain')); + o = s.option(form.Value, 'name', _('Domain')); o.rmempty = false; o = s.option(widgets.DeviceSelect, 'interface', _('Interface')); - o.rmempty = false; + o.noaliases = true; + o.noinactive = true; + o.nocreate = true; + o.ucioption = 'dev'; o = s.option(form.Value, 'note', _('Note')); o.rmempty = true; @@ -43,8 +46,11 @@ return L.view.extend({ o = s.option(form.Value, 'ip', _('IP')); o.rmempty = false; - o = s.option(widgets.DeviceSelect, 'interface', _('Interface')); - o.rmempty = false; + o = s.option(widgets.DeviceSelect, 'interface', _('Interface'),_('When none selected, MPTCP master interface is used.')); + o.noaliases = true; + o.noinactive = true; + o.nocreate = true; + o.ucioption = 'dev'; o = s.option(form.Value, 'note', _('Note')); o.rmempty = true; @@ -65,7 +71,10 @@ return L.view.extend({ o.value('udp'); o = s.option(widgets.DeviceSelect, 'interface', _('Interface')); - o.rmempty = false; + o.noaliases = true; + o.noinactive = true; + o.nocreate = true; + o.ucioption = 'dev'; o = s.option(form.Value, 'note', _('Note')); o.rmempty = true; @@ -83,7 +92,10 @@ return L.view.extend({ }); o = s.option(widgets.DeviceSelect, 'interface', _('Interface')); - o.rmempty = false; + o.noaliases = true; + o.noinactive = true; + o.nocreate = true; + o.ucioption = 'dev'; o = s.option(form.Value, 'note', _('Note')); o.rmempty = true; @@ -103,7 +115,10 @@ return L.view.extend({ }); o = s.option(widgets.DeviceSelect, 'interface', _('Interface')); - o.rmempty = false; + o.noaliases = true; + o.noinactive = true; + o.nocreate = true; + o.ucioption = 'dev'; o = s.option(form.Value, 'note', _('Note')); o.rmempty = true; @@ -116,7 +131,10 @@ return L.view.extend({ o.rmempty = false; o = s.option(widgets.DeviceSelect, 'interface', _('Interface')); - o.rmempty = false; + o.noaliases = true; + o.noinactive = true; + o.nocreate = true; + o.ucioption = 'dev'; o = s.option(form.Value, 'note', _('Note')); o.rmempty = true; @@ -154,7 +172,10 @@ return L.view.extend({ }; o = s.option(widgets.DeviceSelect, 'interface', _('Interface')); - o.rmempty = false; + o.noaliases = true; + o.noinactive = true; + o.nocreate = true; + o.ucioption = 'dev'; o = s.option(form.Value, 'note', _('Note')); o.rmempty = true; From f5dc724da7a9bceed0647a9c4a366e73ec4cbe27 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 1 May 2020 11:07:48 +0200 Subject: [PATCH 10/88] Add proto gre --- luci-proto-gre/Makefile | 21 ++++ .../luci-static/resources/protocol/gre.js | 96 ++++++++++++++++ .../luci-static/resources/protocol/gretap.js | 101 +++++++++++++++++ .../luci-static/resources/protocol/grev6.js | 98 +++++++++++++++++ .../resources/protocol/grev6tap.js | 103 ++++++++++++++++++ 5 files changed, 419 insertions(+) create mode 100644 luci-proto-gre/Makefile create mode 100644 luci-proto-gre/htdocs/luci-static/resources/protocol/gre.js create mode 100644 luci-proto-gre/htdocs/luci-static/resources/protocol/gretap.js create mode 100644 luci-proto-gre/htdocs/luci-static/resources/protocol/grev6.js create mode 100644 luci-proto-gre/htdocs/luci-static/resources/protocol/grev6tap.js diff --git a/luci-proto-gre/Makefile b/luci-proto-gre/Makefile new file mode 100644 index 000000000..804a46547 --- /dev/null +++ b/luci-proto-gre/Makefile @@ -0,0 +1,21 @@ +# +# Based on luci-proto-ipip. +# Credited author of luci-proto-ipip is Roger Pueyo Centelles +# Copyright 2016 Roger Pueyo Centelles +# +# Modified by Jan Betik +# Copyright 2020 Jan Betik +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + +include $(TOPDIR)/rules.mk + +LUCI_TITLE:=Support for GRE tunnels (RFC2784) +LUCI_DEPENDS:=+gre + +PKG_MAINTAINER:=Jan Betik + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature diff --git a/luci-proto-gre/htdocs/luci-static/resources/protocol/gre.js b/luci-proto-gre/htdocs/luci-static/resources/protocol/gre.js new file mode 100644 index 000000000..e431bccd7 --- /dev/null +++ b/luci-proto-gre/htdocs/luci-static/resources/protocol/gre.js @@ -0,0 +1,96 @@ +'use strict'; +'require form'; +'require network'; +'require tools.widgets as widgets'; + +network.registerPatternVirtual(/^gre4-.+$/); + +return network.registerProtocol('gre', { + getI18n: function() { + return _('GRE tunnel over IPv4'); + }, + + getIfname: function() { + return this._ubus('l3_device') || 'gre4-%s'.format(this.sid); + }, + + getOpkgPackage: function() { + return 'gre'; + }, + + isFloating: function() { + return true; + }, + + isVirtual: function() { + return true; + }, + + getDevices: function() { + return null; + }, + + containsDevice: function(ifname) { + return (network.getIfnameOf(ifname) == this.getIfname()); + }, + + renderFormOptions: function(s) { + var o; + + // -- general --------------------------------------------------------------------- + + o = s.taboption('general', form.Value, 'peeraddr', _("Remote IPv4 address or FQDN"), _("The IPv4 address or the fully-qualified domain name of the remote tunnel end.")); + o.optional = false; + o.datatype = 'or(hostname,ip4addr("nomask"))'; + + o = s.taboption('general', form.Value, 'ipaddr', _("Local IPv4 address"), _("The local IPv4 address over which the tunnel is created (optional).")); + o.optional = true; + o.datatype = 'ip4addr("nomask")'; + + // -- advanced --------------------------------------------------------------------- + + o = s.taboption('advanced', widgets.NetworkSelect, 'tunlink', _("Bind interface"), _("Bind the tunnel to this interface (optional).")); + o.exclude = s.section; + o.nocreate = true; + o.optional = true; + + o = s.taboption('advanced', form.Value, 'mtu', _("Override MTU"), _("Specify an MTU (Maximum Transmission Unit) other than the default (1280 bytes) (optional).")); + o.optional = true; + o.placeholder = 1280; + o.datatype = 'range(68, 9200)'; + + o = s.taboption('advanced', form.Value, 'ttl', _("Override TTL"), _("Specify a TTL (Time to Live) for the encapsulating packet other than the default (64) (optional).")); + o.optional = true; + o.placeholder = 64; + o.datatype = 'min(1)'; + + o = s.taboption('advanced', form.Value, 'tos', _('Override TOS'), _("Specify a TOS (Type of Service). Can be either inherit (the outer header inherits the value of the inner header) or an hexadecimal value starting with 0x (optional).")); + o.optional = true; + o.validate = function(section_id, value) { + if (value.length > 0 && !value.match(/^0x[a-fA-F0-9]{1,2}$/) && !value.match(/^inherit$/i)) + return _('Invalid value'); + + return true; + }; + + o = s.taboption('advanced', form.Flag, 'df', _("Don't Fragment"), _("Enable the DF (Don't Fragment) flag of the encapsulating packets.")); + o.default = o.enabled; + + o = s.taboption('advanced', form.Flag, 'nohostroute', _("No host route"), _("Do not create host route to peer (optional).")); + o.optional = true; + + o = s.taboption('advanced', form.Value, 'ikey', _("Incoming key"), _("Key for incoming packets (optional).")); + o.optional = true; + o.datatype = 'integer'; + + o = s.taboption('advanced', form.Value, 'okey', _("Outgoing key"), _("Key for outgoing packets (optinal).")); + o.optional = true; + o.datatype = 'integer'; + + s.taboption('advanced', form.Flag, 'icsum', _("Incoming checksum"), _("Require incoming checksum (optional).")); + s.taboption('advanced', form.Flag, 'ocsum', _("Outgoing checksum"), _("Compute outgoing checksum (optional).")); + s.taboption('advanced', form.Flag, 'iseqno', _("Incoming serialization"), _("Require incoming packets serialization (optional).")); + s.taboption('advanced', form.Flag, 'oseqno', _("Outgoing serialization"), _("Perform outgoing packets serialization (optional).")); + + } +}); diff --git a/luci-proto-gre/htdocs/luci-static/resources/protocol/gretap.js b/luci-proto-gre/htdocs/luci-static/resources/protocol/gretap.js new file mode 100644 index 000000000..426b5d98d --- /dev/null +++ b/luci-proto-gre/htdocs/luci-static/resources/protocol/gretap.js @@ -0,0 +1,101 @@ +'use strict'; +'require form'; +'require network'; +'require tools.widgets as widgets'; + +network.registerPatternVirtual(/^gre4t-.+$/); + +return network.registerProtocol('gretap', { + getI18n: function() { + return _('GRETAP tunnel over IPv4'); + }, + + getIfname: function() { + return this._ubus('l3_device') || 'gre4t-%s'.format(this.sid); + }, + + getOpkgPackage: function() { + return 'gre'; + }, + + isFloating: function() { + return true; + }, + + isVirtual: function() { + return true; + }, + + getDevices: function() { + return null; + }, + + containsDevice: function(ifname) { + return (network.getIfnameOf(ifname) == this.getIfname()); + }, + + renderFormOptions: function(s) { + var o; + + // -- general --------------------------------------------------------------------- + + o = s.taboption('general', form.Value, 'peeraddr', _("Remote IPv4 address or FQDN"), _("The IPv4 address or the fully-qualified domain name of the remote tunnel end.")); + o.optional = false; + o.datatype = 'or(hostname,ip4addr("nomask"))'; + + o = s.taboption('general', form.Value, 'ipaddr', _("Local IPv4 address"), _("The local IPv4 address over which the tunnel is created (optional).")); + o.optional = true; + o.datatype = 'ip4addr("nomask")'; + + o = s.taboption('general', widgets.NetworkSelect, 'network', _("Network interface"), _("Logical network to which the tunnel will be added (bridged) (optional).")); + o.exclude = s.section; + o.nocreate = true; + o.optional = true; + + // -- advanced --------------------------------------------------------------------- + + o = s.taboption('advanced', widgets.NetworkSelect, 'tunlink', _("Bind interface"), _("Bind the tunnel to this interface (optional).")); + o.exclude = s.section; + o.nocreate = true; + o.optional = true; + + o = s.taboption('advanced', form.Value, 'mtu', _("Override MTU"), _("Specify an MTU (Maximum Transmission Unit) other than the default (1280 bytes) (optional).")); + o.optional = true; + o.placeholder = 1280; + o.datatype = 'range(68, 9200)'; + + o = s.taboption('advanced', form.Value, 'ttl', _("Override TTL"), _("Specify a TTL (Time to Live) for the encapsulating packet other than the default (64) (optional).")); + o.optional = true; + o.placeholder = 64; + o.datatype = 'min(1)'; + + o = s.taboption('advanced', form.Value, 'tos', _('Override TOS'), _("Specify a TOS (Type of Service). Can be either inherit (the outer header inherits the value of the inner header) or an hexadecimal value starting with 0x (optional).")); + o.optional = true; + o.validate = function(section_id, value) { + if (value.length > 0 && !value.match(/^0x[a-fA-F0-9]{1,2}$/) && !value.match(/^inherit$/i)) + return _('Invalid value'); + + return true; + }; + + o = s.taboption('advanced', form.Flag, 'df', _("Don't Fragment"), _("Enable the DF (Don't Fragment) flag of the encapsulating packets.")); + o.default = o.enabled; + + o = s.taboption('advanced', form.Flag, 'nohostroute', _("No host route"), _("Do not create host route to peer (optional).")); + o.optional = true; + + o = s.taboption('advanced', form.Value, 'ikey', _("Incoming key"), _("Key for incoming packets (optional).")); + o.optional = true; + o.datatype = 'integer'; + + o = s.taboption('advanced', form.Value, 'okey', _("Outgoing key"), _("Key for outgoing packets (optinal).")); + o.optional = true; + o.datatype = 'integer'; + + s.taboption('advanced', form.Flag, 'icsum', _("Incoming checksum"), _("Require incoming checksum (optional).")); + s.taboption('advanced', form.Flag, 'ocsum', _("Outgoing checksum"), _("Compute outgoing checksum (optional).")); + s.taboption('advanced', form.Flag, 'iseqno', _("Incoming serialization"), _("Require incoming packets serialization (optional).")); + s.taboption('advanced', form.Flag, 'oseqno', _("Outgoing serialization"), _("Perform outgoing packets serialization (optional).")); + + } +}); diff --git a/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6.js b/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6.js new file mode 100644 index 000000000..bd9a43e27 --- /dev/null +++ b/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6.js @@ -0,0 +1,98 @@ +'use strict'; +'require form'; +'require network'; +'require tools.widgets as widgets'; + +network.registerPatternVirtual(/^gre6-.+$/); + +return network.registerProtocol('grev6', { + getI18n: function() { + return _('GRE tunnel over IPv6'); + }, + + getIfname: function() { + return this._ubus('l3_device') || 'gre6-%s'.format(this.sid); + }, + + getOpkgPackage: function() { + return 'gre'; + }, + + isFloating: function() { + return true; + }, + + isVirtual: function() { + return true; + }, + + getDevices: function() { + return null; + }, + + containsDevice: function(ifname) { + return (network.getIfnameOf(ifname) == this.getIfname()); + }, + + renderFormOptions: function(s) { + var o; + + // -- general --------------------------------------------------------------------- + + o = s.taboption('general', form.Value, 'peer6addr', _("Remote IPv6 address or FQDN"), _("The IPv6 address or the fully-qualified domain name of the remote tunnel end.")); + o.optional = false; + o.datatype = 'or(hostname,ip6addr("nomask"))'; + + o = s.taboption('general', form.Value, 'ip6addr', _("Local IPv6 address"), _("The local IPv6 address over which the tunnel is created (optional).")); + o.optional = true; + o.datatype = 'ip6addr("nomask")'; + + o = s.taboption('general', widgets.NetworkSelect, 'weakif', _("Source interface"), _("Logical network from which to select the local endpoint if local IPv6 address is empty and no WAN IPv6 is available (optional).")); + o.exclude = s.section; + o.nocreate = true; + o.optional = true; + + // -- advanced --------------------------------------------------------------------- + + o = s.taboption('advanced', widgets.NetworkSelect, 'tunlink', _("Bind interface"), _("Bind the tunnel to this interface (optional).")); + o.exclude = s.section; + o.nocreate = true; + o.optional = true; + + o = s.taboption('advanced', form.Value, 'mtu', _("Override MTU"), _("Specify an MTU (Maximum Transmission Unit) other than the default (1280 bytes) (optional).")); + o.optional = true; + o.placeholder = 1280; + o.datatype = 'range(68, 9200)'; + + o = s.taboption('advanced', form.Value, 'ttl', _("Override TTL"), _("Specify a TTL (Time to Live) for the encapsulating packet other than the default (64) (optional).")); + o.optional = true; + o.placeholder = 64; + o.datatype = 'min(1)'; + + o = s.taboption('advanced', form.Value, 'tos', _('Traffic Class'), _("Specify a Traffic Class. Can be either inherit (the outer header inherits the value of the inner header) or an hexadecimal value starting with 0x (optional).")); + o.optional = true; + o.validate = function(section_id, value) { + if (value.length > 0 && !value.match(/^0x[a-fA-F0-9]{1,2}$/) && !value.match(/^inherit$/i)) + return _('Invalid value'); + + return true; + }; + + o = s.taboption('advanced', form.Flag, 'nohostroute', _("No host route"), _("Do not create host route to peer (optional).")); + o.optional = true; + + o = s.taboption('advanced', form.Value, 'ikey', _("Incoming key"), _("Key for incoming packets (optional).")); + o.optional = true; + o.datatype = 'integer'; + + o = s.taboption('advanced', form.Value, 'okey', _("Outgoing key"), _("Key for outgoing packets (optinal).")); + o.optional = true; + o.datatype = 'integer'; + + s.taboption('advanced', form.Flag, 'icsum', _("Incoming checksum"), _("Require incoming checksum (optional).")); + s.taboption('advanced', form.Flag, 'ocsum', _("Outgoing checksum"), _("Compute outgoing checksum (optional).")); + s.taboption('advanced', form.Flag, 'iseqno', _("Incoming serialization"), _("Require incoming packets serialization (optional).")); + s.taboption('advanced', form.Flag, 'oseqno', _("Outgoing serialization"), _("Perform outgoing packets serialization (optional).")); + + } +}); diff --git a/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6tap.js b/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6tap.js new file mode 100644 index 000000000..3b1a50371 --- /dev/null +++ b/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6tap.js @@ -0,0 +1,103 @@ +'use strict'; +'require form'; +'require network'; +'require tools.widgets as widgets'; + +network.registerPatternVirtual(/^gre6t-.+$/); + +return network.registerProtocol('grev6tap', { + getI18n: function() { + return _('GRETAP tunnel over IPv6'); + }, + + getIfname: function() { + return this._ubus('l3_device') || 'gre6t-%s'.format(this.sid); + }, + + getOpkgPackage: function() { + return 'gre'; + }, + + isFloating: function() { + return true; + }, + + isVirtual: function() { + return true; + }, + + getDevices: function() { + return null; + }, + + containsDevice: function(ifname) { + return (network.getIfnameOf(ifname) == this.getIfname()); + }, + + renderFormOptions: function(s) { + var o; + + // -- general --------------------------------------------------------------------- + + o = s.taboption('general', form.Value, 'peer6addr', _("Remote IPv6 address or FQDN"), _("The IPv6 address or the fully-qualified domain name of the remote tunnel end.")); + o.optional = false; + o.datatype = 'or(hostname,ip6addr("nomask"))'; + + o = s.taboption('general', form.Value, 'ip6addr', _("Local IPv6 address"), _("The local IPv6 address over which the tunnel is created (optional).")); + o.optional = true; + o.datatype = 'ip6addr("nomask")'; + + o = s.taboption('general', widgets.NetworkSelect, 'weakif', _("Source interface"), _("Logical network from which to select the local endpoint if local IPv6 address is empty and no WAN IPv6 is available (optional).")); + o.exclude = s.section; + o.nocreate = true; + o.optional = true; + + o = s.taboption('general', widgets.NetworkSelect, 'network', _("Network interface"), _("Logical network to which the tunnel will be added (bridged) (optional).")); + o.exclude = s.section; + o.nocreate = true; + o.optional = true; + + // -- advanced --------------------------------------------------------------------- + + o = s.taboption('advanced', widgets.NetworkSelect, 'tunlink', _("Bind interface"), _("Bind the tunnel to this interface (optional).")); + o.exclude = s.section; + o.nocreate = true; + o.optional = true; + + o = s.taboption('advanced', form.Value, 'mtu', _("Override MTU"), _("Specify an MTU (Maximum Transmission Unit) other than the default (1280 bytes) (optional).")); + o.optional = true; + o.placeholder = 1280; + o.datatype = 'range(68, 9200)'; + + o = s.taboption('advanced', form.Value, 'ttl', _("Override TTL"), _("Specify a TTL (Time to Live) for the encapsulating packet other than the default (64) (optional).")); + o.optional = true; + o.placeholder = 64; + o.datatype = 'min(1)'; + + o = s.taboption('advanced', form.Value, 'tos', _('Traffic Class'), _("Specify a Traffic Class. Can be either inherit (the outer header inherits the value of the inner header) or an hexadecimal value starting with 0x (optional).")); + o.optional = true; + o.validate = function(section_id, value) { + if (value.length > 0 && !value.match(/^0x[a-fA-F0-9]{1,2}$/) && !value.match(/^inherit$/i)) + return _('Invalid value'); + + return true; + }; + + o = s.taboption('advanced', form.Flag, 'nohostroute', _("No host route"), _("Do not create host route to peer (optional).")); + o.optional = true; + + o = s.taboption('advanced', form.Value, 'ikey', _("Incoming key"), _("Key for incoming packets (optional).")); + o.optional = true; + o.datatype = 'integer'; + + o = s.taboption('advanced', form.Value, 'okey', _("Outgoing key"), _("Key for outgoing packets (optinal).")); + o.optional = true; + o.datatype = 'integer'; + + s.taboption('advanced', form.Flag, 'icsum', _("Incoming checksum"), _("Require incoming checksum (optional).")); + s.taboption('advanced', form.Flag, 'ocsum', _("Outgoing checksum"), _("Compute outgoing checksum (optional).")); + s.taboption('advanced', form.Flag, 'iseqno', _("Incoming serialization"), _("Require incoming packets serialization (optional).")); + s.taboption('advanced', form.Flag, 'oseqno', _("Outgoing serialization"), _("Perform outgoing packets serialization (optional).")); + + } +}); From c199d8bc6097a7232d492ccf5b30b6d2d27f0669 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 1 May 2020 11:08:31 +0200 Subject: [PATCH 11/88] Use fd80 instead of fe80 for 6in4 --- omr-6in4/files/bin/omr-6in4 | 4 ++-- omr-6in4/files/etc/uci-defaults/9010-omr-6in4 | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/omr-6in4/files/bin/omr-6in4 b/omr-6in4/files/bin/omr-6in4 index 594c9b2d0..34c03a17c 100755 --- a/omr-6in4/files/bin/omr-6in4 +++ b/omr-6in4/files/bin/omr-6in4 @@ -39,8 +39,8 @@ while true; do ipv6_addr=$(ubus call network.interface.omr6in4 status | jsonfilter -q -l 1 -e '@["ipv6-address"][0].address' | tr -d "\n") ip -6 addr add $ipv6_addr dev 6in4-omr6in4 > /dev/null 2>&1 ipv6_gw=$(ubus call network.interface.omr6in4 status | jsonfilter -q -l 1 -e '@.route[@.target="::"].nexthop' | tr -d "\n") - [ "$ipv6_gw" = "::" ] && ipv6_gw='fe80::a00:1' - [ -z "$ipv6_gw" ] && ipv6_gw='fe80::a00:1' + [ "$ipv6_gw" = "::" ] && ipv6_gw='fd80::a00:1' + [ -z "$ipv6_gw" ] && ipv6_gw='fd80::a00:1' #[ -z "$ipv6_gw" ] && ipv6_gw='fe80::aff:ff01' ip -6 route replace default via ${ipv6_gw} dev 6in4-omr6in4 > /dev/null 2>&1 if [ "$(uci -q get openmptcprouter.settings.uci_route)" = "1" ]; then diff --git a/omr-6in4/files/etc/uci-defaults/9010-omr-6in4 b/omr-6in4/files/etc/uci-defaults/9010-omr-6in4 index 56ca8b282..3247a243d 100755 --- a/omr-6in4/files/etc/uci-defaults/9010-omr-6in4 +++ b/omr-6in4/files/etc/uci-defaults/9010-omr-6in4 @@ -10,8 +10,8 @@ if [ "$(uci -q show network | grep omr6in4)" = "" ]; then set network.omr6in4.multipath=off set network.omr6in4.ipaddr=10.255.255.2 set network.omr6in4.peeraddr=10.255.255.1 - set network.omr6in4.gateway=fe80::a00:1 - set network.omr6in4.ip6addr='fe80::a00:2/128' + set network.omr6in4.gateway=fd80::a00:1 + set network.omr6in4.ip6addr='fd80::a00:2/128' set network.omr6in4.auto='0' commit network EOF @@ -27,7 +27,7 @@ fi if [ "$(uci -q get network.omr6in4.ip6addr)" = "" ]; then uci -q batch <<-EOF >/dev/null - set network.omr6in4.ip6addr=fe80::a00:2 + set network.omr6in4.ip6addr=fd80::a00:2 commit network EOF fi From 2ccc71337958a293dcae0918e4deab93da5c8730 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Fri, 1 May 2020 11:09:04 +0200 Subject: [PATCH 12/88] Fix post tracking --- .../usr/share/omr/post-tracking.d/post-tracking | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/mptcp/files/usr/share/omr/post-tracking.d/post-tracking b/mptcp/files/usr/share/omr/post-tracking.d/post-tracking index 9ac28f24d..9212e83fb 100755 --- a/mptcp/files/usr/share/omr/post-tracking.d/post-tracking +++ b/mptcp/files/usr/share/omr/post-tracking.d/post-tracking @@ -385,13 +385,12 @@ if [ "$multipath_config" = "master" ]; then if [ -n "$omrvpn_intf" ] && [ "$(ip route show default | awk '/default/ {print $5}' | grep $omrvpn_intf)" = "" ]; then _log "Master up : Replace default route by $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE" ip route replace default scope global nexthop via $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE - else - config_load openmptcprouter - if [ "$(uci -q get openmptcprouter.settings.master)" = "balancing" ]; then - config_foreach set_server_all_routes server - elif [ "$(uci -q get openmptcprouter.settings.master)" != "failover" ]; then - config_foreach set_server_default_route server - fi + fi + config_load openmptcprouter + if [ "$(uci -q get openmptcprouter.settings.master)" = "balancing" ]; then + config_foreach set_server_all_routes server + elif [ "$(uci -q get openmptcprouter.settings.master)" != "failover" ]; then + config_foreach set_server_default_route server fi ip route replace default via $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE table 991337 fi From 8fdb3fef122ad054985f7936b57bbe6c4bc0225b Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Sat, 2 May 2020 18:24:09 +0200 Subject: [PATCH 13/88] Fix nginx-ha access --- .../root/usr/share/luci/menu.d/luci-app-nginx-ha.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-nginx-ha/root/usr/share/luci/menu.d/luci-app-nginx-ha.json b/luci-app-nginx-ha/root/usr/share/luci/menu.d/luci-app-nginx-ha.json index d9f54cc33..b62a8ab35 100644 --- a/luci-app-nginx-ha/root/usr/share/luci/menu.d/luci-app-nginx-ha.json +++ b/luci-app-nginx-ha/root/usr/share/luci/menu.d/luci-app-nginx-ha.json @@ -3,7 +3,7 @@ "title": "Nginx High Availability", "order": 80, "action": { - "type": "uci", + "type": "cbi", "path": "nginx-ha" }, "depends": { From e4a6d5e4fbcb8d51aa3a4204f997c792e4559871 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Sat, 2 May 2020 18:24:57 +0200 Subject: [PATCH 14/88] Fix bypass port destination --- .../htdocs/luci-static/resources/view/services/omr-bypass.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/luci-app-omr-bypass/htdocs/luci-static/resources/view/services/omr-bypass.js b/luci-app-omr-bypass/htdocs/luci-static/resources/view/services/omr-bypass.js index 729c8a8ee..edf03099b 100644 --- a/luci-app-omr-bypass/htdocs/luci-static/resources/view/services/omr-bypass.js +++ b/luci-app-omr-bypass/htdocs/luci-static/resources/view/services/omr-bypass.js @@ -62,13 +62,12 @@ return L.view.extend({ o = s.option(form.Value, 'dport', _('port')); o.rmempty = false; - o = s.option(form.MultiValue, 'proto', _('protocol')); + o = s.option(form.ListValue, 'proto', _('protocol')); o.default = 'tcp'; - o.modalonly = true; - o.custom = true; o.rmempty = false; o.value('tcp'); o.value('udp'); + o.value('icmp'); o = s.option(widgets.DeviceSelect, 'interface', _('Interface')); o.noaliases = true; From c468d149d7e709e18901fadda97b7f2394206636 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 5 May 2020 09:54:20 +0200 Subject: [PATCH 15/88] Add multiqueue option to glorytun TCP --- glorytun/glorytun.config | 3 ++- glorytun/init | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/glorytun/glorytun.config b/glorytun/glorytun.config index a0dfe1593..9ee6e41e6 100644 --- a/glorytun/glorytun.config +++ b/glorytun/glorytun.config @@ -9,4 +9,5 @@ config glorytun 'vpn' option chacha20 '1' option mtuauto '1' option localip '10.255.255.2' - option remoteip '10.255.255.1' \ No newline at end of file + option remoteip '10.255.255.1' + option multiqueue '1' \ No newline at end of file diff --git a/glorytun/init b/glorytun/init index 116547ac0..5d0233157 100755 --- a/glorytun/init +++ b/glorytun/init @@ -74,6 +74,7 @@ start_instance() { [ "${listener}" = "1" ] && procd_append_param command listener [ "${mptcp}" = "1" ] && procd_append_param command mptcp [ "${chacha20}" = "1" ] && procd_append_param command chacha20 + [ "${multiqueue}" = "1" ] && procd_append_param command multiqueue procd_append_param command \ retry count -1 const 500000 \ From 7e5b91842b1c644f2e822835ee3556bea32c3895 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 5 May 2020 09:55:13 +0200 Subject: [PATCH 16/88] Remove handover when updating config --- .../files/etc/uci-defaults/1920-omr-network | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/openmptcprouter/files/etc/uci-defaults/1920-omr-network b/openmptcprouter/files/etc/uci-defaults/1920-omr-network index 2c8a1231c..30693dae2 100755 --- a/openmptcprouter/files/etc/uci-defaults/1920-omr-network +++ b/openmptcprouter/files/etc/uci-defaults/1920-omr-network @@ -42,6 +42,15 @@ _setup_macvlan_update() { EOF } +_setup_mptcp_handover_to_on() { + if [ "$(uci -q get network.$1.multipath)" = "handover" ]; then + uci -q set network.$1.multipath=on + fi + if [ "$(uci -q get openmptcprouter.$1.multipath)" = "handover" ]; then + uci -q set openmptcprouter.$1.multipath=on + fi +} + _setup_multipath_off() { uci -q get "network.$1.multipath" >/dev/null && return uci -q set "network.$1.multipath=off" @@ -64,6 +73,7 @@ _setup_wan_interface() { config_load network config_foreach _setup_macvlan_update interface +config_foreach _setup_mptcp_handover_to_on interface if [ "$(uci -q show network.lan | grep multipath)" != "" ]; then exit 0 From 7797f711cc7c38770b97613c8d70058dba7f6df8 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 5 May 2020 09:55:43 +0200 Subject: [PATCH 17/88] Fix when removing mptcp over vpn interface --- openmptcprouter/files/etc/init.d/mptcpovervpn | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openmptcprouter/files/etc/init.d/mptcpovervpn b/openmptcprouter/files/etc/init.d/mptcpovervpn index 27346a09b..365df31ed 100755 --- a/openmptcprouter/files/etc/init.d/mptcpovervpn +++ b/openmptcprouter/files/etc/init.d/mptcpovervpn @@ -68,13 +68,14 @@ mptcp_over_vpn() { [ -z "$multipath" ] && multipath="on" uci -q batch <<-EOF >/dev/null delete network.ovpn${interface} - commit network delete openvpn.${interface} commit openvpn set openmptcprouter.${interface}.multipath="${multipath}" + set network.${interface}.multipath="${multipath}" set openmptcprouter.${interface}.multipathvpn="0" delete openmptcprouter.ovpn${interface} commit openmptcprouter + commit network EOF fi } From 463542a4afd6f56e82d7e6ba48a563ac247299b5 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 5 May 2020 09:56:23 +0200 Subject: [PATCH 18/88] Set a default value for omr-quota --- omr-quota/files/etc/init.d/omr-quota | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/omr-quota/files/etc/init.d/omr-quota b/omr-quota/files/etc/init.d/omr-quota index 0d81f6634..4ed95c735 100755 --- a/omr-quota/files/etc/init.d/omr-quota +++ b/omr-quota/files/etc/init.d/omr-quota @@ -11,7 +11,7 @@ _validate_section() { 'txquota:uinteger' \ 'rxquota:uinteger' \ 'ttquota:uinteger' \ - 'interval:uinteger' \ + 'interval:uinteger:30' \ 'enabled:bool:0' } From 94dd3ef97fcd28340dd447d9255e3f068e7dea91 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 5 May 2020 09:56:56 +0200 Subject: [PATCH 19/88] Better style for indicator --- .../htdocs/luci-static/openmptcprouter/cascade.css | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/cascade.css b/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/cascade.css index 523f978db..facffacbf 100644 --- a/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/cascade.css +++ b/luci-theme-openmptcprouter/htdocs/luci-static/openmptcprouter/cascade.css @@ -1782,7 +1782,8 @@ button.btn::-moz-focus-inner, input[type=submit].btn::-moz-focus-inner { line-height: 28px; } -.label { +.label, +header [data-indicator] { padding: 1px 3px 2px; font-size: 9.75px; font-weight: bold; @@ -1795,6 +1796,10 @@ button.btn::-moz-focus-inner, input[type=submit].btn::-moz-focus-inner { margin-left: .4em; } +header [data-indicator][data-clickable] { + cursor: pointer; +} + a.label:link, a.label:visited { color: #fff; @@ -1816,7 +1821,8 @@ a.label:hover { background-color: #46a546; } -.label.notice { +.label.notice, +header [data-indicator][data-style="active"] { background-color: #62cffc; } From c253fa189f9df0de8a0ca29dd98b492186e7b1e9 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 5 May 2020 10:24:56 +0200 Subject: [PATCH 20/88] Fix acl and menu json for apps --- .../root/usr/share/luci/menu.d/luci-app-https-dns-proxy.json | 2 +- luci-app-iperf/root/usr/share/luci/menu.d/luci-app-iperf.json | 4 ++-- luci-app-mail/root/usr/share/luci/menu.d/luci-app-mail.json | 2 +- .../root/usr/share/luci/menu.d/luci-app-omr-dscp.json | 4 ++-- .../rpcd/acl.d/{luci-app-dscp.json => luci-app-omr-dscp.json} | 2 +- .../root/usr/share/luci/menu.d/luci-app-omr-quota.json | 4 ++-- .../root/usr/share/luci/menu.d/luci-app-omr-tracker.json | 2 +- .../root/usr/share/luci/menu.d/luci-app-openmptcprouter.json | 2 +- luci-app-snmpd/root/usr/share/luci/menu.d/luci-app-snmpd.json | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) rename luci-app-omr-dscp/root/usr/share/rpcd/acl.d/{luci-app-dscp.json => luci-app-omr-dscp.json} (83%) diff --git a/luci-app-https-dns-proxy/root/usr/share/luci/menu.d/luci-app-https-dns-proxy.json b/luci-app-https-dns-proxy/root/usr/share/luci/menu.d/luci-app-https-dns-proxy.json index a2238b5c1..6b44c21df 100644 --- a/luci-app-https-dns-proxy/root/usr/share/luci/menu.d/luci-app-https-dns-proxy.json +++ b/luci-app-https-dns-proxy/root/usr/share/luci/menu.d/luci-app-https-dns-proxy.json @@ -3,7 +3,7 @@ "title": "Proxy DNS Over HTTPS", "order": 20, "action": { - "type": "uci", + "type": "cbi", "path": "https-dns-proxy" }, "depends": { diff --git a/luci-app-iperf/root/usr/share/luci/menu.d/luci-app-iperf.json b/luci-app-iperf/root/usr/share/luci/menu.d/luci-app-iperf.json index fa4f87669..dd6151ee0 100644 --- a/luci-app-iperf/root/usr/share/luci/menu.d/luci-app-iperf.json +++ b/luci-app-iperf/root/usr/share/luci/menu.d/luci-app-iperf.json @@ -3,8 +3,8 @@ "title": "iPerf", "order": 10, "action": { - "type": "uci", - "path": "iperf" + "type": "template", + "path": "iperf/test" }, "depends": { "acl": [ "luci-app-iperf" ] diff --git a/luci-app-mail/root/usr/share/luci/menu.d/luci-app-mail.json b/luci-app-mail/root/usr/share/luci/menu.d/luci-app-mail.json index 089af244c..6098e0a26 100644 --- a/luci-app-mail/root/usr/share/luci/menu.d/luci-app-mail.json +++ b/luci-app-mail/root/usr/share/luci/menu.d/luci-app-mail.json @@ -3,7 +3,7 @@ "title": "E-Mail", "order": 90, "action": { - "type": "uci", + "type": "cbi", "path": "mail" }, "depends": { diff --git a/luci-app-omr-dscp/root/usr/share/luci/menu.d/luci-app-omr-dscp.json b/luci-app-omr-dscp/root/usr/share/luci/menu.d/luci-app-omr-dscp.json index db602b6ff..bd3fe3960 100644 --- a/luci-app-omr-dscp/root/usr/share/luci/menu.d/luci-app-omr-dscp.json +++ b/luci-app-omr-dscp/root/usr/share/luci/menu.d/luci-app-omr-dscp.json @@ -3,8 +3,8 @@ "title": "OMR-DSCP", "order": 80, "action": { - "type": "uci", - "path": "omr-dscp" + "type": "cbi", + "path": "dscp" }, "depends": { "acl": [ "luci-app-omr-dscp" ] diff --git a/luci-app-omr-dscp/root/usr/share/rpcd/acl.d/luci-app-dscp.json b/luci-app-omr-dscp/root/usr/share/rpcd/acl.d/luci-app-omr-dscp.json similarity index 83% rename from luci-app-omr-dscp/root/usr/share/rpcd/acl.d/luci-app-dscp.json rename to luci-app-omr-dscp/root/usr/share/rpcd/acl.d/luci-app-omr-dscp.json index 4cb8a0bb1..ec318e6ee 100644 --- a/luci-app-omr-dscp/root/usr/share/rpcd/acl.d/luci-app-dscp.json +++ b/luci-app-omr-dscp/root/usr/share/rpcd/acl.d/luci-app-omr-dscp.json @@ -1,5 +1,5 @@ { - "luci-app-dscp": { + "luci-app-omr-dscp": { "description": "Grant UCI access for luci-app-dscp", "read": { "uci": [ "dscp" ] diff --git a/luci-app-omr-quota/root/usr/share/luci/menu.d/luci-app-omr-quota.json b/luci-app-omr-quota/root/usr/share/luci/menu.d/luci-app-omr-quota.json index 5b7149b3f..73ac0e6f4 100644 --- a/luci-app-omr-quota/root/usr/share/luci/menu.d/luci-app-omr-quota.json +++ b/luci-app-omr-quota/root/usr/share/luci/menu.d/luci-app-omr-quota.json @@ -3,8 +3,8 @@ "title": "Quota", "order": 90, "action": { - "type": "uci", - "path": "quota" + "type": "cbi", + "path": "quota/quota" }, "depends": { "acl": [ "luci-app-omr-quota" ] diff --git a/luci-app-omr-tracker/root/usr/share/luci/menu.d/luci-app-omr-tracker.json b/luci-app-omr-tracker/root/usr/share/luci/menu.d/luci-app-omr-tracker.json index 102c65c16..ed1c7a074 100644 --- a/luci-app-omr-tracker/root/usr/share/luci/menu.d/luci-app-omr-tracker.json +++ b/luci-app-omr-tracker/root/usr/share/luci/menu.d/luci-app-omr-tracker.json @@ -3,7 +3,7 @@ "title": "OMR-Tracker", "order": 10, "action": { - "type": "uci", + "type": "cbi", "path": "omr-tracker" }, "depends": { diff --git a/luci-app-openmptcprouter/root/usr/share/luci/menu.d/luci-app-openmptcprouter.json b/luci-app-openmptcprouter/root/usr/share/luci/menu.d/luci-app-openmptcprouter.json index 08c5b6f32..eea51e8f9 100644 --- a/luci-app-openmptcprouter/root/usr/share/luci/menu.d/luci-app-openmptcprouter.json +++ b/luci-app-openmptcprouter/root/usr/share/luci/menu.d/luci-app-openmptcprouter.json @@ -3,7 +3,7 @@ "title": "OpenMPTCProuter", "order": 1, "action": { - "type": "uci", + "type": "template", "path": "openmptcprouter/wizard" }, "depends": { diff --git a/luci-app-snmpd/root/usr/share/luci/menu.d/luci-app-snmpd.json b/luci-app-snmpd/root/usr/share/luci/menu.d/luci-app-snmpd.json index 5df5fa97a..771c4021a 100644 --- a/luci-app-snmpd/root/usr/share/luci/menu.d/luci-app-snmpd.json +++ b/luci-app-snmpd/root/usr/share/luci/menu.d/luci-app-snmpd.json @@ -3,7 +3,7 @@ "title": "SNMPd", "order": 91, "action": { - "type": "uci", + "type": "cbi", "path": "snmpd" }, "depends": { From 400dc0e5740b463c193be2d1579437999ddc5e76 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 5 May 2020 10:26:24 +0200 Subject: [PATCH 21/88] LTE/3G/... in uppercase in status --- .../luci-static/resources/openmptcprouter/css/wanstatus.css | 1 + 1 file changed, 1 insertion(+) diff --git a/luci-app-openmptcprouter/htdocs/luci-static/resources/openmptcprouter/css/wanstatus.css b/luci-app-openmptcprouter/htdocs/luci-static/resources/openmptcprouter/css/wanstatus.css index 3ea2fb277..878f540e1 100644 --- a/luci-app-openmptcprouter/htdocs/luci-static/resources/openmptcprouter/css/wanstatus.css +++ b/luci-app-openmptcprouter/htdocs/luci-static/resources/openmptcprouter/css/wanstatus.css @@ -297,6 +297,7 @@ Thanks :)*/ .network-node .info .title i { font-weight: lighter; font-size: 5px; + text-transform: uppercase; } .network-node .info .status-message { From d3a77da00594c5e2224a2cb26c6193086b844fe5 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Tue, 5 May 2020 10:27:02 +0200 Subject: [PATCH 22/88] Force reset cache of OMR status page --- .../luasrc/view/openmptcprouter/wanstatus.htm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wanstatus.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wanstatus.htm index 610ff3975..526b67ea2 100644 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wanstatus.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wanstatus.htm @@ -31,9 +31,9 @@ -- * Many tests -%> <%+header%> - - - + + +