[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [oonib/master] maintain old behaviour



commit 5fa24c3364c4349995d3bb1ca900dc54e546f5c4
Author: Joe Landers <joe@xxxxxxxxxxxxxx>
Date:   Fri May 6 13:11:33 2016 +0200

    maintain old behaviour
---
 oonib/oonibackend.py | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/oonib/oonibackend.py b/oonib/oonibackend.py
index 0b8c4ec..1e77d6b 100644
--- a/oonib/oonibackend.py
+++ b/oonib/oonibackend.py
@@ -154,15 +154,20 @@ if config.main.tor_hidden_service:
     torconfig = TorConfig()
     configTor(torconfig)
 
-if config.main.bouncer_endpoints:
-    for endpoint_config in config.main.bouncer_endpoints:
-        print "Starting bouncer with config %s" % endpoint_config
-        endpoint = getEndpoint(endpoint_config)
-        createService(endpoint, 'bouncer', endpoint_config)
-
-if config.main.bouncer_endpoints:
-    for endpoint_config in config.main.collector_endpoints:
-        print "Starting collector with config %s" % endpoint_config
-        endpoint = getEndpoint(endpoint_config)
-        createService(endpoint, 'collector', endpoint_config)
+# this is to ensure same behaviour with an old config file
+if config.main.bouncer_endpoints is None:
+    config.main.bouncer_endpoints = [ {'type': 'onion', 'hsdir': 'bouncer'} ]
+
+if config.main.collector_endpoints is None:
+    config.main.collector_endpoints = [ {'type': 'onion', 'hsdir': 'collector'} ]
+
+for endpoint_config in config.main.bouncer_endpoints:
+    print "Starting bouncer with config %s" % endpoint_config
+    endpoint = getEndpoint(endpoint_config)
+    createService(endpoint, 'bouncer', endpoint_config)
+
+for endpoint_config in config.main.collector_endpoints:
+    print "Starting collector with config %s" % endpoint_config
+    endpoint = getEndpoint(endpoint_config)
+    createService(endpoint, 'collector', endpoint_config)
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits