Commit graph

3990 commits

Author SHA1 Message Date
Hannu Nyman
771eb787cc treewide: Backport translations from master
Backport translations from master and sync.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2022-11-12 23:10:27 +02:00
Hannu Nyman
ec905e6e97 timezone data: update to 2022f
Update timezone data to 2022f.
* http://mm.icann.org/pipermail/tz-announce/2022-October/000075.html

 -   Mexico will no longer observe DST after 2022, except for areas
     near the US border that continue to observe US DST rules.
     On 2022-10-30 at 02:00 the Mexican state of Chihuahua moves
     from -07 (-06 with DST) to year-round -06.
 -   Fiji will not observe DST in 2022/3.
     For now, assume DST is suspended indefinitely.
 -   Simplify four Ontario zones.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
[adapt the commit in master, lua instead of ucode]
2022-10-31 20:06:11 +02:00
Kevin Darbyshire-Bryant
2878b35deb luci-mod-status: nftables.js: correct icmp display
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit 6a03a88430)
2022-10-29 13:44:28 +02:00
Jo-Philipp Wich
e07607129e luci-mod-network: gracefully handle empty channel lists
Avoid undefined value access when the channel list is empty.

Fixes: #5937, #5951
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 9af8486517)
2022-10-27 16:13:47 +02:00
Hannu Nyman
bb3379797a timezone data: update to 2022e
Update timezone data to 2022e.
* http://mm.icann.org/pipermail/tz-announce/2022-September/000073.html
* http://mm.icann.org/pipermail/tz-announce/2022-October/000074.html

 - Palestine transitions are now Saturdays at 02:00.
 - Simplify three Ukraine zones into one.
 - Jordan and Syria switch from +02/+03 with DST to year-round +03.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
(cherry picked from commit 10d762eab7)
2022-10-24 19:03:41 +03:00
Viktor Tsvetkov
96ec0cd3cc sysauth: add autocomplete and id attributes to login inputs
this let browser automatically fill according to HTML spec for input elements.
luci-theme-bootstrap and luci-base are affected.

Signed-off-by: Viktor Tsvetkov <zwetvik@gmail.com>
[indentation fix]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 3e9d9a9dbb)
2022-10-15 14:32:27 +02:00
Jo-Philipp Wich
0a576fb158 treewide: resync and merge master translations
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-10-15 14:27:31 +02:00
Hannu Nyman
c0224f765f treewide: Backport and sync translations
Backport translations from master.
Sync.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2022-10-04 23:02:08 +03:00
Jo-Philipp Wich
b6b7da4ffa luci-mod-system: sshkeys.js: prevent XSS through pubkey comments
Ensure to not display public key comments verbatim in order to prevent
injection of markup.

Reported-by: Eric McDonald <ericmcdonald@protonmail.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 944b55738e)
2022-09-21 14:49:32 +02:00
Hannu Nyman
487e58a0a6 timezone data: update to 2022c
Update timezone data to 2022c.

http://mm.icann.org/pipermail/tz-announce/2022-August/000071.html
http://mm.icann.org/pipermail/tz-announce/2022-August/000072.html
* Iran no longer observes DST after 2022.
* Rename Europe/Kiev to Europe/Kyiv.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
(cherry picked from commit 10bcb228a7)
2022-09-03 00:32:08 +03:00
Hannu Nyman
b13d8c7a33 luci-mod-network: Offer ft-over-air by default for 802.11r
OpenWrt commit 2984a0420 (0588b124e in 22.03) changed the default 802.11r
Fast Transition method to be ft-over-air instead of ft-over-ds.

Offer ft-over-air as the first item in the drop-down list, so that
it gets selected by default when 802.11r option is enabled.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
(cherry picked from commit 2c3c7f5c50)
2022-09-01 18:13:38 +03:00
Hannu Nyman
17fde96892 treewide: Backport translations - i18n
Backport from master, sync.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2022-08-28 19:04:48 +03:00
Jo-Philipp Wich
08fb38399f luci-base: use different cookie names for HTTP and HTTPS
Since HTTP cookies may not overwrite HTTPS ("secure") ones, users are
frequently unable to log into LuCI when a stale, "secure" `sysauth` cookie
is still present in the browser as it commonly happens after e.g. a
sysupgrade operation or when frequently jumping between HTTP and HTTPS
access.

Rework the dispatcher to set either a `sysauth_http` or `sysauth_https`
cookie, depending on the HTTPS state of the server connection and accept
both cookie names when verifying the session ID.

This allows users to log into a HTTP-only LuCI instance while a stale,
"secure" HTTPS cookie is still present.

Requires commit 2b0539ef9d ("lucihttp: update to latest Git HEAD") to
function properly.

Fixes: #5843
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit e1932592c3)
2022-08-25 10:56:38 +02:00
Jo-Philipp Wich
d09fbe0bbf luci-base: sys.lua: make timeout optional when parsing conntrack entries
Fixes: #5909
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit abd9125fbf)
2022-08-01 11:59:09 +02:00
Jo-Philipp Wich
ee5a7c6fc5 luci-base: form.js: save parent map on opening nested modal map
Before opening (rendering) a nested modal map, make sure to save the parent
modal map in order to persist any structural uci changes, such as newly added
anonymous sections to prevent the nested map from operating on stale values
or ephemeral config section IDs.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 3be479446b)
2022-08-01 11:57:42 +02:00
Jo-Philipp Wich
156009aae3 luci-base: form.js: handle SectionValue objects in GridSection modals
The existing logic for cloning section options into the modal form section
container did not properly handle SectionValue objects. Introduce a new
`cloneOptions()` helper to recursively traverse and properly clowning
such nested sections.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f24606b1ff)
2022-08-01 11:57:42 +02:00
Jo-Philipp Wich
9780bc0152 luci-base: form.js: reset parent maps on returning from nested section modal
The nested section modal might have changed values also covered/displayed by
the parent map, so ensure to reload all parent maps in the current modal
view stack to ensure that no stale values are shown on return.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 0c81e25faa)
2022-08-01 11:57:42 +02:00
Jo-Philipp Wich
b556cdf93e luci-base: form.js: rework stacked modal CBI map logic
Only stack a new modal CBI map on top of the currently displayed modal one
if the related map or section differs. This prevents misbehavior when
switching the protocol of interfaces.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f2fa59e89a)
2022-08-01 11:57:42 +02:00
Hannu Nyman
3dd66c443a treewide: Backport translations - sync
Backport from master and sync.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2022-07-28 20:15:05 +03:00
Jo-Philipp Wich
9a18337350 luci-base: form.js: allow overriding section placeholder of TableSections
The existing implementation was hardcoding the empty TableSection placeholder
instead of invoking `renderSectionPlaceholder()` which might be overridden by
various forms.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 818776451d)
2022-07-23 13:53:42 +02:00
Jo-Philipp Wich
f5ebd6ec5b luci-base: form.js: remove stray <br> elements from section placeholder
Theme CSS styles shoudl take care of introducing padding as needed.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit e4e001b596)
2022-07-23 13:53:42 +02:00
Jo-Philipp Wich
e06751f5a3 luci-base: form.js: trim option description
If a whitespace-only description is set on an element, the CSS :empty
selector will not match, causing description icons to be shown when
there's no actual content.

To avoid that, trim the description string when building the element.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit b6ae1d4f4a)
2022-07-23 13:53:42 +02:00
Jo-Philipp Wich
8d9e9775ec luci-base: form.js: minor tweaks for mobile styling
- Annotate gridsection textvalue cells as CBI.DummyValue widgets
 - Replace `<br>` elements with newlines in `stripTags()`

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 9c136c9bea)
2022-07-23 13:53:42 +02:00
Jo-Philipp Wich
1e7d9e4461 luci-base: form.js: fix removing just created named GridSection
Since the `handleModalSave()` handler of the GridSection class invokes
`handleModalCancel()` after saving the data but before removing the
`addedSection` property, the `handleModalCancel` handler incorrectly
removed the uci section that has just been created.

This bug didn't affect anonymous GridSections because after saving the
id of the created section changes, causing the remove command to fail,
but for named ones with stable section IDs, the bug manifested.

Solve the issue by passing a flag to `handleModalCancel()` indicating
whether the method was called from a safe operation and use it do
decide whether to delete the new staged uci section or not.

Fixes: #5760
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 2771360108)
2022-07-23 00:15:06 +02:00
Jo-Philipp Wich
df15ea39ff luci-base: uci.js: prevent sending empty uci set operations
Under certain circumstances, a staged uci option value might get unset
again before saving the config, leaving an empty section change set
behind, causing the save call to send an empty uci set request via rpc,
triggering an ubus code 4 (Resource not found) error.

In particular this prevented bridge VLANs from getting saved properly.

Fixes: #5876
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 25dcd0b77c)
2022-07-23 00:14:38 +02:00
Jo-Philipp Wich
f19d41cb14 luci-mod-network: demote WPA-PSK to "low" security in the choice list
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit ef7fe79ffc)
2022-07-12 16:13:03 +02:00
Alexander Georgievskiy
6731190ac8 luci-mod-status: nftables.js: fix OOM on big nftables IP sets
Signed-off-by: Alexander Georgievskiy <galeksandrp@gmail.com>
(cherry picked from commit 88c62fe218)
2022-07-08 15:28:21 +02:00
Hannu Nyman
ee5576f5e3 treewide: backport and sync tranlations
Backport translations from master.
(also remove the erronenous Portuguese translations from English)

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2022-07-03 13:37:08 +03:00
Jo-Philipp Wich
c4e1fcd458 treewide: sync with master translations
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-06-21 23:58:54 +02:00
Jo-Philipp Wich
28d70baeaa luci-mod-network: wireless.js: fix typo in description string
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit 53a998895b)
2022-06-21 23:55:21 +02:00
Jo-Philipp Wich
ac36cb549f treewide: sync with master translations
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-06-21 12:30:45 +02:00
Jo-Philipp Wich
42cc1b402a luci-mod-network: wireless.js: expose wifi-iface macaddr option
Fixes: #5845
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f039069ac5)
2022-06-21 08:57:41 +02:00
Jo-Philipp Wich
b528725635 luci-base: remove redundant english translations
Drop translations that match the msgid as well as stry, misplaced spanish
ones.

Ref: https://forum.openwrt.org/t/openwrt-22-03-0-rc4/129874/50
Ref: https://forum.openwrt.org/t/openwrt-22-03-0-rc4/129874/60
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit cc3d97ccec)
2022-06-20 11:25:41 +02:00
Jo-Philipp Wich
8a4486a792 luci-base: network.js: consider uci config for Device.getType()/getParent()
For network devices declared in uci but not yet created by netifd, the
runtime status information will be unavailable, causing methods such as
`getType()` to assume plain ethernet interfaces and `getParent()` to fail
resolving parent devices.

Fall back to infer the information from uci configuration settings in such
cases to give accurate type hints to callers.

In particular, this prevents LuCI from turning wireless target networks
containing a to-be-created bridge device into bridges themselves.

Fixes: https://github.com/openwrt/packages/issues/18768
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 8effea58d7)
2022-06-16 09:53:14 +02:00
Hannu Nyman
2b78a18d7b treewide: Backport translations and sync
Backport translations from master.
Sync.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2022-06-12 19:51:16 +03:00
Jo-Philipp Wich
ef99568d88 luci-base: ui.js: warn about connectivity loss on changing iface settings
If specific settings such as the protocol, IP address or netmask of an
interface the user is connected to are changed, the apply/rollback
mechanism might interfere. Display an additional warning dialog in this
case, instructing the user to manually reconnect and offering to continue
with a less safe unchecked apply mechanism.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 733ee9a7b6)
2022-05-20 20:24:28 +02:00
Jo-Philipp Wich
ea5f85f3f0 luci-base: ui.js: make "Apply unchecked" available from the changes dialog
Previously, "Apply unchecked" was only possible from the save action of CBI
maps, allow to invoke it from the configuration change dialog as well.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 8583efb5a9)
2022-05-20 20:24:27 +02:00
Jo-Philipp Wich
514a459b9b luci-base: ui.js: gracefully handle failing confirm calls on rollback
Do not abort the poll loop if some confirm request attempts fail, which
might happen when the device starts rolling back its configuration.

Before that fix, the rollback information dialog offering an unchecked
apply was not reliably presented in such situations.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit b6797821b8)
2022-05-20 20:24:27 +02:00
Jo-Philipp Wich
07cf1a33a2 luci-base: fix DSL feature detection
On boards with ADSL instead of VDSL support we need to expect an
`/sbin/dsl_cpe_control` instead of an `/sbin/vdsl_cpe_control` executable.

Ref: https://forum.openwrt.org/t/dsl-line-stats/126580
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 111c551cdb)
2022-05-20 20:23:26 +02:00
Jo-Philipp Wich
ec7cadc37e luci-mod-network: routes: allow prefixes as route source
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 904c174caf)
2022-05-20 20:23:26 +02:00
Jo-Philipp Wich
02913bef60 luci-mod-system: enforce availability of english as language choice
Always offer english, regardless of whether a dummy language pack for it
is installed or not.

Fixes: #5783
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit c2eb30bba7)
2022-05-20 20:23:26 +02:00
Jo-Philipp Wich
f777bf78c1 luci-mod-network: diagnostics: peg max traceroute hops to rpc timeout
In the worst case, traceroute might take up to 30s to complete when tracing
a completely unreachable path, due to the default limit of 30 hops multiplied
by the per-hop deadline of 1 second (-w 1).

Limit the maximum amount of hops to the configured rpc execution timeout,
20 second by default, in order to avoid running into timed out rpc requests.

Fixes: #5782
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 1ae142d7d1)
2022-05-20 20:23:26 +02:00
Jo-Philipp Wich
3886866ad6 luci-mod-status: hide iptables firewall status when nft is present
Do not expose the iptables status page as menu item when nftables is present
on the system. Instead add a warning banner to the nftables status page
directing the user to the hidden iptables status page when we encounter
legacy rules on the system.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 2f80fe3767)
2022-05-20 20:23:26 +02:00
Jo-Philipp Wich
f29452ced0 luci-base: dispatcher.lua: support "absent" fs dependency for menu nodes
The "absent" dependency type requires the given path to not exist on the
local system for the condition to be satisified. This is useful to disable
menu nodes depending on the presence of specific files.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 2e4b5fb8ff)
2022-05-20 20:23:26 +02:00
Chen Minqiang
272611d74e luci-mod-network: switch: Fix multi instances handling
Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
(cherry picked from commit d65c5e6496)
2022-05-20 20:23:26 +02:00
Jo-Philipp Wich
791e458a77 luci-mod-status: nftables: add translations for further expression kinds
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f2f7e0c1f7)
2022-05-20 20:23:26 +02:00
Hannu Nyman
b8e6cdda04 treewide: Backport translations and sync
Backport from master, sync.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2022-05-15 20:12:41 +03:00
Alexey Dobrovolsky
26fcbd5df2 luci-mod-system: add interface selection for NTPD
UCI option `interface` for sysntpd server was introduced in
OpenWrt commit 4da60500ebd2. NTP server binds to the specified interface,
or if unspecified, to all.

This patch adds selection widget to LuCI.

Signed-off-by: Alexey Dobrovolsky <dobrovolskiy.alexey@gmail.com>
(cherry picked from commit 24ac5a2bf6)
2022-05-10 03:05:31 +03:00
Jo-Philipp Wich
66994a580e luci-base: sys.lua: fix parsing conntrack entries without timeout
Flow offloaded conntrack entries carry no timeout value and trip up the
record parsing routine. Adjust the code to properly deal with such entries.

Ref: https://forum.openwrt.org/t/offloading-breaks-connections-list/126423
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 531c0ecff2)
2022-04-29 12:18:35 +02:00
Jo-Philipp Wich
4c263cff5c luci-mod-network: avoid needlessly writing none RA flags
Fixes: #5725
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit f04011f068)
2022-04-27 12:20:07 +02:00