diff --git a/.gitignore b/.gitignore index 0d20b648..72102502 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,64 @@ -*.pyc +# Emacs temp files: +*~ +*.*~ +\#*\# +.\#* + +# Python binary and object files: +*.py[cod] + +# C extensions +*.so + +# Packages +*.egg +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg +lib +lib64 +__pycache__ + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox +nosetests.xml + +# Translations +*.mo + +# Mr Developer +.mr.developer.cfg +.project +.pydevproject] + +# PyCharm directory: +.idea/* + +# config.tor_datadir directory: +tmp/* + +# openssl certificates, keys, signing requests: +*.crt +*.csr +*.key + +# logs and private files: +*.log +*.private + +# from "python setup.py install --record installed-files.txt": +installed-files.txt + +# client config: +oonib.conf diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index daddf8f4..00000000 --- a/.gitmodules +++ /dev/null @@ -1,9 +0,0 @@ -[submodule "ooni/lib/txscapy"] - path = ooni/lib/txscapy - url = https://github.com/isislovecruft/txscapy.git -[submodule "ooni/lib/txtraceroute"] - path = ooni/lib/txtraceroute - url = https://github.com/isislovecruft/txtraceroute.git -[submodule "ooni/lib/txtorcon"] - path = ooni/lib/txtorcon - url = https://github.com/isislovecruft/txtorcon.git diff --git a/.requirements.travis b/.requirements.travis new file mode 100644 index 00000000..e2929a61 --- /dev/null +++ b/.requirements.travis @@ -0,0 +1,25 @@ +## we do not want to override the PI URI for TravisCI: +#-i https://pypi.python.org/packages +PyYAML>=3.10 +#https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.10.tar.gz#md5=74c94a383886519e9e7b3dd1ee540247#egg=PyYAML +Twisted>=12.2.0 +#https://pypi.python.org/packages/source/T/Twisted/Twisted-13.0.0.tar.bz2#md5=68afff4e1efd3757d934e39f70c99f57#egg=Twisted +cyclone>=1.1 +#https://pypi.python.org/packages/source/c/cyclone/cyclone-1.1.tar.gz#md5=477c5ef9cf8902e37105fe450c4d8c5d#egg=cyclone +ipaddr>=2.1.10 +#https://ipaddr-py.googlecode.com/files/ipaddr-2.1.10.tar.gz#sha1=c608450b077b19773d4f1b5f1ef88b26f6650ce0#egg=ipaddr +pygeoip>=0.2.6 +#https://pypi.python.org/packages/source/p/pygeoip/pygeoip-0.2.6.zip#md5=b3ac1bfcd535782bc59af78e722cf5c1#egg=pygeoip +# Originally fetched from the hg repo on secdev.org: +# https://hg.secdev.org/scapy/archive/tip.zip#egg=scapy +# This is a Tor Project mirror with valid SSL/TLS certs that is stable and fast: +https://people.torproject.org/~ioerror/src/mirrors/ooniprobe/scapy-02-25-2013-tip.zip#egg=scapy +transaction>=1.4.1 +#https://pypi.python.org/packages/source/t/transaction/transaction-1.4.1.zip#md5=8db2680bc0f999219861a67b8f335a88#egg=transaction +storm>=0.19 +#https://pypi.python.org/packages/source/s/storm/storm-0.19.tar.gz#md5=61d1ee4cd2a08639ab917e43fa2c9265#egg=storm +txtorcon>=0.7 +pyOpenSSL>=0.13 +zope.component>=4.0.0 +zope.event>=4.0.0 +zope.interface>=4.0.1 diff --git a/.travis.test.sh b/.travis.test.sh new file mode 100755 index 00000000..d7f5092d --- /dev/null +++ b/.travis.test.sh @@ -0,0 +1,35 @@ +#!/bin/bash +############################################################################## +# +# .travis.test.sh +# ------------------- +# Run $2 for $1 seconds and then kill the process. +# +# :authors: Isis Agora Lovecruft, 0x2cdb8b35 +# :date: 21 April 2013 +# :version: 0.0.1 +############################################################################## + +set -vx -- + +function killitwithfire () { + trap - ALRM + kill -ALRM $prog 2>/dev/null + kill -9 $! 2>/dev/null && exit 0 +} + +function waitforit () { + trap "killitwithfire" ALRM + sleep $1& wait + kill -ALRM $$ +} + +waitforit $1& prog=$! ; shift ; +trap "killitwithfire" ALRM INT +"$@"& wait $! +RET=$? +if [[ "$(ps -ef | awk -v pid=$prog '$2==pid{print}{}')" != "" ]]; then + kill -ALRM $prog + wait $prog +fi +exit $RET diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..0a42f4a5 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,41 @@ +language: python +notifications: + irc: + channels: + - "irc.oftc.net#tor-bots" + - "irc.oftc.net#ooni" + on_success: always + on_failure: always + email: + recipients: + - isis@torproject.org + - aagbsn@torproject.org + - ioerror@torproject.org + - hellais@torproject.org + on_success: change + on_failure: always +before_install: + - echo "deb http://deb.torproject.org/torproject.org wheezy main" | sudo tee -a /etc/apt/sources.list + - gpg --keyserver keys.gnupg.net --recv 886DDD89 + - gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add - + - sudo apt-get update + - sudo apt-get install deb.torproject.org-keyring tor tor-geoipdb build-essential python-dev python-setuptools openssl +python: + #- "3.3" + - "2.7" + - "2.6" +install: + - pip install -r .requirements.travis --use-mirrors + - python setup.py install +# command to run tests, e.g. python setup.py test +script: + - cp oonib.conf.example oonib.conf + - openssl genrsa -des3 -passout pass:oonib -out private.key 4096 + - openssl req -batch -passin pass:oonib -new -key private.key -out server.csr + - cp private.key private.key.org + - openssl rsa -passin pass:oonib -in private.key.org -out private.key + - openssl x509 -req -days 365 -in server.csr -signkey private.key -out certificate.crt + - test -f "private.key.org" && rm -f private.key.org + - test -f "server.csr" && rm -f server.csr + - chmod +x .travis.test.sh && ./.travis.test.sh 30 ./bin/oonib + - echo "Build successful." diff --git a/HACKING b/HACKING index b92ddbec..44dfe015 100644 --- a/HACKING +++ b/HACKING @@ -36,109 +36,15 @@ Code Structure - HACKING The document you are currently reading. -- inputs/ - Contains input files for tests. - - oonib/ Contains the OONI probe backend to be run on the ooni-net -- ooni/ - Contains the main ooni probe comand line client - -- ooni/config.py - Parts of the code related to parsing OONI - configuration files and making them accessible - to other components of the software. - -- ooni/inputunit.py - In here we have functions related to the creation of input - units. Input units are how the inputs to be fed to tests are - split up into. - -- ooni/nettest.py - In here is the NetTest API definition. This is how people - interested in writing ooniprobe tests will be specifying - them. - -- ooni/nodes.py - Mostly broken code for the remote dispatching of tests. - -- ooni/oonicli.py - In here we take care of running ooniprobe from the command - line interface - -- ooni/reporter.py - In here goes the logic for the creation of ooniprobe - reports. - -- ooni/runner.py - Handles running ooni.nettests as well as - ooni.plugoo.tests.OONITests. - -- ooni/otime.py - Generation of timestamps, time conversions and all the rest - -- ooni/kit/ - In here go utilities that can be used by tests. - -- ooni/lib/ - XXX this directory is to be removed. - -- ooni/utils/ - In here go internal utilities that are useful to ooniprobe - -- ooni/utils/geodata.py - In here go functions related to the understanding of - geographical information of the probe - -- ooni/utils/hacks.py - When some software has issues and we need to fix it in a - hackish way, we put it in here. This one day will be empty. - -- ooni/utils/log.py - log realted functions. - -- ooni/utils/net.py - utilities for networking related operations - -- ooni/utils/onion.py - Utilities for working with Tor. - XXX this code should be removed and merged into txtorcon. - -- ooni/utils/txscapy.py - Tools for making scapy work well with twisted. - - ooniprobe.conf The main OONI-probe configuration file. This can be used to configure your OONI CLI, tell it where it should report to, where the asset files are located, what should be used for control, etc. -Test related conventions ------------------------- - -These are the conventions for tests that are written in ooniprobe. That is what -goes inside of nettests/. - -Naming -...... - -All methods that are relevant to the test should be all lower case separated by -underscore. - -All variables that are specific to your test should be all lower case separated -by underscore. - -Simplicity -.......... - -Tests written in ooniprobe should be as short as possible and should contain as -little code not related to the measurement as possible. It should be possible -from reading the test to understand what it does without clutter. - -Everything that is not related directly to the test should go inside of the -test template of which the test you are writing is a subclass of. - Style guide ----------- @@ -288,5 +194,3 @@ methods. Even better if you write them also for non-public methods. Place docstrings under the def. For a better overview on how to write docstrings consult: PEP-257 - - diff --git a/README.md b/README.md index 78777ee1..90a3d1af 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,81 @@ -# Dependencies +# Dependencies and Installation + - cp oonib.conf.example oonib.conf + - chmod +x .travis.test.sh && ./.travis.test.sh 30 ./bin/oonib + - echo "Build successful." -The extra dependencies necessary to run OONIB are: +## Distro dependencies (Debian) +There are a few dependencies which we recommend you get from your +distribution's archives. -* twisted-names -* cyclone: https://github.com/fiorix/cyclone + sudo apt-get install build-essential python-dev python-setuptools openssl -We recommend that you use a python virtualenv. See OONI's README.md. +### Tor +You will need a Tor binary on your system. For complete instructions, see also: + + https://www.torproject.org/docs/tor-doc-unix.html.en + https://www.torproject.org/docs/rpms.html.en + +If you've already got Tor, or plan to compile it yourself from source, great! +You can skip this step. Otherwise, if you're installing Tor (or reinstalling), +you'll want to make sure to get our keyring package in Debian: + + echo "deb http://deb.torproject.org/torproject.org wheezy main" | \ + sudo tee -a /etc/apt/sources.list + gpg --keyserver keys.gnupg.net --recv 886DDD89 + gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add - + sudo apt-get update + sudo apt-get install deb.torproject.org-keyring tor tor-geoipdb + +### Pip (>=1.3.0) +We recommend using the Pip>=1.3.0 because it included several important +security and privacy related patches: + + * It forces the use of HTTPS for [PyPI](pypi.python.org). + * and checks package hash sums before installation, with support for hashes + more collision-resistant than MD5. -# Generate self signed certs for OONIB +The least painful way (that we know of) to install a newer Pip is to use Pip's +get-pip script: + # Grab the get-pip installer to make sure we have pip>=1.3.0 + curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py + sudo python ./get-pip.py ## pip (>=1.3.0) is recommended for security reasons + # And make sure we're actually using the newer one: + sudo update-alternatives --install /usr/bin/pip pip /usr/local/bin/pip 0 + +### Virtualenv +We recommend that you use a python virtualenv. The recommended commands for +setting up this up and installing are: + + sudo pip install --upgrade virtualenv virtualenvwrapper + # Setup the virtualenv directory: + export WORKON_HOME=~/.virtualenvs && mkdir -p $WORKON_HOME + source /usr/local/bin/virtualenvwrapper.sh + # Clone ooni-backend: + git clone https://github.com/TheTorProject/ooni-backend.git && cd ooni-backend + # Create the virtualenv for ooni-backend... + mkvirtualenv -a $PWD --unzip-setuptools --setuptools --no-site-packages oonib + # ...and install ooni-backend (sudo is not necessary since we're in a virtualenv): + pip install -r requirements.txt --use-mirrors + python setup.py install + +# Running an OONI collector + +## Configure oonib + +Copy the example config file to ```oonib.conf```. + + cp oonib.conf.example oonib.conf + +Then edit your configuration to fit your needs. The fields you should probably +end up changing are ```report_dir``` (the public web server directory where you +would like ooni-probe clients to be able to submit reports to, for example, if +the clients should submit POSTs to https://abcdef0123456789.onion/report then +this would simply be ```'report'```) and ```tor_datadir``` (where you would +like the spawned Tor process to keep its data). If you compiled Tor yourself, +you'll likely want to specify it for the ```tor_binary``` option. + +## Generate self signed certs for OONIB If you want to use the HTTPS test helper, you will need to create a certificate: openssl genrsa -des3 -out private.key 4096 @@ -18,13 +85,15 @@ If you want to use the HTTPS test helper, you will need to create a certificate: openssl rsa -in private.key.org -out private.key openssl x509 -req -days 365 -in server.csr -signkey private.key -out certificate.crt rm private.key.org + rm server.csr -Don't forget to update oonib/config.py options helpers.ssl.private_key and -helpers.ssl.certificate - -# Redirect low ports with iptables +If you decide to put your certificate and key somewhere else, don't forget to +update oonib.conf options ```helpers.ssl.private_key``` and +```helpers.ssl.certificate```! -The following iptables commands will map connections on low ports to those bound by oonib +## Redirect low ports with iptables +The following iptables commands will map connections on low ports to those +bound by oonib: # Map port 80 to config.helpers.http_return_request.port (default: 57001) iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 57001 @@ -35,35 +104,6 @@ The following iptables commands will map connections on low ports to those bound # Map port 53 tcp to config.helpers.dns.tcp_port (default: 57005) iptables -t nat -A PREROUTING -p tcp -m tcp --dport 53 -j REDIRECT --tor-ports -# Install Tor (Debian). - -You will need a Tor binary on your system. For complete instructions, see also: - - https://www.torproject.org/docs/tor-doc-unix.html.en - https://www.torproject.org/docs/rpms.html.en - -Add this line to your /etc/apt/sources.list, replacing -where appropriate: - - deb http://deb.torproject.org/torproject.org main - -Add the Tor Project gpg key to apt: - - gpg --keyserver keys.gnupg.net --recv 886DDD89 - gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add - - # Update apt and install the torproject keyring, tor, and geoipdb - apt-get update - apt-get install deb.torproject.org-keyring tor tor-geoipdb - -# Configure oonib - -Copy the example config file - - cp oonib.conf.example oonib.conf - -Then edit your configuration to fit your needs. The fields you should probably -end up changing are `tor_binary`, `report_dir` and `tor_datadir`. - # (For Experts Only) Tor2webmode: WARNING: provides no anonymity! Use only if you know what you are doing! @@ -106,10 +146,9 @@ Build Tor with enable-tor2web-mode ./autogen.sh ; ./configure --enable-tor2web-mode ; make Copy the tor binary from src/or/tor somewhere and set the corresponding -options in oonib/config.py +options in oonib.conf. # To launch oonib on system boot - To launch oonib on startup, you may want to use supervisord (www.supervisord.org) The following supervisord config will use the virtual environment in /home/ooni/venv_oonib and start oonib on boot: diff --git a/oonib.conf.example b/oonib.conf.example index 3afdd385..a4cb7076 100644 --- a/oonib.conf.example +++ b/oonib.conf.example @@ -1,9 +1,11 @@ main: - report_dir: - tor_datadir: + report_dir: Null + logfile: Null + tor_datadir: Null database_uri: 'sqlite://oonib_test_db.db' db_threadpool_size: 10 - tor_binary: '/usr/bin/tor' + tor_binary: Null + socks_port: 9055 tor2webmode: false pidfile: 'oonib.pid' nodaemon: true diff --git a/oonib/__init__.py b/oonib/__init__.py index 30ebd69d..8ddad008 100644 --- a/oonib/__init__.py +++ b/oonib/__init__.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- # -# :authors: Arturo Filastò -# :licence: see LICENSE +# :authors: Arturo Filastò, Isis Lovecruft +# :licence: see LICENSE for details """ In here we shall keep track of all variables and objects that should be instantiated only once and be common to pieces of GLBackend code. diff --git a/oonib/log.py b/oonib/log.py index 64d82f1f..14b203df 100644 --- a/oonib/log.py +++ b/oonib/log.py @@ -1,3 +1,11 @@ +# -*- encoding: utf-8 -*- +# +# :authors: Arturo Filastò, Isis Lovecruft +# :licence: see LICENSE for details +""" +Twisted logger for the ooni backend system. +""" + import sys import os import logging @@ -28,16 +36,16 @@ def start(logfile=None, application_name="oonib"): daily_logfile = None if not logfile: - logfile = config.basic.logfile + logfile = config.main.logfile log_folder = os.path.dirname(logfile) log_filename = os.path.basename(logfile) daily_logfile = DailyLogFile(log_filename, log_folder) - txlog.msg("Starting %s on %s (%s UTC)" % (application_name, otime.prettyDateNow(), - otime.utcPrettyDateNow())) - + txlog.msg("Starting %s on %s (%s UTC)" % (application_name, + otime.prettyDateNow(), + otime.utcPrettyDateNow())) txlog.startLoggingWithObserver(LogWithNoPrefix(sys.stdout).emit) txlog.addObserver(txlog.FileLogObserver(daily_logfile).emit) @@ -48,9 +56,12 @@ def msg(msg, *arg, **kw): print "%s" % msg def debug(msg, *arg, **kw): - if config.advanced.debug: + if config.main.debug: print "[D] %s" % msg +def warn(msg, *arg, **kw): + print "[W] %s" % msg + def err(msg, *arg, **kw): print "[!] %s" % msg diff --git a/oonib/oonibackend.py b/oonib/oonibackend.py index 2345632b..c0424639 100644 --- a/oonib/oonibackend.py +++ b/oonib/oonibackend.py @@ -15,8 +15,6 @@ from cyclone import web -import txtorcon - from oonib.testhelpers import dns_helpers, ssl_helpers from oonib.testhelpers import http_helpers, tcp_helpers diff --git a/oonib/runner.py b/oonib/runner.py index b5bc5dcb..c3b57b0a 100644 --- a/oonib/runner.py +++ b/oonib/runner.py @@ -1,14 +1,24 @@ +# -*- encoding: utf-8 -*- +# +# :authors: Arturo Filastò, Isis Lovecruft +# :licence: see LICENSE for details """ In here we define a runner for the oonib backend system. -We are just extending the - """ +from __future__ import print_function + +import tempfile +import os + +from shutil import rmtree + from twisted.internet import reactor from twisted.application import service, internet, app from twisted.python.runtime import platformType -import txtorcon +from txtorcon import TCPHiddenServiceEndpoint, TorConfig +from txtorcon import launch_tor from oonib.report.api import reportingBackend @@ -16,58 +26,79 @@ from oonib import config from oonib import log + +class OBaseRunner(object): + pass + + +_repo_dir = os.path.join(os.getcwd().split('ooni-backend')[0], 'ooni-backend') +tempfile.tempdir = os.path.join(_repo_dir, 'tmp') +if not os.path.isdir(tempfile.gettempdir()): + os.makedirs(tempfile.gettempdir()) +_temp_dir = tempfile.mkdtemp() + def txSetupFailed(failure): log.err("Setup failed") log.exception(failure) def setupCollector(tor_process_protocol): def setup_complete(port): - print "Exposed collector Tor hidden service on httpo://%s" % port.onion_uri - - torconfig = txtorcon.TorConfig(tor_process_protocol.tor_protocol) + print("Exposed collector Tor hidden service on httpo://%s" + % port.onion_uri) + + if config.main.tor_datadir is None: + log.warn("Option 'tor_datadir' in oonib.conf is unspecified!") + log.msg("Creating tmp directory in current directory for datadir.") + log.debug("Using %s" % _temp_dir) + datadir = _temp_dir + else: + datadir = config.main.tor_datadir + + torconfig = 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, data_dir=config.main.tor_datadir) + hs_endpoint = TCPHiddenServiceEndpoint(reactor, torconfig, public_port, + data_dir=datadir) hidden_service = hs_endpoint.listen(reportingBackend) hidden_service.addCallback(setup_complete) hidden_service.addErrback(txSetupFailed) def startTor(): def updates(prog, tag, summary): - print "%d%%: %s" % (prog, summary) + print("%d%%: %s" % (prog, summary)) - torconfig = txtorcon.TorConfig() - torconfig.SocksPort = 9055 + torconfig = TorConfig() + torconfig.SocksPort = config.main.socks_port if config.main.tor2webmode: torconfig.Tor2webMode = 1 torconfig.CircuitBuildTimeout = 60 torconfig.save() - d = txtorcon.launch_tor(torconfig, reactor, - tor_binary=config.main.tor_binary, - progress_updates=updates) + if config.main.tor_binary is not None: + d = launch_tor(torconfig, reactor, + tor_binary=config.main.tor_binary, + progress_updates=updates) + else: + d = launch_tor(torconfig, reactor, progress_updates=updates) d.addCallback(setupCollector) d.addErrback(txSetupFailed) -class OBaseRunner(): - pass if platformType == "win32": from twisted.scripts._twistw import WindowsApplicationRunner OBaseRunner = WindowsApplicationRunner - # XXX Current we don't support windows for the starting of Tor Hidden Service + # XXX Currently we don't support windows for starting a Tor Hidden Service + log.warn( + "Apologies! We don't support starting a Tor Hidden Service on Windows.") else: from twisted.scripts._twistd_unix import UnixApplicationRunner class OBaseRunner(UnixApplicationRunner): def postApplication(self): - """ - To be called after the application is created: start the - application and run the reactor. After the reactor stops, - clean up PID files and such. + """After the application is created, start the application and run + the reactor. After the reactor stops, clean up PID files and such. """ self.startApplication(self.application) # This is our addition. The rest is taken from @@ -75,10 +106,12 @@ def postApplication(self): startTor() self.startReactor(None, self.oldstdout, self.oldstderr) self.removePID(self.config['pidfile']) + if os.path.exists(tempfile.gettempdir()): + log.msg("Removing temporary directory: %s" + % tempfile.gettempdir()) + rmtree(tempfile.gettempdir(), onerror=log.err) def createOrGetApplication(self): return oonibackend.application OBaseRunner.loggerFactory = log.LoggerFactory - - diff --git a/requirements.txt b/requirements.txt index e6477245..fd6fb4b0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,23 +1,24 @@ +-i https://pypi.python.org/packages PyYAML>=3.10 -Pygments>=1.5 +#https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.10.tar.gz#md5=74c94a383886519e9e7b3dd1ee540247#egg=PyYAML Twisted>=12.2.0 -argparse>=1.2.1 -cyclone>=1.0-rc13 -docutils>=0.9.1 +#https://pypi.python.org/packages/source/T/Twisted/Twisted-13.0.0.tar.bz2#md5=68afff4e1efd3757d934e39f70c99f57#egg=Twisted +cyclone>=1.1 +#https://pypi.python.org/packages/source/c/cyclone/cyclone-1.1.tar.gz#md5=477c5ef9cf8902e37105fe450c4d8c5d#egg=cyclone ipaddr>=2.1.10 -pyOpenSSL>=0.13 -pygeoip>=0.2.5 -# -# This is a Tor Project mirror with valid SSL/TLS certs that is stable and fast -# +#https://ipaddr-py.googlecode.com/files/ipaddr-2.1.10.tar.gz#sha1=c608450b077b19773d4f1b5f1ef88b26f6650ce0#egg=ipaddr +pygeoip>=0.2.6 +#https://pypi.python.org/packages/source/p/pygeoip/pygeoip-0.2.6.zip#md5=b3ac1bfcd535782bc59af78e722cf5c1#egg=pygeoip # Originally fetched from the hg repo on secdev.org: # https://hg.secdev.org/scapy/archive/tip.zip#egg=scapy -# Mirrored on Tor's webserver: -https://people.torproject.org/~ioerror/src/mirrors/ooniprobe/scapy-02-25-2013-tip.zip#egg= +# This is a Tor Project mirror with valid SSL/TLS certs that is stable and fast: +https://people.torproject.org/~ioerror/src/mirrors/ooniprobe/scapy-02-25-2013-tip.zip#egg=scapy +transaction>=1.4.1 +#https://pypi.python.org/packages/source/t/transaction/transaction-1.4.1.zip#md5=8db2680bc0f999219861a67b8f335a88#egg=transaction storm>=0.19 -transaction>=1.3.0 -txtorcon -wsgiref>=0.1.2 +#https://pypi.python.org/packages/source/s/storm/storm-0.19.tar.gz#md5=61d1ee4cd2a08639ab917e43fa2c9265#egg=storm +txtorcon>=0.7 +pyOpenSSL>=0.13 zope.component>=4.0.0 zope.event>=4.0.0 zope.interface>=4.0.1 diff --git a/setup.py b/setup.py index 64cce36e..e474b0db 100644 --- a/setup.py +++ b/setup.py @@ -1,27 +1,27 @@ from __future__ import with_statement from setuptools import setup, find_packages -def get_requirements(): - with open('requirements.txt', 'r') as f: - requirements = f.read().splitlines() - - # For urls such as https://hg.secdev.org/scapy/archive/tip.zip#egg=scapy in - # requirements.txt we need to add the package name to install_requires and - # the entire url to dependency_links. That way setuptools will be able to - # satisfy the dependency using that url (as long as it is in standard sdist - # format, a single .py file or an egg). - pypi_packages = [] - dependency_links = [] - for package_desc in requirements: - if '#egg=' in package_desc: - dependency_links.append(package_desc) - pypi_packages.append(package_desc.split('#egg=')[-1]) - else: - pypi_packages.append(package_desc) - - return pypi_packages, dependency_links - -install_requires, dependency_links = get_requirements() +#def get_requirements(): +# with open('requirements.txt', 'r') as f: +# requirements = f.read().splitlines() +# +# # For urls such as https://hg.secdev.org/scapy/archive/tip.zip#egg=scapy in +# # requirements.txt we need to add the package name to install_requires and +# # the entire url to dependency_links. That way setuptools will be able to +# # satisfy the dependency using that url (as long as it is in standard sdist +# # format, a single .py file or an egg). +# pypi_packages = [] +# dependency_links = [] +# for package_desc in requirements: +# if '#egg=' in package_desc: +# dependency_links.append(package_desc) +# pypi_packages.append(package_desc.split('#egg=')[-1]) +# else: +# pypi_packages.append(package_desc) +# +# return pypi_packages, dependency_links +# +#install_requires, dependency_links = get_requirements() setup( name="oonib", version="0.9", @@ -31,6 +31,6 @@ def get_requirements(): description="OONI-Probe Backend", scripts=["bin/oonib"], packages=find_packages(), - install_requires=install_requires, - dependency_links=dependency_links, + #install_requires=install_requires, + #dependency_links=dependency_links, )