import cherrypy
import os
import sys
-from main import InvirtWeb
+from main import InvirtWeb, InvirtUnauthWeb
dev = False
base_dir = os.path.dirname(__file__)
'tools.staticdir.dir': static_dir}
})
app.merge(conf_file)
+ unauthApp = cherrypy.tree.mount(InvirtUnauthWeb(),
+ '/unauth',
+ {'/': {'tools.invirtwebstate.on': True}})
+ unauthApp.merge(conf_file)
cherrypy.config.update(conf_file)
if dev:
else:
cherrypy.engine.start(blocking=False)
from flup.server.fcgi import WSGIServer
- server = WSGIServer(app)
+ server = WSGIServer(cherrypy.tree)
server.run()
from view import View
+class InvirtUnauthWeb(View):
+ @cherrypy.expose
+ @cherrypy.tools.mako(filename="/unauth.mako")
+ def index(self):
+ return {'simple': True}
+
class InvirtWeb(View):
def __init__(self):
super(self.__class__,self).__init__()
fields = fields)
return d
-def unauthFront(_, _2, _3, fields):
- """Information for unauth'd users."""
- return templates.unauth(searchList=[{'simple' : True,
- 'hostname' : socket.getfqdn()}])
-
-mapping = dict(
- unauth=unauthFront)
+mapping = dict()
def printHeaders(headers):
"""Print a dictionary as HTTP headers."""
-#from skeleton import skeleton
-#extends skeleton
+<%page expression_filter="h"/>
+<%inherit file="skeleton.mako" />
-
-#def title
+<%def name="title()">
Intro
-#end def
+</%def>
-#def body
<h1>XVM — Virtual Servers for MIT </h1>
<p><strong>xvm.mit.edu</strong> is a virtualization service for the
<p>MIT users:</p>
<blockquote><big><a
-href="https://$hostname/"><strong><font color="green">→</font> Log in to XVM now</strong>
+href="https://${config.web.hostname}/"><strong><font color="green">→</font> Log in to XVM now</strong>
</a></big></blockquote>
<p>You'll need an <a href="http://ca.mit.edu/">MIT personal
certificate</a>.</p>
<p>Questions and feedback welcome at <a
href="mailto:xvm@mit.edu">xvm@mit.edu</a>.</p>
-
-#end def