Commit graph

1681 commits

Author SHA1 Message Date
Jo-Philipp Wich
4d2332c01c libs/web: add missing css class to cbi simpleform template 2012-08-08 11:29:46 +00:00
Jo-Philipp Wich
7bca24db1b libs/web: adapt dispatcher to sauth api changes 2012-08-08 09:48:50 +00:00
Jo-Philipp Wich
abef50b852 libs/web: rework luci.sauth
- perform decoding/encoding transparently in read() and write()
	- remove decode() and encode() helpers
	- introduce reap() to kill expired sessions
2012-08-08 09:48:47 +00:00
Jo-Philipp Wich
a58370ab74 Rework authentication system
The validity of authentication tokens was determined by the
mtime of respective authentication tokens on filesystem
stored in $sessionpath.
Talking about hardware without RTC or without a prior
connection to a time server, date/time usually around 1970 -
so is the mtime of the authentication token file in
$sessionpath.

When now configuring an internet connection via LuCI, the
system might fetch the current date/time (e.g. via ntp)
which invalidates the token, returns "403 Forbidden" and
kicks the user out of the interface.

This patch changes the authentication system to use time values
based on the uptime of the machine - rather than values based upon
gettimeofday() and {a|m}time values - and save them inside the token.
That way can always determine the difference between login
(last interaction respectively) and the current time, in-
dependant of the system clock jumping backwards/forwards.

Warning: This patch removes the clean() function and respective calls.
This means, invalid tokens will NOT be determined and removed from
filesystem automatically anymore.
Before, every HTTP-call caused a scan for invalid tokens,
which is quite expensive. Instead consider using a cron job
deleting all stalled files periodically.

Contributed by T-Labs, Deutsche Telekom Innovation Laboratories

Signed-off-by: Mirko Vogt <mirko@openwrt.org>
2012-08-07 19:11:56 +00:00
Jo-Philipp Wich
a798da5d8b libs/web: support creating networks in checkbox network widget (#457) 2012-07-24 11:48:03 +00:00
Jo-Philipp Wich
46c84206f3 libs/sys: workaround broken entries in /proc/net/ipv6_route, observed on brcm-2.4 2012-07-18 11:22:10 +00:00
Jo-Philipp Wich
c098c59fd1 libs/core: only consider enabled routes when finding wan interface 2012-06-29 11:59:38 +00:00
Jo-Philipp Wich
e2dd594c38 libs/sys: fix login with empty password after previous commit 2012-06-27 14:11:48 +00:00
Jo-Philipp Wich
b1617b3718 libs/sys: fix luci.sys.checkpasswd() semantics 2012-06-27 13:52:09 +00:00
Jo-Philipp Wich
9fab594101 libs/core: improve luci.util.imatch() to not create temporary strings when iterating non-string values 2012-06-26 22:58:24 +00:00
Jo-Philipp Wich
0f3175ad42 libs/core: implement get_wandev(), get_wan6dev(), get_wannet() and get_wan6net() in luci.model.network 2012-06-26 22:19:27 +00:00
Jo-Philipp Wich
61883f2c3f libs/core: fix network is_empty() check for wifi-ifaces which are part of multiple networks 2012-06-26 21:49:24 +00:00
Jo-Philipp Wich
fe7424b68e libs/web: extend network_ifacelist widget to display all networks an iface is member of 2012-06-26 21:49:15 +00:00
Jo-Philipp Wich
699391a559 libs/core: allow ifaces to be part of multiple networks in luci.model.network 2012-06-26 21:49:07 +00:00
Jo-Philipp Wich
6780f757d6 libs/web: implement minlength(), maxlength() and rangelength() datatypes 2012-06-25 09:51:59 +00:00
Jo-Philipp Wich
5bcf9d07fd libs/core: fix various problems in the network model 2012-06-17 11:18:58 +00:00
Jo-Philipp Wich
22ce33a5a6 libs/core: fix ubus corner cases in network model 2012-05-31 17:24:13 +00:00
Jo-Philipp Wich
eb7a72f251 libs/core: use ubus to fetch interface and device status information, depend on libubus-lua 2012-05-31 10:05:31 +00:00
Jo-Philipp Wich
16ffd14cc2 move luci specific index.html from package 'sgi-cgi' to 'admin-core'
Contributed by T-Labs, Deutsche Telekom Innovation Laboratories

Signed-off-by: Mirko Vogt <mirko.vogt@external.telekom.de>
2012-05-06 18:57:18 +00:00
Jo-Philipp Wich
216264b6e4 libs/sys: fix luci.sys.init.index() (#399) 2012-05-06 09:47:57 +00:00
Jo-Philipp Wich
b6c98f9c57 Fix JSON NaN
Hi,

The attached patch fixes the JSON generation when dealing with NaN (not
a number), this makes the JSON parsing in the web browser succeed
(before it would get a "nan" which is not a valid JS value)

Chris
2012-04-16 16:48:59 +00:00
Jo-Philipp Wich
fd28386e35 libs/web: fix html output for complex datatypes containing apostrophes 2012-04-15 14:31:04 +00:00
Jo-Philipp Wich
4711c01509 libs/sys: introduce luci.sys.init.start() and luci.sys.init.stop(), also execute all init action with an empty environment 2012-04-15 14:30:54 +00:00
Manuel Munz
7fdb055265 libs/datatypes: Fix typo 2012-04-13 18:12:34 +00:00
Jo-Philipp Wich
005fd26cf6 libs/nixio: reorder linker commandline args to fix build on Ubuntu 11.x 2012-03-13 22:45:26 +00:00
Jo-Philipp Wich
e620bdac3e libs/nixio: disable TLS implementation by default, fixes host builds on Ubuntu 11.x 2012-03-13 22:11:27 +00:00
Jo-Philipp Wich
fd0f8e80c5 libs/web: fix wrong default focus in dynlist widgets (#388) 2012-03-04 14:15:09 +00:00
Jo-Philipp Wich
1c10042f8c libs/web: fix delete action in tblsections, fix extedit buttons 2012-02-15 22:08:51 +00:00
Jo-Philipp Wich
5d45927643 libs/web: remove inline styles from firewall_zoneforwards and firewall_zonelist widgets 2012-02-15 17:50:25 +00:00
Jo-Philipp Wich
7c9dd3ab81 libs/web: remove inline styles from network_netinfo widget 2012-02-15 16:43:39 +00:00
Jo-Philipp Wich
481ddd0909 libs/web: remove inline styles for interface badges 2012-02-15 16:00:23 +00:00
Jo-Philipp Wich
857dcdf727 libs/web: remove more inline styles from tblsection template, fixes action buttons in bootstrap theme 2012-02-15 15:27:03 +00:00
Jo-Philipp Wich
13beaf8b3d libs/web: use new button classes for tblsection template 2012-02-15 15:13:27 +00:00
Jo-Philipp Wich
47b51b54e8 libs/web: fix firewall_zoneforwards template for bootstrap theme 2012-02-15 15:12:53 +00:00
Jo-Philipp Wich
63a75c6ea9 libs/web: implement new phone digit datatype, useful for VoIP related config screens 2012-02-14 15:16:53 +00:00
Jo-Philipp Wich
8412034c3d libs/web: use CSS class for sort buttons, drop inline style 2012-02-14 15:08:12 +00:00
Jo-Philipp Wich
75f849ca58 libs/web: fix invalid html after r8224 - the whitespace trimming removed the space between the attributes 2012-02-14 14:11:57 +00:00
Patrick Grimm
a3b0db7d86 libs/web: fix line wrapping error 2012-02-13 00:44:56 +00:00
Patrick Grimm
9305afaf0d libs/web: replace <a href> by <input type=button> for better css style in tables 2012-02-12 22:50:48 +00:00
Jo-Philipp Wich
001e15a0db [PATCH] Explicit Cache-Control for lucid.http static content
The Chrome web browser revalidates every resource if no explicit Cache-Control or Expires HTTP/1.1 header is sent. This makes the page loads appear to take a long time on pages with a few external resources, adding 300-500ms 
per item. This includes the XHR json responses that set page images, like wireless signal indicators and the like-- the images are revalidated on every XHR response. As an example, the Network -> Interfaces page generates 16 
requests to the lucid http server:

    Main HTML
    cascade.css
    xhr.js
    tabbg.png
    cbi.js
    loading.gif
    ethernet_disabled.png
    reload.png
    reset.gif
    edit.gif
    remove.gif
    add.gif
    bridge.png
    vlan.png
    wifi.png
    iface_status 

Of those, 14 should be pulled from cache but they are all valdiated. The lucid server returns the correct 304 (Not Modified) responses but it delays the apparent page load time because of the backlog it creates at the http 
server.

I would suggest setting explicit cache control on all files returned by the lucid http directory dispatcher. The "Expires" header is reportedly more widely supported, however this relies on the clock on the OpenWrt? system 
being accurate, which may not be the case. The "Cache-Control: max-age=" allows the server to set a timeout in seconds. I've included a patch that sets revalidate interval to 1 year, which is the value recommended by google.
Reference:  http://code.google.com/speed/page-speed/docs/caching.html

Note this could create an issue if there are luci application which are generating files which change that are being served by the lucid http DirectoryPublisher?. I'm not sure if there is anyone doing that. If needed, this can 
probably be created as an option to the DirectoryPublisher? config stanza for each vhost.

Finally, this only affects the Google Chrome browser, as both IE9 and Firefox seem to have their own revalidation interval in the absence of explicit cache control which may be based on the last modified time of the resource. 
Even in Chrome, this change doesn't take effect until the item is re-served with a 200 HTTP response so Chrome's cache should be cleared after this patch is applied. The patch can be extended to include cache control on 304 
responses, but I'd not worry about cluttering the code with it because the problem will solve itself once chrome redownloads the resource.
2012-01-09 00:04:54 +00:00
Jo-Philipp Wich
a4996261ea libs/web: remove debugging code 2012-01-08 23:39:29 +00:00
Jo-Philipp Wich
875baa244a libs/web: allow zero-length string literals when parsing datatypes 2012-01-08 23:36:35 +00:00
Jo-Philipp Wich
9fcdf0fe81 libs/web: introduce recursive expression support for datatypes, introduce "or" and "and" datatypes
The commit adds a recursive parser for datatype expressions which allows nesting of validators,
this allows for complex expressions like  "list(or(range(0,65535),'infinite'))" to allow a list of
values which are either integers between 0 and 65535 or the literal string "inifinite".
That change also deprecates combined datatypes like "ipaddr" ["or(ip4addr,ip6addr)"] or
"host" ["or(hostname,ip4addr,ip6addr)"]
2012-01-08 23:33:47 +00:00
Jo-Philipp Wich
3812f29087 libs/web: remove neg_ipaddr, neg_ip4addr and neg_network_ip4addr datatypes, can be represented with neg(type) 2012-01-07 22:06:02 +00:00
Jo-Philipp Wich
481cd6feb7 libs/core: remove various uses of global vars in luci.ip 2012-01-01 15:51:37 +00:00
Jo-Philipp Wich
574eff4e8e libs/core: rework luci.model.uci.apply() to return the commandline as table, suitable for passing to nixio.exec() 2011-12-20 19:02:14 +00:00
Jo-Philipp Wich
3553d308f6 [PATCH] Naive fix for bug #208
For SimpleSection, use the section name (always "1") instead of the
section type in the CBI-like string used to identify the upload.  This
allows upload fields to be placed in SimpleSections.  The fix changes a
minimal number of lines, but does introduce some unnecessary confusion,
it may or may not be better than a more thorough/invasive fix.

Set the enctype for the form element in the simpleform view to be
multipart/form-data because the default
application/x-www-form-urlencoded does not support input files.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2011-12-20 17:52:10 +00:00
Jo-Philipp Wich
8358175f25 libs/web: show input/forward hints in zonelist widget only if bnoth allowany and allowlocal are enabled 2011-12-20 17:51:44 +00:00
Jo-Philipp Wich
b89300eb67 libs/web: prevent break between action buttons in tblsection template 2011-12-20 03:57:40 +00:00
Jo-Philipp Wich
48838ea0f7 libs/web: fix placeholder attribute for DynList 2011-12-20 03:00:17 +00:00
Jo-Philipp Wich
161218a576 libs/web: fix undesired autofocus of DynamicList widget 2011-12-20 02:56:03 +00:00
Jo-Philipp Wich
6ae669da06 libs/web: improve ip6addr datype validation, accept both CIDR and IP/Mask notation 2011-12-20 02:44:32 +00:00
Jo-Philipp Wich
24c4cce3ae libs/web: add "any" option to firewall_zonelist widget 2011-12-19 20:09:20 +00:00
Jo-Philipp Wich
21a0fcc4c1 libs/web: rework DynamicList widget to support dynamic lists composed of comboboxes 2011-12-19 18:55:59 +00:00
Jo-Philipp Wich
375a476d27 libs/web: rework hostname match to not allow arbritary sequences of numbers and dots 2011-12-16 06:05:51 +00:00
Jo-Philipp Wich
3a0905f21c libs/web: add list(...) datatype for space separated lists of arbritary datatypes 2011-12-16 05:52:24 +00:00
Jo-Philipp Wich
ca7bc48ebc [PATCH] Abstract address UNIX sockets not binding properly (by capnbry@gmail.com, #366)
In #274, I stated abstract namespace and autobound abstract namespace datagram UNIX domain sockets work perfectly with nixio. However, I may have jumped the gun on that conclusion. Turns out they work perfectly for only one 
concurrent connection.

The problem is that when binding to an abstract address socket, which begins with a NULL byte, nixio strncpy's the name into the sockaddr_un structure, which effectively copies nothing. It then binds to an address of 180 NULLs, 
which is completely legal, but obviously you run into problems when a second client tries to bind to the same address.

The rules are as follows ( http://linux.die.net/man/7/unix) for the names:

  * If the name is blank, bind() should pass that the addrlen of sizeof(sa_family_t) and Linux will autobind a name that begins with null and is followed by 5 digits.
  * If the first character of the name is non-null, the name is a pathname and is null-terminated. addrlen should be sizeof(sockaddr_un), but the length can also be the pathname len + sizeof(sa_family_t) as the value will be 
null-terminated by the kernel unix socket driver
  * If the first character is null, the address is abstract and the value should not be null-terminated and addrlen is pathname + sizeof(sa_family_t) 

The attached patch fixes bind/connect/sendto by shortening the addrlen passed to be pathname len + sizeof(sa_family_t), which generates the correct socket names for all 3 cases above.
It also fixes the address returned by recvfrom, which currently returns a blank string for any abstract address socket (as they begin with a null).
2011-12-16 02:10:37 +00:00
Jo-Philipp Wich
757e9c2f1c libs/web: add missing parts of previous commit 2011-12-16 01:18:34 +00:00
Jo-Philipp Wich
cdcfb5502b libs/web: implement "network" cbi datatype 2011-12-16 01:18:15 +00:00
Jo-Philipp Wich
c5811d52d0 libs/web: allow one-character hostnames 2011-12-14 15:01:54 +00:00
Jo-Philipp Wich
df3ee4c199 libs/core: fix undefined tostring() in network model 2011-12-05 19:36:50 +00:00
Jo-Philipp Wich
fd130ead81 libs/core: expose txpower offset values in network model 2011-12-05 18:34:22 +00:00
Jo-Philipp Wich
f6ee6322f9 From c63e369d57cb6862a8890c7b2ee1b6b449b2c42d Mon Sep 17 00:00:00 2001
From: Gabor Juhos <juhosg@openwrt.org>
Date: Mon, 5 Dec 2011 14:36:34 +0100
Subject: [PATCH] libs/sys: read model name from /tmp/sysinfo/model if present

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
2011-12-05 16:38:54 +00:00
Jo-Philipp Wich
099e97532c libs/web: add assert() statements for unresolvable function case 2011-11-30 12:50:32 +00:00
Jo-Philipp Wich
3face70859 libs/nixio: link with libcrypto when using OpenSSL as digest backend 2011-11-20 18:18:46 +00:00
Jo-Philipp Wich
cfe48c17d3 libs/core: fix removal of wifi networks without interface attached (OpenWrt #10400) 2011-11-12 11:27:10 +00:00
Jo-Philipp Wich
fbaef58943 libs/sys: update zoneinfo data to version 2011n (#345) 2011-11-10 11:21:13 +00:00
Jo-Philipp Wich
96f494f4ba libs/web: dispatcher: fix access to template properties in attr() and ifattr() helpers (#10317) 2011-10-30 15:00:54 +00:00
Jo-Philipp Wich
84cbbf3968 libs/core: fix status reporting of standalone wifi iface in network model 2011-10-28 22:36:15 +00:00
Jo-Philipp Wich
d60d892385 libs/sys: recent busybox versions changed top output from %MEM to %VSZ, fix luci.sys.process.list() accordingly 2011-10-26 21:23:37 +00:00
Jo-Philipp Wich
334756a472 libs/web: fix possible dispatcher crash 2011-10-26 03:04:41 +00:00
Jo-Philipp Wich
e12b8dbc1f libs/web: move ifattr() and attr() helpers into dispatcher scope to make them avilable to all templates, remove duplicate exports in cbi tempalte scope 2011-10-26 02:17:45 +00:00
Jo-Philipp Wich
5f7d2719b2 libs/web: dispatcher add node_childs() and node_visible() helper functions for templates 2011-10-26 00:24:17 +00:00
Jo-Philipp Wich
6021cf3bdf libs/web: dispatcher: implement a "firstchild()" target which simply redirects to the first child of a node, useful for menus that are empty by default and may gain arbritary childs 2011-10-25 22:48:43 +00:00
Jo-Philipp Wich
621fff61a3 libs/nixio: remove forgotten stamp file 2011-10-24 21:39:47 +00:00
Jo-Philipp Wich
8cd46b595a libs/web: cbi: support description attribute in nullsection instances 2011-10-23 04:21:14 +00:00
Jo-Philipp Wich
a24d340ca4 libs/web: fix package name in error suggestion 2011-10-21 17:22:48 +00:00
Jo-Philipp Wich
f83cdb1b8b libs/ipkg: give caller more control over filter pattern 2011-10-15 03:10:19 +00:00
Jo-Philipp Wich
55297447cd libs/ipkg: don't --autoremove; its dangeros. Attempting to uninstall kmod-ipt-nat with it will remove half of luci too, additionally opkg segfaults and corrupts the status database 2011-10-14 22:25:07 +00:00
Jo-Philipp Wich
1ffe61277e move protocol support into a new protocols/ subdir 2011-10-11 02:07:15 +00:00
Jo-Philipp Wich
cd46e1611e libs/web: handle .redirect property for SimpleForm widgets 2011-10-11 01:20:36 +00:00
Jo-Philipp Wich
2c316a6aab libs/core: more fixes for network model 2011-10-11 01:14:11 +00:00
Jo-Philipp Wich
be9f5d6872 libs/core: mark relay protocol as floating 2011-10-10 18:50:42 +00:00
Jo-Philipp Wich
2337ee9206 libs/web: add network_netlist widget option to filter virtual networks 2011-10-10 18:10:12 +00:00
Jo-Philipp Wich
96846f1518 libs/core: remove uneeded error import 2011-10-09 22:04:00 +00:00
Jo-Philipp Wich
c7a95b6683 libs/core: add more heuristics to infer device name from switch name 2011-10-09 22:02:46 +00:00
Jo-Philipp Wich
ce024e350a libs/core: add luci.model.network.get_protocol(protoname[, networkname]) 2011-10-09 21:16:59 +00:00
Jo-Philipp Wich
63608d2636 libs/web: sent origin section id encoded in cbi.cts. requests 2011-10-09 20:14:25 +00:00
Jo-Philipp Wich
4fb5f1aca6 libs/web: pass origin section id to :create() callback, needed when multiple, filtered TypedSection instances of the same type are used within a single Map 2011-10-09 20:07:02 +00:00
Jo-Philipp Wich
be71f1c93a libs/core: fix bug in contains_interface() implementation of PPPoE protocol 2011-10-09 19:25:43 +00:00
Jo-Philipp Wich
0d4ec2bbba libs/web: add error message printing to nullsection template, fixes server side validation in SimpleForm instances 2011-10-09 18:43:11 +00:00
Jo-Philipp Wich
1771b0c551 libs/core: rework class structure of network model, add per protocol is_installed() and opkg_package() utility functions to query availability 2011-10-04 13:32:18 +00:00
Jo-Philipp Wich
35137845dd libs/core: clean up network model, make it modular and move protocol deviations into submodules, fix recognition of pptp and properly implement relayd protocol awareness 2011-10-03 13:57:11 +00:00
Jo-Philipp Wich
43df504278 libs/web: assign extra css class to typed or named sections with tabs 2011-09-30 14:14:04 +00:00
Jo-Philipp Wich
ea6f5379dc libs/web: network widget fixes 2011-09-25 11:59:21 +00:00
Jo-Philipp Wich
a6dcb3f6a3 libs/core: more fixes in network model 2011-09-25 11:58:24 +00:00
Jo-Philipp Wich
bf49f78599 libs/web: align interface related widgets to changed network model api 2011-09-24 03:49:17 +00:00
Jo-Philipp Wich
47f011b947 libs/core: non-bridge handling fix in network model 2011-09-24 03:31:00 +00:00
Jo-Philipp Wich
9b18001b9f libs/core: add "tunnel" interface type to network model, various optimizations 2011-09-24 00:57:59 +00:00
Jo-Philipp Wich
7925014561 libs/web: add missing class attributes 2011-09-22 18:21:38 +00:00
Jo-Philipp Wich
737daee3e1 libs/web: cbi: dynamically update css class of last field after dependency update 2011-09-22 17:05:14 +00:00
Jo-Philipp Wich
688eb421cc libs/web: cbi: assign dedicated css class to last child 2011-09-22 16:34:52 +00:00
Jo-Philipp Wich
96dd29753c libs/web: cbi: provide a "last_child" property to allow for more layout control in form rendering 2011-09-22 16:33:28 +00:00
Jo-Philipp Wich
362c84480a libs/web: add another missing class attribute 2011-09-22 13:43:39 +00:00
Jo-Philipp Wich
b360dbc6dc modules/admin-full, modules/freifunk, modules/niu, libs/web, applications/luci-upnp: tune input class attributes 2011-09-22 13:25:48 +00:00
Jo-Philipp Wich
59e95ddcad modules/admin-full, libs/web: various interface handling fixes in network settings 2011-09-22 01:40:26 +00:00
Jo-Philipp Wich
e2a1ffb59d libs/core: various interface handling fixes in network model 2011-09-22 01:39:35 +00:00
Jo-Philipp Wich
0285631f5b libs/core: also enumerate not-yet-spawned vlan interfaces in network model, differentiate switch and vlan interfaces 2011-09-14 09:36:55 +00:00
Jo-Philipp Wich
537c929d63 libs/web: track submit state in network_ifacelist widget, fixes deselecting all member ifaces in checkbox mode 2011-09-14 09:28:16 +00:00
Jo-Philipp Wich
794094caa2 libs/web: add "neg()" cbi datatype to negate arbritary types, e.g. "neg(hostname)" would allow "!example.com" 2011-09-04 12:07:43 +00:00
Jo-Philipp Wich
37df666e0a libs/web: fix some missing escapes in iface and netlist widgets 2011-09-01 16:07:02 +00:00
Jo-Philipp Wich
5bc4c852da libs/core: fallback to trunk version 2011-08-13 09:52:50 +00:00
Jo-Philipp Wich
a8ac3b344f libs/web: add _() function to dispatcher, used for marking translatable menu entries 2011-08-12 13:11:29 +00:00
Jo-Philipp Wich
986c4b5bc1 libs/web: eliminate another uneeded require in dispatcher 2011-08-12 12:34:13 +00:00
Jo-Philipp Wich
c1d69d0146 libs/web: optimize access to translate() api by directly reusing the luci.i18n instance loaded in dispatcher - this saves one extra function call, one extra require and one extra table lookup for _each_ translation string 2011-08-12 11:13:39 +00:00
Jo-Philipp Wich
0cb0742818 [PATCH] Allow smarter node creation based on visibility during createtree
As I've brought up on the mailing list thread "High latency caused by full tree creation", there is a large amount of delay per LuCI request which is spent building the node tree in createtree(). Most nodes created aren't 
needed for the view presented to the user and only serve to consume memory and CPU time during a page load.

My idea is to provide an easy mechanism for index()ers to determine which needs to be created and what isn't. Due to the constraints of the standard LuCI web interface, this optimization needs to establish a few rules:

 * The page requested must have its node created
 * All parents of the page being requested must be created, so the children inherit the track
 * All the top-level nodes "Status", "System", "Services", "Network" (and others added by extensions) must be created in order to have their top-level tabs in the UI
 * All peers of second-level nodes need to be created as well for the same reason, to display their links on the subindexes 
                
To make this easy to implement in each controller, the attached patch adds an "inreq" field to each created node to indicate if it lies on the request path. To satisfy the "top level node" requirement, we always 
add the top level node, then check its inreq property if the top-level node is not "in request", then the controller can exit index() early.
2011-08-12 11:05:59 +00:00
Jo-Philipp Wich
b3861e0ec7 [PATCH] Wasted memory use storing path copies in node tree
When creating the node tree, every node stores a copy of its full path table. e.g. for node("admin.network.wireless"), node.path = { "admin", "network", "wireless" }

This value is not used anywhere, and likely may be from before the addition of the treecache lookup table? In any instance, I've searched high and low and see nothing ever referencing any node's path via the path member. It 
eats a good chunk of memory though and as such I believe it should be removed.

I've tested every page in the admin-full module after removing it and all seem to function properly.
2011-08-12 11:04:42 +00:00
Jo-Philipp Wich
69ba2e55a1 libs/nixio: add missing file in previous commit, revert unrelated change 2011-08-12 10:27:48 +00:00
Jo-Philipp Wich
2b33717dc4 libs/nixio: implement getproto(), getprotobyname() and getprotobynumber() 2011-08-12 10:26:33 +00:00
Jo-Philipp Wich
4e78f77d63 libs/lucid: fix process function leak (#285) 2011-08-11 23:23:11 +00:00
Jo-Philipp Wich
0d73b6d411 libs/nixio: allow building without shadow password support 2011-08-11 23:21:06 +00:00
Jo-Philipp Wich
11ff9204cf libs/nixio: fix possible issue with nonblocking bind() 2011-08-11 23:15:05 +00:00
Jo-Philipp Wich
ff892ab41a libs/lucid: perform full gc cycle prior to forking, massively improves memory consumption 2011-07-22 13:59:29 +00:00
Jo-Philipp Wich
2e618aaf29 libs/web: more verbose faults 2011-07-21 01:04:53 +00:00
Jo-Philipp Wich
d970d7bd27 libs/web: make dispatcher faults more verbose 2011-07-20 23:57:32 +00:00
Jo-Philipp Wich
253eafb577 libs/web: fix index cache rebuild triggering (#275) 2011-07-18 14:50:39 +00:00
Jo-Philipp Wich
518dc0fef9 libs/nixio: Fix recvfrom() return values for unnamed unix sockets, patch by capnbry@gmail.com (#274) 2011-07-17 09:04:43 +00:00
Jo-Philipp Wich
1a221ddfb9 libs/core: fix multiple errors in zone delete handling of firewall model 2011-07-11 12:14:55 +00:00
Jo-Philipp Wich
ded8dae503 libs/httpclient: return server response line in error case (#249) 2011-06-25 22:57:18 +00:00
Jo-Philipp Wich
307f307a8e libs/ipkg: capture stdout, stderr when running opkg commands 2011-06-23 10:12:03 +00:00
Jo-Philipp Wich
354aeb44f6 libs/web: add new datatypes min(...), max(...) and neg_network_ip4addr 2011-06-17 10:52:49 +00:00
Manuel Munz
1d70d03c08 libs/core: Allow the use of commands with arguments or of multiple commands for exec in /etc/config/ucitrack 2011-06-01 11:56:38 +00:00
Jo-Philipp Wich
8431916f7d libs/sys: redirect stdout to /dev7null when calling initscripts 2011-05-21 16:29:31 +00:00
Jo-Philipp Wich
6e6bac2a4a libs/web: remove license comments from cbi templates, saves around 50% of their size 2011-05-04 12:56:06 +00:00
Jo-Philipp Wich
b95ec6c93a libs/web: fix another invalid entity 2011-05-03 03:31:30 +00:00
Jo-Philipp Wich
6697e282af trunk: s/&nbsp;/&#160;/g 2011-05-03 03:20:15 +00:00
Jo-Philipp Wich
fdf625ea67 libs/json: Fix a typo and a logic error in json.lua to make luci.json.encode() work like expected (#220) 2011-04-17 11:39:17 +00:00
Manuel Munz
bb2d7517eb luci-firewall: Add support for negations for ip addresses/nets (#218) 2011-04-13 00:33:42 +00:00
Jo-Philipp Wich
8ea7eb8615 libs/web: fix "port" datatype to allow port 0 2011-03-17 17:40:40 +00:00
Jo-Philipp Wich
380726158d libs/sys: ignore TIME_WAIT connections in luci.sys.net.conntrack() 2011-03-13 22:08:32 +00:00
Jo-Philipp Wich
8cab9e2b8f libs/web: explicitely cast input value of %m pattern to float in order to avoid throwing an exception in toFixed() with very low values 2011-03-13 21:56:31 +00:00
Jo-Philipp Wich
8e5590037d libs/core: add luci.model.network.wifinet.id() 2011-03-13 17:22:52 +00:00
Jo-Philipp Wich
986d8b00a2 libs/core: add txpower() and country() to luci.model.network.wifinet 2011-03-13 17:09:26 +00:00
Jo-Philipp Wich
a8688343d6 libs/web: add %m pattern to String.format() 2011-03-13 11:12:11 +00:00
Jo-Philipp Wich
9836e949a5 libs/sys: disregard ::/0 routes on "lo" in luci.sys.net.defaultroute6() 2011-03-12 19:25:03 +00:00
Jo-Philipp Wich
3b4450a58b libs/core: allow resolving of virtual interfaces via get_interface(), should fix wan status display with 6to4, 6in4 tunnels or pppoe connections 2011-03-11 23:11:34 +00:00
Jo-Philipp Wich
1db9f295fa libs/web: repair and modernize FileBrowser widget, patches by Kevin Locke <klocke@digitalenginesoftware.com> (#207) 2011-03-05 06:35:26 +00:00
Jo-Philipp Wich
efcc1bfbf1 libs/core: make general network model aware of the relay pseudo bridge protocol 2011-02-26 01:34:58 +00:00
Jo-Philipp Wich
74c6fb4cd7 libs/core: mark radvd as affected by network restarts 2011-02-20 18:35:28 +00:00
Jo-Philipp Wich
72fac8f90f libs/core: ensure that luci.model.network.network._ip() always returns a table if a list was requested 2011-02-20 14:42:35 +00:00
Manuel Munz
58d319ea5f libs/sys: Filter model string from /proc/diag/model 2011-02-14 18:54:00 +00:00
Jo-Philipp Wich
31ebd0e378 libs/sys: better handle bogomips parsing 2011-02-14 15:36:04 +00:00
Manuel Munz
489279bb9a web: Relax hostname validation for length 2011-02-12 19:39:54 +00:00
Jo-Philipp Wich
4b0d5f9205 libs/sys: fix call to nixio.uname() 2011-02-12 19:39:30 +00:00
Jo-Philipp Wich
68b51e1527 libs/sys: fix parsing of model and cpu info, consider 2000::/3 as IPv6 default route if no ::/0 route exists (#200) 2011-02-12 19:32:36 +00:00
Jo-Philipp Wich
094e2c8c81 libs/core: use is6linklocal() 2011-02-12 19:10:17 +00:00
Jo-Philipp Wich
4eb853d2d2 libs/core: whitespace fix in previous commit 2011-02-12 19:00:54 +00:00
Jo-Philipp Wich
e351f43f0c libs/core: add is4linklocal(), is4rfc1918() and is6linklocal() to luci.ip 2011-02-12 18:59:33 +00:00
Manuel Munz
408a58f6f6 web: Improve hostname validation 2011-02-12 11:09:13 +00:00
Jo-Philipp Wich
ce68705702 libs/core: add new convenience functions to luci.model.network 2011-02-11 04:50:56 +00:00
Jo-Philipp Wich
b818354c94 libs/core: fix lookups bridge interface -> network in luci.model.network 2011-02-06 04:12:41 +00:00
Jo-Philipp Wich
c3c22f792b libs/sys: fix ip6tables parsing issue 2011-01-29 22:47:40 +00:00
Jo-Philipp Wich
b477dae307 libs/sys: add ip6tables support to luci.sys.iptparser 2011-01-29 18:34:00 +00:00
Jo-Philipp Wich
be5b1015b2 libs/web: improve cbi handling of Flag values, support usage of .default attribute to signalize default-on checkboxes, this helps to deal with the reversed logic of various uci bools within OpenWrt configs 2011-01-29 17:54:00 +00:00
Jo-Philipp Wich
8055a5e183 libs/web: remove a stray non breaking space in DummyValue template 2011-01-26 16:21:15 +00:00
Jo-Philipp Wich
9c03a76fc2 libs/sys: properly handle passwords with apostrophes 2011-01-25 12:51:41 +00:00
Jo-Philipp Wich
2ae8c99606 libs/web: readd add/remove icons to dynamic list widgets 2011-01-23 18:28:35 +00:00
Jo-Philipp Wich
510a023d77 libs/core: reuse existing, empty networks in add_network() 2011-01-20 23:24:02 +00:00
Jo-Philipp Wich
8193a249f1 libs/web: fix row sorting in IE 2011-01-20 12:35:42 +00:00
Jo-Philipp Wich
df5329a5cb libs/web: fix row ordering for named sections 2011-01-20 00:47:03 +00:00
Jo-Philipp Wich
a30ea6c2a3 libs/web: add missing cells to tblsection template 2011-01-20 00:19:05 +00:00
Jo-Philipp Wich
80e1900b03 libs/web: implement sortable rows for uci reordering 2011-01-20 00:01:55 +00:00
Jo-Philipp Wich
c176c70d5b libs/web: add up & down arrow icons 2011-01-19 23:57:00 +00:00
Jo-Philipp Wich
32e908a51c libs/sys: fix luci.sys.wifi.channels() 2011-01-19 21:37:01 +00:00
Jo-Philipp Wich
86a13c6ab9 libs/web: fix an untranslated string 2011-01-14 22:50:50 +00:00
Jo-Philipp Wich
5355d11e2c libs/web: some fixes for network_ifacelist widget 2011-01-14 19:57:30 +00:00
Jo-Philipp Wich
716fd7a2d1 libs/nixio: fix sendto(), implement support for unix domain sockets (#140) 2011-01-13 23:26:19 +00:00
Jo-Philipp Wich
4bbd85fe42 libs/web: properly handle .default property for ListValue fields with integer keys 2011-01-13 20:54:57 +00:00
Jo-Philipp Wich
bd8ac05d56 libs/web: introduce width property for fields in tblsections 2011-01-13 20:02:16 +00:00
Jo-Philipp Wich
052f65950c libs: drop uvl and uvldoc 2011-01-02 19:26:37 +00:00
Jo-Philipp Wich
73578276af libs/lmo: skip all entries with identical key and value when generating lmo archives 2011-01-02 18:16:54 +00:00
Jo-Philipp Wich
330c013475 libs/sys: update zonedata to version 2010i 2011-01-02 17:54:12 +00:00
Jo-Philipp Wich
8ee6d915ee libs/core: fix some issues in network model 2010-12-24 21:39:44 +00:00
Jo-Philipp Wich
0f9f2a42a4 libs/core: bring get_first() boolean casting in line with get_bool() 2010-12-24 21:39:26 +00:00
Jo-Philipp Wich
f383dc0229 libs/lmo: apply FD_CLOEXEC on archive descriptors to avoid leaking i18n file fds into executed subprocesses 2010-12-24 20:28:00 +00:00
Jo-Philipp Wich
f68906c20f libs/web: fix error in wep key validation 2010-12-16 15:59:25 +00:00
Manuel Munz
6951da02ce modules/freifunk: Make status page update dynamically with javascript and small cosmetic changes. 2010-12-15 16:35:19 +00:00
Manuel Munz
4f65a01295 libs/sgi-uhttpd: move exectime inside handle_request 2010-12-15 01:04:38 +00:00
Manuel Munz
4e3cc9a886 libs/sgi-uhttpd: Add variable exectime to measure script execution time 2010-12-15 00:42:56 +00:00
Jo-Philipp Wich
39578a6b72 libs/web: change "module" variable to "modname" in dispatcher.lua, solves apidoc artefacts 2010-12-12 20:16:13 +00:00
Manuel Munz
99881d9cb6 libs/core: Create get_first() in uci model 2010-12-12 15:01:39 +00:00
Jo-Philipp Wich
8027502b35 libs/httpclient: fix cookie handling (#141) 2010-12-05 18:22:30 +00:00
Jo-Philipp Wich
99bf12fb63 libs/web: add field validation for add section name inputs 2010-12-05 17:37:59 +00:00
Jo-Philipp Wich
5dd3b57bbb libs/core: always use internal network ids for admin links to wifi networks (#172) 2010-12-05 03:57:29 +00:00
Jo-Philipp Wich
ea294f0b64 libs/core: ignore sit0 in network model 2010-12-05 03:21:52 +00:00
Jo-Philipp Wich
6c84824d79 libs/web: handle empty tables in Map.set() 2010-12-05 00:54:18 +00:00
Jo-Philipp Wich
090ce4f17e libs/web: add float and ufloat datatypes for field validation 2010-12-05 00:19:09 +00:00
Jo-Philipp Wich
2a0903bc50 libs/web: fix dynamic list handling 2010-12-03 12:41:12 +00:00
Jo-Philipp Wich
9d83aafb78 libs/core: fix nil access, implement luci.model.network.network.uptime() 2010-12-01 21:15:59 +00:00
Jo-Philipp Wich
de3ea4e956 libs/web: remove debug code from cbi.js 2010-12-01 20:59:36 +00:00
Jo-Philipp Wich
9abe328f9a libs/web: add %t format to String.format(), fix float formatting 2010-12-01 20:53:29 +00:00
Jo-Philipp Wich
a3207ded53 libs/web: fix filtering of overlong utf8 sequences 2010-11-28 20:25:03 +00:00
Jo-Philipp Wich
34ee162976 libs/web: render aggregated messages 2010-11-27 18:18:06 +00:00
Jo-Philipp Wich
6e97be1e92 libs/web: add the ability for maps to push error messages to the global page header 2010-11-27 18:17:15 +00:00
Jo-Philipp Wich
e291678012 libs/sys: protect iwinfo loading and return stub if module is not present 2010-11-27 16:57:39 +00:00
Jo-Philipp Wich
e8490c385f libs/sys: lazy load iwinfo 2010-11-27 16:29:33 +00:00
Jo-Philipp Wich
3b5123937e libs/sys: remove luci.sys.flash() 2010-11-25 08:14:10 +00:00
Jo-Philipp Wich
6d02d50d46 libs/web: fix IPv6 live validation 2010-11-23 23:19:40 +00:00
Manuel Munz
450bdd5a40 Add possibility to show execution time in the footer 2010-11-23 01:02:21 +00:00
Jo-Philipp Wich
9c3db58ee4 libs/web: combine apply actions of all maps on a page, prevents concurrent XHR 2010-11-22 00:32:54 +00:00
Jo-Philipp Wich
f72aa0c4c8 libs/web: implement "unspecified" option for netlist widget 2010-11-21 02:27:13 +00:00
Jo-Philipp Wich
7892bcec29 libs/web: add network_netinfo widget 2010-11-21 00:46:14 +00:00
Jo-Philipp Wich
6b3e6fb854 libs/web: add "back to overview" button to page actions if .redirect is set on the corresponding map 2010-11-21 00:21:49 +00:00
Jo-Philipp Wich
25754119d4 libs/web: expose cbi map redirect property to page templates 2010-11-21 00:14:03 +00:00
Jo-Philipp Wich
be385bfcc6 libs/web: better server side handling of DynList values 2010-11-20 18:35:44 +00:00
Jo-Philipp Wich
d79895c0c3 libs/web: fix DynList template for empty values 2010-11-20 18:24:17 +00:00
Jo-Philipp Wich
ff58e81d18 libs/web: skip empty values in DynList widget 2010-11-20 18:08:18 +00:00
Jo-Philipp Wich
7a7874d14e libs/web: give cbi tabcontainers a CSS class 2010-11-19 17:35:06 +00:00
Jo-Philipp Wich
8dde0803af libs/web: fix apply xhr for IE... 2010-11-18 03:07:21 +00:00
Jo-Philipp Wich
4121f34ac0 libs/web: make apply_xhr less aggressive, only rerequest status if previous response returned 2010-11-17 15:09:18 +00:00
Jo-Philipp Wich
c20dcb3612 libs/web: add range(min,max) datatype validator 2010-11-16 18:48:02 +00:00
Jo-Philipp Wich
b17848e82e libs/web: treat .rmempty like .optional for live field validation 2010-11-16 18:05:17 +00:00
Jo-Philipp Wich
1293c6ac24 libs/px5g: fix compilation on OpenWrt trunk 2010-11-16 16:30:07 +00:00
Jo-Philipp Wich
b304373297 libs/core: network model fixes 2010-11-15 22:03:45 +00:00
Jo-Philipp Wich
3ac93d53ea libs/core: make network model 6to4 aware 2010-11-15 12:30:26 +00:00
Jo-Philipp Wich
59e3062caf libs/web: add support for exclude property to ifacelist and netlist widgets 2010-11-15 12:28:25 +00:00
Jo-Philipp Wich
fa3b7ce070 libs/web: allow percent sign in urls 2010-11-13 20:50:20 +00:00
Jo-Philipp Wich
0aa85e7131 libs/web: stricter validation in build_url(), prevents some XSS 2010-11-13 13:50:54 +00:00
Jo-Philipp Wich
5a03beffcb libs/core: switch to C pcdata() implementation, its up to 7 times faster while also ensuring safe UTF-8 2010-11-13 12:16:51 +00:00
Jo-Philipp Wich
8ac568acb0 libs/web: fix sanitize_utf8(), passes all testcases now 2010-11-12 22:48:17 +00:00
Jo-Philipp Wich
09e71acf6b libs/web: add UTF-8 validation and pcdata escaping C routines to template parser 2010-11-12 22:37:50 +00:00
Jo-Philipp Wich
472ffe69a9 libs/core: restore original implementation of copcall() and coxpcall(), solves issues with RPC UCI endpoint 2010-11-09 19:43:13 +00:00
Jo-Philipp Wich
16262c2be0 libs/web: implement rawhtml property for DummyValue switches, allowes passing arbritary markup 2010-11-08 18:13:40 +00:00
Jo-Philipp Wich
b93adb7603 libs/core: restart miniupnpd when firewall is reloaded 2010-11-08 09:45:13 +00:00
Jo-Philipp Wich
d26ceda459 libs/web: support local destination in zonelist widget 2010-11-07 20:01:12 +00:00
Jo-Philipp Wich
561673c0a1 libs/web: add luci.http.write_json() 2010-11-07 19:27:15 +00:00
Jo-Philipp Wich
fcd9579fd4 libs/sys: fix logic fail in luci.sys.user.checkpasswd() (#152) 2010-11-05 22:05:11 +00:00
Jo-Philipp Wich
4ede70c0ce libs/web: introduce firewall_zoneforwards widget 2010-11-01 19:39:57 +00:00
Jo-Philipp Wich
75ccb1c5a8 libs/core: some firewall model enhancements 2010-11-01 19:39:02 +00:00
Jo-Philipp Wich
aab6378bc3 libs/core: several fixes for firewall model 2010-11-01 01:51:26 +00:00
Jo-Philipp Wich
5b63f544f5 libs/core: return ordered list in luci.model.network.get_interfaces() 2010-10-31 22:38:07 +00:00
Jo-Philipp Wich
3407c007d8 libs/core: fix bug in firewall model 2010-10-31 21:43:21 +00:00
Jo-Philipp Wich
ea81c6ad53 libs/web: use the value of the .enabled property in flag widget html 2010-10-31 21:41:57 +00:00
Jo-Philipp Wich
0a7bfa4f78 libs/web: support entering custom ifnames in iface list widget 2010-10-31 21:41:27 +00:00
Jo-Philipp Wich
0a8fa4e4a5 libs/core: support not-yet-existing interfaces in network model 2010-10-31 21:38:36 +00:00
Jo-Philipp Wich
b3b708a585 libs/web: add support for post commit redirects in cbi maps 2010-10-31 19:34:45 +00:00
Jo-Philipp Wich
141095fa7f libs/core: fix luci.model.firewall.rename_zone() 2010-10-30 18:26:46 +00:00
Jo-Philipp Wich
29f0b48ddc libs/web: fix type in datatypes.lua 2010-10-30 18:18:18 +00:00
Jo-Philipp Wich
4622241535 libs/web: introduce "uciname" datatype for cbi validation 2010-10-30 18:12:39 +00:00
Jo-Philipp Wich
fc5b9e27f0 libs/web: use imatch() in model related widgets, support multivalues in netlist widget 2010-10-30 17:57:49 +00:00