14721 Commits

Author SHA1 Message Date
Rafał Miłecki
5356e3fa25 luci-mod-network: add bridge interface migration
LuCI now supports the updated UCI syntax for bridges that requires:
1. device section for L2
2. interface section for L3

Check for legacy syntax usage and offser user a migration to allow
changing network config.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit bca76a767316a689d59dfd4974dcb7bfb04db1e8)
2021-05-27 12:19:08 +02:00
Rafał Miłecki
660156e166 luci-mod-network: use "ports" option for setting bridge ports
netifd has been recently patched to use more accurate "ports" option
instead of "ifname"

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit a90115cd82372eaaa0ed531800b568387e200c97)
2021-05-27 12:19:08 +02:00
Rafał Miłecki
8623436678 luci-mod-network: drop support for *editing* legacy bridges
The old way of defining bridge (L2) as part of interface (L3) is
deprecated. All such configs should be migrated to define bridge as L3
UCI section type "device".

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit ec020cee0c44793f8ce1b346675c6a36e63b0154)
2021-05-27 12:19:08 +02:00
Rafał Miłecki
cdaf5635b2 luci-mod-network: drop support for *adding* legacy bridges
The old way of defining bridge (L2) as part of interface (L3) is
deprecated. Don't support *adding* interfaces like that.

Support for *editing* legacy bridges is kept for now for compatibility
with existing legacy setups.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit b7f3cf66cadf6753153bc9d1feac1eca0c7e37f0)
2021-05-27 12:19:08 +02:00
Jo-Philipp Wich
220f5006af luci-mod-network: fix device section cleanup
Ensure that device sections are only automatically removed after all
related options have been parsed, to avoid prematurely deleting sections.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 2072c66c5a4b755a6ed16bb6486afb956a475be9)
2021-05-27 12:19:05 +02:00
Jo-Philipp Wich
e7a9d9e4bd luci-mod-network: allow disabling interface->device option migration
Introduce a `migrate` properties which selectively allows disabling the
`config interface` to `config device` migration logic for single options.

Use the new flag to disable migration of the "ipv6" option which has
different semantics in interface and device sections.

Ref: https://forum.openwrt.org/t/pppoe-disable-ipv6/92548
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 935e9a3c3430db5fad1004926ddfa2e35a950be5)
2021-05-27 12:19:05 +02:00
Jo-Philipp Wich
9f76002dae luci-mod-network: fix changing ifname in disabled legacy bridge mode
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 7dde01be3cc197f79bc6812a2c912c1889dbf1ee)
2021-05-27 12:19:05 +02:00
Jo-Philipp Wich
08f5bc236e luci-mod-network: make condition for disabling legacy bridging more specific
Only disable legacy bridging if an existing network.device section with type
bridge is found, ignore non-type sections since those do not declare a
bridge but set attributes on top of an existing one.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f48f9f11e7f6e3d74e2fd4b6b2478e5673f2f459)
2021-05-27 12:19:05 +02:00
Jo-Philipp Wich
8c2ea08aa8 luci-mod-network: fix unsetting network.device options
The existing logic only handled removing the last remaining device section
option (which results in the deletion of the entire section) but failed to
actually unset single options.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit b9fad85f2e3fc988528fd326db715719288604ea)
2021-05-27 12:19:05 +02:00
Jo-Philipp Wich
216ddcce71 luci-mod-network: don't implicitly move bridge opts into device sections
When setting bridge and device specific options such 'stp' or
'igmp_snooping', LuCI so far transparently created or reused a
`config device` section and set the corresponding option there.

In the case of bridges, this triggers multiple problems:

 - When implicitely creating a `config device` section referring to the
   bridge device, the legacy bridge configuration of the corresponding
   interface is disabled, causing a broken configuration on subsequent
   save operations

 - Netifd does not appear to properly merge bridge settings from config
   device and config interface sections, leading to an incoherent
   configuration state

In order to avoid that issue, do not automatically migrate bridge specific
options.

Fixes: #4948
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit a9a223b973c7f5f057d19a7fc09e7364087fec79)
2021-05-27 12:19:05 +02:00
Jo-Philipp Wich
dec5d8099e luci-mod-network: fix handling of peerdns/dns/dns_search options
The previous change didn't take dynamic dependency mangling into account.

Fixes: 2bfd4908a9 ("luci-mod-network: restore DNS option semantics for proto static")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 9a92f9c7615f710a7934cccc8ac23902247c154b)
2021-05-27 12:19:05 +02:00
Jo-Philipp Wich
7684c18604 luci-mod-network: restore DNS option semantics for proto static
The peerdns settings makes little practical sense for proto:static
interfaces, so revert to allow setting the DNS server list directly.

Fixes: faad7464a8 ("luci-mod-network: add support for network.device sections")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 2bfd4908a9cfeac74c7abc31d8cef0bf1e58af52)
2021-05-27 12:19:05 +02:00
Jo-Philipp Wich
a3ec9b262d luci-mod-network: fix legacy bridge configuration
Ref: https://github.com/openwrt/luci/pull/4307#issuecomment-803432603
Fixes: faad7464a8 ("luci-mod-network: add support for network.device sections")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit edf640af583de122b020d215aadd141028c9458f)
2021-05-27 12:19:05 +02:00
Jo-Philipp Wich
7147b37a24 luci-mod-network: fix invalid variable access when creating interfaces
Fixes: eeef38d534 ("luci-mod-network: add support for bridge vlan filtering")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 1c4284150dff9d37503f6f901d047c0caa9a3af0)
2021-05-27 12:19:05 +02:00
Jo-Philipp Wich
dfd499b4d4 luci-mod-network: fix opacity for device icon tooltips
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit bea7b8dc7cd7231d7ec6ab82fcc80dfaec699326)
2021-05-27 12:19:05 +02:00
Jo-Philipp Wich
f366dfe484 luci-mod-network: tools.network: handle bridge config and vlan corner cases
- Disable interface-level bridging if a corresponding br-$name bridge
   already exists as device declaration

 - Exempt wireless interfaces from bridge port configuration, they can only
   be attached indirectly through "option network"

 - Consider bridge ports from both "option ifname" in interface/device
   sections and from "option ports" in bridge-vlan ones

 - Small fixes for rendering quirks

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 14fdce0fcdfe39ff4143b294a1f1f65d7c783ce7)
2021-05-27 12:19:05 +02:00
Jo-Philipp Wich
482f342d25 luci-mod-network: allow wifi bridging with bridge or bridge vlan ifaces
Recent netifd automatically adds wireless devices as bridge ports if the
layer 2 device referenced by the "config interface" target network is a
Linux network bridge or a VLAN interface on top of a network bridge.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 3b4c161e01e2bd19105c123fbec463bc069d637b)
2021-05-27 12:19:05 +02:00
Jo-Philipp Wich
470848fac9 luci-base: network.js: recognize DSA ports and bridge VLANs
Use the newly introduced devtype attribute for more robust network device
type detection. This also allows us to easily recognize DSA ports.

Furthermore, synthesize VLAN devices declared by uci bridge-vlan sections,
similar to how it is done for legacy swconfig switch_vlan ones.

Finally implement a new Network.Device.getParent() method to use the newly
available "parent" attribute to resolve the base device of DSA ports or
VLAN devices.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit d1bf56d7f178f1b7582d7b3600ee70e65128ccfa)
2021-05-27 12:19:05 +02:00
Jo-Philipp Wich
15ae326879 luci-mod-network: add support for bridge vlan filtering
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit eeef38d53412a78f185f0bb53153ecb3fe9e8838)
2021-05-27 12:19:05 +02:00
Jo-Philipp Wich
e75ac2ae34 luci-mod-network: add support for network.device sections
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit faad7464a8ed88a251c621dc92e8cbfb146bcd7f)
2021-05-27 12:19:04 +02:00
Jo-Philipp Wich
9e57b782aa luci-mod-network: interfaces.js: simplify some code using new ui helpers
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 069a97e55c9a44c366db2003944d40238dfc2620)
2021-05-27 12:19:04 +02:00
Oleksandr Pastushkov
5047592f77 luci-mod-network: issue with breakdown of dnsmasq after duplication of static IP was fixed
Before this commit, assigning the same static IP address to two
different hosts disabled dnsmasq.

Logic of adding a new static lease was modified. If user try to assign a
new MAC address to already reserved IP, old lease will be modified (list
of MAC addresses will be extended by new MAC) instead of creation a new lease with the same IP.

Signed-off-by: Oleksandr Pastushkov <oleks.pastushkov@gmail.com>
(cherry picked from commit 463e910119813aaea0755ff5c16c91ce412a8cbb)
2021-05-27 12:18:42 +02:00
Rafał Miłecki
a5586749d0 luci-mod-network: drop duplicated "Master" option
It got accidentally added while cherry picking RA and NDP params
support.

Fixes: 3a9ebc537f63 ("luci-mod-network: Introduce new RA and NDP params with help-text.")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-05-27 08:41:14 +02:00
Hannu Nyman
d851570070 treewide: backport i18n translations from master
Backport translations.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-05-26 19:11:37 +03:00
Liangbin Lian
ac0bcc2d10 luci-theme-material: fix wrong active state on common prefix node
Before fixed, if we have two nodes: 'services/ddns' and 'services/ddnsto',
click any one of they, will show they all actived.

Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
(cherry picked from commit 97d50d2c6b80805cd7e513eeafc8b62fef4ab1b6)
2021-05-26 10:09:05 +03:00
Liangbin Lian
19de3acdde luci-app-samba4: support listen on multiple interfaces
/etc/init.d/samba4 already support that

Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
(cherry picked from commit 169ab9979eee780758256c2859f7c2ee86a0b0ae)
2021-05-25 20:04:30 +03:00
Hannu Nyman
53c572ac9b treewide: i18n - Backport translations
Backport translations from master and sync.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-05-16 20:52:12 +03:00
Jo-Philipp Wich
e2abb45b0e luci-mod-status: fix potential XSS via specially crafted DNS names
When an upstream NS returns PTR domain names containing HTML, it is
added verbatim to the connection status table.

Prevent this issue by HTML escaping any values in the source and
destination columns.

Fixes: CVE-2021-32019
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 3c66c5b1651aa25afbff09bee45047da9a0ba43d)
2021-05-12 12:03:00 +02:00
Hannu Nyman
766e8f8cbf treewide: backport translations i18n
Backport translations.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-05-08 17:05:54 +03:00
Jo-Philipp Wich
e9b6431b14 luci-mod-status: iptables: always make tab pane visible
When ip6tables is not present, the tab group was not initialized,
causing the iptables status display to be empty with certain themes.

Manually mark the pane active in this case to avoid the problem.

Fixes: #5040
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit d24e3295f004c87722ad59927738f208a2a84ac5)
2021-05-07 19:19:35 +02:00
Paul Spooren
56c323505b luci-app-attendedsysupgrade: fix branch detection
The running branch determines which upgrades are suggested. A jump to a
newer branch (e.g. 19.07.8 to 21.02.1) is only suggested if the advanced
mode is enable, since it may break the router.

OpenWrt versions end in either `-SNAPSHOT`, `.X-rcY` or `.x`. All these
suffixes are removed, resulting in the branch name.

Previously the `-SNAPSHOT` suffix wasn't removed resulting in wrong
branch names.

Also clean up some log spam.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 85e9ee31239c4e912613005f4c222f13c34e9a36)
2021-05-07 03:45:32 -10:00
Paul Spooren
29d3ed290c luci-app-attendedsysupgrade: hide branch update
Branch updates (e.g. 19.07 to 21.02) are risky and shouldn't be
suggested by default. Hide those unless the advanced mode is enabled.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 9184721fab65934fe016c132a8f11a2308742f92)
2021-05-07 03:45:32 -10:00
Florian Eckert
424d11381b luci-app-mwan3: i18n sync translations
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2021-05-06 12:27:00 +02:00
Florian Eckert
0ddb72dec2 luci-app-mwan3: fix css status with
This commit fixes the width of the mwan3 status page for the
openwrt-2020 theme.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 6fa40fffcaa6015633e1e7426ff1f0bae61597c9)
2021-05-06 12:23:21 +02:00
Florian Eckert
ea334e254e luci-app-mwan3: add i18n to status page
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 2b0fbcb0c88fb073745ec99974c12f363b771ac2)
2021-05-06 12:23:12 +02:00
Florian Eckert
d31345fc77 luci-app-mwan3: update status page for no tracked interfaces
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 4fee871630dec3b6bfbfb6dadc1580f0e3edf830)
2021-05-06 12:23:04 +02:00
Florian Eckert
942288b4fa luci-base: i18n sync translations
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2021-05-04 09:17:11 +02:00
Sven Roederer
1a59584167 luci-base: change button-text from Dismiss to Close in UCI changes overview
Change the left button of the UCI Apply-changes overview to the more correct
function close. This also avoids confusion between Dismiss and Revert, which
translate to the same in german.

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
(cherry picked from commit b56912d9fcf6acb0ba3008de3df15188318376f2)
2021-05-04 09:16:12 +02:00
Florian Eckert
9dc93d5d2f treewide: i18n sync translations
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2021-05-04 09:16:04 +02:00
Dirk Brenken
11cfd83648
luci-app-banip: switch IP query provider
* switch to IPWHOIS.IO for IP report queries, the IP geolocation API is
  more accurate & faster

Signed-off-by: Dirk Brenken <dev@brenken.org>
2021-05-02 22:11:25 +02:00
Dirk Brenken
0eb4e0911a
luci-app-travelmate: typo fix
* typo fix & sync translations

Signed-off-by: Dirk Brenken <dev@brenken.org>
2021-05-01 11:11:32 +02:00
Paul Spooren
33aa61ff25 luci-app-attendedsysupgrade: add target in reuqest
The updated ASU api requires `target` within reuqests since the
`profile` or `board_name` is never truely unique. This is especially a
problem for x86 devices which mostly use `generic` as profile name.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit c6b4d4ab5a2c57889bcf14fafac17e73d22205c6)
2021-04-28 01:31:04 -10:00
Hannu Nyman
a27b10dd36 treewide: i18n - backport translations from master
Backport translations from master.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2021-04-27 23:31:27 +03:00
Jo-Philipp Wich
9344026efd luci-app-statistics: treat APC UPS "host" setting as single value option
Existing Lua code incorrectly stated that the "Host" option takes a space
sparated list of hostnames which is not the case since the collect plugin
does not handle multiple hosts.

This change reverts the configuration to a simple value as proposed by
the original PR and adjusts the config summary accordingly, while retaining
the translation string.

Ref: https://github.com/openwrt/luci/pull/5010#issuecomment-827285319
Fixes: dd5d96afd ("luci-app-statistics: fix APC UPS host configuration")
Fixes: e7d22dce5 ("luci-app-statistics: convert collectd configuration to client side views")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 8816c8fff7e8e30f19e85c0f1c7f70b6914be701)
2021-04-27 10:18:14 +02:00
Jo-Philipp Wich
a6efaee0dc luci-app-statistics: fix APC UPS host configuration
Ensure that list of hosts is stored as space separated list, like it was
done in the previous Lua implementation.

Fixes: #5010
Fixes: e7d22dce5 ("luci-app-statistics: convert collectd configuration to client side views")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit dd5d96afdba698e11d12880f4adf28e24a140305)
2021-04-26 17:41:19 +02:00
Dirk Brenken
bbc677096d
luci-app-banip: sync with banIP 0.7.7
* support the new 'Whitelist Only' mode
* sync translations

Signed-off-by: Dirk Brenken <dev@brenken.org>
2021-04-22 06:04:22 +02:00
Florian Eckert
a7845594f5 luci-app-dockerman: Carelessness fixed during branch rebasing
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit c4f3ac05288ba148fcd5c0222f34f393dbec57a2)
2021-04-21 23:00:29 +02:00
Hannu Nyman
af7a61d3a6 luci-mod-network: fix handling of optional RA/NDP options
Fix the handling of optional IPv6 RA and NDP options
that were exposed to LuCI with 504bdb23f

Commit 504bdb23f defined them optional but provided default values.
Those values might get unnecessarily written to /etc/config dhcp when
the the user modifies some other values. Remove the default values,
but provide placeholder for some of them.

Add the missing optional definition to 'ndproxy_routing'.
(It is a flag, so optional default values do not get written to
the config file.)

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
(cherry picked from commit b7dd10da0fcdc9c69857d848ce1d47243998a22c)
2021-04-20 21:13:33 +03:00
Florian Eckert
7d913b9976 luci-app-dockerman: update I18n
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2021-04-19 16:27:34 +02:00
Florian Eckert
0e664b6c56 luci-app-dockerman: revised the information for the individual page
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit ad05a0187bb9b03ba5ac9df27159f54521e15e18)
2021-04-19 16:26:45 +02:00