forked from tizzo/Drupal.org-Git-Daemons
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdrupalGitSSHDaemon.tac
More file actions
executable file
·25 lines (21 loc) · 922 Bytes
/
drupalGitSSHDaemon.tac
File metadata and controls
executable file
·25 lines (21 loc) · 922 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
#!/usr/bin/twistd -ny
# You can run this .tac file directly with:
# twistd -ny drupalGitSSHDaemon.tac
import os
import drupalGitSSHDaemon
from twisted.application import service, internet
from twisted.python.log import ILogObserver, FileLogObserver
from twisted.python.logfile import DailyLogFile
def getSSHService():
ssh_server = drupalGitSSHDaemon.Server()
return internet.TCPServer(ssh_server.port,
ssh_server.application(),
interface=ssh_server.interface)
# this is the core part of any tac file, the creation of the root-level
# application object
application = service.Application("Drupal SSH Git Server")
logfile = DailyLogFile("gitssh.log", "/var/log/git")
application.setComponent(ILogObserver, FileLogObserver(logfile).emit)
# attach the service to its parent application
service = getSSHService()
service.setServiceParent(application)