[tor-commits] [ooni-probe/master] Parametrize datadir location

art at torproject.org art at torproject.org
Wed Nov 21 15:36:20 UTC 2012


commit c6ee2090554b61715432f5a11c976c14e6cb2468
Author: Arturo Filastò <art at fuffa.org>
Date:   Wed Nov 21 15:38:37 2012 +0100

    Parametrize datadir location
---
 oonib/config.py |    8 ++++++--
 oonib/runner.py |    5 ++++-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/oonib/config.py b/oonib/config.py
index e07dc98..0726c5e 100644
--- a/oonib/config.py
+++ b/oonib/config.py
@@ -9,10 +9,14 @@ def get_root_path():
 
 # XXX convert this to something that is a proper config file
 main = Storage()
-main.collector_port = 8888
+
+# This is the location where submitted reports get stored
 main.report_dir = os.path.join(get_root_path(), 'oonib', 'reports')
 
-# XXX make this be the server name that is of 
+# This is where tor will place it's Hidden Service hostname and Hidden service
+# private key
+main.tor_datadir = os.path.join(get_root_path(), 'oonib', 'data', 'tor')
+
 main.database_uri = "sqlite:"+get_root_path()+"oonib_test_db.db"
 main.db_threadpool_size = 10
 
diff --git a/oonib/runner.py b/oonib/runner.py
index 2538710..3e207df 100644
--- a/oonib/runner.py
+++ b/oonib/runner.py
@@ -25,8 +25,11 @@ def setupCollector(tor_process_protocol):
 
     torconfig = txtorcon.TorConfig(tor_process_protocol.tor_protocol)
     public_port = 80
+    # XXX there is currently a bug in txtorcon that prevents data_dir from
+    # being passed properly. Details on the bug can be found here:
+    # https://github.com/meejah/txtorcon/pull/22
     hs_endpoint = txtorcon.TCPHiddenServiceEndpoint(reactor, torconfig,
-            public_port)
+            public_port, data_dir=config.main.tor_datadir)
     hidden_service = hs_endpoint.listen(reportingBackend)
     hidden_service.addCallback(setup_complete)
     hidden_service.addErrback(txSetupFailed)





More information about the tor-commits mailing list