project/luci.git
8 years agoluci-app-openvpn: Add udp6 and tcp6 to proto 559/head
Arnie97 [Fri, 27 Nov 2015 03:20:26 +0000 (11:20 +0800)]
luci-app-openvpn: Add udp6 and tcp6 to proto

Signed-off-by: Yifeng Zhang <arnie97@gmail.com>
8 years agoMerge pull request #534 from yousong/add-luci-proto-pppossh
Jo-Philipp Wich [Thu, 26 Nov 2015 22:23:15 +0000 (23:23 +0100)]
Merge pull request #534 from yousong/add-luci-proto-pppossh

Add luci proto pppossh

8 years agoluci-mod-admin-full: limit SSID to 32 characters (#558)
Jo-Philipp Wich [Thu, 26 Nov 2015 11:30:53 +0000 (12:30 +0100)]
luci-mod-admin-full: limit SSID to 32 characters (#558)

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
8 years agoluci-mod-admin-full: fix script regression after 152ba9ab228ad4ea4c1748f29fe4ffa5f8f74ac6
Jo-Philipp Wich [Sat, 21 Nov 2015 12:53:33 +0000 (13:53 +0100)]
luci-mod-admin-full: fix script regression after 152ba9ab228ad4ea4c1748f29fe4ffa5f8f74ac6

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
8 years agoluci-base: use board.json to infer switch netdev
Jo-Philipp Wich [Fri, 20 Nov 2015 23:31:06 +0000 (00:31 +0100)]
luci-base: use board.json to infer switch netdev

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
8 years agoluci-base: switch to luci-lib-jsonc
Jo-Philipp Wich [Fri, 20 Nov 2015 23:29:55 +0000 (00:29 +0100)]
luci-base: switch to luci-lib-jsonc

Add dependency on luci-lib-jsonc and use it to
reimplement luci.util.serialize_json().

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
8 years agoluci-mod-admin-full: make mirror port settings depend on mirror enable
Jo-Philipp Wich [Fri, 20 Nov 2015 22:44:43 +0000 (23:44 +0100)]
luci-mod-admin-full: make mirror port settings depend on mirror enable

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
8 years agoMerge pull request #554 from bittorf/better_neigh.sh
Hannu Nyman [Fri, 20 Nov 2015 20:01:27 +0000 (22:01 +0200)]
Merge pull request #554 from bittorf/better_neigh.sh

freifunk-common: neigh.sh - show hostnames

8 years agofreifunk-common: neigh.sh - show hostnames 554/head
Bastian Bittorf [Fri, 20 Nov 2015 19:46:55 +0000 (20:46 +0100)]
freifunk-common: neigh.sh - show hostnames

if nameservice-plugin is configured, we read
in all locally known hostnames and show them
in the output:

root@stuttgarter-core:~# neigh.sh
Local          Remote         vTime  LQ       NLQ      Cost Host
10.230.105.241 10.230.105.246 138851 1.000000 1.000000 1024 stuttgarter-rhnk.olsr
10.230.105.241 10.230.105.247 135717 1.000000 1.000000 1024 stuttgarter-emma.olsr
10.230.105.241 10.230.105.244 138309 1.000000 1.000000 1024 stuttgarter-sued.olsr
10.230.105.241 10.230.105.245 136001 1.000000 1.000000 1024 stuttgarter-west.olsr
10.230.105.241 10.230.105.242 134818 1.000000 1.000000 1024 stuttgarter-nord.olsr
10.230.105.241 10.230.105.243 137187 1.000000 1.000000 1024 stuttgarter-ost.olsr
10.230.105.241 10.230.105.250 139984 1.000000 1.000000 1024 stuttgarter-hof2.olsr
10.230.105.241 10.230.105.251 138294 1.000000 1.000000 1024 stuttgarter-stra2.olsr

Local               Remote              vTime  LQ       NLQ      Cost Host
2001:bf7:820:901::1 2001:bf7:820:950::1 139703 1.000000 1.000000 1024 stuttgarter-rhnk.olsr
2001:bf7:820:901::1 2001:bf7:820:960::1 139541 1.000000 1.000000 1024 stuttgarter-emma.olsr
2001:bf7:820:901::1 2001:bf7:820:990::1 140415 1.000000 1.000000 1024 stuttgarter-hof2.olsr
2001:bf7:820:901::1 fde6:24f1:a388::1   141338 1.000000 1.000000 1024

the filenames for the olsrd hosts-file is taken from uci
and falls back to sane defaults.

Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>
8 years agoluci-mod-admin-full: revert accidential button type change in 20fdac1ac4a126ceebde13f...
Jo-Philipp Wich [Thu, 19 Nov 2015 09:02:41 +0000 (10:02 +0100)]
luci-mod-admin-full: revert accidential button type change in 20fdac1ac4a126ceebde13fb627a9f88bba0e2b3

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
8 years agocontrib/package/freifunk-policyrouting: remove rc.d symlink
Manuel Munz [Wed, 18 Nov 2015 11:34:06 +0000 (12:34 +0100)]
contrib/package/freifunk-policyrouting: remove rc.d symlink

9 years agoluci-mod-admin-full: allow empty mac in interface status
Jo-Philipp Wich [Tue, 17 Nov 2015 16:42:22 +0000 (17:42 +0100)]
luci-mod-admin-full: allow empty mac in interface status

Also adjust for changed IP address format emitted by iface_status call.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-mod-admin-full: use :ipaddrs() and :ip6addrs() helper for iface_status
Jo-Philipp Wich [Tue, 17 Nov 2015 16:36:00 +0000 (17:36 +0100)]
luci-mod-admin-full: use :ipaddrs() and :ip6addrs() helper for iface_status

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-base: eliminate use of uci state vars in luci.model.network
Jo-Philipp Wich [Tue, 17 Nov 2015 16:35:02 +0000 (17:35 +0100)]
luci-base: eliminate use of uci state vars in luci.model.network

Also implement :ipaddrs() and :ip6addrs() helper for network instances.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-mod-admin-full: prevent submit with interface delete button (#549)
Jo-Philipp Wich [Mon, 16 Nov 2015 13:30:13 +0000 (14:30 +0100)]
luci-mod-admin-full: prevent submit with interface delete button (#549)

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-base: fix uci documentation issue (#538)
Jo-Philipp Wich [Mon, 16 Nov 2015 11:36:29 +0000 (12:36 +0100)]
luci-base: fix uci documentation issue (#538)

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoMerge pull request #548 from chris5560/master
Christian Schoenebeck [Sun, 15 Nov 2015 20:36:11 +0000 (21:36 +0100)]
Merge pull request #548 from chris5560/master

luci-app-ddns: rollup to 2.3.0 to reflect changes on ddns-scripts

9 years agoluci-app-ddns: rollup to 2.3.0 to reflect changes on ddns-scripts 548/head
Christian Schoenebeck [Sun, 15 Nov 2015 10:42:43 +0000 (11:42 +0100)]
luci-app-ddns: rollup to 2.3.0 to reflect changes on ddns-scripts

- support for new options "lookup_host", "param_enc" and "param_opt"
- rewritten ddns provider handling to only show/check needed options "domain", "username", etc.
- modified version check/handling incl. using new ipkg.compare_versions function
- modified map.title and map.description generation
- changed XHR.poll interval to 15 seconds on system status page
- using new value_parse function for testing and later implementation into cbi.lua
- some optimizations

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
9 years agoMerge pull request #396 from fanthos/master
Jo-Philipp Wich [Wed, 11 Nov 2015 09:15:33 +0000 (10:15 +0100)]
Merge pull request #396 from fanthos/master

luci-app-qos: Add custom QOS classes to luci dropdown list

9 years agoMerge pull request #535 from saik0/redirect-root-if-empty-signed
Jo-Philipp Wich [Wed, 11 Nov 2015 09:14:34 +0000 (10:14 +0100)]
Merge pull request #535 from saik0/redirect-root-if-empty-signed

Redirect to root on empty path (signed off)

9 years agoMerge pull request #545 from chris5560/master
Christian Schoenebeck [Mon, 9 Nov 2015 20:48:07 +0000 (21:48 +0100)]
Merge pull request #545 from chris5560/master

luci-app-radicale: remove map.title hack

9 years agoluci-app-radicale: remove map.title hack 545/head
Christian Schoenebeck [Mon, 9 Nov 2015 20:46:01 +0000 (21:46 +0100)]
luci-app-radicale: remove map.title hack

remove map.title hack; no longer needed

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
9 years agoMerge pull request #544 from chris5560/master
Christian Schoenebeck [Mon, 9 Nov 2015 20:41:13 +0000 (21:41 +0100)]
Merge pull request #544 from chris5560/master

luci-app-privoxy: remove map.title hack

9 years agoluci-app-privoxy: remove map.title hack 544/head
Christian Schoenebeck [Mon, 9 Nov 2015 20:39:50 +0000 (21:39 +0100)]
luci-app-privoxy: remove map.title hack

remove map.title hack; no longer needed

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
9 years agoMerge pull request #542 from eamars/master
Hannu Nyman [Fri, 6 Nov 2015 07:53:36 +0000 (09:53 +0200)]
Merge pull request #542 from eamars/master

Fix a typo mistake in UI string (mount/fstab extroot advice)

9 years agofix a typo error in command script shown to users 542/head
Ran Bao [Thu, 5 Nov 2015 23:48:47 +0000 (12:48 +1300)]
fix a typo error in command script shown to users

Signed-off-by: Ran Bao <worksev@gmail.com>
9 years agoluci-mod-admin-full: limit interface name length to 15 chars
Hannu Nyman [Thu, 5 Nov 2015 08:54:33 +0000 (10:54 +0200)]
luci-mod-admin-full: limit interface name length to 15 chars

Limit the name of a new interface to 15 characters.
Add a note about the maximum length and the automatic protocol/bridge
prefixes (br-, 6in4-, pppoe- etc.).

Reference to:
https://dev.openwrt.org/ticket/20380
https://github.com/openwrt/luci/issues/507

There is a 15 character limit to the "real" interface name,
enforced both in the firewall and dnsmasq. The real interface name
includes the possible prefix "br-", "6in4-" etc. Example of an error:
  interface name `br-lan_protected' must be shorter than IFNAMSIZ (15)

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
9 years agoRedirect to root on empty path 535/head
Joel Pedraza [Fri, 30 Oct 2015 15:22:15 +0000 (11:22 -0400)]
Redirect to root on empty path

* Prevents an empty Location header
* Useful in environments where build_url() could return an empty string (such as http server rewrites requests to /cgi-bin/luci)

Signed-off-by: Joel Pedraza <github@saik0.net>
9 years agoluci-proto-ppp: add support for pppossh 534/head
Yousong Zhou [Fri, 30 Oct 2015 08:26:04 +0000 (16:26 +0800)]
luci-proto-ppp: add support for pppossh

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
9 years agoluci-base: add support for DynamicList with FileBrowser
Yousong Zhou [Tue, 3 Nov 2015 06:20:03 +0000 (14:20 +0800)]
luci-base: add support for DynamicList with FileBrowser

Two new arguments url, defpath were added to cbi_dynlist_init() for
initializing the brower button.

An example of usage

    identity = section:taboption("general", DynamicList, "identity",
    translate("List of SSH key files for auth"))
    identity.datatype = "file"

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
9 years agoluci-base: urlencode: encode all except unreserved characters.
Yousong Zhou [Tue, 26 Aug 2014 03:02:16 +0000 (11:02 +0800)]
luci-base: urlencode: encode all except unreserved characters.

As per http://tools.ietf.org/html/rfc3986#section-2.3

   Characters that are allowed in a URI but do not have a reserved
   purpose are called unreserved.  These include uppercase and lowercase
   letters, decimal digits, hyphen, period, underscore, and tilde.

      unreserved  = ALPHA / DIGIT / "-" / "." / "_" / "~"

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
9 years agoMerge pull request #532 from chris5560/master
Christian Schoenebeck [Sun, 1 Nov 2015 16:59:35 +0000 (17:59 +0100)]
Merge pull request #532 from chris5560/master

documentation/CBI.md fixed markdown formating

9 years agodocumentation/CBI.md fixed markdown formating 532/head
Christian Schoenebeck [Sun, 1 Nov 2015 16:57:08 +0000 (17:57 +0100)]
documentation/CBI.md fixed markdown formating

CBI.md: fixed markdown formating
ModulesHowTo.md: fixed to make link inside CBI.md work.

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
9 years agoMerge pull request #528 from nmav/no-vpn
Christian Schoenebeck [Sun, 1 Nov 2015 16:19:26 +0000 (17:19 +0100)]
Merge pull request #528 from nmav/no-vpn

ocserv: removed unnecessary option and add proxy arp option

9 years agoMerge pull request #531 from chris5560/master
Christian Schoenebeck [Sun, 1 Nov 2015 15:38:05 +0000 (16:38 +0100)]
Merge pull request #531 from chris5560/master

template cbi/value.htm implement documented property maxlength

9 years agotemplate cbi/value.htm implement documented property maxlength 531/head
Christian Schoenebeck [Sun, 1 Nov 2015 15:36:29 +0000 (16:36 +0100)]
template cbi/value.htm implement documented property maxlength

template cbi/value.htm implement already documented property maxlength

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
9 years agoMerge pull request #529 from chris5560/master
Christian Schoenebeck [Sun, 1 Nov 2015 14:34:17 +0000 (15:34 +0100)]
Merge pull request #529 from chris5560/master

cbi: Implement "readonly" property for "Value"

9 years agoocserv: added proxy arp option 528/head
Nikos Mavrogiannopoulos [Sun, 1 Nov 2015 09:15:49 +0000 (10:15 +0100)]
ocserv: added proxy arp option

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agoluci-app-ocserv: removed unecessary option
Nikos Mavrogiannopoulos [Sat, 31 Oct 2015 10:53:41 +0000 (11:53 +0100)]
luci-app-ocserv: removed unecessary option

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 years agocbi.lua: Implement "readonly" property for "Value" 529/head
Christian Schoenebeck [Sat, 31 Oct 2015 22:09:40 +0000 (23:09 +0100)]
cbi.lua: Implement "readonly" property for "Value"

cbi.lua: Implement "readonly" property for "Value"

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
9 years agotemplate cbi/value.htm: add "readonly" property
Christian Schoenebeck [Sat, 31 Oct 2015 21:54:25 +0000 (22:54 +0100)]
template cbi/value.htm: add "readonly" property

template cbi/value.htm: add "readonly" property

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
9 years agoMerge pull request #526 from chris5560/master
Christian Schoenebeck [Sat, 31 Oct 2015 20:43:41 +0000 (21:43 +0100)]
Merge pull request #526 from chris5560/master

cbi.lua: Implement Flag.validate function

9 years agocbi.lua: Implement Flag.validate function 526/head
Christian Schoenebeck [Fri, 30 Oct 2015 17:42:38 +0000 (18:42 +0100)]
cbi.lua: Implement Flag.validate function

cbi.lua
- Implement Flag.validate function to be overwritable
- rewritten if clause for easier reading ;-)

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
9 years agoluci-app-voice-core and -diag: mark broken
Hannu Nyman [Thu, 29 Oct 2015 09:59:30 +0000 (11:59 +0200)]
luci-app-voice-core and -diag: mark broken

Mark luci-app-voice-core and luci-app-voice-diag @BROKEN as their only functionality
is to create menu structure to be filled by items from luci-app-diag-devinfo,
which is currently broken due to missing dependencies.

References:

Initial commit creating all three packages:
https://github.com/openwrt/luci/commit/820f11932f548182ebb32704e1df83b78e69b19e

Explanation why luci-app-diag-devinfo is currently broken:
https://github.com/openwrt/luci/commit/ec6ccf1cd3225b51b958b38c7439f1dea8c28457

If luci-app-diag-devinfo gets its dependencies fixed, these two voice packages
might be re-activated. Combining the three packages would increase clarity.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
9 years agoluci-app-firewall: limit zone name length to 11 characters
Hannu Nyman [Wed, 28 Oct 2015 11:07:47 +0000 (13:07 +0200)]
luci-app-firewall: limit zone name length to 11 characters

Change the maximum length of a firewall zone name from 14 to 11 characters.

Longer names break iptables rule generation (max. 29 chars are allowed).

XT_EXTENSION_MAXNAMELEN = 29
29 - sizeof("postrouting_") - sizeof("_rule") - sizeof("\0") = 11

References to:
https://github.com/openwrt/luci/issues/507
https://dev.openwrt.org/ticket/20380

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
9 years agoMerge pull request #494 from ollie27/strings
Hannu Nyman [Wed, 28 Oct 2015 10:40:16 +0000 (12:40 +0200)]
Merge pull request #494 from ollie27/strings

fix string "UPNP" -> "UPnP"

9 years agofix string "UPNP" -> "UPnP" 494/head
Oliver Middleton [Sun, 27 Sep 2015 23:50:37 +0000 (00:50 +0100)]
fix string "UPNP" -> "UPnP"

Signed-off-by: Oliver Middleton <olliemail27@gmail.com>
9 years agoMerge pull request #509 from neheb/master
Hannu Nyman [Tue, 27 Oct 2015 15:30:24 +0000 (17:30 +0200)]
Merge pull request #509 from neheb/master

resources/icons: Use gifsicle to save a few bytes.

9 years agoluci-base: eliminiate use of uci state vars in luci.sys
Jo-Philipp Wich [Tue, 27 Oct 2015 13:11:11 +0000 (14:11 +0100)]
luci-base: eliminiate use of uci state vars in luci.sys

Rewrite `luci.sys.wifi.getiwinfo()` to use the ubus wireless state instead of
depreacated uci state vars in order to map abstract network notation to
wireless ifnames.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoAdd link to API reference
Jo-Philipp Wich [Tue, 27 Oct 2015 12:24:09 +0000 (13:24 +0100)]
Add link to API reference

9 years agoMove libubus-lua dependency to luci-base
Jo-Philipp Wich [Tue, 27 Oct 2015 12:09:03 +0000 (13:09 +0100)]
Move libubus-lua dependency to luci-base

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-app-diag-devinfo: mark broken due to dependencies
Hannu Nyman [Tue, 27 Oct 2015 07:57:57 +0000 (09:57 +0200)]
luci-app-diag-devinfo: mark broken due to dependencies

Mark luci-app-diag-devinfo @BROKEN as it has several failing dependencies:

Four dependencies from "oldpackages":
 httping, mac-to-devinfo, smap-to-devinfo, netdiscover-to-devinfo

One dependency from "abandoned":
 smap

(netdiscover is currently ok in trunk, but not in 15.05.)

Reference to Luci issue #523.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
9 years agoluci-app-statistics: Adjust ping graphs to show target hosts separately
Hannu Nyman [Sun, 25 Oct 2015 08:19:26 +0000 (10:19 +0200)]
luci-app-statistics: Adjust ping graphs to show target hosts separately

Ping statistics plugin allows the user to define multiple ping targets.
The graphs have so far shown multiple hosts in a stacked way.
Adjust graphs to show the target hosts separately (overlay=true).

Clarify the plugin definition with some additional line spacing.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
9 years agoluci-app-statistics: improve scaling of the associated stations graph
Hannu Nyman [Sun, 25 Oct 2015 08:11:35 +0000 (10:11 +0200)]
luci-app-statistics: improve scaling of the associated stations graph

Improve scaling of the associated stations graph on the wireless page.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
9 years agoMerge pull request #522 from LuttyYang/master
Hannu Nyman [Sat, 24 Oct 2015 06:33:42 +0000 (09:33 +0300)]
Merge pull request #522 from LuttyYang/master

luci-theme-material: fix some style bugs

9 years agoluci-theme-material: fix some style bugs 522/head
Lutty Yang [Sat, 24 Oct 2015 02:14:11 +0000 (10:14 +0800)]
luci-theme-material: fix some style bugs

Signed-off-by: Lutty Yang <lutty@wcan.in>
9 years agoMerge pull request #521 from LuttyYang/master
Hannu Nyman [Fri, 23 Oct 2015 17:21:01 +0000 (20:21 +0300)]
Merge pull request #521 from LuttyYang/master

luci-theme-material: Synchronized to the LUCI version f9e590a

9 years agoRevert "luci-theme-material: do not infer login state from url (#520)"
Hannu Nyman [Fri, 23 Oct 2015 17:16:04 +0000 (20:16 +0300)]
Revert "luci-theme-material: do not infer login state from url (#520)"

This reverts commit f9e590aa4741bf337029be3f374a33543cc3f37b
in order to enable a clean merge of the PR #521 from the theme author.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
9 years agoluci-theme-material: try find current position by using lua code 521/head
Lutty Yang [Fri, 23 Oct 2015 12:51:12 +0000 (20:51 +0800)]
luci-theme-material: try find current position by using lua code

thanks for jow

Signed-off-by: Lutty Yang <lutty@wcan.in>
9 years agoluci-theme-material: Synchronized to the LUCI version f9e590a
Lutty Yang [Fri, 23 Oct 2015 04:51:07 +0000 (12:51 +0800)]
luci-theme-material: Synchronized to the LUCI version f9e590a

Signed-off-by: Lutty Yang <lutty@wcan.in>
9 years agoluci-theme-material: do not infer login state from url (#520)
Jo-Philipp Wich [Thu, 22 Oct 2015 19:07:40 +0000 (21:07 +0200)]
luci-theme-material: do not infer login state from url (#520)

Checking for `;` in the url is no good indicator whether a user is logged in,
instead query the dispatcher and set a `logged-in` CSS class on the `<body>`
element if a session exists.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-mod-admin-full: fix invalid markup in packages.htm (#518)
Jo-Philipp Wich [Thu, 22 Oct 2015 10:20:09 +0000 (12:20 +0200)]
luci-mod-admin-full: fix invalid markup in packages.htm (#518)

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-mod-admin-full: restructure and fix backup, restore and sysuprade (#517)
Jo-Philipp Wich [Thu, 22 Oct 2015 06:35:34 +0000 (08:35 +0200)]
luci-mod-admin-full: restructure and fix backup, restore and sysuprade (#517)

Do not use standard post security checking for actions that require file upload
since reading the token value will trigger parsing of the http message body
before the file upload handler has been set, which causes LuCI to buffer the
entire request body in memory.

In order to simplify the code and logic flow, split action_flashops() into
separate handlers for reset, backup, restore and sysupgrade.

Let the backup restore and sysupgrade handlers use the new test_post_security()
method in luci.dispatcher to perform token checking *after* setting the upload
handler.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-base: dispatcher expose test_post_security()
Jo-Philipp Wich [Thu, 22 Oct 2015 06:30:29 +0000 (08:30 +0200)]
luci-base: dispatcher expose test_post_security()

Allows external code to perform POST and token checking manually.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-base: ensure that base url is emitted with trailing slash
Jo-Philipp Wich [Wed, 21 Oct 2015 14:45:48 +0000 (16:45 +0200)]
luci-base: ensure that base url is emitted with trailing slash

Now that we don't have an url token anymore, '/cgi-bin/luci' becomes a valid
url while cookies are restricted to only '/cgi-bin/luci/' and below.

In order to ensure that the first request after login refers to a path
covered by the authentication cookie, change build_url() to always append
a trailing slash if we're referring to the base url.

This should fix the login problems mentioned in #516.

While we're touching the dispatcher, also remove remaining url token code.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-mod-admin-full: do not access dispatcher.context.urltoken in logout
Jo-Philipp Wich [Wed, 21 Oct 2015 14:42:39 +0000 (16:42 +0200)]
luci-mod-admin-full: do not access dispatcher.context.urltoken in logout

The urltoken table is going to be removed.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-base: remove security token from urls
Jo-Philipp Wich [Tue, 20 Oct 2015 22:31:27 +0000 (00:31 +0200)]
luci-base: remove security token from urls

Now that sensitive urls require post requests and only accept them if a valid
security token is sent along the request, we can drop the global random url
token to improve LuCI usability.

The main improvement is the ability to use multiple tabs with the same login
session, but also deep linking to specific urls without the need for another
login becomes feasible, e.g. for documentation purposes.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-app-upnp: protect lease delete call with csrf token
Jo-Philipp Wich [Tue, 20 Oct 2015 22:11:28 +0000 (00:11 +0200)]
luci-app-upnp: protect lease delete call with csrf token

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-app-splash: protect admin status call with csrf token
Jo-Philipp Wich [Tue, 20 Oct 2015 22:09:55 +0000 (00:09 +0200)]
luci-app-splash: protect admin status call with csrf token

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-app-radicale: protect start/stop actions with csrf token
Jo-Philipp Wich [Tue, 20 Oct 2015 22:03:56 +0000 (00:03 +0200)]
luci-app-radicale: protect start/stop actions with csrf token

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-app-privoxy: protect start/stop actions with csrf token
Jo-Philipp Wich [Tue, 20 Oct 2015 22:03:03 +0000 (00:03 +0200)]
luci-app-privoxy: protect start/stop actions with csrf token

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-app-ocserv: protect disconnect action with csrf token
Jo-Philipp Wich [Tue, 20 Oct 2015 22:00:55 +0000 (00:00 +0200)]
luci-app-ocserv: protect disconnect action with csrf token

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-app-ddns: protect start/stop actions with csrf token
Jo-Philipp Wich [Tue, 20 Oct 2015 21:58:01 +0000 (23:58 +0200)]
luci-app-ddns: protect start/stop actions with csrf token

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-mod-admin-full: protect iptables counter reset and restart with token
Jo-Philipp Wich [Tue, 20 Oct 2015 20:27:39 +0000 (22:27 +0200)]
luci-mod-admin-full: protect iptables counter reset and restart with token

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-mod-admin-full: protect network post actions with csrf tokens
Jo-Philipp Wich [Tue, 20 Oct 2015 20:17:23 +0000 (22:17 +0200)]
luci-mod-admin-full: protect network post actions with csrf tokens

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-base: filter invalid opkg status lines
Jo-Philipp Wich [Tue, 20 Oct 2015 19:04:38 +0000 (21:04 +0200)]
luci-base: filter invalid opkg status lines

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-mod-admin-full: protect clock, flash and opkg ops with submit token
Jo-Philipp Wich [Tue, 20 Oct 2015 19:01:41 +0000 (21:01 +0200)]
luci-mod-admin-full: protect clock, flash and opkg ops with submit token

* Use post_on() target to require csrf token verification for modifying actions
* Ensure that package and flash operation handlers guard modifying operations
  with parameter check

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-base: generalize post security token handling
Jo-Philipp Wich [Tue, 20 Oct 2015 18:58:30 +0000 (20:58 +0200)]
luci-base: generalize post security token handling

* Add a generic helper function to check need for post / csrf token validation
* Remove custom token verification in cbi targets
* Support requiring post security depending on specific submit parameters,
  usable through post_on() action

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoMerge pull request #513 from LuttyYang/master
Hannu Nyman [Tue, 13 Oct 2015 15:15:05 +0000 (18:15 +0300)]
Merge pull request #513 from LuttyYang/master

luci-theme-material: PR from Version 0.2.11

9 years agoluci-theme-material: PR from Version 0.2.11 513/head
Lutty Yang [Tue, 13 Oct 2015 15:07:16 +0000 (23:07 +0800)]
luci-theme-material: PR from Version 0.2.11

Signed-off-by: Lutty Yang <lutty@wcan.in>
9 years agoi18n: Sync translations
Hannu Nyman [Tue, 13 Oct 2015 09:35:57 +0000 (12:35 +0300)]
i18n: Sync translations

Sync translations to the current strings.

Changes in luci-app-ddns, luci-app-mjpg-streamer, luci-app-qos,
luci-app-shadowsocks-libev, luci-app-statistics and luci-base

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
9 years agoluci-base: update i18n base template
Hannu Nyman [Tue, 13 Oct 2015 09:25:58 +0000 (12:25 +0300)]
luci-base: update i18n base template

Update i18n base template to match the current strings.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
9 years agoluci.mk: correct SK language name to Slovak
Hannu Nyman [Tue, 13 Oct 2015 07:13:50 +0000 (10:13 +0300)]
luci.mk: correct SK language name to Slovak

SK language code refers to Slovak, not Slovene.
Native language name is correct.

References:
https://forum.openwrt.org/viewtopic.php?id=60235
https://en.wikipedia.org/wiki/Slovak_language

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
9 years agoluci-app-ddns: fix typo in previous commit
Jo-Philipp Wich [Mon, 12 Oct 2015 09:13:26 +0000 (11:13 +0200)]
luci-app-ddns: fix typo in previous commit

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoTimezone information: update to 2015g
Hannu Nyman [Mon, 12 Oct 2015 07:58:09 +0000 (10:58 +0300)]
Timezone information: update to 2015g

Changes in 2015g:
http://mm.icann.org/pipermail/tz-announce/2015-October/000034.html

     Norfolk moves from +1130 to +1100 on 2015-10-04 at 02:00 local time.

     Fiji's 2016 fall-back transition is scheduled for January 17, not 24.

     Fort Nelson, British Columbia will not fall back on 2015-11-01. It has
     effectively been on MST (-0700) since it advanced its clocks on 2015-03-08.
     New zone America/Fort_Nelson.

Note: the Turkey-related one-time rule change is not apparently catched by
the zoneinfo2lua script, so that change is not included in this commit.
(Turkey's 2015 fall-back transition is scheduled for Nov. 8, not Oct. 25.)

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
9 years agoluci-app-ddns: remove title <a> hacks
Jo-Philipp Wich [Mon, 12 Oct 2015 07:14:49 +0000 (09:14 +0200)]
luci-app-ddns: remove title <a> hacks

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoresources/icons: Use gifsicle to save a few bytes. 509/head
Mangix [Fri, 9 Oct 2015 23:00:57 +0000 (16:00 -0700)]
resources/icons: Use gifsicle to save a few bytes.
Signed-off by: Rosen Penev <rosenp@gmail.com>

9 years agoMerge pull request #505 from roger-/dump1090-latlon
Jo-Philipp Wich [Thu, 8 Oct 2015 00:06:08 +0000 (02:06 +0200)]
Merge pull request #505 from roger-/dump1090-latlon

dump1090: lat/lon should be floats

9 years agodump1090: lat/lon should be floats 505/head
Roger [Wed, 7 Oct 2015 23:16:03 +0000 (18:16 -0500)]
dump1090: lat/lon should be floats

Signed-off-by: Roger D <rogerdammit@gmail.com>
9 years agoluci-base: prevent UCI changes in CBI if form is not in submit state
Jo-Philipp Wich [Wed, 7 Oct 2015 19:44:46 +0000 (21:44 +0200)]
luci-base: prevent UCI changes in CBI if form is not in submit state

Only process submitted data if the "cbi.submit" parameter is present as the
dispatcher will verify the integrity of the CSRF token in this case.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoGlobally replace luci.dispatcher.build_url(...) with url(...) invocations
Jo-Philipp Wich [Wed, 7 Oct 2015 17:07:36 +0000 (19:07 +0200)]
Globally replace luci.dispatcher.build_url(...) with url(...) invocations

Also concat multiple string arguments into one while we're at it.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-base: expose luci.dispatcher.build_url() as url() in templates
Jo-Philipp Wich [Wed, 7 Oct 2015 11:03:42 +0000 (13:03 +0200)]
luci-base: expose luci.dispatcher.build_url() as url() in templates

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-base: protect simpleforms with CSRF tokens
Jo-Philipp Wich [Wed, 7 Oct 2015 10:24:51 +0000 (12:24 +0200)]
luci-base: protect simpleforms with CSRF tokens

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-mod-admin-full: switch to POST action for reboot
Jo-Philipp Wich [Tue, 6 Oct 2015 23:54:56 +0000 (01:54 +0200)]
luci-mod-admin-full: switch to POST action for reboot

Also rework the reboot tmeplate a little bit.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-base: switch to POST action for service reload
Jo-Philipp Wich [Tue, 6 Oct 2015 20:37:23 +0000 (22:37 +0200)]
luci-base: switch to POST action for service reload

Switches the service reload calls to CSRF token protected POST action.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-mod-admin-full: switch to POST actions for UCI changes
Jo-Philipp Wich [Tue, 6 Oct 2015 20:29:07 +0000 (22:29 +0200)]
luci-mod-admin-full: switch to POST actions for UCI changes

Switches UCI apply/revert/save to CSRF token protected POST actions.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-theme-bootstrap: add redir parameter to uci change menu
Jo-Philipp Wich [Tue, 6 Oct 2015 20:21:48 +0000 (22:21 +0200)]
luci-theme-bootstrap: add redir parameter to uci change menu

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-theme-material: add redir parameter to uci change menu
Jo-Philipp Wich [Tue, 6 Oct 2015 20:21:36 +0000 (22:21 +0200)]
luci-theme-material: add redir parameter to uci change menu

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-base: protect CBI forms with CSRF tokens
Jo-Philipp Wich [Tue, 6 Oct 2015 16:54:35 +0000 (18:54 +0200)]
luci-base: protect CBI forms with CSRF tokens

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
9 years agoluci-base: add support for POST-only actions with CSRF token check
Jo-Philipp Wich [Tue, 6 Oct 2015 13:53:35 +0000 (15:53 +0200)]
luci-base: add support for POST-only actions with CSRF token check

Add the dispatcher infrastructure to restrict certain routes to POST
requests only in conjunction with verification of CSRF tokens.

This is the first step to get rid of the CSRF token in the url in favor
to tokens embedded in forms.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>