[tor-commits] [ooni-probe/master] Add a list of things TODO

art at torproject.org art at torproject.org
Thu Mar 8 05:04:00 UTC 2012


commit 70def2b8642b3b0f2c9a697f5bcadf7e99a18981
Author: Arturo Filastò <hellais at gmail.com>
Date:   Wed Mar 7 21:04:02 2012 -0800

    Add a list of things TODO
---
 TODO               |   40 ++++++++++++++++++++++++++++++++++++++++
 plugoo/__init__.py |   27 +++++++++++++++++++++++++++
 2 files changed, 67 insertions(+), 0 deletions(-)

diff --git a/TODO b/TODO
new file mode 100644
index 0000000..803ee5b
--- /dev/null
+++ b/TODO
@@ -0,0 +1,40 @@
+This is a list of things to be done on ooni-probe.
+
+Once you have completed something you should add a
+note to this file stating what you have done under
+the item.
+
+Migrate code from old
+---------------------
+
+Migrate all the interesting parts of the old code to the new.
+
+It's important to make the new code asych and based on gevent.
+It should respect the design goals of the new ooni-probe model.
+
+* All the parts related to HTTP and Squid (old/ooni/http.py)
+effort: low, skill: medium
+
+* All the captive portal detection tests (old/ooni/http.py
+  and old/ooni/dnsooni.py)
+effort: low, skill: low
+
+* All the DNS censorship detection tests (old/ooni/dnsooni.py)
+effort: medium, skill: medium
+
+* Misc scripts to detect censorship that are not written in any
+  version of OONI.
+effort: low-medium, skill: low-medium
+
+New things to develop
+---------------------
+
+These are either components specific to the new refactor of ooni
+or that we haven't yet figured out how they should work.
+
+* Design and implement the Worker and the Unit of Work classes
+
+* Design and implement the Node Factory
+
+* Design and implement the Network Node and the Code Exec node classes
+
diff --git a/plugoo/__init__.py b/plugoo/__init__.py
index 1bd4446..384c128 100644
--- a/plugoo/__init__.py
+++ b/plugoo/__init__.py
@@ -27,6 +27,33 @@ import logging
 import itertools
 import gevent
 
+def gen_headers(self, options="common"):
+    """
+    Returns a set of headers to be used when generating
+    HTTP requests.
+
+    :options specify what rules should be used for
+             generating the headers.
+             "common": choose a very common header set (default)
+             "random": make the headers random
+    """
+    if options == "common":
+        headers = [('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'),
+         ('Accept-Charset', 'ISO-8859-1,utf-8;q=0.7,*;q=0.3'),
+         ('Accept-Encoding', 'gzip,deflate,sdch'),
+         ('Accept-Language', 'en,en-US;q=0.8,it;q=0.6'),
+         ('Cache-Control', 'max-age=0')
+         ('User-Agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11')]
+    elif options == "random":
+        # XXX not implemented
+        return False
+    else:
+        print "Error, unrecognized header generation options.."
+        return False
+
+    return headers
+
+
 class torify(object):
     """This is the torify decorator. It should be used to
     decorate functions that should use to for connecting to



More information about the tor-commits mailing list