GithubHelp home page GithubHelp logo

seamustuohy / luci-commotion-quickstart Goto Github PK

View Code? Open in Web Editor NEW
1.0 14.0 3.0 2.58 MB

An easy-to-use interface to configure a CommotionWRT mesh node. - DEPRECATED (see website link for current replacement)

Home Page: https://github.com/opentechinstitute/luci-commotion

License: GNU General Public License v3.0

Shell 0.43% Lua 37.21% CSS 62.37%

luci-commotion-quickstart's Introduction

DEPRECATED

Deprecated per: 1.0:grumpycat release. Here for historic reasons.... and the tons of useful snippets implemented in the history of this repo.

Please see the luci-commotion branch of opentechinstitute for replacement.

https://github.com/opentechinstitute/luci-commotion

commotion-quick-start

The quickstart is a "on first boot" interface that walks a user through customizing a node. This is intended to make the initial setup of a node trivial for a new user.

###Using The Quickstart

Upon starting a new node a link to the quickstart will be created in the "password needed" text block. When a user clicks on this the QuickStart begins.

###Understanding the Quickstart

The quickstart is controlled by the /etc/config/quickstart file. (see below for customization.) The quickstart file controls the QS.lua buttons.lua and modules.lua files in the QS controller folder in the luci directory.

The movement of data is as such.

  1. The user requests the page http://IPADDRESS/cgi-bin/luci/QuickStart

  2. QS.lua asks module renderers for any data the page needs

  3. module.lua requests the PAGErenderer function and passes the QS.lua

  4. QS.lua renders the page, passing it any data the modules sent to it

  5. Quickstart.htm loads and pulls in the module htm files to create the custom page

  6. The user clicks a submit button

  7. QS.lua checks to see if the button pressed has any special functions and passes those buttons a list of the modules on the page

  • If the button pressed has no predefined function and just points to the next page then QS.lua's pages function will process that here
  • If a button has a special function it will run that function and chooses the page it will continue to next
  1. button.lua calls any defined buttons which pass back the names of modules that they want to process data passed through the submit call

  2. modules.lua runs the PAGEparser function to process any data passed to it from a module on the page

  3. QS.lua checks for any possible uploaded data to the node and processes it

  4. GOTO #2

###Creating Your Own Quickstart Walkthrough

The whole quickstart configuration can be found in /etc/config/quickstart. This contains one "quickstart" section titled "options" and multiple "page" sections. "options" holds the current and last pages as well as a variable that controls weather the Quickstart page is accessible. We disable it after completion because it allows non-admin users to manipulate root level controls. A "page" contains title that is either a number (this is how the controller iterates through the quickstart) or a title that represents a side page.

Each page has set of title information for its display. The page also contains a "buttonText" item that specifies the text to be placed on any button that links to it in the quickstart. A "page" can contain up to two lists. The first list is modules. This list pulls content to populate the main section. In our quickstart I have separated most pages to include only one content section. There is nothing to stop someone from customizing a page that holds multiple content items. Modules call a Renderer function in the controller when the page is initially rendered, and a Parser function when data from a page is submitted. This means that if you want your own module you simple add it to a page and create a renderer and a parser function. Renderer's send initial variables to the page and parsers process user input and send back errors that possible occur in the page.They stack quite well. Lastly a "page" can contain a button list. Buttons call Button functions when pressed that load up side pages. The noBack button removes the auto-generated back button to allow for specialized pages.

luci-commotion-quickstart's People

Contributors

cmdln avatar glamrock avatar hawkinswnaf avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

luci-commotion-quickstart's Issues

Language suggestions for Quickstart

Mesh Password: This is teh password that nodes use to connect to each other
This is teh password that the mesh links use between nodes. This password must be the same on all devices.

Node Name: This is people to find your network wirelessly and over the mesh. This value can be composed of letter, number and hyphens. (Hyphens can
not be used at the beggining or end of the name.)

redirect page: (top)You have finished configuring your node. (bottom) You can connect to your node using this network name.

Add explanitory text to top of first quickstart page

A request was mode to add some text to the top of the quickstart page that gives an overview of what the quickstart process is.
e.g. "Welcome to commotion quickstart we are going to set the name of your node and a few passwords you need to configure"

Prepare quickstart startup hooks for new UI interface

Reconstruct the back-end of quickstart so that when the final UI review is complete the new version of quickstart (which should be renamed) is seamlessly presented upon a routers first startup as well as as the basic menu. This will consist of the following:

  • Create a temporary entry that captures the front page on first boot
  • Create hooks that reset the front page upon completing quickstart or clicking exit/advanced
  • Version 01 UI review is a prerequisite to this task. Remove all configuration from "quickstart" repo and push to custom menu repo, so that only startup specific tasks like these remain.

Have clear and flexible support for multiple interfaces.

Right now we just assume one interface of each type. However, in your average router, we might have many different physical and virtual interfaces. We should evaluate whether this is a use case we want to manage in QuickStart, and how we might present that, or if we just want to handle it post-QuickStart.

Remove applyreboot module from QS, refactor for easy opkg install/remove

When preparing a custom image built without Commotion Quickstart, we uncovered a bug/hidden dependency for QS on the 'Apply Reboot' page. See error text below. This was generated when making changes on the Mesh Config page and attempting to apply them. The image was built without QS, but apparently there are pages that reference the 'applyreboot' module within QS anyway.

Suggestion to make Commotion QS a separable package so that it can be installed or removed after flashing, or built without it completely such that other functionality isn't broken.

/usr/lib/lua/luci/dispatcher.lua:448: Failed to execute call dispatcher target for entry '/admin/commotion/meshprofile_submit'.
The called action terminated with an exception:
/usr/lib/lua/luci/template.lua:81: Failed to load template 'QS/module/applyreboot'.
Error while parsing template '/usr/lib/lua/luci/view/QS/module/applyreboot.htm':
No such file or directory
stack traceback:
[C]: in function 'assert'
/usr/lib/lua/luci/dispatcher.lua:448: in function 'dispatch'
/usr/lib/lua/luci/dispatcher.lua:195: in function </usr/lib/lua/luci/dispatcher.lua:194>

QuickStart fails when run before node is done flashing

If QuickStart attempts to make its changes before the node is done flashing, this error occurs:

Status: 500 Internal Server Error /usr/lib/lua/luci/dispatcher.lua:448: Failed to execute call dispatcher target for entry '/QuickStart'. The called action terminated with an exception: /usr/lib/lua/luci/template.lua:104: Failed to execute template 'QS/module/applyreboot'. A runtime error occured: [string "/usr/lib/lua/luci/view/QS/module/applyreboo..."]:20: bad argument #1 to 'lines' (/etc/commotion/profiles.d/quickstartMesh: No such file or directory) stack traceback: [C]: in function 'assert' /usr/lib/lua/luci/dispatcher.lua:448: in function 'dispatch' /usr/lib/lua/luci/dispatcher.lua:195: in function

Yes, I know this is quite a corner case.

(Was issue 560 on code.commotionwireless.net)

Mesh password

I don't think we should have the mesh password field on the quick start. Andrew mentioned that it would encourage weak passwords, since the password would have to be shared and manually entered into every mesh node that is set up, and I would agree with that reasoning.

I think a better approach would be, instead of having the user change default values on the quickstart, there should be another notification for the admin after quickstart that the node is using default values and should change them. These values should be changed manually on one node, then shared with the others strictly through exported profile files. The profile file would include, among other settings, the mesh password and the serval keyring used for olsrd-mdp. We could even have the node randomly generate a strong mesh password (though the PRNG on the routers is of dubioius entropy).

Quickstart Entry Ordering

A request was made to switch the ordering on Quickstarts first page to:

1)Node name first
2)Wifi-password
3)Mesh Password
4)Admin password
5) Certificate warning
6) buttons

Node Name is mislabled

Add explanitory text letting users know it will become a hostname (with random hash ID) and the access point name.

Quickstart OFF button

If a user skips the quickstart process and moved directly to the admin pages there is no "off" button. This would be added to the reset quickstart page. It would also require a change to the quickstart pages top menu item to "wuickstart options" from "restart quickstart"

Edits to HTTPS cert tutorial

  • Cert tutorial link needs more prominent styling
  • Review text for typos
  • Consider exposing all the sections of the tutorial when user clicks “how do I use...” down to the browser icons. Then let the user click on the appropriate icon to show the image for that browser.
  • Language on quickstart page is somewhat confusing - perhaps it should say: When you log in to the node for the first time, you WILL receive a warning from your browser.
  • Slideshows are swapped for Firefox and Chrome
  • If a user permanently stores an exception for a node, then ends up re-flashing the same node, they'll receive a certificate reuse error when running quickstart the second time, requiring the exception to be manually removed from their web browser before continuing.

Quickstart warning language is ambiguous

Language on quickstart page is somewhat confusing - perhaps it should say: When you logIn to the node for the first time, you WILL receive a warning from your browser.

Add "basic" and advanced menu bar swapping

The current LuCI menu is a presentation of the data structure that it sits upon. The CBI interface maps directly on to database files and presents them to the administrator. While this method of organization makes sense when the user is a technologist who understands the underlying configuration files and is looking for a simple way to manipulate them the organizational structure does not make sense to new users.

A menu with content to reflect the UI process will need to be implemented for new users. This menu should be task/use case focused instead of configuration file based. In order to support this eventuality, this task will consist of the following.

  • A luci function that allows for menu swapping the LuCI menu's.
  • A clear (user-tested) button or indicator that allows for quickly re-actively on the "advanced" menu

These menu's can be implemented in a variety of ways.

  • The LuCI menu generator could be patched to have it construct menu's only out of specified sections.
  • The swap could occur by having the basic menu-structure be a seperate secondary menu that does not use the main LuCI menu with an item in the main LuCI menu that allows a user to click back to it.
  • other ways...

Certificate tutorial needs more prominent styling.

The link to the certificate tutorial in Quickstart is easy to miss as your going through the Quickstart process, as it's just a bold text link in the middle of the page. If it could be made more prominent, or be some kind of separate page or popup, then it would be more difficult for users to miss.

Quickstart Entry Help Icons

A request was mode to add icons that show where on a network a password is used.

e.g.
Mesh password:
(user) -----(node) ==== (node)----(internet)----(website)
Admin password:
(admin user) ====(node)----(node)----(internet)----(website)
Access Point Password
(user) ====(node)----(node)----(internet)----(website)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.