Difference between revisions of "Mesh/Firmware/Web Admin Development"

From Sudo Room
Jump to navigation Jump to search
(→‎Web Admin Development: Reverting changes)
Line 1: Line 1:
== Web Admin Development ==


See [[Mesh/Firmware|Firmware Wants]] for a description of what we're hoping to be able to implement with our web admin page.
See [[Mesh/Firmware|Firmware Wants]] for a description of what we're hoping to be able to implement with our web admin page.
Line 7: Line 6:
https://github.com/sudomesh/luci-app-peopleswifi
https://github.com/sudomesh/luci-app-peopleswifi


=== Luci ===
= Luci =


Luci is the web admin framework that OpenWrt ships with and seems to be a popular choice among other projects. It is written in Lua, which is a sort of procedural language that's kind of a mix between javascript and ruby (??).  
Luci is the web admin framework that OpenWrt ships with and seems to be a popular choice among other projects. It is written in Lua, which is a sort of procedural language that's kind of a mix between javascript and ruby (??).  
Line 23: Line 22:
[https://github.com/openwrt-routing/packages/tree/master/luci-app-bmx6 bmx6 Luci Package]
[https://github.com/openwrt-routing/packages/tree/master/luci-app-bmx6 bmx6 Luci Package]


We'll likely need every AP to serve a private WPA encrypted AP even if users have their own home router so that they can config the routers securely.


We'll likely need every AP to serve a private WPA encrypted AP even if users have their own home router so that they can config the routers securely.
== Debugging ==
 
Luci is run as a cgi script. The script is at:
 
  /www/cgi-bin/luci
 
Luci has a caching system, which should be disabled when debugging, to ensure that requests are not being answered from the cache. To disable caching, change /www/cgi-bin/luci by commenting out the following lines:
 
-- require "luci.cacheloader"
-- luci.dispatcher.indexcache = "/tmp/luci-indexcache"
 
You can run /www/cgi-bin/luci from the command line like so:
 
REQUEST_URI="/cgi-bin/luci HTTP/1.1" QUERY_STRING="username=root&password=<password>" /www/cgi-bin/luci
 
The [http://en.wikipedia.org/wiki/Common_Gateway_Interface wikipedia article for CGI] has a list of other environment variables that can be set to pass data to a cgi script.

Revision as of 05:31, 2 January 2014

See Firmware Wants for a description of what we're hoping to be able to implement with our web admin page.

The code for the web admin is hosted here:

https://github.com/sudomesh/luci-app-peopleswifi

Luci

Luci is the web admin framework that OpenWrt ships with and seems to be a popular choice among other projects. It is written in Lua, which is a sort of procedural language that's kind of a mix between javascript and ruby (??).

All of the Luci code is contained on the router in /usr/lib/lua/luci

Documentation related to the Luci project can be found at:

Luci Documentation

Its a MVC framework, and files are separated into controller/ model/ and view/

There's a fairly similar package that we can probably take some cues from:

bmx6 Luci Package

We'll likely need every AP to serve a private WPA encrypted AP even if users have their own home router so that they can config the routers securely.

Debugging

Luci is run as a cgi script. The script is at:

 /www/cgi-bin/luci

Luci has a caching system, which should be disabled when debugging, to ensure that requests are not being answered from the cache. To disable caching, change /www/cgi-bin/luci by commenting out the following lines:

-- require "luci.cacheloader"
-- luci.dispatcher.indexcache = "/tmp/luci-indexcache"

You can run /www/cgi-bin/luci from the command line like so:

REQUEST_URI="/cgi-bin/luci HTTP/1.1" QUERY_STRING="username=root&password=<password>" /www/cgi-bin/luci

The wikipedia article for CGI has a list of other environment variables that can be set to pass data to a cgi script.