Commit graph

9609 commits

Author SHA1 Message Date
Hannu Nyman
658b6d7d21
Merge pull request #1789 from ldir-EDB0/miniupdpdtweak
luci-app-upnp: change leasefile location hint
2018-05-09 22:11:48 +03:00
Kevin Darbyshire-Bryant
ea02940c0e 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>
2018-05-09 20:05:44 +01:00
Florian Eckert
ee54a9542f 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>
2018-05-09 14:20:03 +02:00
Florian Eckert
f50de41959 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>
2018-05-09 14:19:58 +02:00
Dirk Brenken
3b709d8cdf
Merge pull request #1780 from dibdot/adblock
luci-app-adblock: support new workflow
2018-05-09 13:38:09 +02:00
Dirk Brenken
3aae6ce82e 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>
2018-05-09 13:35:49 +02:00
Dirk Brenken
ffb654310e
Merge pull request #1777 from dibdot/travelmate
luci-app-travelmate: support new workflow
2018-05-09 13:19:14 +02:00
Dirk Brenken
741327dfe2
Merge pull request #1785 from EricLuehrsen/unbound_luci
luci-app-unbound: clean up tab presentation
2018-05-09 13:18:13 +02:00
Dirk Brenken
e7edcb4057 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>
2018-05-09 13:13:33 +02:00
INAGAKI Hiroshi
71ffabc11c luci-app-pagekitec: add Japanese translation
Added Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-05-09 16:16:26 +09:00
Eric Luehrsen
1204d2a617 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>
2018-05-08 22:57:32 -04:00
Yousong Zhou
e4f77ace8b luci-app-commands: fix link generation
Fixes openwrt/luci##824

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2018-05-07 22:28:40 +08:00
Yousong Zhou
b810d99503 luci-mod-freifunk: fix redirect url
location.hostname lacks port info

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2018-05-07 22:27:58 +08:00
Florian Eckert
c1eba6a046 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>
2018-05-07 21:46:38 +08:00
Yousong Zhou
c91ba4babc 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>
2018-05-07 21:19:35 +08:00
Florian Eckert
690ae5c211 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>
2018-05-07 21:14:48 +08:00
Florian Eckert
da4fab0462 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>
2018-05-07 20:36:40 +08:00
Florian Eckert
428eb63f0a 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>
2018-05-07 20:06:34 +08:00
Florian Eckert
6f3007980b 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>
2018-05-07 14:37:35 +08:00
Florian Eckert
54455719e5 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>
2018-05-07 14:03:32 +08:00
Florian Eckert
3cb7452eba luci-base: fix i18n de typo for rc.local
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2018-05-07 13:51:18 +08:00
Jo-Philipp Wich
9f796fad3a 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>
2018-05-05 23:11:23 +02:00
Jo-Philipp Wich
fd1ddcc419 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>
2018-05-05 23:11:23 +02:00
Jo-Philipp Wich
8deb949551 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>
2018-05-05 23:11:23 +02:00
Jo-Philipp Wich
7cca313959 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>
2018-05-05 23:11:23 +02:00
Jo-Philipp Wich
055b621cf5 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>
2018-05-05 23:11:07 +02:00
Hannu Nyman
6b6733b11e luci-app-upnp: sync translations
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-05-05 23:16:05 +03:00
Jo-Philipp Wich
34821b15a5 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>
2018-05-05 21:16:53 +02:00
Hannu Nyman
4edc9256fa 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>
2018-05-05 21:20:41 +03:00
Jo-Philipp Wich
6a1cdca345 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>
2018-05-05 19:56:26 +02:00
Jo-Philipp Wich
9664fb3d81
Merge pull request #1778 from ldir-EDB0/igdv2
luci-app-upnp: support igdv1 run time flag
2018-05-05 19:41:22 +02:00
Jo-Philipp Wich
b0f3946570 luci-base: support hiding the "Back to Overview" button in cbi maps
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-03 08:25:26 +02:00
Jo-Philipp Wich
07de9190d8 Revert "luci-base: support hiding the "Back to Overview" button in cbi maps"
This reverts commit 52cf265c9d.

I accidentally committed unrelated changes.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-03 08:24:36 +02:00
Jo-Philipp Wich
52cf265c9d luci-base: support hiding the "Back to Overview" button in cbi maps
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-05-03 08:22:55 +02:00
Kevin Darbyshire-Bryant
0ddc0596af luci-app-upnp: support igdv1 run time flag
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2018-05-02 21:53:36 +01:00
Hannu Nyman
3f51712153
Merge pull request #1776 from lamego/fix-indentifies-typo
Fixing small typo
2018-05-02 23:26:45 +03:00
Ricardo Lamego
e55a5fa386 Fixing small typo
indentifies > identifies
2018-05-02 21:01:53 +01:00
Hannu Nyman
c946efee0f
Merge pull request #1775 from musashino205/l10n/base-upd-ja
luci-base: update Japanese translation
2018-05-02 18:40:08 +03:00
INAGAKI Hiroshi
27af493779 luci-base: update Japanese translation
Updated Japanese translations.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-05-03 00:25:41 +09:00
Jo-Philipp Wich
9adbd79faa 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>
2018-05-02 16:55:22 +02:00
INAGAKI Hiroshi
0efc6daecf luci-base: sync translations
Synchronized translations with sources.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2018-05-02 23:53:48 +09:00
Jo-Philipp Wich
8335997df5
Merge pull request #1705 from Mushoz/add-igmp-snooping
luci-mod-admin-full: add igmp snooping option
2018-05-02 16:31:27 +02:00
Jo-Philipp Wich
fa2975d7c5 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>
2018-05-02 07:15:58 +02:00
Hannu Nyman
dcfc4569c4
Merge pull request #1690 from karlp/pagekite
luci-app-pagekitec: new package
2018-05-01 10:01:50 +03:00
Jo-Philipp Wich
27dd9d75f9 documentation: regenerate documents from current code base
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-30 14:45:25 +02:00
fy1128
00d242918f luci-app-ddns: fix typo: CRTL should be CTRL
Reference to https://github.com/openwrt/luci/pull/1756
cherry picked from commit d9cd43fee1

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-04-28 08:58:53 +03:00
Hannu Nyman
8656ab726d
Merge pull request #1767 from SvenRoederer/patch-2
luci-mod-freifunk: align spacing
2018-04-28 08:48:09 +03:00
Jo-Philipp Wich
aa6c97154e 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>
2018-04-26 09:40:17 +02:00
Jo-Philipp Wich
65479e3236 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>
2018-04-26 09:30:11 +02:00
Jo-Philipp Wich
736d8fee47 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>
2018-04-26 08:26:30 +02:00