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

[tor-commits] [ooni-probe/master] Check for the minimum version of twisted to support certificates



commit 4aeb08eed886c6268c146957c5ca35cd62f45395
Author: Arturo Filastò <arturo@xxxxxxxxxxx>
Date:   Fri Feb 5 16:44:05 2016 +0100

    Check for the minimum version of twisted to support certificates
    
    * Remove the commented out line of ooniresources
---
 data/ooniprobe.conf.sample |  1 +
 ooni/oonicli.py            | 16 ++++++++++++++++
 setup.py                   |  4 ++--
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/data/ooniprobe.conf.sample b/data/ooniprobe.conf.sample
index e68b449..7aaacd7 100644
--- a/data/ooniprobe.conf.sample
+++ b/data/ooniprobe.conf.sample
@@ -51,6 +51,7 @@ advanced:
     report_log_file: null
     inputs_dir: null
     decks_dir: null
+    insecure_collector: false
 tor:
     #socks_port: 8801
     #control_port: 8802
diff --git a/ooni/oonicli.py b/ooni/oonicli.py
index 1167da9..2b37ad1 100644
--- a/ooni/oonicli.py
+++ b/ooni/oonicli.py
@@ -6,6 +6,8 @@ import yaml
 import random
 import urlparse
 
+from twisted import version as _twisted_version
+from twisted.python.versions import Version
 from twisted.python import usage
 from twisted.python.util import spewer
 from twisted.internet import defer, reactor, protocol
@@ -265,6 +267,20 @@ def createDeck(global_options, url=None):
             log.exception(e)
         log.err(e)
         sys.exit(5)
+
+    if net_test_loader.collector and net_test_loader.collector.startswith('https://'):
+        _twisted_14_0_2_version = Version('twisted', 14, 0, 2)
+        if _twisted_version < _twisted_14_0_2_version:
+            log.err("HTTPS collectors require a twisted version of at least 14.0.2.")
+            sys.exit(6)
+    elif net_test_loader.collector and net_test_loader.collector.startswith('http://'):
+        if config.advanced.insecure_collector is not True:
+            log.err("Attempting to report to an insecure collector.")
+            log.err("To enable reporting to insecure collector set the "
+                    "advanced->insecure_collector option to true in "
+                    "your ooniprobe.conf file.")
+            sys.exit(7)
+
     return deck
 
 
diff --git a/setup.py b/setup.py
index 23088c9..388de5f 100644
--- a/setup.py
+++ b/setup.py
@@ -156,7 +156,7 @@ class install(_st_install):
         prefix = os.path.abspath(self.prefix)
         self.set_data_files(prefix)
         self.do_egg_install()
-        #self.ooniresources()
+        self.ooniresources()
 
 install_requires = []
 dependency_links = []
@@ -205,7 +205,7 @@ setup(
     include_package_data=True,
     scripts=["bin/oonideckgen", "bin/ooniprobe",
              "bin/oonireport", "bin/ooniresources",
-			 "bin/ooniprobequeue"],
+             "bin/ooniprobequeue"],
     dependency_links=dependency_links,
     install_requires=install_requires,
     zip_safe=False,



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