-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackfrontendserver.tac
More file actions
33 lines (24 loc) · 996 Bytes
/
packfrontendserver.tac
File metadata and controls
33 lines (24 loc) · 996 Bytes
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
# Copyright 2015 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
# You can run this .tac file directly with:
# twistd -ny packfrontendserver.tac
from twisted.application import internet, service
from twisted.scripts.twistd import ServerOptions
from turnip.config import config
from turnip.log import RotatableFileLogObserver
from turnip.pack.git import PackFrontendFactory
def getPackFrontendService():
"""Return a PackFrontend Service."""
return internet.TCPServer(
int(config.get("pack_frontend_port")),
PackFrontendFactory(
config.get("pack_virt_host"), int(config.get("pack_virt_port"))
),
)
options = ServerOptions()
options.parseOptions()
application = service.Application("Turnip Pack Frontend Service")
application.addComponent(
RotatableFileLogObserver(options.get("logfile")), ignoreClass=1
)
getPackFrontendService().setServiceParent(application)