project/luci.git
6 years agoluci-base: fix dispacher fail 1814/head
Ansuel Smith [Sun, 20 May 2018 17:51:33 +0000 (19:51 +0200)]
luci-base: fix dispacher fail

http.getenv("SCRIPT_NAME") fail if it's not provided. This can happen in the login screen when we don't have any script to load.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
6 years agoMerge pull request #1805 from musashino205/l10n/base-upd-ja
Hannu Nyman [Sun, 20 May 2018 16:26:57 +0000 (19:26 +0300)]
Merge pull request #1805 from musashino205/l10n/base-upd-ja

luci-base: update Japanese translation

6 years agoluci-base: update Japanese translation 1805/head
INAGAKI Hiroshi [Sun, 20 May 2018 16:01:31 +0000 (01:01 +0900)]
luci-base: update Japanese translation

Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years agoi18n: sync translations
INAGAKI Hiroshi [Sun, 20 May 2018 13:29:33 +0000 (22:29 +0900)]
i18n: sync translations

Synchronized translations with sources.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years agoluci-mod-admin-full: fix crash on wireless when no networks are declared
Jo-Philipp Wich [Sat, 19 May 2018 21:28:14 +0000 (23:28 +0200)]
luci-mod-admin-full: fix crash on wireless when no networks are declared

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-mod-admin-full: do not override iface section in wireless cbi map
Jo-Philipp Wich [Sat, 19 May 2018 21:26:34 +0000 (23:26 +0200)]
luci-mod-admin-full: do not override iface section in wireless cbi map

Do override the iface section id upon commit to avoid clobbering the resulting
configuration. The manual config sync is not needed anymore after switching
to uncached ubus uci operations.

Fixes #1770.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-base: handle potential crash in luci.model.network.interface.get_i18n()
Jo-Philipp Wich [Sat, 19 May 2018 20:11:05 +0000 (22:11 +0200)]
luci-base: handle potential crash in luci.model.network.interface.get_i18n()

Should prevent the crash mentioned in #1779.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-base: break circular luci.config <> luci.model.uci dependency
Jo-Philipp Wich [Sat, 19 May 2018 11:07:37 +0000 (13:07 +0200)]
luci-base: break circular luci.config <> luci.model.uci dependency

On certain environments, mainly with the embedded uhttpd interpreter, the
luci.config class cannot be loaded due to a circular dependency with the
luci.model.uci class.

Break up the dependency by deferring the loading of luci.config in
luci.model.uci until it is actually needed.

Fixes #1803, FS#1553.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoMerge pull request #1801 from dibdot/adblock
Dirk Brenken [Fri, 18 May 2018 16:31:07 +0000 (18:31 +0200)]
Merge pull request #1801 from dibdot/adblock

luci-app-adblock: respect SimpleForm size limit

6 years agoluci-app-adblock: respect SimpleForm size limit 1801/head
Dirk Brenken [Fri, 18 May 2018 16:17:31 +0000 (18:17 +0200)]
luci-app-adblock: respect SimpleForm size limit

* respect SimpleForm size limit of 100KB for advanced online editing

Signed-off-by: Dirk Brenken <dev@brenken.org>
6 years agoluci-lib-json: support serializing userdata
Jo-Philipp Wich [Fri, 18 May 2018 14:59:16 +0000 (16:59 +0200)]
luci-lib-json: support serializing userdata

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>
6 years agoluci-mod-rpc: fix unresolved controller reference in rpc_auth()
Jo-Philipp Wich [Fri, 18 May 2018 14:58:17 +0000 (16:58 +0200)]
luci-mod-rpc: fix unresolved controller reference in rpc_auth()

Fixes the following error:

   .../rpc.lua:85: attempt to index global 'ctrl' (a nil value)

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoMerge pull request #1769 from jow-/master
Jo-Philipp Wich [Fri, 18 May 2018 14:44:33 +0000 (16:44 +0200)]
Merge pull request #1769 from jow-/master

UCI apply/rollback workflow

6 years agoluci-base: raise maximum POST value size to 100KB
Jo-Philipp Wich [Fri, 18 May 2018 14:42:43 +0000 (16:42 +0200)]
luci-base: raise maximum POST value size to 100KB

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agolucihttp: update to latest HEAD
Jo-Philipp Wich [Fri, 18 May 2018 09:42:40 +0000 (11:42 +0200)]
lucihttp: update to latest HEAD

6ddea4c utils: fix crash with zero length input string in lh_header_attribute()
cb119de lib: add support for setting the maximum allowed data size

Fixes #1784.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoMerge pull request #1748 from hnyman/wifidata
Hannu Nyman [Fri, 18 May 2018 09:51:24 +0000 (12:51 +0300)]
Merge pull request #1748 from hnyman/wifidata

luci-base: show wifi chip identification on overview

6 years agoMerge pull request #1793 from TDT-AG/pr/20180514-luci-app-ddns-fix-output
Hannu Nyman [Wed, 16 May 2018 06:28:08 +0000 (09:28 +0300)]
Merge pull request #1793 from TDT-AG/pr/20180514-luci-app-ddns-fix-output

luci-app-ddns: fix HTML page rendering in globals section

6 years agoluci-app-ddns: fix HTML page rendering in globals section 1793/head
Helge Mader [Mon, 23 Apr 2018 11:26:41 +0000 (13:26 +0200)]
luci-app-ddns: fix HTML page rendering in globals section

Signed-off-by: Helge Mader <ma@dev.tdt.de>
6 years agoMerge pull request #1797 from Rixerx/master
Hannu Nyman [Tue, 15 May 2018 15:15:32 +0000 (18:15 +0300)]
Merge pull request #1797 from Rixerx/master

luci-base: update Polish translation

6 years agoMerge pull request #1796 from TDT-AG/pr/20180515-luci-app-mwan3-add-param
Hannu Nyman [Tue, 15 May 2018 15:15:04 +0000 (18:15 +0300)]
Merge pull request #1796 from TDT-AG/pr/20180515-luci-app-mwan3-add-param

luci-app-mwan3: add new config options and fix

6 years agoluci-base: update Polish translation 1797/head
Rixerx [Mon, 14 May 2018 20:21:30 +0000 (22:21 +0200)]
luci-base: update Polish translation

Signed-off-by: Rixerx <krystian.kozak20@gmail.com>
6 years agoluci-app-mwan3: add quality check options 1796/head
Florian Eckert [Mon, 7 May 2018 12:38:10 +0000 (14:38 +0200)]
luci-app-mwan3: add quality check options

Add new quality_check feature

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
6 years agoluci-app-mwan3: add dependecy to size option
Florian Eckert [Mon, 7 May 2018 08:56:22 +0000 (10:56 +0200)]
luci-app-mwan3: add dependecy to size option

This option is only valid if track-method is set to "ping".

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
6 years agoMerge pull request #1794 from dibdot/adblock
Dirk Brenken [Tue, 15 May 2018 06:07:10 +0000 (08:07 +0200)]
Merge pull request #1794 from dibdot/adblock

luci-app-adblock: sync with adblock 3.5.2

6 years agoluci-app-adblock: sync with adblock 3.5.2 1794/head
Dirk Brenken [Mon, 14 May 2018 20:09:31 +0000 (22:09 +0200)]
luci-app-adblock: sync with adblock 3.5.2

* archive sub-categories (shalla & ut_capitole) are now configurable
  via LuCI CBI template
* small bugfixes & enhancements

Signed-off-by: Dirk Brenken <dev@brenken.org>
6 years agoluci-base: harden cookie sysauth=
Yousong Zhou [Sun, 13 May 2018 09:55:01 +0000 (17:55 +0800)]
luci-base: harden cookie sysauth=

A simple scan of the code indicates that currently no code in the repo
is accessing the sysauth= cookie

Closes openwrt/luci#1555

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
6 years agoMerge pull request #1786 from musashino205/l10n/pagekite-add-ja
Dirk Brenken [Sat, 12 May 2018 07:36:54 +0000 (09:36 +0200)]
Merge pull request #1786 from musashino205/l10n/pagekite-add-ja

luci-app-pagekitec: add Japanese translation

6 years agoMerge pull request #1787 from TDT-AG/pr/20180509-net-mwan3-fixes
Dirk Brenken [Fri, 11 May 2018 18:26:11 +0000 (20:26 +0200)]
Merge pull request #1787 from TDT-AG/pr/20180509-net-mwan3-fixes

luci-app-mwan3: fixes

6 years agoMerge pull request #1791 from dibdot/travelmate
Dirk Brenken [Fri, 11 May 2018 18:15:20 +0000 (20:15 +0200)]
Merge pull request #1791 from dibdot/travelmate

luci-app-travelmate: fix Interface Wizard

6 years agoluci-app-travelmate: fix Interface Wizard 1791/head
Dirk Brenken [Fri, 11 May 2018 09:00:16 +0000 (11:00 +0200)]
luci-app-travelmate: fix Interface Wizard

* make sure to update the nw & fw entries only once

Signed-off-by: Dirk Brenken <dev@brenken.org>
6 years agoMerge pull request #1789 from ldir-EDB0/miniupdpdtweak
Hannu Nyman [Wed, 9 May 2018 19:11:48 +0000 (22:11 +0300)]
Merge pull request #1789 from ldir-EDB0/miniupdpdtweak

luci-app-upnp: change leasefile location hint

6 years agoluci-app-upnp: change leasefile location hint 1789/head
Kevin Darbyshire-Bryant [Wed, 9 May 2018 12:50:35 +0000 (13:50 +0100)]
luci-app-upnp: change leasefile location hint

Change default leasefile hint from /var/log/upnp.leases to
/var/run/miniupnpd.leases

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
6 years agoluci-app-mwan3: pin diag ping command to interface device 1787/head
Florian Eckert [Wed, 9 May 2018 11:48:27 +0000 (13:48 +0200)]
luci-app-mwan3: pin diag ping command to interface device

If the physical device is not set in the diag_command then the ping will
always use the route with the lowest metric from the default routing
table.
To fix this add the physical device of the logical interface to the ping
command.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
6 years agoluci-app-mwan3: honor dynamic interface to get gateway ip
Florian Eckert [Wed, 9 May 2018 11:13:20 +0000 (13:13 +0200)]
luci-app-mwan3: honor dynamic interface to get gateway ip

If a logical interface setup and adds in the protocol handler a dynamic
interface then the gateway is configured in the dynamic interface and the
setting up logical interface does not have a gateway specified.
To fix this check first if a dynamic interface is present and use this
gateway ip if found and if no dynamich interface is set then check for a
gateway in the logical interface.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
6 years agoMerge pull request #1780 from dibdot/adblock
Dirk Brenken [Wed, 9 May 2018 11:38:09 +0000 (13:38 +0200)]
Merge pull request #1780 from dibdot/adblock

luci-app-adblock: support new workflow

6 years agoluci-app-adblock: support new workflow 1780/head
Dirk Brenken [Sat, 5 May 2018 06:16:40 +0000 (08:16 +0200)]
luci-app-adblock: support new workflow

* adapt Adblock to support the new cbi apply workflow
* tested successfully with old & new workflow

Signed-off-by: Dirk Brenken <dev@brenken.org>
6 years agoMerge pull request #1777 from dibdot/travelmate
Dirk Brenken [Wed, 9 May 2018 11:19:14 +0000 (13:19 +0200)]
Merge pull request #1777 from dibdot/travelmate

luci-app-travelmate: support new workflow

6 years agoMerge pull request #1785 from EricLuehrsen/unbound_luci
Dirk Brenken [Wed, 9 May 2018 11:18:13 +0000 (13:18 +0200)]
Merge pull request #1785 from EricLuehrsen/unbound_luci

luci-app-unbound: clean up tab presentation

6 years agoluci-app-travelmate: support new workflow & re-ordering fix 1777/head
Dirk Brenken [Thu, 3 May 2018 05:53:48 +0000 (07:53 +0200)]
luci-app-travelmate: support new workflow & re-ordering fix

* Remove SimpleForm stuff from Interface Wizard
* adapt Travelmate to support new cbi apply workflow
* fix station re-odering
* tested successfully with old & new workflow

Signed-off-by: Dirk Brenken <dev@brenken.org>
6 years agoluci-app-pagekitec: add Japanese translation 1786/head
INAGAKI Hiroshi [Fri, 4 May 2018 12:37:57 +0000 (21:37 +0900)]
luci-app-pagekitec: add Japanese translation

Added Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years agoluci-app-unbound: clean up tab presentation 1785/head
Eric Luehrsen [Tue, 8 May 2018 05:48:44 +0000 (01:48 -0400)]
luci-app-unbound: clean up tab presentation

Some of the options in the tabs were not placed in
optimal groups. Add tabs for DHCP and start triggers.

Signed-off-by: Eric Luehrsen <ericluehrsen@hotmail.com>
6 years agoluci-app-commands: fix link generation
Yousong Zhou [Mon, 7 May 2018 14:07:15 +0000 (22:07 +0800)]
luci-app-commands: fix link generation

Fixes openwrt/luci##824

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
6 years agoluci-mod-freifunk: fix redirect url
Yousong Zhou [Mon, 7 May 2018 14:20:18 +0000 (22:20 +0800)]
luci-mod-freifunk: fix redirect url

location.hostname lacks port info

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
6 years agoluci-app-firewall: redirect to overview page on zone details save
Florian Eckert [Tue, 20 Dec 2016 13:06:34 +0000 (14:06 +0100)]
luci-app-firewall: redirect to overview page on zone details save

This fixes an inconsistency because on the interface configuration if
you press Save&Apply it will go back to overview page.  It is also the
case with "Firewall - Traffic Rules" details.  On firewall zone it only
goes back to firewall zone-detail. Same behaviour on all pages is a good
user experience.

Signed-off-by: Florian Eckert <Eckert.Florian@googlemail.com>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
6 years agoluci-mod-admin-full: use fs.glob instead nixio.fs.glob
Yousong Zhou [Mon, 7 May 2018 13:17:42 +0000 (21:17 +0800)]
luci-mod-admin-full: use fs.glob instead nixio.fs.glob

It's how the module was named when "require"d and used by other code in
the same function

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
6 years agoluci-mod-admin-full: no menu entry for leds if "/sys/class/leds" is empty
Florian Eckert [Sun, 4 Jun 2017 16:49:27 +0000 (18:49 +0200)]
luci-mod-admin-full: no menu entry for leds if "/sys/class/leds" is empty

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
6 years agoluci-mod-admin-full: change supports_reset() test for factory reset
Florian Eckert [Wed, 29 Nov 2017 15:51:08 +0000 (16:51 +0100)]
luci-mod-admin-full: change supports_reset() test for factory reset

The check "supports_reset" only covers /proc/mtd partitions. If we have
this the commands checks for names like ubi or rootfs_data. If this is
found the system is possible for a factory reset.  But on x86 the
situation is different.  We have no /proc/mtd partitions because this
system do not use a bare metall flash.

To solve this issue check if we have an overlay and if so we could do a
factory reset. This could be applied for system which uses bare metal
flash and system which uses FTL or harddisks.

Jffs2reset is the current command used for factory reset.  It will try
to find volume "rootfs_data" and if it's mounted will delete all files
under directory /overlay

luci-mod-admin-mini also has check for reset available, but we leave it
alone for now as it uses "mtd -r erase rootfs_data"

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
6 years agoluci-app-openvpn: add license tag
Florian Eckert [Sun, 15 Jan 2017 08:28:04 +0000 (09:28 +0100)]
luci-app-openvpn: add license tag

Add missing license tag.  File headers of the application indicate so

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
6 years agoluci-base: reload log on uci system change
Florian Eckert [Wed, 22 Nov 2017 11:09:45 +0000 (12:09 +0100)]
luci-base: reload log on uci system change

If log configuration get changed in uci system no new values are applied
until reboot. Add /etc/init.d/log reload to exec option will solve this
issue.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
6 years agoluci-proto-ppp: add translation to ipv6 handling
Florian Eckert [Wed, 4 Apr 2018 12:04:17 +0000 (14:04 +0200)]
luci-proto-ppp: add translation to ipv6 handling

If there is no translation set, then on material theme the dropdown
selection displaced. To fix this add an translation to this dropdown.

The commit also changes source code whitespace shifting.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
6 years agoluci-base: fix i18n de typo for rc.local
Florian Eckert [Mon, 7 May 2018 05:47:17 +0000 (07:47 +0200)]
luci-base: fix i18n de typo for rc.local

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
6 years agoluci-base: add transitional /etc/init.d/ucitrack 1769/head
Jo-Philipp Wich [Wed, 2 May 2018 08:37:02 +0000 (10:37 +0200)]
luci-base: add transitional /etc/init.d/ucitrack

Ship an /etc/init.d/ucitrack for spawning a virtual service with the sole
purpose to track the configurations and dependencies formerly handled by
luci-reload.

Once all LuCI supported services ship with procd compatible init scripts,
the uci track support can be dropped.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-mod-admin-full: rework wifi configuration
Jo-Philipp Wich [Tue, 1 May 2018 19:12:12 +0000 (21:12 +0200)]
luci-mod-admin-full: rework wifi configuration

- localize variables
- get rid of redirects breaking apply workflow
- auto-adjust unusable channels when switching country
- use apply/rollback workflow when enabling/disabling networks

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agotreewide: rework uci apply workflow
Jo-Philipp Wich [Thu, 26 Apr 2018 06:52:55 +0000 (08:52 +0200)]
treewide: rework uci apply workflow

Switch to rpcd based uci apply/rollback workflow which helps to avoid soft-
bricking devices by requiring an explicit confirmation call after config
apply.

When a user now clicks "Save & Apply", LuCI first issues a call to uci apply
which commits and reloads configuration, then goes into a polling countdown
mode where it repeatedly attempts to call uci confirm.

If the committed configuration is sane, the confirm call will go through and
cancel rpcd's pending rollback timer.

If the configuration change leads to a loss of connectivity (e.g. due to bad
firewall rules or similar), the rollback mechanism will kick in after the
timeout and revert configuration files and pending changes to the pre-apply
state.

In order to cover such rare cases where a lost of connectivity is expected
and desired, the user is offered an "unchecked" apply option after timing
out, which allows committing and applying the changes anyway, without the
extra safety checks.

As a consequence of this change, the luci-reload mechanism is now completely
unsused since rpcd uses ubus config reload signals to reload affected
services, which means that only procd-enabled services will receive proper
reload treatment with the new workflow.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-base: enable uci session isolation
Jo-Philipp Wich [Tue, 24 Apr 2018 19:26:01 +0000 (21:26 +0200)]
luci-base: enable uci session isolation

Switch to per-session save directories to decouple LuCI configuration changes
from system wide ones.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-mod-rpc: more auth/login fixes, expose further libraries
Jo-Philipp Wich [Sat, 5 May 2018 20:56:30 +0000 (22:56 +0200)]
luci-mod-rpc: more auth/login fixes, expose further libraries

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>
6 years agoluci-app-upnp: sync translations
Hannu Nyman [Sat, 5 May 2018 20:16:05 +0000 (23:16 +0300)]
luci-app-upnp: sync translations

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
6 years agoluci-base: xhr.js: fix timeout setting with IE 11
Jo-Philipp Wich [Sat, 28 Apr 2018 20:55:08 +0000 (22:55 +0200)]
luci-base: xhr.js: fix timeout setting with IE 11

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>
6 years agoluci-base: show wifi chip identification on overview 1748/head
Hannu Nyman [Sat, 5 May 2018 18:20:41 +0000 (21:20 +0300)]
luci-base: show wifi chip identification on overview

Show the correct wifi chip identification in case iwinfo
recognises the chip.

So far the wifidev.get_i18n function has practically always
returned just "Generic", but use iwinfo.hardware_name to
fetch the name.

In case iwinfo returns the default "Generic MAC80211", there
is a double 80211 in the final string, which is a cosmetic bug.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
6 years agoluci-mod-rpc: fix authentication via query string parameter
Jo-Philipp Wich [Sat, 5 May 2018 17:51:20 +0000 (19:51 +0200)]
luci-mod-rpc: fix authentication via query string parameter

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>
6 years agoMerge pull request #1778 from ldir-EDB0/igdv2
Jo-Philipp Wich [Sat, 5 May 2018 17:41:22 +0000 (19:41 +0200)]
Merge pull request #1778 from ldir-EDB0/igdv2

luci-app-upnp: support igdv1 run time flag

6 years agoluci-base: support hiding the "Back to Overview" button in cbi maps
Jo-Philipp Wich [Thu, 3 May 2018 06:22:16 +0000 (08:22 +0200)]
luci-base: support hiding the "Back to Overview" button in cbi maps

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoRevert "luci-base: support hiding the "Back to Overview" button in cbi maps"
Jo-Philipp Wich [Thu, 3 May 2018 06:24:15 +0000 (08:24 +0200)]
Revert "luci-base: support hiding the "Back to Overview" button in cbi maps"

This reverts commit 52cf265c9d12537d5f37043350328d30ca11bab4.

I accidentally committed unrelated changes.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-base: support hiding the "Back to Overview" button in cbi maps
Jo-Philipp Wich [Thu, 3 May 2018 06:22:16 +0000 (08:22 +0200)]
luci-base: support hiding the "Back to Overview" button in cbi maps

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-app-upnp: support igdv1 run time flag 1778/head
Kevin Darbyshire-Bryant [Sun, 29 Apr 2018 18:28:54 +0000 (19:28 +0100)]
luci-app-upnp: support igdv1 run time flag

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
6 years agoMerge pull request #1776 from lamego/fix-indentifies-typo
Hannu Nyman [Wed, 2 May 2018 20:26:45 +0000 (23:26 +0300)]
Merge pull request #1776 from lamego/fix-indentifies-typo

Fixing small typo

6 years agoFixing small typo 1776/head
Ricardo Lamego [Wed, 2 May 2018 20:01:53 +0000 (21:01 +0100)]
Fixing small typo

indentifies > identifies

6 years agoMerge pull request #1775 from musashino205/l10n/base-upd-ja
Hannu Nyman [Wed, 2 May 2018 15:40:08 +0000 (18:40 +0300)]
Merge pull request #1775 from musashino205/l10n/base-upd-ja

luci-base: update Japanese translation

6 years agoluci-base: update Japanese translation 1775/head
INAGAKI Hiroshi [Wed, 2 May 2018 15:25:41 +0000 (00:25 +0900)]
luci-base: update Japanese translation

Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years agoluci-mod-admin-full: canonicalize configured static lease MAC
Jo-Philipp Wich [Wed, 2 May 2018 14:52:37 +0000 (16:52 +0200)]
luci-mod-admin-full: canonicalize configured static lease MAC

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>
6 years agoluci-base: sync translations
INAGAKI Hiroshi [Wed, 2 May 2018 14:53:48 +0000 (23:53 +0900)]
luci-base: sync translations

Synchronized translations with sources.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years agoMerge pull request #1705 from Mushoz/add-igmp-snooping
Jo-Philipp Wich [Wed, 2 May 2018 14:31:27 +0000 (16:31 +0200)]
Merge pull request #1705 from Mushoz/add-igmp-snooping

luci-mod-admin-full: add igmp snooping option

6 years agoluci-app-statistics: convert init script to procd
Jo-Philipp Wich [Wed, 2 May 2018 05:13:34 +0000 (07:13 +0200)]
luci-app-statistics: convert init script to procd

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>
6 years agoMerge pull request #1690 from karlp/pagekite
Hannu Nyman [Tue, 1 May 2018 07:01:50 +0000 (10:01 +0300)]
Merge pull request #1690 from karlp/pagekite

luci-app-pagekitec: new package

6 years agodocumentation: regenerate documents from current code base
Jo-Philipp Wich [Mon, 30 Apr 2018 12:45:25 +0000 (14:45 +0200)]
documentation: regenerate documents from current code base

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-app-ddns: fix typo: CRTL should be CTRL
fy1128 [Sat, 28 Apr 2018 05:54:08 +0000 (08:54 +0300)]
luci-app-ddns: fix typo: CRTL should be CTRL

Reference to https://github.com/openwrt/luci/pull/1756
cherry picked from commit d9cd43fee1d9e0b01c91e569820ba83120d8840b

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
6 years agoMerge pull request #1767 from SvenRoederer/patch-2
Hannu Nyman [Sat, 28 Apr 2018 05:48:09 +0000 (08:48 +0300)]
Merge pull request #1767 from SvenRoederer/patch-2

luci-mod-freifunk: align spacing

6 years agoluci-base: extend xhr.js
Jo-Philipp Wich [Thu, 26 Apr 2018 07:39:22 +0000 (09:39 +0200)]
luci-base: extend xhr.js

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>
6 years agothemes: fix CSS class of uci change indicator
Jo-Philipp Wich [Thu, 26 Apr 2018 07:28:53 +0000 (09:28 +0200)]
themes: fix CSS class of uci change indicator

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>
6 years agothemes: add common class to uci change indicator
Jo-Philipp Wich [Thu, 26 Apr 2018 06:21:59 +0000 (08:21 +0200)]
themes: add common class to uci change indicator

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>
6 years agoluci-base: add simple CORS handling to luci.dispatcher
Jo-Philipp Wich [Tue, 24 Apr 2018 18:32:47 +0000 (20:32 +0200)]
luci-base: add simple CORS handling to luci.dispatcher

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>
6 years agoluci-base: handle bodies of non-POST requests as well
Jo-Philipp Wich [Tue, 24 Apr 2018 18:29:59 +0000 (20:29 +0200)]
luci-base: handle bodies of non-POST requests as well

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>
6 years agoluci-mod-freifunk: align spacing 1767/head
Sven Roederer [Wed, 25 Apr 2018 19:13:00 +0000 (21:13 +0200)]
luci-mod-freifunk: align spacing

remove some tailing tabs and an empty line in OSMLatLon.htm

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
6 years agoMerge pull request #1766 from musashino205/l10n/dcp-upd-ja
Hannu Nyman [Wed, 25 Apr 2018 15:32:54 +0000 (18:32 +0300)]
Merge pull request #1766 from musashino205/l10n/dcp-upd-ja

luci-app-dnscrypt-proxy: update Japanese translation

6 years agoMerge pull request #1765 from musashino205/l10n/base-upd-ja
Hannu Nyman [Wed, 25 Apr 2018 15:32:23 +0000 (18:32 +0300)]
Merge pull request #1765 from musashino205/l10n/base-upd-ja

luci-base: update japanese translation

6 years agoluci-base: update japanese translation 1765/head
INAGAKI Hiroshi [Wed, 25 Apr 2018 15:25:16 +0000 (00:25 +0900)]
luci-base: update japanese translation

Updated japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years agoluci-app-dnscrypt-proxy: update Japanese translation 1766/head
INAGAKI Hiroshi [Wed, 25 Apr 2018 14:13:28 +0000 (23:13 +0900)]
luci-app-dnscrypt-proxy: update Japanese translation

Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years agoluci-base: additionally return error code strings in luci.util.ubus()
Jo-Philipp Wich [Tue, 24 Apr 2018 17:22:55 +0000 (19:22 +0200)]
luci-base: additionally return error code strings in luci.util.ubus()

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>
6 years agoluci-base: ensure that file upload values have length
Jo-Philipp Wich [Tue, 24 Apr 2018 11:37:33 +0000 (13:37 +0200)]
luci-base: ensure that file upload values have length

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>
6 years agoMerge pull request #1759 from pmelange/feature_remove_nameserver_213_73_91_35
Hannu Nyman [Mon, 23 Apr 2018 14:42:05 +0000 (17:42 +0300)]
Merge pull request #1759 from pmelange/feature_remove_nameserver_213_73_91_35

Removed retired nameserver 213.73.91.35 from the Freifunk profiles

6 years agoRemoved retired nameserver 213.73.91.35 from the Freifunk profiles 1759/head
pmelange [Mon, 23 Apr 2018 14:27:08 +0000 (16:27 +0200)]
Removed retired nameserver 213.73.91.35 from the Freifunk profiles
See issue openwrt/luci#1757

Signed-off-by: Perry Melange <isprotejesvalkata@gmail.com>
6 years agoluci-base: decode plus signs in x-www-form-urlencoded POST data
Jo-Philipp Wich [Sun, 22 Apr 2018 10:03:23 +0000 (12:03 +0200)]
luci-base: decode plus signs in x-www-form-urlencoded POST data

Depends on 5ef51b2ab ("lucihttp: update to latest HEAD").
Fixes #1755.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agolucihttp: update to latest HEAD
Jo-Philipp Wich [Sun, 22 Apr 2018 09:59:47 +0000 (11:59 +0200)]
lucihttp: update to latest HEAD

ccc685e lua: expose LH_URLDECODE_PLUS flag in Lua library

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-base: ship rpcd uci access ACL
Jo-Philipp Wich [Sat, 21 Apr 2018 12:59:41 +0000 (14:59 +0200)]
luci-base: ship rpcd uci access ACL

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>
6 years agoluci-app-lxc: fix syntax error in previous commit
Jo-Philipp Wich [Sat, 21 Apr 2018 12:37:08 +0000 (14:37 +0200)]
luci-app-lxc: fix syntax error in previous commit

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoluci-app-lxc: various changes
Admin Localnet [Mon, 30 Oct 2017 20:12:25 +0000 (21:12 +0100)]
luci-app-lxc: various changes

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>
6 years agolucihttp: update to latest HEAD
Jo-Philipp Wich [Fri, 20 Apr 2018 09:23:27 +0000 (11:23 +0200)]
lucihttp: update to latest HEAD

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>
6 years agoluci-base: properly handle repeated POST parameters
Jo-Philipp Wich [Thu, 19 Apr 2018 09:56:44 +0000 (11:56 +0200)]
luci-base: properly handle repeated POST parameters

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>
6 years agoluci-base: implement session handling in luci.model.uci
Jo-Philipp Wich [Thu, 19 Apr 2018 09:42:12 +0000 (11:42 +0200)]
luci-base: implement session handling in luci.model.uci

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>
6 years agoluci-base: drop dependency on libuci-lua
Jo-Philipp Wich [Wed, 18 Apr 2018 14:54:53 +0000 (16:54 +0200)]
luci-base: drop dependency on libuci-lua

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>