Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V0.21 #24

Merged
merged 28 commits into from
May 16, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c2d9543
added node status to reboot page
Apr 26, 2013
164c655
added a complete from first page button. Still need to build the nami…
Apr 26, 2013
7af4e2b
got quickstart to actually be a quick start... down to two pages.
Apr 26, 2013
c42bed3
updating todo's
Apr 26, 2013
f313435
revamped the value settings to occur at the end of the QS instead of …
Apr 30, 2013
32879eb
completed make it work completion without error on all possibilities.
May 1, 2013
0c81faf
made node addition text sit next to input field, and added help text …
May 2, 2013
a5701e2
modified descriptions, and organization of the quickstart main page. …
May 3, 2013
e2801ef
changed just make it work button to finish button (bug 494)
May 7, 2013
822dab1
swapped finish button
May 9, 2013
08b6563
changed menu's to menus
May 9, 2013
ba39f84
added wifi designation to wifi password
May 9, 2013
a2eb59a
replaced name with password when talking about password inputs
May 9, 2013
1a41ff5
added a check for node_name compatability with hostname values
May 9, 2013
b949064
made password validation better, fixed some css, and added a quicksta…
May 10, 2013
29b3beb
Merging elationfoundation:v0.21
May 10, 2013
98ef9c7
Used HTML5 placeholder for name input default text. Added jquery fail…
May 10, 2013
21f6b93
Merge pull request #21 from areynold/v0.21-name-placeholder
May 10, 2013
1c350a2
Added a nodogsplash restart to the end of the quickstart finish proce…
May 13, 2013
86963bd
added increased logging to final countdown sequence in order to track…
May 13, 2013
4be6bfc
added hostname success logging
May 13, 2013
ff3db9c
made it so the access point does not receive the node ID in its name
May 14, 2013
4c22fe2
removed node ID from the end of the name input, since it will only be…
May 14, 2013
d0912b2
Merge pull request #23 from elationfoundation/v0.21
May 14, 2013
c7f0391
fixed a quick misspelling
May 14, 2013
541fbe9
added values to set exit codes to. I think this is causing the lua pr…
May 15, 2013
d203784
stopped trying to be so controlling on how the settings are run in th…
May 16, 2013
804bc31
Merged elationfoundation/APdiffFromHostName
May 16, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
118 changes: 11 additions & 107 deletions etc/config/quickstart
Original file line number Diff line number Diff line change
Expand Up @@ -6,119 +6,23 @@ config quickstart options

config page 'welcome'
option pageTitle 'Welcome'
option topheader 'Welcome to the Commotion Quick Start wizard'
list modules 'welcome'
list modules 'adminPassword'
option topheader 'Welcome to the Commotion Quick Start'
list modules 'adminPassword'
list modules 'name'
list buttons 'noBack'
list buttons '2:settingsFile,|Manual Configuration >,| ,| '
list buttons '3:makeItWork,|Just Make it Work >,| ,| '
list buttons '2:finish,|Finish >,| ,| '
list buttons '3:settingsFile,|Use a pre-built network file >,| ,| '


config page 'settingsFile'
option pageTitle 'Using a Settings File'
option topheader 'Using a Settings File'
option subheading 'Do you have a settings file? Your network administrator may have provided a settings file. If you have a settings file, please upload it below. Or, you can enter the settings manually.'
option subheading 'If you have a settings file, please upload it below.'
option fileType 'config'
list modules 'upload'
list buttons '3:noConfigUploaded,|Continue >,|Continue without uploading a file,| ,|'
list buttons '4:wifiSharing,|Upload & Continue >>,|Upload a settings file and continue,| ,|'
list buttons '5:startOver,|<< Start Over,| ,|plus'

config page 'wifiSharing'
option pageTitle 'Setup Wireless Connection sharing'
option topheader 'Setup Wireless Connection sharing'
option subheading 'Would you like to allow anyone to use your wifi access point?'
list buttons '3:accessPoint,|Yes >,|Set up an open access point,| ,|'
list buttons '4:secAccessPoint,|No >,|Set up a secure access point,| ,|'
list buttons '4:finish,|Upload and Finish,|,| ,|'
list buttons '5:startOver,|<< Start Over,| ,|plus'

config page 'accessPoint'
option pageTitle 'Setup an Open Access Point'
option topheader 'Setup an Open Access Point'
option subheading ''
list modules 'accessPoint'
list buttons '2:internetCheck,|Save >,|Continue with this setting,| ,|'
list buttons '4:startOver,|<< Start Over,| ,|plus'

config page 'secAccessPoint'
option pageTitle 'Setup a Private Access Point'
option topheader 'Setup a Private Access Point'
option subheading ''
list modules 'secAccessPoint'
list buttons '2:internetCheck,|Save >,|Continue with this setting,| ,|'
list buttons '4:startOver,|<< Start Over,| ,|plus'

config page 'internetCheck'
option pageTitle 'Internet Connectivity'
option topheader 'Internet Connectivity'
option subheading 'Are you planning to connect a cable between this Router and your home or business Internet connection?'
list buttons '2:internetSharing,|Yes >,|Configure your internet gateway,| ,|'
list buttons '3:splashPage,|No >,|Skip this step,| ,|'
list buttons '4:startOver,|<< Start Over,| ,|plus'

config page 'internetSharing'
option pageTitle 'Sharing your Internet Connection'
option topheader 'Sharing your Internet Connection'
option subheading 'Internet access will be available to those that connect to the mesh.<br />You may choose to advertise it to the mesh, or keep it hidden.'
list buttons '2:splashPage,|Please advertise my Internet access. &gt;,|,| ,|'
list buttons "3:gatewayShareOff,|Please DON'T advertise my Internet access. &gt;,|Note that access will still be available, just not advertised,| ,|"
list buttons '4:startOver,|&lt;&lt; Start Over,| ,|plus'

config page 'splashPage'
option pageTitle 'Setup a Splash Page'
option topheader 'Setup a Splash Page'
option subheading 'Would you like people connecting to your node to first see a splash page on their web browser?<br />This is the only way to ask people connecting to the node to agree to a Community Standards agreement or Terms of Service.'
list modules 'splashPage'
list buttons '2:meshApplications,|Submit Splash Text&gt;,|Use the above for your nodes splash page,| ,|'
list buttons '3:noSplash,|No &gt;,|Skip this step,| ,|'
list buttons '4:startOver,|&lt;&lt; Start Over,| ,|plus'

config page 'meshApplications'
option pageTitle 'Setup Mesh Application Advertising'
option topheader 'Setup Mesh Application Advertising'
option subheading 'Would you like to advertise mesh applications to people connected to your node?<br />You will be alerted when new applications are available and need approval.'
list modules 'applications'
list buttons '2:netSec,|Yes &gt;,|I would like to create an application portal,| ,|'
list buttons "3:noApplications,|No &gt;,|I don't want to let my node advertise applications,| ,|"
list buttons '4:startOver,|&lt;&lt; Start Over,| ,|plus'

config page 'keyfilesAndSecurity'
option pageTitle 'Network Security Settings'
option topheader 'Network Security Settings'
option subheading 'This network configuration requires a key and/or password.<br />Remember, other nodes will have to use this key and/or password to connect to this mesh network.'
option fileType 'key'
list modules 'networkSecurity'
list modules 'upload'
list buttons '3:naming,|Continue &gt;,|,| ,|'
list buttons '2:checkKeyFile,|Download Key File,|,| ,|'
list buttons '4:continueInsecure,|No &gt;,|Continue with a insecure network,| ,|'
list buttons '5:startOver,|&lt;&lt; Start Over,| ,|plus'

config page 'naming'
option pageTitle 'Please Choose your Mesh Names'
option topheader 'Please Choose your Mesh Names'
list modules 'nodeNaming'
list buttons '3:yourNetwork,|Continue &gt;,|Set this name for your node and continue,| ,|'
list buttons '4:startOver,|&lt;&lt; Start Over,| ,|plus'

config page 'makeItNaming'
option pageTitle 'Please Choose your Mesh Names'
option topheader 'Please Choose your Mesh Names'
list modules 'nodeNaming'
list modules 'accessPoint'
list buttons '3:yourNetwork,|Continue &gt;,|Set this name for your node and continue,| ,|'
list buttons '4:startOver,|&lt;&lt; Start Over,| ,|plus'

config page 'yourNetwork'
option pageTitle 'Your Network'
option topheader 'Your Network'
list modules 'yourNetwork'
list buttons '3:setupComplete,|Continue &gt;,|Apply these settings to your node,| ,|'
list buttons '4:startOver,|&lt;&lt; Start Over,| ,|plus'

config page 'setupComplete'
option pageTitle 'Setup is complete!'
option topheader 'Setup is complete!'
option subheading 'You have completed the Commotion quickstart. Check below to see if your node is connected to any other nodes in the area.'
list module 'complete'
list buttons '3:finish,|Finish &gt;,|Go to node admin login,| ,|'
list buttons '4:startOver,|&lt;&lt; Start Over,| If there is a problem, Start Over,|plus'
#TODO
#create "name" module that creates a AP and a hostname from one name value (hostname adds a number)
# make sure "complete" module is always processed after all other modules
25 changes: 18 additions & 7 deletions usr/lib/lua/luci/controller/QS/QS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ end

function pages(command, next, skip)
--manipulates the rendered pages for a user
log("pages command: " .. command)
--log("pages command: " .. command)
local uci = luci.model.uci.cursor()
local page = uci:get('quickstart', 'options', 'pageNo')
local lastPg = uci:get('quickstart', 'options', 'lastPg')
log(page)
log("last="..lastPg)
--log(page)
--log("last="..lastPg)
if next == 'back' then
uci:set('quickstart', 'options', 'pageNo', lastPg)
uci:set('quickstart', 'options', 'lastPg', 'welcome')
Expand Down Expand Up @@ -123,7 +123,6 @@ function wirelessController(profiles)
function(s)
table.insert(dev, s['.name'])
end)

--Create interfaces
for devNum,device in ipairs(dev) do
--Make sure wireless devices are on... because it starts them disabled for some reason
Expand Down Expand Up @@ -157,7 +156,9 @@ end

function checkPage()
local returns = luci.http.formvalue()
--log(returns)
errors = parseSubmit(returns)
--log(errors)
return errors
end

Expand Down Expand Up @@ -202,7 +203,8 @@ function parseSubmit(returns)
pages('next', button)
end
if next(errors) ~= nil then
log("errors HERE")
--log("errors HERE")
--log(errors)
pages('next','back')
return(errors)
end
Expand All @@ -213,20 +215,29 @@ function runParser(modules)
errors = {}
local returns = luci.http.formvalue()
--log(returns)
--log(modules)
if modules then
for _,value in ipairs(modules) do
for i,x in pairs(luci.controller.QS.modules) do
if i == (value .. "Parser") then
--log(value)
errors[value]= luci.controller.QS.modules[value .. "Parser"](returns)
errors[value] = luci.controller.QS.modules[value .. "Parser"](returns)
if next(errors) then
for i,x in ipairs(modules) do
if x == 'complete' then
modules[i] = nil
end
end
end
end
end
end
end
--log(errors)
return(errors)
end



function keyCheck()
local uci = luci.model.uci.cursor()
--check if a key is required in a config file and compare the current key to it.
Expand Down
29 changes: 20 additions & 9 deletions usr/lib/lua/luci/controller/QS/buttons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,24 @@ end
function networkSecuritySettings(modules)
local QS = luci.controller.QS.QS
local error = luci.controller.QS.QS.keyCheck()
QS:log(error)
--QS:log(error)
return(modules)
end

function gatewayShare(modules)
return modules
end

function keepGoing(modules)
for i,x in ipairs(modules) do
if x == 'complete' then
rem = i
end
end
table.remove(modules, rem)

end

function back()
return {}
end
Expand Down Expand Up @@ -105,7 +115,7 @@ function continueInsecure(modules)
end

function noConfigUploaded(modules)
luci.controller.QS.QS.log(modules)
--luci.controller.QS.QS.log(modules)
for i,x in ipairs(modules) do
if x == 'upload' then
rem = i
Expand All @@ -117,7 +127,7 @@ function noConfigUploaded(modules)
end

function noSplash(modules)
luci.controller.QS.QS.log(modules)
--luci.controller.QS.QS.log(modules)
for i,x in ipairs(modules) do
if x == 'splashPage' then
rem = i
Expand Down Expand Up @@ -164,12 +174,13 @@ function checkKeyFile(modules)
end

function finish(modules)
environment = luci.http.getenv("SERVER_NAME")
if not environment then
environment = "thisnode"
--luci.controller.QS.QS.log(modules)
mod = {}
for i,x in pairs(modules) do
table.insert(mod, x)
end
luci.template.render("QS/module/applyreboot", {redirect_location=("http://" .. environment .. "/cgi-bin/luci/admin")})
luci.http.close()
return({'complete'})
table.insert(mod, 'complete')
--luci.controller.QS.QS.log(mod)
return mod
end