Commit graph

1305 commits

Author SHA1 Message Date
Hannu Nyman
edf352efa2 i18n: sync translations
Sync translations.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2015-12-20 11:47:08 +02:00
GuoGuo
376d064309 Add some Simplified Chinese translations
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
2015-12-20 13:15:09 +08:00
Hannu Nyman
e42e5f5865 luci-mod-admin-full: interface status page / clarify address display
Copy the changes made by f8d0ba00b2
also to the interface details pages in order to clarify display of
multiple addresses.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2015-12-18 20:38:08 +02:00
Jo-Philipp Wich
967bb1f36f Merge pull request #464 from remakeelectric/pulls/list-operations
get/set list operations and documentation
2015-12-17 02:39:23 +01:00
Jo-Philipp Wich
31816e92f1 Merge pull request #577 from cshore/pull-request-safe-file-upload
luci-base: Make default for FileUpload 'safe'
2015-12-17 02:32:47 +01:00
Daniel Dickinson
c481f3f343 validation: Add option ipv4only option to host and hostport datatypes
Some applications only support ipv4 so add ipv4only option
to host and hostport datatypes so that for thos applications
that when an IP address is specified only and ipv4 ip address
gets accepted.
2015-12-15 20:41:01 -05:00
Daniel Dickinson
bbcfad7953 modules/luci-base: Fix ipaddrport validator to support ipv6
The previous versiono of ipaddrport validator only worked for ipv4
due to disallowing colons (:) in ip address which obvious fails for
ipv6.  We now instead allow either ipv4 address or an ipv6 address of
the form [<ipv6address>]:port
2015-12-15 20:40:14 -05:00
Daniel Dickinson
b475ec699d luci-base: Make default for FileUpload 'safe'
Some files and pointers to files are not safe to remove without a replacement
file and config pointing to the file.  For instance for uhttpd application in
the works, removing the certificate or key config or files without having the
replacements in places renders the WeUI inaccessible.

The only other place where FileUpload is currently used is for wifi certificates
for which the 'safe' handling is also preferred.  Therefore make the default for
the FileUpload widget the safe handling and add a property self.unsafeupload that
allows for the old unsafe handling should it prove useful in some case.

Also allow to specify a file already on router instead of uploading a file.

Signed-off By: Daniel Dickinson <openwrt@daniel.thecshore.com>
2015-12-15 20:36:17 -05:00
Jo-Philipp Wich
f25c4e07bc Merge pull request #564 from cshore/pull-request-app-firewall-timedate
Pull request app firewall timedate
2015-12-15 23:08:17 +01:00
Daniel Dickinson
986baa5cce applications: firewall: Add time and date for rules and redirects
UCI config for the firewall has the option of specifying time and date
limitations; add these options the UI.
2015-12-14 23:26:33 -05:00
Daniel Dickinson
6318f67fd4 luci-base: Add time and data datatypes for use with firewall app
Adding LuCI configuation of the firewall time and data uci options
is in progress and this adds the necessary datatypes for validating
those fields.
2015-12-14 23:26:26 -05:00
Daniel Dickinson
403b939acd modules/luci-base: Move LuCI FileUpload directory to /etc/luci-uploads and save across sysupgrade
/lib/uci/upload is a rather odd place for configuration files

Also the files were not saved across sysupgrade, which is somewhat
counter-productive for configuration files.

Signed-off By: Daniel Dickinson <openwrt@daniel.thecshore.com>
2015-12-12 22:45:29 -05:00
Jo-Philipp Wich
397294ab06 luci-base: rewrite luci.sys.net.conntrack()
The new function is twice as fast as the old implementation and properly
summarizes outgoing and incoming byte and packet counters.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-12-09 15:54:43 +01:00
Alexander Logger
f8d0ba00b2 luci-mod-admin-full: update IPv4/IPv6 list views
For better view of 'Interface Overview' IPv4/IPv6 addresses for
interfaces should be displayed as lists, but not as comma separated
strings.

Signed-off-by: Alexander Logger <intagger@gmail.com>
2015-12-08 21:20:11 +03:00
Hannu Nyman
bac5f2cebf i18n: sync translations
Sync translations.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2015-12-06 13:23:38 +02:00
Yousong Zhou
862b84feb2 luci-base: fix escaping lua string to js repr
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2015-12-02 20:56:08 +08:00
Jo-Philipp Wich
9b30357454 luci-base: add hostport and ipaddrport validation types
Add two new types 'hostport' and 'ipaddrport' to validate strings in the form
'sub.example.org:1234' and '0.0.0.0:80'. The 'hostport' accepts hostnames or
IP addresses followed by a colon and a port number while the 'ipaddrport' type
accepts numeric IP addresses only, followed by a colon and a port.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-12-02 11:13:39 +01:00
Daniel Dickinson
829467b627 luci-base: Add function for shell single-quote parameter escaping
When using os.execute or luci.sys.call the shell is called with the
command line which means that standard shell interpretation of strings
occurs.  To allow to use these commands more easily we add functions
for properly escaping single-quoted strings used on the command line
2015-12-02 02:19:02 -05:00
Daniel Dickinson
1d5cab4ced luci-mod-admin-full: fstab: Add ability to redo the detection of block devices
Adds a button that does block detect and write the new configuration
to /etc/config/fstab.
2015-12-02 02:17:20 -05:00
Daniel Dickinson
89f74f77da luci-mod-admin-full: fstab: Add ability to set global options like anonymous mounts
Previously the global configuration options were missing the the LuCI configuration,
however these options are useful, so make them available to the UI.
2015-12-02 02:16:35 -05:00
Daniel Dickinson
031cab418c luci-mod-admin-full: Don't show jail bind mounts
The user is unlikely to care about the plethora of jail bind mounts
when using jails, so don't display them in this app.
2015-12-02 02:16:22 -05:00
Daniel Dickinson
b8c2d340f3 luci-mod-admin-full: fstab: Add ability to unmount non-system mounts
Add an unmount button for non-system mounts which will unmount
the corresponding file system.
2015-12-02 02:16:13 -05:00
Jo-Philipp Wich
c123fa86b0 Merge pull request #534 from yousong/add-luci-proto-pppossh
Add luci proto pppossh
2015-11-26 23:23:15 +01:00
Jo-Philipp Wich
ce04adb383 luci-mod-admin-full: limit SSID to 32 characters (#558)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-11-26 12:30:53 +01:00
Jo-Philipp Wich
c478101ca4 luci-mod-admin-full: fix script regression after 152ba9ab22
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-11-21 13:53:43 +01:00
Jo-Philipp Wich
55f458326d luci-base: use board.json to infer switch netdev
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-11-21 00:31:06 +01:00
Jo-Philipp Wich
fbfa62627f 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>
2015-11-21 00:29:55 +01:00
Jo-Philipp Wich
9b5046259f luci-mod-admin-full: make mirror port settings depend on mirror enable
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-11-20 23:44:55 +01:00
Jo-Philipp Wich
f16405df91 luci-mod-admin-full: revert accidential button type change in 20fdac1ac4
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-11-19 10:02:41 +01:00
Jo-Philipp Wich
20fdac1ac4 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>
2015-11-17 17:42:22 +01:00
Jo-Philipp Wich
152ba9ab22 luci-mod-admin-full: use :ipaddrs() and :ip6addrs() helper for iface_status
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-11-17 17:36:00 +01:00
Jo-Philipp Wich
e626599c26 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>
2015-11-17 17:35:02 +01:00
Jo-Philipp Wich
9b176c8d7b luci-mod-admin-full: prevent submit with interface delete button (#549)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-11-16 14:30:13 +01:00
Jo-Philipp Wich
092d2143bd luci-base: fix uci documentation issue (#538)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-11-16 12:37:23 +01:00
Jo-Philipp Wich
2258d3de25 Merge pull request #535 from saik0/redirect-root-if-empty-signed
Redirect to root on empty path (signed off)
2015-11-11 10:14:34 +01:00
Ran Bao
38b7c6cef4 fix a typo error in command script shown to users
Signed-off-by: Ran Bao <worksev@gmail.com>
2015-11-06 12:50:05 +13:00
Hannu Nyman
b1217c88c3 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>
2015-11-05 11:00:41 +02:00
Joel Pedraza
5541065793 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>
2015-11-03 09:53:39 -05:00
Yousong Zhou
a28da6a88a 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>
2015-11-03 17:07:45 +08:00
Yousong Zhou
20ccc90350 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>
2015-11-03 17:07:45 +08:00
Christian Schoenebeck
3dbc93bf91 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>
2015-11-01 16:36:29 +01:00
Christian Schoenebeck
162548a879 cbi.lua: Implement "readonly" property for "Value"
cbi.lua: Implement "readonly" property for "Value"

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
2015-10-31 23:09:40 +01:00
Christian Schoenebeck
c7d3619b0c template cbi/value.htm: add "readonly" property
template cbi/value.htm: add "readonly" property

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>
2015-10-31 22:54:25 +01:00
Christian Schoenebeck
84a57ec36f 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>
2015-10-30 18:42:38 +01:00
Hannu Nyman
ff9e34e47c Merge pull request #509 from neheb/master
resources/icons: Use gifsicle to save a few bytes.
2015-10-27 17:30:24 +02:00
Jo-Philipp Wich
927dc1aff9 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>
2015-10-27 14:13:05 +01:00
Jo-Philipp Wich
6d368a4033 Move libubus-lua dependency to luci-base
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-10-27 13:09:21 +01:00
Jo-Philipp Wich
6c4341ee01 luci-mod-admin-full: fix invalid markup in packages.htm (#518)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-10-22 12:20:20 +02:00
Jo-Philipp Wich
94ab57f48c 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>
2015-10-22 08:48:06 +02:00
Jo-Philipp Wich
d32c685039 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>
2015-10-22 08:30:29 +02:00