Commit Graph

1696 Commits (master)

Author SHA1 Message Date
Mustafa Can Elmacı ae8bbb814f treewide: HTML Cleanup
* HTML Cleanup: Meta tags.
* Converted charset to shorthand.
* Removed meta tags with `Content-Script-Type` attribute. (Invalid in HTML5 spec.)

* HTML Cleanup: CSS tags.
* Removed `type` attribute with CSS files from link tags. (HTML5 spec recommends omitting it.)
* Removed `type` attribute from style tags. (Deprecated in HTML5 spec.)
https://html.spec.whatwg.org/#attr-link-type
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style

* HTML Cleanup: Convert from XHTML to HTML5
* Removed XML declaration.
* Removed XML namespace.
* Changed doctype to HTML5.

* HTML Cleanup: CDATA tags.
* CDATA sections should not be used within HTML they are considered as comments and not displayed.
https://developer.mozilla.org/en-US/docs/Web/API/CDATASection

* HTML Cleanup: Script tags.
* Removed `language` attribute from script tags. (No longer valid in HTML5)
* Removed `type` attribute with JavaScript MIME type from script tags. (HTML5 spec recommends omitting it.)
https://html.spec.whatwg.org/multipage/scripting.html#attr-script-type
https://mimesniff.spec.whatwg.org/#javascript-mime-type

Signed-off-by: Mustafa Can Elmacı <mustafacan@elmaci.net>
2024-11-22 22:39:46 +01:00
Anari Jalakas 44fbd008fb luci-lib-nixio: fix build error with LTO
Adding $(FPIC) parameter fixes building with CONFIG_USE_LTO enabled.

Signed-off-by: Anari Jalakas <anari.jalakas@gmail.com>
2024-11-17 23:23:42 +01:00
Anari Jalakas 5de203082f luci-lib-jsonc: fix build error with LTO
Adding $(FPIC) parameter fixes building with CONFIG_USE_LTO enabled.

Signed-off-by: Anari Jalakas <anari.jalakas@gmail.com>
2024-11-17 23:23:42 +01:00
Anari Jalakas 82bde8c42d luci-lib-ip: fix build error with LTO
Adding $(FPIC) parameter fixes building with CONFIG_USE_LTO enabled.

Signed-off-by: Anari Jalakas <anari.jalakas@gmail.com>
2024-11-17 23:23:42 +01:00
Ansuel Smith f71e9cbd42 rpcd-mod-luci: strip colon from dnsmasq duid
Dnsmasq DHCPv6 use colons in the generated duid present in the lease file. Strip the colon as this is not supported by the OpenWrt config and follow the same way odhcpd use to display duid.

Fixes: #4543

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2024-07-26 02:13:46 +02:00
Paul Donald b2e7441a60 luci-lib-uqr: introduce JS library
Initial idea by Christian Marangi <ansuelsmth@gmail.com>

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
2024-06-27 20:08:21 +02:00
Florian Eckert b69bce077d
Merge pull request #6994 from TDT-AG/pr/20240315-luci-app-nlbwmon
luci-app-nlbwmon: add missing PKG_LICENSE
2024-03-27 08:48:28 +01:00
Florian Eckert 10e3c449ef luci-app-nlbwmon: move chartjs to own packages luci-lib-chartjs
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-03-21 10:53:53 +01:00
Florian Eckert c1e3fa97dc luci-lib-jsonc: add missing license information
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-03-19 13:49:16 +01:00
Florian Eckert c3f93d6cb5 luci-lib-iptparser: add missing license information
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-03-19 13:49:07 +01:00
Florian Eckert fea8509c37 luci-lib-ipkg: add missing license information
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-03-19 13:48:47 +01:00
Florian Eckert 946bad0654 luci-lib-httpprotoutils: add missing license information
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-03-19 13:48:26 +01:00
Florian Eckert 589c9f674d luci-lib-httpclient: add missing license information
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-03-19 13:48:02 +01:00
Florian Eckert 3e3005c14d luci-lib-base: add missing license information
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-03-19 13:47:44 +01:00
Tony Ambardar 8b08b48df9 rpcd-mod-luci: use standard POSIX header for basename()
The musl libc only implements POSIX basename() but provided a GNU header
kludge in <string.h>, which was removed in musl 1.2.5 [1]. Use the standard
<libgen.h> header to avoid compilation errors like:

luci.c: In function 'rpc_luci_parse_network_device_sys':
luci.c:676:53: error: implicit declaration of function 'basename' [-Werror=implicit-function-declaration]
  676 |                 blobmsg_add_string(&blob, "master", basename(link));
      |                                                     ^~~~~~~~
luci.c:676:53: error: passing argument 3 of 'blobmsg_add_string' makes pointer from integer without a cast [-Werror=int-conversion]
  676 |                 blobmsg_add_string(&blob, "master", basename(link));
      |                                                     ^~~~~~~~~~~~~~
      |                                                     |
      |                                                     int
...
cc1: all warnings being treated as errors

Link 1: https://git.musl-libc.org/cgit/musl/log/?qt=grep&q=basename

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
2024-03-06 00:26:29 -08:00
Paul Donald d46da53bcd luci-lilb-nixio: Code quality fixes
future variants could use en/decodeURIComponent

ordering is important when handling "&"

Signed-off-by: Paul Donald <newtwen@gmail.com>
2024-01-31 02:55:05 +01:00
Xiang W c2f679962d
luci-lib-nixio: Fix add_luci_conffiles adding duplicate files (#6568)
* luci-lib-nixio: Fix add_luci_conffiles adding duplicate files

add_luci_conffiles does not check whether the file already exists
when adding the file, which may result in redundant backups in the
sysupgrade backup.

Signed-off-by: Xiang W <wxjstz@126.com>
2023-12-04 21:48:19 +01:00
Jo-Philipp Wich ac7b37ef01 luci-lib-ip: fix creating address instances from integers
Ensure that the proper byte order is used when creating IPv4/IPv6/MAC
instances from integer values on big endian systems.

Fixes: #6678
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2023-11-07 22:59:08 +01:00
Jo-Philipp Wich efcd487978 luci-lib-jsonc: improve handling of integral numeric values
Properly deal with integral numeric values exceeding the int32_t range
by replacing the cast logic with more fine grained checks:

 - Lua numbers which are integers in the first place are directly converted
   to JSON integers

 - Finite double Lua numbers which are integral are converted to JSON
   integer values

 - All other numeric values are converted to JSON doubles

This should bring the handling of large integral value in line with the
documented behavior of turning non-fractional Lua numbers into JSON
integers.

Fixes: #6647
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2023-10-25 22:42:23 +02:00
Hannu Nyman 46a8abc54b luci-lib-rpcc: Remove old broken lib
Remove the old library that has been BROKEN since 2015.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2023-08-06 22:27:18 +03:00
Andre Heider ff2c45d4a6 luci-lib-px5g: refactor to use PKG_BUILD_FLAGS:=no-mips16
See commit 5c545bdb "treewide: replace PKG_USE_MIPS16:=0 with
PKG_BUILD_FLAGS:=no-mips16" on the main repository.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-03-23 10:09:02 +01:00
Jo-Philipp Wich 2234d0c5dd
Merge pull request #6104 from dhewg/6g
luci-mod-network: enable configuring wifi ax networks on the 6G band
2023-02-07 14:05:17 +01:00
Jo-Philipp Wich a570e30006 rpcd-mod-luci: fix reporting network device flags
Fix reporting of ceertain flag values larger than 255, such as IFF_PROMISC
by explicitly casting the bit test expression to a boolean result since
the implicit integer truncation to uint8_t will turn the `0x100` result of
a set IFF_PROMISC bit into just `0x0`.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2023-02-07 10:09:42 +01:00
Sasha Andonov e776759549 luci-lib-httpprotoutils: add airplay mime types
Airplay of a statically hosted video file from one Apple device to another
fails due to unrecognized content-type. Adding Airplay supported
mime types fixes the issue.

Signed-off-by: Sasha Andonov <s.andonnov@gmail.com>
2023-01-24 10:00:51 -05:00
Andre Heider eb93ea0ac2 rpcd-mod-luci: bump version
Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-01-23 14:51:28 +01:00
Andre Heider ed2ee96e44 rpcd-mod-luci: add "hwmodes_text" to the iwinfo info output
This is a preformatted string like "ac/ax/b/g/n" for presentation.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-01-23 14:51:28 +01:00
Andre Heider eae86ee9bd rpcd-mod-luci: reuse infos provided by libiwinfo
Don't hardcode bit/name pairs, instead iterate over what's known to the
library and use that instead.

This automatically adds the missing ad hwmode and HE80+80 htmode - and any
future ones.

The only difference in the output is the order of the 'hwmodes' array.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-01-23 14:51:28 +01:00
Christian Marangi 938e54df17
treewide: bump PKG_RELEASE for libiwinfo ABI change
Bump PKG_RELEASE for libiwinfo ABI change for rpcd-mod-luci and
luci-mod-status.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-01-23 14:03:10 +01:00
Jo-Philipp Wich 9118452313 luci-lib-base: ensure that `luci.http` can be required standalone
Various existing Lua software is requiring the `luci.http` library for
URL encoding/decoding tasks so ensure that it can be loaded in a stand
alone manner even if the emulated Lua runtime environment is not
available.

Fixes: cea2c3578e ("luci-lib-base: forward luci.http.context.request.message to ucode")
Ref: https://forum.openwrt.org/t/x/141817
Ref: https://github.com/openwrt/luci/pull/5976#issuecomment-1296220586
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-11-04 16:10:12 +01:00
Jo-Philipp Wich 036424df5b treewide: add explicit Lua runtime dependencies where needed
Some packages require Lua libraries but do not ship with a luasrc directory,
add explicit dependencies in these cases.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-10-25 01:03:37 +02:00
Jo-Philipp Wich cea2c3578e luci-lib-base: forward luci.http.context.request.message to ucode
Some existing LuCI application code accesses the
`luci.http.context.request.message.params` HTTP parameter table directly.

Forward the `luci.http.context.request.message` object to the ucode
`luci.http.message` instance in order to properly support this.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-10-25 01:03:37 +02:00
Jo-Philipp Wich 673f38246a treewide: separate Lua runtime resources
Move classes required for Lua runtime support into a new `luci-lua-runtime`
package. Also replace the `luci.http` and `luci.util` classes in
`luci-lib-base` with stubbed versions interacting with the ucode based
runtime environment.

Finally merge `luci-base-ucode` into the remainders of `luci-base`.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-10-25 01:03:37 +02:00
Joerg Werner 7e4c087f86 rpc-mod-luci: Add support for ccmp-256/gcmp/gcmp-256 ciphers
Signed-off-by: Joerg Werner <schreibubi@gmail.com>
2022-08-25 15:28:11 +03:00
Eneas U de Queiroz 88b9088514
luci-lib-nixio: always build without TLS support
The build system fails to set up the chosen TLS provider and always
builds the package without TLS.

While this could be easily fixed, the package would fail to build with
axTLS and cyaSSL without further intervention.

The version of axTLS included with the source is outdated, as is the API
used with cyaSSL, now wolfSSL.

OpenSSL support could be enabled, but the TLS code limits connections to
TLS 1.0, deprecated by RFC 8996: "TLS 1.0 MUST NOT be used".

Remove the provider configuration from build options, and always build
the library without TLS.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2022-08-10 16:52:35 -03:00
Markus Stockhausen 77d29c9dc0 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>
2022-06-28 11:06:23 +02:00
Justin Klaassen 45f411b7a2 luci-lib-jsonc: stringify int use json_object_new_int64 instead
Fixes: #3293
Signed-off-by: Justin Klaassen <jck112@users.noreply.github.com>
2022-03-20 08:11:33 -07:00
Jo-Philipp Wich 4424424366 rpcd-mod-luci: parse prefix size from DHCPv6 leases
Remember the prefix size when parsing odhcpd lease entries and expose
it in the ip6addrs array.

Fixes: #4345
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-10-26 19:40:35 +02:00
Jo-Philipp Wich af4352c07e rpcd-mod-luci: fix syntax error
Fixes: 45a398e1ed ("rpcd-mod-luci: avoid PTR requests for IPv6 link-local and ULA addrs")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-09-22 12:42:54 +02:00
Jo-Philipp Wich 45a398e1ed rpcd-mod-luci: avoid PTR requests for IPv6 link-local and ULA addrs
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-09-22 09:56:09 +02:00
Jo-Philipp Wich 93bd93e220 rpcd-mod-luci: let IPv4 hostnames take precedence over IPv6 ones
Do not overwrite IPv4-resolved hostnames with IPv6 ones in case both are
available or resolvable.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-09-22 09:56:09 +02:00
Jo-Philipp Wich a26b53314d rpcd-mod-luci: bump version
Fixes: a78b74784d ("rpcd-mod-luci: refactor host hint gathering")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-15 10:02:44 +02:00
Jo-Philipp Wich a78b74784d 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>
2021-06-14 21:52:56 +02:00
Jo-Philipp Wich 113c0b0d26 rpcd-mod-luci: add link details to ubus netdev information
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-06-11 08:32:03 +02:00
David Bauer 516c58e133
Merge pull request #5070 from blocktrron/pr-luci-wifi6
luci-mod-network: add 802.11ax HE support
2021-06-05 19:04:11 +02:00
David Bauer 7b11e848ac rpcd-mod-luci: support parsing 11ax HW / HT modes
Add support for parsing 11ax modes returned from UBUS. This is required
so the frontend can display information about supported 11ax operation.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-06-05 16:24:19 +02:00
Niels Widger a5195e7825 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>
2021-06-03 09:51:09 +02:00
Jo-Philipp Wich 71feaa5285 rpcd-mod-luci: expose devtype and iflink properties in getNetworkDevices
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-03-18 17:28:40 +01:00
Niels Widger 8920a2bf71
rpcd-mod-luci: Fix parsing of DUID-LLT's in duid2ea
Fix parsing of DUID-LLT's in duid2ea.  Unlike DUID-LL's, DUID-LLT's have a 32-bit time field between the hardware type and link-layer address fields, see RFC 3315 Sections 9.2 and 9.4:

https://tools.ietf.org/html/rfc3315#section-9.2
https://tools.ietf.org/html/rfc3315#section-9.4

therefore, the link-layer address starts at offset 16 instead of 8.

Signed-off-by: Niels Widger <niels@qacafe.com>
2021-02-25 15:31:00 -05:00
Andre Heider 8b90932329 rpcd-mod-luci: get rid of now unused getDSLStatus ubus rpc
Good riddance.

Signed-off-by: Andre Heider <a.heider@gmail.com>
Tested-by: Martin Schiller <ms@dev.tdt.de>
2021-01-26 07:10:19 +01:00
Jo-Philipp Wich bc121a5a45 rpcd-mod-luci: allow finding suffixed libwinfo.so
Recent versions ship a version suffixed libiwinfo.so, therefor we cannot
rely on a fixed path name anymore. Use globbing to find matching libraries
and load the first one we find.

Fixes: #4718
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2021-01-08 18:34:17 +01:00