summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2018-05-07luci-base: fix i18n de typo for rc.localFlorian Eckert
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-05-05luci-mod-rpc: more auth/login fixes, expose further librariesJo-Philipp Wich
The previous attempt to fix authentication broke login functionality so rework the code once again, this time with referencing helper functions directly via the controller scope. Furthermore, properly expose luci.sys.wifi.getiwinfo() and luci.ip. For getiwinfo(), the RPC wrapped function accepts one further optional parameter specifying the operation to invoke on the iwinfo instance. If no operation is specified, a summary object containing all info without country and scan list is returned. Example to obtain iwinfo summary object: curl --cookie sysauth=... \ --data '{"method": "wifi.getiwinfo", "params": ["wlan0"]}' \ "http://192.168.1.1/cgi-bin/luci/rpc/sys" Example to obtain iwinfo scan list: curl --cookie sysauth=... \ --data '{"method": "wifi.getiwinfo", "params": ["wlan0", "scanlist"]}' \ "http://192.168.1.1/cgi-bin/luci/rpc/sys" The exposed luci.ip class uses a similar approach to allow invoking instance methods on cidr objects. The new(), IPv4(), IPv6() and MAC() constructors accept two further optional arguments, with the first specifying the instance method to invoke and the second the value to pass to the instance method. Example to get list of IPv4 neighbours (ARP entries): curl --cookie sysauth=... \ --data '{"method": "neighbors", "params": [{"family": 4}]}' \ "http://192.168.1.1/cgi-bin/luci/rpc/ip" Example to add 100 hosts to a network address: curl --cookie sysauth=... \ --data '{"method": "IPv4", "params": ["192.168.0.1", "255.255.255.0", "add", 1000]}' \ "http://192.168.1.1/cgi-bin/luci/rpc/ip" Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-05luci-app-upnp: sync translationsHannu Nyman
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-05-05luci-base: xhr.js: fix timeout setting with IE 11Jo-Philipp Wich
Internet Explorer 11 requires the timeout to be applied after the open() call, otherwise an invlaid state exception will be raised Fixes aa6c97154 ("luci-base: extend xhr.js") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-05luci-mod-rpc: fix authentication via query string parameterJo-Philipp Wich
Localize the `authenticatior()` and `session_retrieve()` functions into the `index()` function scope so that they're retained when extracting the function into the dispatcher bytecode cache. Also allow access to the global scope since upvalues do not work reliably due to the out-of-context byte code caching of index functions. Fixes https://github.com/openwrt/luci/issues/1300#issuecomment-381352765 Fixes feefc600e ("luci-mod-rpc: rework authentication and session handling") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-05Merge pull request #1778 from ldir-EDB0/igdv2Jo-Philipp Wich
luci-app-upnp: support igdv1 run time flag
2018-05-03luci-base: support hiding the "Back to Overview" button in cbi mapsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-03Revert "luci-base: support hiding the "Back to Overview" button in cbi maps"Jo-Philipp Wich
This reverts commit 52cf265c9d12537d5f37043350328d30ca11bab4. I accidentally committed unrelated changes. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-03luci-base: support hiding the "Back to Overview" button in cbi mapsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-02luci-app-upnp: support igdv1 run time flagKevin Darbyshire-Bryant
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2018-05-02Merge pull request #1776 from lamego/fix-indentifies-typoHannu Nyman
Fixing small typo
2018-05-02Fixing small typoRicardo Lamego
indentifies > identifies
2018-05-02Merge pull request #1775 from musashino205/l10n/base-upd-jaHannu Nyman
luci-base: update Japanese translation
2018-05-03luci-base: update Japanese translationINAGAKI Hiroshi
Updated Japanese translations. Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-05-02luci-mod-admin-full: canonicalize configured static lease MACJo-Philipp Wich
When reading the configured mac address of the static lease, filter it through luci.ip.checkmac() to canonicalize and uppercase the value for mapping it against the combo box host hints. Fixes #1772. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-02luci-base: sync translationsINAGAKI Hiroshi
Synchronized translations with sources. Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-05-02Merge pull request #1705 from Mushoz/add-igmp-snoopingJo-Philipp Wich
luci-mod-admin-full: add igmp snooping option
2018-05-02luci-app-statistics: convert init script to procdJo-Philipp Wich
Convert init script to procd format in order to register reload triggers on /etc/config/luci_statistics. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-01Merge pull request #1690 from karlp/pagekiteHannu Nyman
luci-app-pagekitec: new package
2018-04-30documentation: regenerate documents from current code baseJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-28luci-app-ddns: fix typo: CRTL should be CTRLfy1128
Reference to https://github.com/openwrt/luci/pull/1756 cherry picked from commit d9cd43fee1d9e0b01c91e569820ba83120d8840b Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-04-28Merge pull request #1767 from SvenRoederer/patch-2Hannu Nyman
luci-mod-freifunk: align spacing
2018-04-26luci-base: extend xhr.jsJo-Philipp Wich
Add timeout options to get() and post() and introduce XHR.stop() to support stopping a poll operation. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-26themes: fix CSS class of uci change indicatorJo-Philipp Wich
The previous commit incorrectly added a new class attribute without considering existing ones. Fixes 736d8fee4 ("themes: add common class to uci change indicator") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-26themes: add common class to uci change indicatorJo-Philipp Wich
Add a common CSS class name to the change indicator and modify the openwrt.org theme to hide it when no changes are present, similar to all other themes. This is needed for upcoming uci apply handling changes to be able to auto-hide the indicator without page reload after an apply. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-26luci-base: add simple CORS handling to luci.dispatcherJo-Philipp Wich
Support a new boolean property `cors` which - if set to true - causes the dispatcher to positively answer CORS OPTIONS requests after authentication without actually running the dispatching target. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-26luci-base: handle bodies of non-POST requests as wellJo-Philipp Wich
Decode the HTTP message bodies of any request carrying a Content-Length header, not just those in POST requests. This allows handling parameters in other methods, OPTIONS in particular. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-25luci-mod-freifunk: align spacingSven Roederer
remove some tailing tabs and an empty line in OSMLatLon.htm Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
2018-04-25Merge pull request #1766 from musashino205/l10n/dcp-upd-jaHannu Nyman
luci-app-dnscrypt-proxy: update Japanese translation
2018-04-25Merge pull request #1765 from musashino205/l10n/base-upd-jaHannu Nyman
luci-base: update japanese translation
2018-04-26luci-base: update japanese translationINAGAKI Hiroshi
Updated japanese translations. Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-04-25luci-app-dnscrypt-proxy: update Japanese translationINAGAKI Hiroshi
Updated Japanese translations. Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-04-24luci-base: additionally return error code strings in luci.util.ubus()Jo-Philipp Wich
Add a 3rd return value to luci.util.ubus() containing the string value of the error return value. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-24luci-base: ensure that file upload values have lengthJo-Philipp Wich
Ensure that the (table) length of a file upload value has nonzero length by initializing the first table index with the file name. This fixes tests in the form x = luci.http.formvalue(...) if x and #x > 0 then ... end Fixes #1763. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-23Merge pull request #1759 from pmelange/feature_remove_nameserver_213_73_91_35Hannu Nyman
Removed retired nameserver 213.73.91.35 from the Freifunk profiles
2018-04-23Removed retired nameserver 213.73.91.35 from the Freifunk profilespmelange
See issue openwrt/luci#1757 Signed-off-by: Perry Melange <isprotejesvalkata@gmail.com>
2018-04-22luci-base: decode plus signs in x-www-form-urlencoded POST dataJo-Philipp Wich
Depends on 5ef51b2ab ("lucihttp: update to latest HEAD"). Fixes #1755. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-22lucihttp: update to latest HEADJo-Philipp Wich
ccc685e lua: expose LH_URLDECODE_PLUS flag in Lua library Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-21luci-base: ship rpcd uci access ACLJo-Philipp Wich
Ship an ACL definition for granting full read/write access to uci configuration files via ubus rpc. This is a precondition for enabling uci session isolation later on. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-21luci-app-lxc: fix syntax error in previous commitJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-21luci-app-lxc: various changesAdmin Localnet
1) Modify dependencies Add dependencies required for to be able use containers created from "images.linuxcontainers.org". Several of them require "lxc-attach" for set password so to be able login. None of them has SSH preinstalled so "lxc-console" is required to be able login and install SSH, for example. Remove dependency "xz", it seems incompatible with LXC_BUSYBOX_OPTIONS when both are enabled happens a build crash. 2) Change container image repository The repository "virtualwrt.org/containers/" seems to not work, I have change it by the official LXC container image repository. 3) Translate the arch Translate the local uname architecture to a valid "images.linuxcontainers.org" arch. Only tested with the platform "mvebu" (armv7l -> armhf). 4) Other minor fixes Use same server to list images and download the image. Disable GPG check when listing images. Reported-by: "Admin Localnet <localnet@users.noreply.github.com>" [Squashed commits, cleaned up whitespace, refactor arch mapping, escape url setting, use system wide ubus helper, use uci model library] Closes: #1422 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-20lucihttp: update to latest HEADJo-Philipp Wich
c7c9c66 src: extend multipart parser test program 5071efb testcases: add multipart parsing edge cases 689e3d0 lib: multipart-parser: fix various edge cases Fixes #1754. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-19luci-base: properly handle repeated POST parametersJo-Philipp Wich
Restore the old luci.http behaviour of converting repeated POST params into single tables holding all values instead of letting each repeated parameter overwrite the value of the preceeding one. Fixes, among other things, the handling of CBI dynamic list values. Fixes #1752 Fixes 59dea0230 ("luci-base: switch to lucihttp based POST data processing") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-19luci-base: implement session handling in luci.model.uciJo-Philipp Wich
Introduce luci.model.uci.set_session_id() and luci.model.uci.get_session_id() to set and get the effective session ID respectively. When a session ID is set, it is sent as `ubus_rpc_session` attribute to rpcd, causing it to use per-session change directories, isolating LuCI changes from the global system uci state. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-18luci-base: drop dependency on libuci-luaJo-Philipp Wich
LuCI itself now uses ubus calls to interact with uci configuration while the remaining direct libuci-lua users have been updated to either depend on the binding library or to use luci.model.uci. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-18freifunk-common: explicitely depend on libuci-luaJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-18lucihttp: update to latest HEADJo-Philipp Wich
8617997 lib: cast size_t values in printf() to prevent compielr warnings Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-18libs: move http.protocol.{date,mime,conditionals} to luci-lib-httpprotoutilsJo-Philipp Wich
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>
2018-04-18luci-base: fold luci.http.protocol into luci.httpJo-Philipp Wich
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>
2018-04-18luci-base: refactor luci.httpJo-Philipp Wich
- Rewrite getcookie() to use liblucihttp header value parsing - Rewrite setfilehandler() to use local variables and have cleaner code - Fix build_querystring() to actually *en*code the given params Signed-off-by: Jo-Philipp Wich <jo@mein.io>