Made URLs less absolute.

This commit is contained in:
Nick Daly 2013-10-06 21:11:08 -05:00
parent 54313fcb35
commit c61e73245a
2 changed files with 11 additions and 11 deletions

View File

@ -52,7 +52,7 @@ class FirstBoot(PagePlugin):
message += _("Invalid box name: %s") % config.valid_hostname(hostname)
else:
hostname = config.get_hostname()
if box_key:
if box_key:
if self.valid_box_key_p(box_key):
db['box_key'] = box_key
else:
@ -68,11 +68,11 @@ class FirstBoot(PagePlugin):
## Update state to 1 and head there
with sqlite_db(cfg.store_file, table="firstboot", autocommit=True) as db:
db['state']=1
raise cherrypy.InternalRedirect('/firstboot/state1')
raise cherrypy.InternalRedirect('firstboot/state1')
main = "<p>Welcome. It looks like this FreedomBox isn't set up yet. We'll need to ask you a just few questions to get started.</p>"
form = Form(title="Welcome to Your FreedomBox!",
action="/firstboot",
form = Form(title="Welcome to Your FreedomBox!",
action="firstboot",
name="whats_my_name",
message=message)
form.html("<p>For convenience, your FreedomBox needs a name. It should be something short that doesn't contain spaces or punctuation. 'Willard' would be a good name. 'Freestyle McFreedomBox!!!' would not.</p>")
@ -106,16 +106,16 @@ TODO: explain all this cert stuff to the user.</p>
with sqlite_db(cfg.store_file, table="firstboot", autocommit=True) as db:
db['state']=5
main = main + """
<p>Welcome screen not completely implemented yet. Press <a href="/router">continue</a> to
<p>Welcome screen not completely implemented yet. Press <a href="router">continue</a> to
see the rest of the web interface.</p>"
"""
if False:
## Update state to 2 and head there
with sqlite_db(cfg.store_file, table="firstboot", autocommit=True) as db:
db['state']=1
#TODO: switch to HTTPS
raise cherrypy.InternalRedirect('/firstboot/state1')
raise cherrypy.InternalRedirect('firstboot/state1')
return self.fill_template(template="base", title=_("Installing the Certificate"), main=main,
sidebar_right=_("""<strong>Getting Help</strong><p>We've done our best to make your FreedomBox easy to use. If you have questions during setup, there are a few places to turn for help. TODO: add links to such help.</p>"""))

View File

@ -58,14 +58,14 @@ class Root(plugin_mount.PagePlugin):
## TODO: firstboot hijacking root should probably be in the firstboot module with a hook in plinth.py
with sqlite_db(cfg.store_file, table="firstboot") as db:
if not 'state' in db:
raise cherrypy.InternalRedirect('/firstboot')
raise cherrypy.InternalRedirect('firstboot')
elif db['state'] < 5:
cfg.log("First Boot state = %d" % db['state'])
raise cherrypy.InternalRedirect('/firstboot/state%d' % db['state'])
raise cherrypy.InternalRedirect('firstboot/state%d' % db['state'])
if cherrypy.session.get(cfg.session_key, None):
raise cherrypy.InternalRedirect('/router')
raise cherrypy.InternalRedirect('router')
else:
raise cherrypy.InternalRedirect('/help/about')
raise cherrypy.InternalRedirect('help/about')
def load_modules():
"""Import all the symlinked .py files in the modules directory and