15552 Commits

Author SHA1 Message Date
Jo-Philipp Wich
92dd6a7808 luci-proto-wireguard: configuration import improvements
- Reword texts in import dialogs for better clarity, use different
   descriptions for full import and peer import

 - Allow importing configurations without [Peer] section

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 2ae74b909b4acf35b72142d913f9e61090febf6d)
2022-08-01 11:57:42 +02:00
Jo-Philipp Wich
bf5d9d4a0f luci-proto-wireguard: gracefully deal with missing uci configs
The /etc/config/ddns in particular might not be present on the system,
don't fail if it is absent.

Fixes: #5838
Fixes: 9ba20645b0 ("luci-proto-wireguard: rewrite protocol handler")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 340183786e5441197141efaf7d8cf0e682047bfe)
2022-08-01 11:57:42 +02:00
Jo-Philipp Wich
ae2b636612 luci-proto-wireguard: grant uci read access to system and ddns config
The configuration export requires access to /e/c/system and /e/c/ddns for
external hostname hints.

Fixes: #5838
Fixes: 9ba20645b0 ("luci-proto-wireguard: rewrite protocol handler")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 4769bf11aa5d33cda4785faec8046c67cb51a606)
2022-08-01 11:57:42 +02:00
Jo-Philipp Wich
de6638b794 luci-proto-wireguard: rewrite protocol handler
This commit rewrites large chunks of the WireGuard protocol handler in order
to simplify the process of importing and exporting configuration. The major
changes are:

1) The wireguard interface configuration tab (General Settings) gained an
   import assistant which allows dragging or pasting a native WireGuard
   configuration file in order to import required settrings into uci

2) The peer configuration tab gained a similar import assistant which allows
   importing the settings for a WireGuard peer from an existing native
   WireGuard configuration file

3) The QR code export feature has been rewritten to make the resulting codes
   actually useful for importing into a WireGuard client application.
   Additionally the plaintext native WireGuard configuration is displayed
   to allow copy-pasting it for use on a Linux or OS X system

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 9ba20645b01aacb391ab8c69f57b3da60db8f630)
2022-08-01 11:57:42 +02:00
Lukas Voegl
c1ab5148cc luci-proto-wireguard: add generate psk button
Signed-off-by: Lukas Voegl <lvoegl@tdt.de>
(cherry picked from commit b6925a12277224b4a02dc1febb58de8d4d6fdbe0)
2022-08-01 11:57:42 +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 3be479446bdeaf446468c5e7ac3b9bc49da023da)
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 f24606b1ffd59cc82c7251243a18f4cfdc4f78d5)
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 0c81e25faa9ff9cb6edec477d56145d70be87cf3)
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 f2fa59e89af3d4bdae9b12471184425b307ad5d6)
2022-08-01 11:57:42 +02:00
Paul Spooren
69231a7d62 luci-app-attendedsysupgrade: s/res/response/
The variable was party called `res` or `response`, always call it
`response` from now on. This also solves a typo where
`data.request_hash` is never set to a correct value.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit af23d0dfc3176511ada5fb3d081f1b0a287a11bc)
2022-07-29 17:02:33 +02:00
Paul Spooren
ce09206d62 luci-app-attendedsysupgrade: request filesystem
It is possible to request a specific filesystem so no other filesystems
are used. This speeds up the build process and may prevent failures in
edge cases.

A recent edge case is installing more packages than ext4 can handle
while squashfs works fine due to compression.

Since  `rootfs_type` is now always available via `procd`, remove the
hack of reading `/proc/mounts`.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 8936e3c386e77c2dc090dbbd5a87907196f9149b)
2022-07-29 17:01:44 +02:00
Paul Spooren
aeeac6d0c5 luci-app-attendedsysugprade: allow to reinstall image
Now it's possible to re-install the currently running version in
advanced mode. This can be useful when installing packages via `opkg`
and then requesting the firmware with the packages stored in squashfs.

FIXES: https://github.com/openwrt/luci/issues/5809

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit fd72e1c23ef1569fd8f8ab71bdcb4a94f802435a)
2022-07-29 16:51:49 +02:00
Paul Spooren
d0828b3672 luci-app-attendedsysupgrade: report used client version
This allows the backend to track popular app versions and drop support for
unsed version in case of API changes.

Specifically the app sends a version string in the format "luci/GIT_HASH" to
the backend.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit f368faf6789a43c2e1a26b721f8115473672eb29)
2022-07-29 16:50:37 +02:00
John Kohl
010119fb5a luci-app-watchcat: add support for run_script mode
Signed-off-by: John Kohl <jtk.git@bostonpog.org>
(cherry picked from commit ae5677b8c24b7be5cbca5dbef00178b88a1161ac)
2022-07-29 08:18:19 +02:00
John Kohl
adeb2baa3a luci-app-watchcat: add support for IP family selection
Signed-off-by: John Kohl <jtk.git@bostonpog.org>
(cherry picked from commit 20fdd8dd9d0c90c9fb157c6314d6ae32e7f4d39c)
2022-07-29 08:18:06 +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 818776451d96e8f1a187eafca4a5ebbf0770fbde)
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 e4e001b59657e4cd0f333a3f43ce66b8f789deb2)
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 b6ae1d4f4aec94b38e59b11e5fd9c28799dae05b)
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 9c136c9beaa7639aecc351c5725de33cfe4d2e5c)
2022-07-23 13:53:42 +02:00
Jo-Philipp Wich
69d981aea3 luci-proto-ncm: rename service option to mode
Package luci-proto-ncm depends on comgt-ncm which uses an option
called 'mode' to set the radiomode of the modem. There is no option
'service' in the comgt-ncm scripts.

Suggested-by: breenstorm <49235337+breenstorm@users.noreply.github.com>
[fix commit subject, add commit message, rebase onto master branch]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 4d6642b636a9feaa173c568c99f4129c440ed8b8)
2022-07-23 13:19:46 +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 2771360108cb3e2011c7c9cb4921a9047ea70910)
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 25dcd0b77c4450b83cd8b8307397e58c34ebfcd1)
2022-07-23 00:14:38 +02:00
Jo-Philipp Wich
cd97091715 luci.mk: ignore language directories not explicitly mentioned
Only create translation packages for languages mentioned in luci.mk

Fixes: #5886
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-07-22 16:11:42 +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 ef7fe79ffc4a0725d51eb554db02fd8e3e73534d)
2022-07-12 16:13:03 +02:00
Jo-Philipp Wich
e0f0502b22 luci-app-ddns: fix broken translation call
Fixes: #5874
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(backported from commit 57b88211c14dd71da44b537ac9062f99e1efbe80)
2022-07-12 15:45:01 +02:00
Jo-Philipp Wich
be3df7c2e2 lucihttp: update to latest Git HEAD
6e68a10 utils: also compare attribute name length in lh_header_attribute()
7b721af testcases: adjust urldecode tests

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 2b0539ef9d1849b42fae206f0647bc647323c75d)
2022-07-08 15:29:19 +02:00
Markus Stockhausen
a57db983db rpcd-mod-luci: update filter for rpc_luci_get_network_devices
When kernel bonding module is loaded it will create a special
file /sys/class/net/bonding_masters. This is no network device.
Filter it out for getNetworkDevices() call.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
(cherry picked from commit 77d29c9dc0226faa9374ca25fba8dc642c99f303)
2022-07-08 15:29:10 +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 88c62fe2187ebf28937cb49f880dada09937b194)
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 53a998895b81ac393d1a9d62e4c3ae0e8708515b)
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 f039069ac52e0da00ce9f3486926fbddd29a6ea0)
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 cc3d97ccecec041128462d44d85f9393a502f60e)
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 8effea58d7281fd4f2b6c31d534195dba27a850b)
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
28e92e3f8c luci-app-opkg: fix parsing package dependencies with version constraints
Due to improper ordering of regexp alternatives, version constraint operators
might get undermatched.

Fixes: https://github.com/openwrt/openwrt/issues/9982
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit b84791bd029c2aaa67cbc06a15d23828f62f4608)
2022-06-03 13:38:01 +02:00
Dirk Brenken
69cbdb87e0
luci-app-banip: mark as broken
banIP 0.7.x is not compatible with new nft firewall (default in master and 22.03).
Mark the package as BROKEN for now.

Signed-off-by: Dirk Brenken <dev@brenken.org>
(cherry picked from commit 8837f7608adf770ff33249821d28da097324c54d)
2022-05-27 21:32:44 +02:00
Jo-Philipp Wich
d8ecf48f20 luci-theme-bootstrap: restore initramfs warning
Restore accidentally removed the initramfs boot warning banner.

Ref: 8055acc9be (commitcomment-73447330)
Fixes: 8055acc9be ("luci-theme-bootstrap: overhaul styles")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 56fab648caa78422aac47ab8cec168e8a0999316)
2022-05-21 18:27:45 +02: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 733ee9a7b6312e9b5fe2a4aa8107baf5379602ab)
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 8583efb5a92785fd56ff4abb0ce56a142eb6602f)
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 b6797821b86678d8dd604ce4805691784e6dc3ce)
2022-05-20 20:24:27 +02:00
Jo-Philipp Wich
e57aaf808d luci-theme-bootstrap: use medium dark text color for version footer
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit c40dd71b84f291ad0db0f28670e1e3979a4c51b0)
2022-05-20 20:23:26 +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 111c551cdb8d14e8e5ef7c7a66ffdceb6d3cbb55)
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 904c174cafe46a6414058d242df279c09e23be29)
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 c2eb30bba7451d16e1de37411624b2bcc449c037)
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 1ae142d7d11862b11a6e0cea06562875cc778ae7)
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 2f80fe3767207e2dbb8c5286603f49808b66a60d)
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 2e4b5fb8ff2fb3bfd1400bf7cbf721057f02fab9)
2022-05-20 20:23:26 +02:00