aboutsummaryrefslogtreecommitdiffstats
path: root/src/acit/__init__.py
blob: ac9693589500e7471418de2e02549dd48696f351 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from os import getenv

import cherrypy

from .web import Server

from .imapplugin import ImapPlugin
from .db import DBPoolManager
from .pagegenerator import Generator

from .types import Site

def run():
	db=DBPoolManager(cherrypy.engine)
	db.subscribe()
	site=Site(dbpool=db)
	imap=ImapPlugin(
		cherrypy.engine, dbpool=db, site=site
		)
	imap.subscribe()

	regen=Generator(cherrypy.engine,imap=imap,site=site,dbpool=db)
	regen.subscribe()


	server=Server(dbpool=db,site=site,imap=imap)
	cherrypy.quickstart(server,'/',{
		'global':{
			'server.socket_host':'0.0.0.0',
			'tools.proxy.on':True if getenv("ACIT_BEHIND_PROXY") else False
			}
		})


if __name__=="__main__":
	run()