summaryrefslogtreecommitdiff
path: root/libs
Commit message (Collapse)AuthorAgeFilesLines
...
* luci-lib-ip: explicitly initialize address scope valueJo-Philipp Wich2020-01-231-0/+6
| | | | | | | | | Explicitly initialize the address scope value to zero in parse_cidr() and L_setaddr() to avoid stray scope identifiers getting added when formatting the address object as string. Fixes: 1d2b4c777 ("luci-lib-ip: support scoped IPv6 addresses") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* luci-app-fwknopd: fix typosBalázs Úr2019-12-201-2/+2
| | | | Signed-off-by: Balázs Úr <balazs@urbalazs.hu>
* luci-lib-httpclient: accept scoped IPv6 addressesJo-Philipp Wich2019-12-091-2/+2
| | | | | Ref: https://github.com/openwrt/luci/issues/3380 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* luci-lib-ip: support scoped IPv6 addressesJo-Philipp Wich2019-12-092-16/+81
| | | | | Ref: https://github.com/openwrt/luci/issues/3380 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rpcd-mod-luci: bump versionJo-Philipp Wich2019-11-141-1/+1
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rpcd-mod-luci: handle multiple IPv6 addresses per leaseJo-Philipp Wich2019-11-141-19/+48
| | | | | Ref: https://forum.openwrt.org/t/luci-not-showing-2nd-ipv6-address/48271 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* luci-lib-jsonc: store large JSON integer values as Lua doublesJo-Philipp Wich2019-11-131-1/+8
| | | | | Fixes: #3293 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rpcd-mod-luci: various improvementsJo-Philipp Wich2019-11-082-17/+80
| | | | | | | | | | - Properly handle infinite dnsmasq leases - Use a more efficient approach to free internal AVL trees - Remove redundant uci context creation - Add new getDUIDHints method Fixes: #3277 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rpcd-mod-luci: properly deal with failing ubus requestsJo-Philipp Wich2019-11-032-1/+6
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rpcd-mod-luci: handle DHCPv6 leases in dnsmasq lease filee9hack2019-11-031-4/+8
| | | | | | | | For DHCPv6, the second entry of a lease is the IAID. The parsing code expects a MAC instead of a IAID. Reported-by: Hartmut Birr <e9hack@gmail.com> Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rpcd-mod-luci: bump versionJo-Philipp Wich2019-11-021-1/+1
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rpcd-mod-luci: fix crash on not existing uci optionsJo-Philipp Wich2019-11-021-4/+4
| | | | | | | Checking the return value of uci_lookup_ptr() is not enough to ensure that the requested optiomn has actually been found. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rpcd-mod-luci: depend on libnl-tiny, do not runtime depend on libiwinfoJo-Philipp Wich2019-11-021-2/+3
| | | | | | Also fix package description. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* libs: add rpcd-mod-luciJo-Philipp Wich2019-11-013-0/+1834
| | | | | | | Add rpcd-mod-luci, a fast rpcd C plugin for speeding up common backend ubus operations. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* luci-lib-luaneightbl: drop package - all functions ar also in luci-lib-ipPatrick Grimm2019-10-213-153/+0
| | | | Signed-off-by: Patrick Grimm <patrick@lunatiki.de>
* luci-lib-ip: support specifying source address in route()Jo-Philipp Wich2019-08-062-18/+42
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* luci-lib-nixio: fix compilationJo-Philipp Wich2019-07-261-1/+1
| | | | | | Fixes: #2921 Fixes: f3f42ff09 ("address: Replace ualarm with setitimer") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* address: Replace ualarm with setitimerRosen Penev2019-07-191-2/+4
| | | | | | ualarm has been deprecated and may not be available in the libc. Signed-off-by: Rosen Penev <rosenp@gmail.com>
* luci-app-radicale2: Add v2 of CalDAV/CardDAV serverDaniel F. Dickinson2019-01-102-0/+99
| | | | | | | | Radicale 2.x has been out for some time, and has better support for a number of clients as well as new features, so radicale2 package has been added to packages, and this is the corresponding UI. Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
* luci-lib-jsonc: prevent infinite recursion in stringifyJo-Philipp Wich2018-12-211-3/+74
| | | | | | | Also increase the stack size as needed to prevent crashes when serializing deeply nested tables. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* luci-lib-httpclient: prevent nil access with invalid IP address literalsJo-Philipp Wich2018-12-111-4/+4
| | | | | Fixes: a54baf7be ("luci-lib-httpclient: revamp URL handling") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* luci-lib-httpclient: revamp URL handlingJo-Philipp Wich2018-12-111-72/+123
| | | | | | | | | | | - Introduce a parse_url() helper which properly deals with literal IPv4 and IPv6 host parts and returns the decomposed uri string as table - Properly format IPv6 literals in autogenerated Host headers - Omit default port numbers in Host headers and calculated redirect URLs. Supersedes PR #2337. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* luci-lib-ipkg: move out of luci-baseJo-Philipp Wich2018-11-143-0/+386
| | | | | | | Move the old luci.model.ipkg utility class into a separate package and let the components using it depend on the new library package. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* luci-lib-iptparser: fix packagingJo-Philipp Wich2018-10-112-0/+0
| | | | | | | The previous commit omitted a subdirectory. Fixes: 94323a61e ("luci-base: move luci.sys.iptparser into separate package") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* Merge pull request #2197 from yangfl/masterHannu Nyman2018-10-109-27/+27
|\ | | | | treewide: Fix typos in comments
| * treewide: Fix typos in commentsyangfl2018-10-109-27/+27
| | | | | | | | Signed-off-by: David Yang <mmyangfl@gmail.com>
* | luci-base: move luci.sys.iptparser into separate packageJo-Philipp Wich2018-10-103-0/+457
|/ | | | | | | | | | | | | Since commit f6bfac211 ("luci-mod-status: rework iptables status page"), nothing in luci-base depends on the iptparser class anymore, so fold it out into a separate package and let the few apps that require it depend on the new library package. Saves about 10K uncompressed in luci-base while the iptables status rework enlarged the markup by roughly 5KB, saving roughly 5KB of size overall. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* restored nixio tls providersSophana KOK2018-09-271-0/+38
| | | | Signed-off-by: Sophana KOK <ml-github@worldspot.net>
* Revert "luci-lib-json: depend on luci-base"Jo-Philipp Wich2018-07-031-1/+1
| | | | This reverts commit 8ca29efec862350d8d621235999947c329dfaba7.
* luci-lib-json: depend on luci-baseJo-Philipp Wich2018-07-031-1/+1
| | | | | Fixes #506 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* luci-lib-json: support serializing userdataJo-Philipp Wich2018-05-181-1/+6
| | | | | | | | Fixes the following error when attempting to serialize userdata objects: .../json.lua:81: attempt to call local 'parser' (a nil value) Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* libs: move http.protocol.{date,mime,conditionals} to luci-lib-httpprotoutilsJo-Philipp Wich2018-04-189-2/+456
| | | | | | | Also adjust the dependencies of components depending on these classes and flatten the namespace from luci.http.protocol.* to luci.http.* Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* luci-base: fold luci.http.protocol into luci.httpJo-Philipp Wich2018-04-181-1/+1
| | | | | | | | | | With only the decoder routines remaining in luci.http.protocol, it makes no sense to keep the low level protocol class around, so fold the remaining code into the central luci.http class. Also adjust the few direct users of luci.http.protocol accordingly. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* luci-lib-ip: add MAC address calculation supportJo-Philipp Wich2018-03-122-219/+655
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* luci-lib-nixio: fix spelling mistakes in documentationJo-Philipp Wich2018-03-125-24/+24
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* typo: fileystem --> filesystemHannu Nyman2017-12-281-1/+1
| | | | | | | fix typo: sed -i "s/fileystem/filesystem/" Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
* rpcd-mod-rrdns: add new rpcd plugin for rapid reverse DNS lookupsJo-Philipp Wich2017-07-114-0/+510
| | | | | | | | | | | The plugin provides a new ubus procedure "network.rrdns.lookup" which allows looking up the names of a large chunk of IP addresses at once, within a fixed global timeout. This is useful to have a guaranteed maximum query time even if the local DNS setup is broken or timing out. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* luci-lib-px5g: add license tagQuirin Hofstaetter2017-06-131-0/+1
| | | | Signed-off-by: Quirin Hofstaetter <qh@dev.tdt.de>
* luci-lib-nixio: add license tagQuirin Hofstaetter2017-06-131-0/+2
| | | | Signed-off-by: Quirin Hofstaetter <qh@dev.tdt.de>
* luci-lib-json: add license tagQuirin Hofstaetter2017-06-131-0/+2
| | | | Signed-off-by: Quirin Hofstaetter <qh@dev.tdt.de>
* luci-lib-ip: add license tagQuirin Hofstaetter2017-06-131-0/+2
| | | | Signed-off-by: Quirin Hofstaetter <qh@dev.tdt.de>
* changed stat to lstat in nixio_lstat functionThorsten M2016-09-161-1/+1
| | | | Signed-off-by: Thorsten M. <thoto@devtal.de>
* Merge pull request #563 from cshore/pull-request-app-uhttpdJo-Philipp Wich2016-01-151-0/+33
|\ | | | | Pull request app uhttpd
| * lib-nixio / luci-base: Fix for reading csrf token prevents file uploadDaniel Dickinson2015-12-151-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The call to http.formvalue in order to read the csrf token causes _parse_input to be triggered *before* controllers and cbi maps have been built. This results in the failure of file uploads because the file handler is not yet in place when _parse_input gets called, and it is in _parse_input that POST data is parsed (including files). To fix this we add the ability to write file fields to temporary files (using mkstemp and unlink in nixio.file) and use this to store file data until the filehandler is registered, with a fallback to reading the file data into memory. Once the filehandler callback gets registered we iterate though all previously parsed (saved) files and copy the data to the file handler, and then close the temporary file (which finally removes because we unlinked after creating the file, but didn't close the file so unlink was deferred). Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com>
* | luci-lib-jsonc: Add ltn12-compatible sink factoryJan-Philipp Litza2015-09-042-1/+84
|/ | | | | | | | | | | | | | To use the luci-lib-jsonc parser as sink for an ltn12 pump (for example from stdin), the following code will now do: require 'luci.ltn12' require 'luci.jsonc' local parser = luci.jsonc.new() luci.ltn12.pump.all(luci.ltn12.source.file(io.input()), parser:sink()) print(parser:get()) Signed-off-by: Jan-Philipp Litza <janphilipp@litza.de>
* luci-lib-ip: fix documentation issueJo-Philipp Wich2015-09-011-8/+8
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* Fix module lines in several luadoc filesJo-Philipp Wich2015-09-013-3/+3
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* luci-lib-jsonc: Fix memory leak in stringify()Jan-Philipp Litza2015-08-311-0/+1
|
* luci-lib-jsonc: allow encoding empty listsJan-Philipp Litza2015-08-301-2/+2
| | | | | | | | | | | | | | To be consistent with the behavior of luci-lib-json, an empty Lua table should be encoded to an empty JSON list, not an empty JSON object. To still allow encoding empty JSON objects, the usage of anything other than a number or a string as a key (for example an empty table or a function) can be used to force encoding as an object: json.stringify({}) -- "[]" json.stringify({[{}] = true}) -- "{}" Signed-off-by: Jan-Philipp Litza <janphilipp@litza.de>
* luci-lib-jsonc: Ignore non-string-or-number keys in tablesJan-Philipp Litza2015-08-301-2/+3
| | | | | | | | | | | | | | Previously, the following caused a segmentation fault: json.stringify({[{}] = true}) This was caused by lua_tostring() returning NULL for anything but strings and numbers, letting json_object_object_add crash. This patch makes jsonc ignore all keys which have no string representation altogether. Signed-off-by: Jan-Philipp Litza <janphilipp@litza.de>