2 """Main FastCGI entry point for unauthenticated web interface"""
7 from main import InvirtUnauthWeb
10 base_dir = os.path.dirname(__file__)
13 print >>sys.stderr, """%s [config]
15 Run server as FastCGI, with CherryPy config from "main.conf".
17 With `config`, run standalone with CherryPy config from `config`.
21 if __name__ == "__main__":
22 static_dir = os.path.join(base_dir, 'static')
27 if sys.argv[1] in ('-h', '--help'):
29 conf_file = sys.argv[1]
32 conf_file = os.path.join(base_dir, 'main.conf')
36 'tools.invirtwebstate.on': True,
40 app = cherrypy.tree.mount(InvirtUnauthWeb(),
44 cherrypy.config.update(conf_file)
47 cherrypy.server.quickstart()
48 cherrypy.engine.start()
49 cherrypy.engine.block()
51 cherrypy.engine.start(blocking=False)
52 from flup.server.fcgi import WSGIServer
53 server = WSGIServer(cherrypy.tree)