[tor-commits] [oonib/master] Print the configured hidden service details to stdout
art at torproject.org
art at torproject.org
Wed Sep 3 13:56:01 UTC 2014
commit 0b37b3db782cb83f6a60211184b281f292dd4aca
Author: aagbsn <aagbsn at extc.org>
Date: Fri Aug 29 14:37:17 2014 +0000
Print the configured hidden service details to stdout
---
oonib/oonibackend.py | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/oonib/oonibackend.py b/oonib/oonibackend.py
index bc05331..8af558d 100644
--- a/oonib/oonibackend.py
+++ b/oonib/oonibackend.py
@@ -106,16 +106,22 @@ if config.main.tor_hidden_service:
return TCPHiddenServiceEndpoint(reactor,
torconfig, 80, data_dir=data_dir)
+ def printOnionEndpoint(endpointService):
+ print("Exposed %s Tor hidden service on httpo://%s" %
+ (endpointService.name, endpointService.endpoint.onion_uri))
+
def addCollector(torControlProtocol):
data_dir = os.path.join(torconfig.DataDirectory, 'collector')
collector_service = internet.StreamServerEndpointService(
getHSEndpoint(data_dir),
ooniBackend)
+ collector_service.setName('collector')
multiService.addService(collector_service)
collector_service.startService()
- return torControlProtocol
+ return collector_service
d.addCallback(addCollector)
+ d.addCallback(printOnionEndpoint)
if ooniBouncer:
def addBouncer(torControlProtocol):
@@ -123,11 +129,13 @@ if config.main.tor_hidden_service:
bouncer_service = internet.StreamServerEndpointService(
getHSEndpoint(data_dir),
ooniBouncer)
+ bouncer_service.setName('bouncer')
multiService.addService(bouncer_service)
bouncer_service.startService()
- return torControlProtocol
+ return bouncer_service
d.addCallback(addBouncer)
+ d.addCallback(printOnionEndpoint)
else:
if ooniBouncer:
bouncer_service = internet.TCPServer(8888, ooniBouncer, interface="127.0.0.1")
More information about the tor-commits
mailing list