project/luci.git
3 years agoluci-mod-network: enforce IPv4 mode for traceroute call
Jo-Philipp Wich [Wed, 30 Jun 2021 15:21:50 +0000 (17:21 +0200)]
luci-mod-network: enforce IPv4 mode for traceroute call

Recent busybox traceroute applet versions support both IPv4 and IPv6 and
default to IPv6 when running a route trace to an IPv6 enabled target
host. Pass the `-4` flag to enforce IPv4 mode in this case.

Fixes: #5155
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit c4f429461545d1401429e7ba133f24a55d1015b6)

3 years agoluci-mod-network: parse ports without tag/pvid annotation as well
Jo-Philipp Wich [Thu, 17 Jun 2021 15:44:21 +0000 (17:44 +0200)]
luci-mod-network: parse ports without tag/pvid annotation as well

Fixes: 01eac366f6 ("luci-mod-network: fix tagging/pvid state parsing in bridge-vlan ports")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit e57f8663afd53cc7421debcd63444e1d136f5dec)

3 years agoluci-mod-network: fix tagging/pvid state parsing in bridge-vlan ports
Jo-Philipp Wich [Thu, 17 Jun 2021 15:33:49 +0000 (17:33 +0200)]
luci-mod-network: fix tagging/pvid state parsing in bridge-vlan ports

The previous code naively looked for a `t` in the entire port spec,
wrongly matching untagged ports having a `t` in their name, such
as `eth0`.

Rework the logic to be more strict when parsing the port member
specification to avoid this issue.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 01eac366f69ba58c090ddc2cb70aeb069adbdd5a)

3 years agoluci-mod-network: refactor device configuration
Jo-Philipp Wich [Thu, 17 Jun 2021 10:28:51 +0000 (12:28 +0200)]
luci-mod-network: refactor device configuration

Since all netifd device types inherit generic device settings, we can
simplify various aspects of the device configuration ui and drop unused
code while we're at it.

 - Remove setIfActive() helper, superseded by commit
   f3f74bd0fe ("luci-base: form.js: consider aliased options in AbstractValue.remove()")

 - Remove most dependency constraints to make all generic device settings
   available for all device types

 - Add MTU value validation to disallow exceeding parent device MTU for
   VLAN interfaces

 - Dynamically update placeholder values when changing base or parent
   device options

 - Undo VLAN network config hack since all options are available now.
   Reverts commit
   3c6b59504a ("luci-mod-interfaces: simplify configuring MAC address of 802.1q devices")

 - Do not suggest inactive wireless networks as existing device or base
   device choices

 - Disallow specifying names of already existing network devices when
   creating new device settings

 - Fix a number of multicast dependency specifications

 - Drop now unused functions

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f689d0d208acbf9934da5a2d49c8717c054be585)

3 years agoluci-mod-network: change port status layout in vlan filter config
Jo-Philipp Wich [Thu, 17 Jun 2021 07:45:48 +0000 (09:45 +0200)]
luci-mod-network: change port status layout in vlan filter config

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 36350e9867ca9fd2f9b137ed76f0fabe0e57c880)

3 years agobuild: add script to find commits suitable for cherry picking
Jo-Philipp Wich [Thu, 1 Jul 2021 19:10:53 +0000 (21:10 +0200)]
build: add script to find commits suitable for cherry picking

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 0ead87320bade6f924991f4310271582a760edb4)

3 years agoluci-app-adblock: sync with latest version
Dirk Brenken [Wed, 30 Jun 2021 14:34:55 +0000 (16:34 +0200)]
luci-app-adblock: sync with latest version

* expose new reporting option to LuCI
* sync translations

Signed-off-by: Dirk Brenken <dev@brenken.org>
(cherry picked from commit 83778c145281eb128a4acf23defda07003dfdc98)

3 years agoMerge pull request #5145 from msylgj/patch-2
Florian Eckert [Tue, 29 Jun 2021 06:58:19 +0000 (08:58 +0200)]
Merge pull request #5145 from msylgj/patch-2

luci-app-frpc/frps:add service status display

3 years agoluci-app-frpc/frps:add service status display 5145/head
SiYao Mo [Thu, 24 Jun 2021 08:01:18 +0000 (16:01 +0800)]
luci-app-frpc/frps:add service status display
reference from luci-app-smartdns
Special thanks to Nick Peng <pymumu@gmail.com>

Signed-off-by: SiYao Mo <msylgj@vip.qq.com>
3 years agoMerge pull request #5142 from msylgj/patch-2
Florian Eckert [Thu, 24 Jun 2021 06:22:36 +0000 (08:22 +0200)]
Merge pull request #5142 from msylgj/patch-2

luci-app-frpc: allow hostname in server address

3 years agoluci-app-frpc: allow hostname in server address 5142/head
Siyao Mo [Tue, 22 Jun 2021 18:40:14 +0000 (02:40 +0800)]
luci-app-frpc: allow hostname in server address

Sometimes, our frp server cannot use a static ip address.
So perhaps we should allow people to use hostname in server address.

Signed-off-by: SiYao Mo <msylgj@vip.qq.com>
3 years agoluci-app-nlbwmon: i18n sync translations
Florian Eckert [Mon, 21 Jun 2021 11:53:18 +0000 (13:53 +0200)]
luci-app-nlbwmon: i18n sync translations

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
3 years agoluci-base: i18n sync translations
Florian Eckert [Mon, 21 Jun 2021 11:53:03 +0000 (13:53 +0200)]
luci-base: i18n sync translations

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
3 years agoluci-app-watchcat: i18n sync translations
Florian Eckert [Mon, 21 Jun 2021 11:52:50 +0000 (13:52 +0200)]
luci-app-watchcat: i18n sync translations

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
3 years agoluci-app-banip: i18n sync translations
Florian Eckert [Mon, 21 Jun 2021 11:52:28 +0000 (13:52 +0200)]
luci-app-banip: i18n sync translations

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
3 years agoluci-app-adblock: i18n sync translations
Florian Eckert [Mon, 21 Jun 2021 11:52:12 +0000 (13:52 +0200)]
luci-app-adblock: i18n sync translations

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
3 years agoluci-mod-network: Support for disabling routes
Anton Kikin [Tue, 6 Apr 2021 01:21:01 +0000 (04:21 +0300)]
luci-mod-network: Support for disabling routes

Support for disabling routes in netifd was added in commit [1]. This commit
adds support for disabling routes through the LuCI interface.

Additionally hidden the route options descriptions in the header of the
routes table (they are still available in the modal view).

[1]: https://git.openwrt.org/?p=project/netifd.git;a=commit;h=327da9895327bc56b23413ee91a6e6b6e0e4329d

Signed-off-by: Anton Kikin <a.kikin@tano-systems.com>
(cherry picked from commit bfe8a01040c8a74f38818195620f069f5bc10c5c)

3 years agoluci-mod-status: switch to html table for wlan channel analysis
Florian Eckert [Wed, 16 Jun 2021 14:32:35 +0000 (16:32 +0200)]
luci-mod-status: switch to html table for wlan channel analysis

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 8f8ce8613fb6e41954aa5bcbb60330e3b034bd3a)

3 years agoluci-theme-openwrt-2020: fix spinning disk animation
Jo-Philipp Wich [Thu, 17 Jun 2021 12:11:39 +0000 (14:11 +0200)]
luci-theme-openwrt-2020: fix spinning disk animation

Fixes: #4824
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit e8a6f0bb7c7c24f31ddbc36f81fa97b3a2a53b2e)

3 years agoluci-app-nlbwmon: show force reload button even if data are available
Florian Eckert [Thu, 17 Jun 2021 13:06:12 +0000 (15:06 +0200)]
luci-app-nlbwmon: show force reload button even if data are available

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit a7be13ff05cc35352a02ad7c36acd704a037e37f)

3 years agoluci-app-nlbwmon: adjused the display export page
Florian Eckert [Thu, 17 Jun 2021 10:50:40 +0000 (12:50 +0200)]
luci-app-nlbwmon: adjused the display export page

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 04c4499be74152c476ca1edfd6b8048252a55251)

3 years agoluci-app-nlbwmon: change force reload html element to button
Florian Eckert [Thu, 17 Jun 2021 10:26:24 +0000 (12:26 +0200)]
luci-app-nlbwmon: change force reload html element to button

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit d6443a629362f7ed79d1212cd964e5d6a127a9c0)

3 years agoluci-app-nlbwmon: add missing cbi-button class for database backup
Florian Eckert [Thu, 17 Jun 2021 10:24:43 +0000 (12:24 +0200)]
luci-app-nlbwmon: add missing cbi-button class for database backup

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 6f6ec9f56cc24be9f432b0a88a29f46277dad7d5)

3 years agoluci-app-nlbwmon: fix url
Florian Eckert [Wed, 16 Jun 2021 12:01:03 +0000 (14:01 +0200)]
luci-app-nlbwmon: fix url

When moving this application to the service section, the links were
forgotten to be changed.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 7a365183296f385bb8cb14b8eb6fcfc29941c7e4)

3 years agoluci-app-nlbwmon: move into menu entry into service section
Florian Eckert [Wed, 8 Jul 2020 08:13:09 +0000 (10:13 +0200)]
luci-app-nlbwmon: move into menu entry into service section

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 9e91737566cc6101b4bf37107c6d945842f06bb8)

3 years agoluco-app-ksmbd, luci-app-omcproxy: use relative luci.mk include path
Jo-Philipp Wich [Fri, 18 Jun 2021 12:28:26 +0000 (14:28 +0200)]
luco-app-ksmbd, luci-app-omcproxy: use relative luci.mk include path

Fixes: #5134
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 2f0ffd9d82b1e41d64e4d63088086f4956010840)

3 years agoluci-mod-network: only consider bridge vlans belonging to the current device
Jo-Philipp Wich [Thu, 17 Jun 2021 06:58:15 +0000 (08:58 +0200)]
luci-mod-network: only consider bridge vlans belonging to the current device

In case multiple bridges with bridge vlans are declared, LuCI did not
correctly filter the VLANs to show only the ones belonging to the
bridge being configured currently.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f6f1eacb012b0364940c1dc9b9392fc0e60405b9)

3 years agoluci-lib-docker: add container export support
Yu Hua [Tue, 15 Jun 2021 14:24:27 +0000 (22:24 +0800)]
luci-lib-docker: add container export support

commit from https://github.com/lisaac/luci-lib-docker

Signed-off-by: Yu Hua <hue715@gmail.com>
(cherry picked from commit fe795d5278e541c91d16374371c7f2a0c3eae998)

3 years agotreewide: resync and merge master translations
Jo-Philipp Wich [Tue, 15 Jun 2021 08:06:26 +0000 (10:06 +0200)]
treewide: resync and merge master translations

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
3 years agorpcd-mod-luci: bump version
Jo-Philipp Wich [Tue, 15 Jun 2021 08:02:44 +0000 (10:02 +0200)]
rpcd-mod-luci: bump version

Fixes: a78b74784d ("rpcd-mod-luci: refactor host hint gathering")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit a26b53314db468e2a3c0c5ea4d8db4939d8eb09c)

3 years agorpcd-mod-luci: refactor host hint gathering
Jo-Philipp Wich [Mon, 14 Jun 2021 18:47:11 +0000 (20:47 +0200)]
rpcd-mod-luci: refactor host hint gathering

 - Do not incorrectly put the IP addresses from the rrdns reply into the
   first hint, instead distribute hostnames to the appropriate hints.

 - Avoid returning stale lease information from previously parsed records
   by clearing the static struct before each parse attempt.

 - Improve existing checks for empty MAC addresses and unspecified IPv6
   addresses.

Fixes: #5126
Fixes: 87bcf9e923 ("rpcd-mod-luci: Return array of addresses in getHostHints")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit a78b74784dc1d4a4007e3e21a79228d5192f0dad)

3 years agoluci-mod-network: wireless.js: recognize HE* htmodes
Jo-Philipp Wich [Mon, 14 Jun 2021 07:05:24 +0000 (09:05 +0200)]
luci-mod-network: wireless.js: recognize HE* htmodes

Ref: https://bugs.openwrt.org/index.php?do=details&task_id=3856#comment9797
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 4286c84825c15f4d36f294b2ea28071667a4be7e)

3 years agoluci-app-banip: sync with banip 0.7.9
Dirk Brenken [Sat, 12 Jun 2021 21:16:48 +0000 (23:16 +0200)]
luci-app-banip: sync with banip 0.7.9

* support the new 'ban_fetchinsecure' option
* improve the chain help text to make clear that you can assign
  multiple FW chains

Signed-off-by: Dirk Brenken <dev@brenken.org>
(cherry picked from commit 770548eadf21ea4c18c57b5e4ee68bf7dfa184fd)

3 years agoluci-app-adblock: sync with adblock 4.1.3
Dirk Brenken [Sat, 12 Jun 2021 20:29:20 +0000 (22:29 +0200)]
luci-app-adblock: sync with adblock 4.1.3

* support the new 'adb_fetchinsecure' option

Signed-off-by: Dirk Brenken <dev@brenken.org>
(cherry picked from commit be578c64e97d138e7104dfa7025eb9ab998b3b07)

3 years agoluci-theme-bootstrap: mobile style fixes for vlan filter matrix
Jo-Philipp Wich [Sun, 13 Jun 2021 19:49:22 +0000 (21:49 +0200)]
luci-theme-bootstrap: mobile style fixes for vlan filter matrix

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit e6a2cdbdab83f8eaefeec36ad668468ea374d471)

3 years agoluci-mod-network: small styling fixes for vlan filter matrix
Jo-Philipp Wich [Sun, 13 Jun 2021 19:47:40 +0000 (21:47 +0200)]
luci-mod-network: small styling fixes for vlan filter matrix

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit cbf2cc396a29d6794a4d883d80f8390e227e072b)

3 years agoluci-mod-network: migrate more device options
Rafał Miłecki [Thu, 10 Jun 2021 11:20:41 +0000 (13:20 +0200)]
luci-mod-network: migrate more device options

Include mtu and igmp_snooping while migrating.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit fa51d04459b16245d33a1562159c65d4b03a32f0)

3 years agocsstidy: update to latest Git HEAD
Jo-Philipp Wich [Sun, 13 Jun 2021 17:54:36 +0000 (19:54 +0200)]
csstidy: update to latest Git HEAD

707feae parse_css: do not omit white space in url() property values

Ref: https://github.com/openwrt/luci/commit/69608199973651baf585d24a095edf8c0c42e21f#commitcomment-52088358
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit e266c749034310b26410cf820e95691654e18174)

3 years agoluci-mod-network: reset bridge VLANs on cancelling modal dialog
Jo-Philipp Wich [Sat, 12 Jun 2021 20:54:51 +0000 (22:54 +0200)]
luci-mod-network: reset bridge VLANs on cancelling modal dialog

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit bb3269945c7f189e1d1de1e7979d79d30a860b03)

3 years agoluci-mod-network: fix vlan filter matrix overflow after redraw
Jo-Philipp Wich [Sat, 12 Jun 2021 20:08:13 +0000 (22:08 +0200)]
luci-mod-network: fix vlan filter matrix overflow after redraw

Ensure that the overflow styles are reapplied after a redraw. This also
simplifies the code as a side-effect.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 7a781d9cd8ab783dd7a5c72f154b972a9ea9aa98)

3 years agotreewide: resync and merge master translations
Jo-Philipp Wich [Sat, 12 Jun 2021 17:37:09 +0000 (19:37 +0200)]
treewide: resync and merge master translations

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
3 years agoprotocols: unify TOS and TTL description strings
Jo-Philipp Wich [Mon, 7 Jun 2021 11:59:03 +0000 (13:59 +0200)]
protocols: unify TOS and TTL description strings

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit b4c394f2d275ab093a16d994333da4f104e1723f)

3 years agotreewide: consolidate {IPv4,IPv6,MAC} {address,gateway} spellings
Jo-Philipp Wich [Mon, 7 Jun 2021 10:43:36 +0000 (12:43 +0200)]
treewide: consolidate {IPv4,IPv6,MAC} {address,gateway} spellings

 - Turn IPv4-Address into IPv4 address
 - Turn IPv4-Gateway into IPv4 gateway
 - Turn IPv6-Address into IPv6 address
 - Turn IPv6-Gateway into IPv6 gateway
 - Turn MAC-Address into MAC address

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit 88b9d843882cf52a6acf4d08a878fd005120edd4)

3 years agotreewide: fix "promiscious" typo
Jo-Philipp Wich [Mon, 7 Jun 2021 09:51:06 +0000 (11:51 +0200)]
treewide: fix "promiscious" typo

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit b5832d134e0e38609ea8a2d83b8aa62e0e662f24)

3 years agoluci-mod-system: remove bogus btn class in flash.js
Dirk Brenken [Wed, 14 Apr 2021 12:12:06 +0000 (14:12 +0200)]
luci-mod-system: remove bogus btn class in flash.js

* fixes #4970

Signed-off-by: Dirk Brenken <dev@brenken.org>
[omit translation sync]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit 8c6a29a45cba64724bd726e52719eabbfa8528a6)

3 years agoluci-mod-status: check if center_chan1 is defined
Wojciech Jowsa [Wed, 5 May 2021 13:28:39 +0000 (15:28 +0200)]
luci-mod-status: check if center_chan1 is defined

Signed-off-by: Wojciech Jowsa <wojciech.jowsa@gmail.com>
(cherry picked from commit ead64c0195cd792341a6dddce7ea5e724247c60d)

3 years agoluci-theme-openwrt-2020: rework table styles
Jo-Philipp Wich [Mon, 1 Mar 2021 18:02:57 +0000 (19:02 +0100)]
luci-theme-openwrt-2020: rework table styles

Target table, tr, th and td tags directly and stop using the corresponding
CSS class names.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 70571084004ede442e7f2e944d17156c83182a24)

3 years agoluci-mod-network: add port status to bridge vlan filter matrix
Jo-Philipp Wich [Fri, 11 Jun 2021 08:18:10 +0000 (10:18 +0200)]
luci-mod-network: add port status to bridge vlan filter matrix

Also ensure that port devices are ordered numerically.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 8c71b1d01ee234c5681684e9aae5f63dbe9ebb07)

3 years agoluci-base: network.js: add link status information accessors
Jo-Philipp Wich [Sat, 12 Jun 2021 16:41:40 +0000 (18:41 +0200)]
luci-base: network.js: add link status information accessors

Fixes: #5121
Fixes: 8c71b1d01e ("luci-mod-network: add port status to bridge vlan filter matrix")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 1bcb12570c3b6f26009801ee6006b2ab305d088f)

3 years agolucihttp: update to latest Git HEAD
Jo-Philipp Wich [Fri, 11 Jun 2021 06:28:31 +0000 (08:28 +0200)]
lucihttp: update to latest Git HEAD

Fixes compilation under 32bit systems by using the proper printf format
specifier for size_t values.

Also fixes compilation with Ninja by appending instead of
overwriting CMAKE_OPTIONS.

Fixes: #5116
Suggested-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit d1fc11d852262bacb650a49782dbce0c8cbd572a)

3 years agorpcd-mod-luci: add link details to ubus netdev information
Jo-Philipp Wich [Wed, 9 Jun 2021 17:18:04 +0000 (19:18 +0200)]
rpcd-mod-luci: add link details to ubus netdev information

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 113c0b0d26b2f60c38a605732ce4c0fb3bdfc7dc)

3 years agoluci-mod-network: fix horizontal scrolling in the bridge vlan filter matrix
Jo-Philipp Wich [Wed, 9 Jun 2021 19:55:14 +0000 (21:55 +0200)]
luci-mod-network: fix horizontal scrolling in the bridge vlan filter matrix

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit ded6e53bcdb9c484f99779fffa20a37bc6d70c3c)

3 years agoluci-base: ui.js: determine dropdown position relative to overflow parent
Jo-Philipp Wich [Wed, 9 Jun 2021 19:45:13 +0000 (21:45 +0200)]
luci-base: ui.js: determine dropdown position relative to overflow parent

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit e3bf521edbd0c6f59aba9aa9a89a9d96e1da3fd2)

3 years agoluci-mod-status: fix NaN errors in realtime graphs
Lukasz Baj [Fri, 16 Apr 2021 17:36:43 +0000 (19:36 +0200)]
luci-mod-status: fix NaN errors in realtime graphs

When I use Realtime Graphs I see following NaN errors:

    Error: <polyline> attribute points: Expected number, "0,298 0,NaN 5,NaN 10,NaN…".
    Error: <polyline> attribute points: Expected number, "0,298 0,NaN 5,NaN 10,NaN…".
    wireless.js?v=git-21.105.40538-2da37c2:19 Error: <polyline> attribute points: Expected number, "0,298 0,NaN 5,NaN 10,NaN…".
    eval @ wireless.js?v=git-21.105.40538-2da37c2:19
    Promise.then (async)
    eval @ wireless.js?v=git-21.105.40538-2da37c2:8
    step @ luci.js?v=git-21.105.40538-2da37c2:91
    start @ luci.js?v=git-21.105.40538-2da37c2:87
    add @ luci.js?v=git-21.105.40538-2da37c2:82
    pollData @ wireless.js?v=git-21.105.40538-2da37c2:7
    render @ wireless.js?v=git-21.105.40538-2da37c2:24
    Promise.then (async)
    __init__ @ luci.js?v=git-21.105.40538-2da37c2:148
    super @ luci.js?v=git-21.105.40538-2da37c2:22
    Anonymous42Class @ luci.js?v=git-21.105.40538-2da37c2:12
    (anonymous) @ luci.js?v=git-21.105.40538-2da37c2:181
    Promise.then (async)
    compileClass @ luci.js?v=git-21.105.40538-2da37c2:177
    Promise.then (async)
    require @ luci.js?v=git-21.105.40538-2da37c2:183
    instantiateView @ ui.js?v=git-21.105.40538-2da37c2:311
    (anonymous) @ wireless:47
    Promise.then (async)
    (anonymous) @ wireless:46

Signed-off-by: Lukasz Baj <l.baj@celerway.com>
[adjust subject]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit c6a5c809ed1fb050d257cf6273b8bc832babfa9b)

3 years agoluci-mod-network: interfaces.js: fix ifname migration in device sections
Jo-Philipp Wich [Wed, 9 Jun 2021 09:01:36 +0000 (11:01 +0200)]
luci-mod-network: interfaces.js: fix ifname migration in device sections

The migration code attempted to add new device sections instead of moving
the ifname option to a ports list within the existing ones.

Fixes: #5108
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit e13d82a202975bd9ac5eca380049b887cb1d585d)

3 years agoluci-mod-network: interfaces: show bridge port device icons again
Jo-Philipp Wich [Wed, 9 Jun 2021 08:22:38 +0000 (10:22 +0200)]
luci-mod-network: interfaces: show bridge port device icons again

Restore the display of bridge port device icons in the interface overviews.
This feature has been lost after migrating the network config from legacy
bridge declarations to device bridge declarations.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 608f89429b4b8537ddaefd070c777a6d4fb1c7a1)

3 years agoluci-mod-network: support newer wireless.wifi-device.band option
Jo-Philipp Wich [Wed, 9 Jun 2021 07:59:15 +0000 (09:59 +0200)]
luci-mod-network: support newer wireless.wifi-device.band option

OpenWrt switched from "option hwmode" to "option band" in order to select
the frequency band to use for the radio phy.

Extend the channel selector to recognize and use an existing "option band"
to select the appropriate channel list. When operating upon a wireless
configuration still using "option hwmode", then translate it to a band
value internally and translate it back to "option hwmode" on save.

This should provide forward- and backwards compatibility with both current
OpenWrt master and older versions still using hwmode.

Fixes: #5106
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 0829d31290e7c902743fbd86ea91b06ee90c6e42)

3 years agoluci-mod-network: allow device declarations and device configs to coexist
Jo-Philipp Wich [Sat, 5 Jun 2021 16:41:39 +0000 (18:41 +0200)]
luci-mod-network: allow device declarations and device configs to coexist

It is legal to have two device sections referring to the same netdev if one
section is a declaration (a section setting option type) and the other is
a configuration (a section not specifying a type but matching an existing
netdev).

Support this case in LuCI since it might be required for some complex
device setups.

Additionally, fix the device type determination for device configuration
sections without type, those should be treated as ethernet (a.k.a.
simple device) configuration instead of falling back to the underlying
netdev device type.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit a6c0ad00b28a5d3f91338b50f7e69fbd45f2154e)

3 years agoluci-base: add 11ax HW / HT modes
David Bauer [Sat, 5 Jun 2021 14:21:42 +0000 (16:21 +0200)]
luci-base: add 11ax HW / HT modes

Add the known values returned for 802.11ax HW as well as HT modes to the
respective method descriptions.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 4b17f8baa3574527dc6ab8914fd322a08cb9784c)

3 years agoluci-mod-network: add 802.11ax HE support
David Bauer [Tue, 20 Apr 2021 15:42:02 +0000 (17:42 +0200)]
luci-mod-network: add 802.11ax HE support

This commit adds the ability to configure HE-modes for radios
(HE20 / HE40 / HE80 / HE160) as well as HE rate information in the
assiciation view.

Tested-on: Ubiquiti UniFi 6 Lite / LR

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit f35e877dc65c727a6ce7f7972a5be4d15921827b)

3 years agoluci-mod-interfaces: simplify configuring MAC address of 802.1q devices
Jo-Philipp Wich [Sat, 5 Jun 2021 14:16:14 +0000 (16:16 +0200)]
luci-mod-interfaces: simplify configuring MAC address of 802.1q devices

Treat not explicitly configured, preexisting VLAN interfaces as simple
network devices when adding configuration for them, since it is more
likely that people want to set general device properties such as MAC
address instead of reconfiguring ingress/egress QoS mapping, which is
the only editable property of preexisting VLAN device config dialogs.

Ref: https://github.com/openwrt/luci/issues/5102
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 3c6b59504aaa6ee33a2ee768aafc0aeaefb06004)

3 years agoluci-mod-network: interfaces: restructure DHCPv6 and IPv6 RA options
Jo-Philipp Wich [Tue, 1 Jun 2021 20:23:09 +0000 (22:23 +0200)]
luci-mod-network: interfaces: restructure DHCPv6 and IPv6 RA options

 - Condense overly large IPv6 RA/DHCPv6 description texts and get rid of most embedded markup

 - Switch ra/ndp/dhcpv6 mode selections to rich dropdown lists and move extended choice
   descriptions next to the selection options

 - Drop ndproxy_static option which has been removed from odhcpd long ago

 - Add format validations to all text input fields

 - Add ability to configure master/relay modes for non-static interfaces (#2998)

 - Move extended RA configuration options into a new tab

 - Prevent enabling master mode on multiple interfaces

 - Prevent enabling ra/dhcpv6 server mode on non-static or master interfaces

 - Drop ra_management in favor to ra_flags option (#5083)

 - Add support for dns_service option

 - Read current effective IPv6 MTU and hop limit placeholder values from procfs

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 3fbd4338846e8229935b54256a3a541a3e15d8bd)

3 years agoluci-app-firewall: further luci-rpc/getHostHints compatibility fixes
Jo-Philipp Wich [Thu, 3 Jun 2021 08:03:48 +0000 (10:03 +0200)]
luci-app-firewall: further luci-rpc/getHostHints compatibility fixes

Rework some further code instances to fall back to the legacy ipv4/ipv6
properties if needed.

Fixes: c7b7b42cd3 ("treewide: Update JS using luci-rpc getHostHints")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit dc0cfc642e42eefcac91bb965f9aa612089fad5d)

3 years agoluci-proto-wireguard: fix fwmark validation to allow 32 bit values
Jo-Philipp Wich [Wed, 2 Jun 2021 18:35:32 +0000 (14:35 -0400)]
luci-proto-wireguard: fix fwmark validation to allow 32 bit values

The iptables mark field is 32 bits wide, which is 4 bytes and so 8 hex
characters. Fix the fwmark validation to allow 8 characters in the hex
string.

Fixes: #5098
Suggested-by: Robert <32970961+differentblue@users.noreply.github.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit bc1015f7db57506b2468846f79dbd5bfe0dbea7a)

3 years agoluci-base: network.js: sorting fixes
Jo-Philipp Wich [Wed, 2 Jun 2021 09:54:42 +0000 (11:54 +0200)]
luci-base: network.js: sorting fixes

Ensure that sort callbacks consistently return [-N .. 0 .. +N] values
instead of just true/false.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit e35041e0a8edcf039d62a74cbc5e0f4043d04029)

3 years agotreewide: Update JS using luci-rpc getHostHints
Niels Widger [Wed, 31 Mar 2021 12:23:12 +0000 (08:23 -0400)]
treewide: Update JS using luci-rpc getHostHints

Update frontend JS code which uses luci-rpc getHostHints to support the new
response format which removes the `ipv4` and `ipv6` host hint string fields
and replaces them with `ipaddrs` and `ip6addrs` weighted string list fields.

Signed-off-by: Niels Widger <niels@qacafe.com>
[rework code to be forwards/backwards compatible, fix some Network.Hosts
 methods, fix IP choice ordering, change commit subject, rewrap commit
 message]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit c7b7b42cd3840cfd67f412191578a8659eb63c87)

3 years agorpcd-mod-luci: Return array of addresses in getHostHints
Niels Widger [Mon, 1 Mar 2021 19:33:33 +0000 (14:33 -0500)]
rpcd-mod-luci: Return array of addresses in getHostHints

Update luci-rpc's getHostHints method to return two string arrays for
each host, `ipaddrs` and `ip6addrs`, each containing the host's IPv4
and IPv6 addresses, respectively.  Each array is sorted by a priority
derived from the source from which the address was discovered.  The
current address sources and their priority is as follows (a
higher (larger) priority is listed first):

    - neighbor table entries: 10
    - /etc/ethers entries:    50
    - DHCP leasefile:        100
    - RRDNS queries:         100
    - getifaddrs():          200
    - UCI static leases:     200

The existing `ipv4` and `ipv6` string fields for each host in
`getHostHints` has been removed.  Downstream users of getHostHints
still need to be updated.

Fixes: #4838
Signed-off-by: Niels Widger <niels@qacafe.com>
[squash commits, reformat fixes tag]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit a5195e7825cbbc3942ca6e571ae0020c1cf080c4)

3 years agoprotocols: rename "device" option to "_modem_device"
Jo-Philipp Wich [Tue, 1 Jun 2021 13:31:44 +0000 (15:31 +0200)]
protocols: rename "device" option to "_modem_device"

This is required to resolve clashes with the generic "option device"
referring to netdev names in current netifd versions.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 96ee6dc8d6c9796ab67de6f313a068a4bd3bb20f)

3 years agoluci-mod-network: rename "device" option to "_net_device" internally
Jo-Philipp Wich [Tue, 1 Jun 2021 13:27:24 +0000 (15:27 +0200)]
luci-mod-network: rename "device" option to "_net_device" internally

This is required to resolve conflicts with the existing "device" option
in other proto handlers such as PPP or QMI where "device" refers to the
device path of the tty control device instead of a netdev name.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 10f02472c5fdab72615a7d3695e8f354811cd661)

3 years agoluci-mod-network: clarify device settings reset button tooltip
Jo-Philipp Wich [Tue, 1 Jun 2021 13:25:24 +0000 (15:25 +0200)]
luci-mod-network: clarify device settings reset button tooltip

Ref: #5090
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 26e21d43b5402d0c20bd2222429629c164968668)

3 years agoluci-base: form.js: consider aliased options in AbstractValue.remove()
Jo-Philipp Wich [Tue, 1 Jun 2021 12:45:42 +0000 (14:45 +0200)]
luci-base: form.js: consider aliased options in AbstractValue.remove()

If different options point to the same underlying uci option, we must only
remove the uci value if none of the other alias options is active in order
to prevent inactive options (due to unsatisfied depends) removing the uci
value of active once on save.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f3f74bd0fe66b94a99a8d944b63dcd6bdd1b93c6)

3 years agoluci-mod-network: don't accidentally reset macvlan device names
Jo-Philipp Wich [Tue, 1 Jun 2021 12:35:31 +0000 (14:35 +0200)]
luci-mod-network: don't accidentally reset macvlan device names

Fixes: #5081
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 671c94b034db9d7470d5f1e681b919158de205f6)

3 years agoluci-theme-bootstrap: add svg help icon to form field descriptions
Jo-Philipp Wich [Tue, 1 Jun 2021 09:14:58 +0000 (11:14 +0200)]
luci-theme-bootstrap: add svg help icon to form field descriptions

The still referenced help.gif icon is absent by default since it has been
moved to luci-compat.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 69608199973651baf585d24a095edf8c0c42e21f)

3 years agoluci-mod-network: make device selector dependent on protocol (again)
Jo-Philipp Wich [Mon, 31 May 2021 12:00:51 +0000 (14:00 +0200)]
luci-mod-network: make device selector dependent on protocol (again)

This commit effectively reverts the change made with
907b4222f7 ("luci-mod-network: don't hide "Device" on protocol change").

Floating tunnel protocols such as 6in4, plain PPP over modem device,
VPNC etc. do not have any layer 2 device at all, for such protocols the
device selector should be hidden.

Also swap back the incorrect option order introduced with commit
b7f3cf66ca ("luci-mod-network: drop support for *adding* legacy bridges").

Since device depends on proto, it should come after the protocol selection,
not before.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit fc12933670ba9efd87a24b6823cf57a666b54c1a)

3 years agoluci-mod-network: fix device dependencies in add interface dialog
Jo-Philipp Wich [Mon, 31 May 2021 09:50:56 +0000 (11:50 +0200)]
luci-mod-network: fix device dependencies in add interface dialog

Commit b7f3cf66ca "luci-mod-network: drop support for *adding* legacy bridges"
dropped the protocol dependcies of the ifname/device selector in the add new
interface dialog.

Re-add the required dependencies and swap the order of the protocol and
device inputs while we're at it since latter depends on the former.

Fixes: b7f3cf66ca ("luci-mod-network: drop support for *adding* legacy bridges")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 147188f6ee7067119746ffc2a505ef8f4eb8943a)

3 years agoluci-app-statistics: fix read of hostname
Anderson McKinley [Wed, 26 May 2021 06:41:49 +0000 (06:41 +0000)]
luci-app-statistics: fix read of hostname

Existing javascript did not read a non-default statistics hostname due to
incorrect config ids.

Signed-off-by: Anderson McKinley <coyoso@tuta.io>
(cherry picked from commit 97424d57af1d0e02ea914012c47987541d7ee6a6)

3 years agoluci-theme-openwrt-2020: use SVG-file for favicon and logo
Sven Roederer [Sat, 22 May 2021 23:43:44 +0000 (01:43 +0200)]
luci-theme-openwrt-2020: use SVG-file for favicon and logo

Using the scalable graphic in place of the static png file saves some
ressources in flash and network. It also aligns the filetype to the type
announced to the browser.

fixes GitHub-issue #5051

Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
(cherry picked from commit 184e93df5f0365d403d4d7a6243286cbe5b914de)

3 years agoluci-theme-openwrt-2020: remove submenu margin-bottom when submenu not visible
Jan Breuer [Tue, 13 Apr 2021 14:38:03 +0000 (16:38 +0200)]
luci-theme-openwrt-2020: remove submenu margin-bottom when submenu not visible

Signed-off-by: Jan Breuer <jan.breuer@jaybee.cz>
(cherry picked from commit 2b5f78e8936b90029478bff0f70ec8333f352b7a)

3 years agoluci-base: uci.js: merge changes when retrieving entire sections
Jo-Philipp Wich [Mon, 29 Mar 2021 20:29:36 +0000 (22:29 +0200)]
luci-base: uci.js: merge changes when retrieving entire sections

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit ba4e214160619e27b88a3929c76a1a01c9c1b1e2)

3 years agoprotocols: fix interface.ipv6 vs. device.ipv6 option conflict
Jo-Philipp Wich [Mon, 29 Mar 2021 18:34:43 +0000 (20:34 +0200)]
protocols: fix interface.ipv6 vs. device.ipv6 option conflict

Ref: https://forum.openwrt.org/t/pppoe-disable-ipv6/92548
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 7d49508480446febe4ed0de929f83ea923c98324)

3 years agorpcd-mod-luci: expose devtype and iflink properties in getNetworkDevices
Jo-Philipp Wich [Wed, 17 Mar 2021 18:29:01 +0000 (19:29 +0100)]
rpcd-mod-luci: expose devtype and iflink properties in getNetworkDevices

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 71feaa52857abb7408d657521c114319c1f0a113)

3 years agoluci-app-firewall: simplify some form actions
Jo-Philipp Wich [Thu, 6 Aug 2020 19:22:18 +0000 (21:22 +0200)]
luci-app-firewall: simplify some form actions

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit bbf1a5343f1d930096cd5ff6b98f3e1f2f0d3c9a)

3 years agoluci-base: remove references to removed functions from documentation
Jo-Philipp Wich [Mon, 1 Mar 2021 08:16:21 +0000 (09:16 +0100)]
luci-base: remove references to removed functions from documentation

Fixes: #4778
Fixes: 366707a68 ("luci-base: drop unused functions in luci.sys")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit a9da1dc5a5d33cd321d83f42fb16bc6bf9d77b5c)

3 years agoluci-base: add new member 'hidden' to DummyValue
Nicholas Smith [Sat, 6 Feb 2021 01:12:36 +0000 (11:12 +1000)]
luci-base: add new member 'hidden' to DummyValue

Signed-off-by: Nicholas Smith <nicholas@nbembedded.com>
(cherry picked from commit 936dde742256c6f81c335e5847524e2771913775)

3 years agoluci-app-frpc: correct prop name 'subdomain'
Huang-Huang Bao [Tue, 28 Jul 2020 14:56:50 +0000 (22:56 +0800)]
luci-app-frpc: correct prop name 'subdomain'

Signed-off-by: Huang-Huang Bao <eh5@sokka.cn>
(cherry picked from commit de9f21cb8c8c056566d3390c93bd72aef9efde7a)

3 years agoMerge pull request #5115 from stangri/21.02-luci-app-vpn-policy-routing
Stan Grishin [Thu, 10 Jun 2021 05:49:22 +0000 (22:49 -0700)]
Merge pull request #5115 from stangri/21.02-luci-app-vpn-policy-routing

[21.02] luci-app-vpn-policy-routing: support for 21.02.0-rc2

3 years agoluci-app-vpn-policy-routing: support for 21.02.0-rc2 5115/head
Stan Grishin [Thu, 10 Jun 2021 05:47:50 +0000 (05:47 +0000)]
luci-app-vpn-policy-routing: support for 21.02.0-rc2

Signed-off-by: Stan Grishin <stangri@melmac.net>
3 years agothemes: Call striptags() on hostname to prevent XSS
Hauke Mehrtens [Tue, 8 Jun 2021 23:28:44 +0000 (01:28 +0200)]
themes: Call striptags() on hostname to prevent XSS

This calls striptags() on the hostname to prevent any XSS over the
hostname. This should fix CVE-2021-33425 as far as I understood it.

If someone adds some Javascript into system.@system[0].hostname it would
have been directly added to the page, this prevents the problem.

This can only be exploited by someone being able to modify the uci
configuration, normally a user with such privileges could also just
modify the webpage.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 5cbd79d7e31c0f0feaea2770bf102bbae7831e3c)

3 years agotreewide: i18n - Backport translations
Hannu Nyman [Tue, 8 Jun 2021 17:07:21 +0000 (20:07 +0300)]
treewide: i18n - Backport translations

Backport translations from master.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
3 years agoluci.mk: make SUBMENU package define customizable and optional
Sven Roederer [Thu, 22 Apr 2021 20:35:58 +0000 (22:35 +0200)]
luci.mk: make SUBMENU package define customizable and optional

When including luci.mk in external repos it's sometimes usefull to not use
the default LuCI-submenu hierarchy.
This change defines the LUCI_SUBMENU_FORCED variable which completely overrides
the default submenu of the LuCI config-section. When LUCI_SUBMENU_FORCED is not
defined, the default submenu derrived from LUCI_TYPE or "Application" fallback
is used.
Defining LUCI_SUBMENU_FORCED in the package Makefile will just use this value.
Setting it to "none" will not define a submenu at all.
Together with LUCI_SECTION and LUCI_CATEGORY menu items can now created at any
place in the menu structure.

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
(cherry picked from commit 2b11ec6fd02be060443cf4afc9d89058aadcfab3)

3 years agoluci.mk: add PKG_PROVIDES make-macro to set package/provides option
Sven Roederer [Sat, 17 Apr 2021 20:38:24 +0000 (22:38 +0200)]
luci.mk: add PKG_PROVIDES make-macro to set package/provides option

Add PKG_PROVIDES macro to be passed down to buildpackage defines as  PROVIDES variable.

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
(cherry picked from commit 209141d49153b999c42b0410010366789b36e86d)

3 years agoluci.mk: add URL and MAINTAINER fields to package-definitions
Sven Roederer [Sat, 17 Apr 2021 15:37:08 +0000 (17:37 +0200)]
luci.mk: add URL and MAINTAINER fields to package-definitions

Add the LUCI_URL and LUCI_MAINTAINER variables to pass them to the buildpackage
defines. Give them some sane defaults and allow overwritting by the individual
package.

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
(cherry picked from commit ae0795deb0c908515550236254b04334be8f90bf)

3 years agotreewide: i18n - backport translations from master
Hannu Nyman [Tue, 1 Jun 2021 05:22:44 +0000 (08:22 +0300)]
treewide: i18n - backport translations from master

Backport translations from master.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
3 years agoluci-mod-network: migrate macaddr during bridge migration
Rafał Miłecki [Mon, 31 May 2021 06:35:09 +0000 (08:35 +0200)]
luci-mod-network: migrate macaddr during bridge migration

Link: https://forum.openwrt.org/t/network-migration-21-02-0-rc2/97934
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 49be69316bfea092e90c2f5a821ded961069f518)

3 years agoluci-mod-network: allow netifd version query to fail
Jo-Philipp Wich [Mon, 31 May 2021 17:00:15 +0000 (19:00 +0200)]
luci-mod-network: allow netifd version query to fail

Fixes: 17af33ee48 ("luci-mod-network: migrate network config depending on netifd version")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 34dc351303bad74c8f753c37788814796888129a)

3 years agoluci-base: fix `network` data type validation
Jo-Philipp Wich [Mon, 31 May 2021 09:39:15 +0000 (11:39 +0200)]
luci-base: fix `network` data type validation

Fixes: #5085
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit dece9b063c16790df731a08f8e73978c51b6c90d)

3 years agoluci-app-samba4: prevent calling split() on array or null values
Jo-Philipp Wich [Mon, 31 May 2021 09:25:54 +0000 (11:25 +0200)]
luci-app-samba4: prevent calling split() on array or null values

Since `uci.get()` may return null or array values, we cannot blindly call
split() on the result. Use the safe `L.toArray()` helper which is intended
to deal with such situations.

Also clean up whitespace while we're at.

Fixes: #5080
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit c4cdfcbe5121d5959dac1e18ed11b8611a86fb9e)

3 years agoluci-mod-network: split config migration into 2 steps
Rafał Miłecki [Sat, 29 May 2021 15:19:02 +0000 (17:19 +0200)]
luci-mod-network: split config migration into 2 steps

Problem with handling all migrations in 1 step is that uci.sections()
doesn't include changes queued using uci.callAdd() and uci.callSet().
That could result in unexpected behaviour and generating invalid
configs.

For the sake of simplicity and reliability use 2 steps migration. The
downside is that users may get prompted twice to migrate.

Reported-by: Hauke Mehrtens <hauke@hauke-m.de>
Fixes: 74be304e541f ("treewide: use "device" option in UCI "interface" sections")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Tested-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit e7c9c63c657963daa1a0d57dcb0848d88e909c25)

3 years agotreewide: drop MAC and MTU from interfaces (protocols)
Rafał Miłecki [Fri, 28 May 2021 07:58:12 +0000 (09:58 +0200)]
treewide: drop MAC and MTU from interfaces (protocols)

Those are L2 options that are not part of interfaces (L3), should not be
set there and don't work. Setting MAC and MTU should be done at device
layer (config device) and is supported for basic types already.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 79947af064122438c803f3b7bc580ede093a26e4)

3 years agotreewide: remove rendundant proto handler options
Jo-Philipp Wich [Thu, 6 Aug 2020 18:58:35 +0000 (20:58 +0200)]
treewide: remove rendundant proto handler options

The introduction of network device configuration support also implemented
all common, protocol-independent interface options directly in the
interface config view, so drop the redundant option definitions.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 171ef77e8985ffd90eb66b8a0a3cd74beb37ccdc)