Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add listen_ip option to server and web interface

  • Loading branch information...
commit 5eed397a295ea1c8a671875fb926c6353e43c6f2 1 parent 2908f50
@robgolding63 authored
View
4 backtrac/server/server.py
@@ -47,7 +47,7 @@ def requestAvatarId(self, credentials):
client)
class BackupServer(object):
- def __init__(self, port=8123):
+ def __init__(self, ip='0.0.0.0', port=8123):
self.port = port
self.clients = {}
self.storage = Storage(settings.BACKTRAC_BACKUP_ROOT)
@@ -57,7 +57,7 @@ def __init__(self, port=8123):
checker = BackupClientAuthChecker()
self.portal = portal.Portal(realm, [checker])
self.factory = PBServerFactory(self.portal)
- self.service = TCPServer(self.port, self.factory)
+ self.service = TCPServer(self.port, self.factory, interface=ip)
self.restore_loop = LoopingCall(self.execute_pending_restores)
self.restore_loop.start(5)
View
2  server.conf
@@ -1,8 +1,10 @@
[backtracserverd]
+listen_ip = 0.0.0.0
listen_port = 8123
backup_root = /tmp/backtrac/backups
[backtracweb]
+listen_ip = 0.0.0.0
listen_port = 8000
View
3  twisted/plugins/backtracserverd_plugin.py
@@ -37,8 +37,9 @@ def makeService(self, options):
config = options['config']
cp = self.getConfig(config)
try:
+ ip = cp.get('backtracserverd', 'listen_ip')
port = cp.getint('backtracserverd', 'listen_port')
- server = BackupServer(port=port)
+ server = BackupServer(ip=ip, port=port)
return server.service
except ConfigParser.Error:
print >> sys.stderr, 'Error parsing config file:', config
View
3  twisted/plugins/backtracweb_plugin.py
@@ -63,6 +63,7 @@ def makeService(self, options):
config = options['config']
cp = self.getConfig(config)
try:
+ ip = cp.get('backtracweb', 'listen_ip')
port = cp.getint('backtracweb', 'listen_port')
#application = service.Application('backtracweb')
@@ -84,7 +85,7 @@ def makeService(self, options):
# create the site and a TCPServer service to serve it with
site = server.Site(root)
- ws = internet.TCPServer(port, site)
+ ws = internet.TCPServer(port, site, interface=ip)
# add the web server service to the multi service
ws.setServiceParent(multi)
Please sign in to comment.
Something went wrong with that request. Please try again.