Skip to content

Commit

Permalink
Merge branch 'release-0.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
isislovecruft committed Mar 25, 2015
2 parents 6f0f536 + 9ec5a96 commit 3a1aa0d
Show file tree
Hide file tree
Showing 52 changed files with 326 additions and 139 deletions.
4 changes: 3 additions & 1 deletion .travis.requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ https://ipaddr-py.googlecode.com/files/ipaddr-2.1.10.tar.gz#sha1=c608450b077b197
pycrypto==2.6.1
pygeoip==0.2.7
gnupg==2.0.1
recaptcha-client==1.0.6
pillow>=2.6.1
qrcode==5.0.1
service_identity==14.0.0
stem==1.3.0
zope.interface==3.6.1
42 changes: 41 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,44 @@
Changes in version 0.3.0 - XXX
Changes in version 0.3.1 - 2015-03-24

* FIXES #14065 https://bugs.torproject.org/14065
When requesting vanilla IPv6 bridges from
https://bridges.torproject.org, BridgeDB would respond with IPv4
addresses. It now correctly responds with IPv6 addresses.

And includes the following general changes:

* FIXES an issue with the filtering of hashrings while answering
requests for Pluggable Transports. (commit 3ef37df6)

* FIXES the return value from the GnuPG interface initialization
function (bridgedb.crypto.initializeGnuPG) when creating a test
signature has failed.

* CHANGES the way BridgeDB handles the case where it parses to
duplicate extrainfo descriptors (for the same Bridge) which also
have identical timestamps. Before, we assumed this wasn't
possible. It turns out that it not only is possible, but that
usually every batch of descriptors has at least one Bridge with
such a set of perfectly identical extrainfo descriptors. Even
stranger, it appears that only Bridges started for the first time
quite recently (within the last eight hours) display this
behaviour. BridgeDB now logs these errors, rather than leaving
them unhandled.
(commit a27d7905)

* ADDS an environment variable check to setup.py which controls
whether the setup.py script tries to install the dependencies
listed in the requirements.txt file with easy_install. If the
environment variable BRIDGEDB_INSTALL_DEPENDENCIES=0, then
setup.py will not use easy_install. When BridgeDB is installed
via `make install` the default is to not use easy_install;
however, when installed via `python setup.py install`, the default
is to use easy_install to check for, find, and install
dependencies. (NOTE: the latter is *not* recommended.)
(commit d035fe64)


Changes in version 0.3.0 - 2015-03-21

* FIXES #2895 https://bugs.torproject.org/2895
BridgeDB no longer assumes that any extrainfo descriptor files are
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ pyflakes:

install:
-python setup.py compile_catalog
python setup.py install --record installed-files.txt
BRIDGEDB_INSTALL_DEPENDENCIES=0 python setup.py install --record installed-files.txt

force-install:
-python setup.py compile_catalog
python setup.py install --force --record installed-files.txt
BRIDGEDB_INSTALL_DEPENDENCIES=0 python setup.py install --force --record installed-files.txt

uninstall:
touch installed-files.txt
Expand Down
11 changes: 6 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
*****************************************
BridgeDB |Build Status| |Coverage Status|
*****************************************
**********************************************************
BridgeDB |Latest Version| |Build Status| |Coverage Status|
**********************************************************

BridgeDB is a collection of backend servers used to distribute `Tor Bridges
<https://www.torproject.org/docs/bridges>`__. Currently, it mainly consists of
a webserver with `an HTTPS interface <https://bridges.torproject.org>`__,
`an email responder <mailto:bridges@torproject.org>`__, and an SQLite database.


.. |Latest Version| image:: https://pypip.in/version/bridgedb/badge.svg?style=flat
:target: https://pypi.python.org/pypi/bridgedb/
.. |Build Status| image:: https://travis-ci.org/isislovecruft/bridgedb.svg
:target: https://travis-ci.org/isislovecruft/bridgedb
.. |Coverage Status| image:: https://coveralls.io/repos/isislovecruft/bridgedb/badge.png?branch=develop
Expand Down Expand Up @@ -397,7 +398,7 @@ Accessing the HTTPS User Interface
----------------------------------

Just connect to the appropriate port. (See the ``HTTPS_PORT`` and
``HTTP_UNENCRYPTED\_PORT`` options in the ``bridgedb.conf`` file.)
``HTTP_UNENCRYPTED_PORT`` options in the ``bridgedb.conf`` file.)

The HTTPS interface for our BridgeDB instance can be found `here
<https://bridges.torproject.org>`__.
Expand Down
2 changes: 1 addition & 1 deletion lib/bridgedb/Bridges.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: see AUTHORS file
# :copyright: (c) 2007-2014, The Tor Project, Inc.
# :copyright: (c) 2007-2015, The Tor Project, Inc.
# :license: 3-Clause BSD, see LICENSE for licensing information

"""This module has low-level functionality for parsing bridges and arranging
Expand Down
6 changes: 3 additions & 3 deletions lib/bridgedb/Dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# :authors: Nick Mathewson
# Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# Matthew Finkel 0x017DD169EA793BE2 <sysrqb@torproject.org>
# :copyright: (c) 2013-2014, Isis Lovecruft
# (c) 2013-2014, Matthew Finkel
# (c) 2007-2014, The Tor Project, Inc.
# :copyright: (c) 2013-2015, Isis Lovecruft
# (c) 2013-2015, Matthew Finkel
# (c) 2007-2015, The Tor Project, Inc.
# :license: 3-Clause BSD, see LICENSE for licensing information

"""This module has functions to decide which bridges to hand out to whom."""
Expand Down
4 changes: 2 additions & 2 deletions lib/bridgedb/Filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def filterAssignBridgesToRing(hmac, numRings, assignedRing):
return funcs[ruleset]
except KeyError:
def _assignBridgesToRing(bridge):
digest = hmac(bridge.fingerprint)
digest = hmac(bridge.getID())
pos = long( digest[:8], 16 )
which = pos % numRings

Expand Down Expand Up @@ -74,7 +74,7 @@ def filterBridgesByIP6(bridge):
setattr(filterBridgesByIP6, "description", "ip=6")

def filterBridgesByTransport(methodname, addressClass=None):
if not isinstance(addressClass, (IPv6Address, IPv4Address)):
if not ((addressClass is IPv4Address) or (addressClass is IPv6Address)):
addressClass = IPv4Address

ruleset = frozenset([methodname, addressClass])
Expand Down
4 changes: 2 additions & 2 deletions lib/bridgedb/HTTPServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: please see included AUTHORS file
# :copyright: (c) 2007-2014, The Tor Project, Inc.
# (c) 2013-2014, Isis Lovecruft
# :copyright: (c) 2007-2015, The Tor Project, Inc.
# (c) 2013-2015, Isis Lovecruft
# :license: see LICENSE for licensing information

"""
Expand Down
8 changes: 4 additions & 4 deletions lib/bridgedb/Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: please see the AUTHORS file for attributions
# :copyright: (c) 2013-2014, Isis Lovecruft
# (c) 2013-2014, Matthew Finkel
# (c) 2007-2014, Nick Mathewson
# (c) 2007-2014, The Tor Project, Inc.
# :copyright: (c) 2013-2015, Isis Lovecruft
# (c) 2013-2015, Matthew Finkel
# (c) 2007-2015, Nick Mathewson
# (c) 2007-2015, The Tor Project, Inc.
# :license: see LICENSE for licensing information

"""This module sets up BridgeDB and starts the servers running."""
Expand Down
8 changes: 4 additions & 4 deletions lib/bridgedb/bridgerequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2007-2014, The Tor Project, Inc.
# (c) 2014, Isis Lovecruft
# :copyright: (c) 2007-2015, The Tor Project, Inc.
# (c) 2014-2015, Isis Lovecruft
# :license: see LICENSE for licensing information
#_____________________________________________________________________________

Expand Down Expand Up @@ -88,8 +88,8 @@ class BridgeRequestBase(object):

def __init__(self, addressClass=None):
self.addressClass = addressClass
if not isinstance(self.addressClass,
(ipaddr.IPv4Address, ipaddr.IPv6Address)):
if not ((self.addressClass is ipaddr.IPv4Address) or
(self.addressClass is ipaddr.IPv6Address)):
self.addressClass = ipaddr.IPv4Address
self.filters = list()
self.transports = list()
Expand Down
8 changes: 5 additions & 3 deletions lib/bridgedb/bridges.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: please see the AUTHORS file for attributions
# :copyright: (c) 2013-2014, Isis Lovecruft
# (c) 2007-2014, The Tor Project, Inc.
# :copyright: (c) 2013-2015, Isis Lovecruft
# (c) 2007-2015, The Tor Project, Inc.
# :license: see LICENSE for licensing information

"""Classes for manipulating and storing Bridges and their attributes."""
Expand Down Expand Up @@ -1038,7 +1038,9 @@ def _getVanillaForRequest(self, bridgeRequest):
return a :term:`Bridge Line` for the requested pluggable transport
type.
"""
logging.info("Bridge %s answering request for vanilla address..." % self)
logging.info(
"Bridge %s answering request for IPv%s vanilla address..." %
(self, "6" if bridgeRequest.addressClass is ipaddr.IPv6Address else "4"))

if not bridgeRequest.filters:
logging.debug(("Request %s didn't have any filters; "
Expand Down
6 changes: 3 additions & 3 deletions lib/bridgedb/captcha.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
# Aaron Gibson 0x2C4B239DD876C9F6 <aagbsn@torproject.org>
# Nick Mathewson 0x21194EBB165733EA <nickm@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2007-2014, The Tor Project, Inc.
# (c) 2007-2014, all entities within the AUTHORS file
# (c) 2014, Isis Lovecruft
# :copyright: (c) 2007-2015, The Tor Project, Inc.
# (c) 2007-2015, all entities within the AUTHORS file
# (c) 2014-2015, Isis Lovecruft
# :license: see LICENSE for licensing information
#_____________________________________________________________________________

Expand Down
8 changes: 4 additions & 4 deletions lib/bridgedb/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: please see the AUTHORS file for attributions
# :copyright: (c) 2013-2014, Isis Lovecruft
# (c) 2013-2014, Matthew Finkel
# (c) 2007-2014, Nick Mathewson
# (c) 2007-2014, The Tor Project, Inc.
# :copyright: (c) 2013-2015, Isis Lovecruft
# (c) 2013-2015, Matthew Finkel
# (c) 2007-2015, Nick Mathewson
# (c) 2007-2015, The Tor Project, Inc.
# :license: see LICENSE for licensing information

"""Utilities for dealing with configuration files for BridgeDB."""
Expand Down
8 changes: 5 additions & 3 deletions lib/bridgedb/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# This file is part of BridgeDB, a Tor bridge distribution system.
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# :copyright: (c) 2007-2014, The Tor Project, Inc.
# (c) 2013-2014, Isis Lovecruft
# (c) 2007-2014, all entities within the AUTHORS file
# :copyright: (c) 2007-2015, The Tor Project, Inc.
# (c) 2013-2015, Isis Lovecruft
# (c) 2007-2015, all entities within the AUTHORS file
# :license: 3-clause BSD, see included LICENSE for information

"""BridgeDB general cryptographic utilities.
Expand Down Expand Up @@ -355,6 +355,8 @@ def gpgSignMessage(message):
logging.info("Test signature with GnuPG key %s okay:\n%s" % (primary, sig))
return (gpg, gpgSignMessage)

return ret


class SSLVerifyingContextFactory(ssl.CertificateOptions):
"""``OpenSSL.SSL.Context`` factory which does full certificate-chain and
Expand Down
4 changes: 2 additions & 2 deletions lib/bridgedb/email/autoresponder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Isis Lovecruft <isis@torproject.org> 0xA3ADB67A2CDB8B35
# Matthew Finkel <sysrqb@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2007-2014, The Tor Project, Inc.
# (c) 2013-2014, Isis Lovecruft
# :copyright: (c) 2007-2015, The Tor Project, Inc.
# (c) 2013-2015, Isis Lovecruft
# :license: see LICENSE for licensing information
#_____________________________________________________________________________

Expand Down
4 changes: 2 additions & 2 deletions lib/bridgedb/email/dkim.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Isis Lovecruft <isis@torproject.org> 0xA3ADB67A2CDB8B35
# Matthew Finkel <sysrqb@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2007-2014, The Tor Project, Inc.
# (c) 2013-2014, Isis Lovecruft
# :copyright: (c) 2007-2015, The Tor Project, Inc.
# (c) 2013-2015, Isis Lovecruft
# :license: see LICENSE for licensing information
#_____________________________________________________________________________

Expand Down
4 changes: 2 additions & 2 deletions lib/bridgedb/email/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Isis Lovecruft <isis@torproject.org> 0xA3ADB67A2CDB8B35
# Matthew Finkel <sysrqb@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2007-2014, The Tor Project, Inc.
# (c) 2013-2014, Isis Lovecruft
# :copyright: (c) 2007-2015, The Tor Project, Inc.
# (c) 2013-2015, Isis Lovecruft
# :license: see LICENSE for licensing information
#_____________________________________________________________________________

Expand Down
4 changes: 2 additions & 2 deletions lib/bridgedb/email/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Isis Lovecruft <isis@torproject.org> 0xA3ADB67A2CDB8B35
# Matthew Finkel <sysrqb@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2007-2014, The Tor Project, Inc.
# (c) 2013-2014, Isis Lovecruft
# :copyright: (c) 2007-2015, The Tor Project, Inc.
# (c) 2013-2015, Isis Lovecruft
# :license: see LICENSE for licensing information
#_____________________________________________________________________________

Expand Down
4 changes: 2 additions & 2 deletions lib/bridgedb/email/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#
# :authors: Isis Lovecruft <isis@torproject.org> 0xA3ADB67A2CDB8B35
# please also see AUTHORS file
# :copyright: (c) 2007-2014, The Tor Project, Inc.
# (c) 2013-2014, Isis Lovecruft
# :copyright: (c) 2007-2015, The Tor Project, Inc.
# (c) 2013-2015, Isis Lovecruft
# :license: see LICENSE for licensing information
#_____________________________________________________________________________

Expand Down
2 changes: 1 addition & 1 deletion lib/bridgedb/i18n/templates/bridgedb.pot
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
msgid ""
msgstr ""
"Project-Id-Version: bridgedb 0.2.4-234-g193c80a-dirty\n"
"Report-Msgid-Bugs-To: 'https://trac.torproject.org/projects/tor/newticket?component=BridgeDB&keywords=bridgedb-reported,msgid&cc=isis,sysrqb&owner=isis'
"Report-Msgid-Bugs-To: 'https://trac.torproject.org/projects/tor/newticket?component=BridgeDB&keywords=bridgedb-reported,msgid&cc=isis,sysrqb&owner=isis'"
"POT-Creation-Date: 2015-03-19 22:13+0000\n"
"PO-Revision-Date: 2015-03-19 22:13+0000\n"
"Last-Translator: Isis Lovecruft <isis@torproject.org>\n"
Expand Down
4 changes: 2 additions & 2 deletions lib/bridgedb/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2007-2014, The Tor Project, Inc.
# (c) 2014, Isis Lovecruft
# :copyright: (c) 2007-2015, The Tor Project, Inc.
# (c) 2014-2015, Isis Lovecruft
# :license: see LICENSE for licensing information
#_____________________________________________________________________________

Expand Down
18 changes: 10 additions & 8 deletions lib/bridgedb/parse/descriptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2007-2014, The Tor Project, Inc.
# (c) 2014, Isis Lovecruft
# :copyright: (c) 2007-2015, The Tor Project, Inc.
# (c) 2014-2015, Isis Lovecruft
# :license: see LICENSE for licensing information
#_____________________________________________________________________________

Expand All @@ -18,8 +18,6 @@
import shutil

from stem import ProtocolError
from stem.descriptor import extrainfo_descriptor
from stem.descriptor import server_descriptor
from stem.descriptor import parse_file
from stem.descriptor.router_status_entry import _parse_file as _parseNSFile
from stem.descriptor.router_status_entry import RouterStatusEntryV3
Expand Down Expand Up @@ -198,10 +196,14 @@ def deduplicate(descriptors):
# ``platform`` line in its server-descriptor and tell whoever
# wrote that code that they're probably (D)DOSing the Tor network.
else:
raise DescriptorWarning(
("Duplicate descriptor with identical timestamp (%s) for "
"router with fingerprint '%s'!")
% (descriptor.published, fingerprint))
try:
raise DescriptorWarning(
("Duplicate descriptor with identical timestamp (%s) "
"for router with fingerprint '%s'!")
% (descriptor.published, fingerprint))
# And just in case it does happen, catch the warning:
except DescriptorWarning as descwarn:
logging.warn("DescriptorWarning: %s" % str(descwarn))

# Hoorah! No duplicates! (yet...)
else:
Expand Down
4 changes: 2 additions & 2 deletions lib/bridgedb/parse/fingerprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2007-2014, The Tor Project, Inc.
# (c) 2014, Isis Lovecruft
# :copyright: (c) 2007-2015, The Tor Project, Inc.
# (c) 2014-2015, Isis Lovecruft
# :license: see LICENSE for licensing information
#_____________________________________________________________________________

Expand Down
6 changes: 3 additions & 3 deletions lib/bridgedb/parse/nickname.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# please also see AUTHORS file
# :copyright: (c) 2013 Isis Lovecruft
# (c) 2007-2014, The Tor Project, Inc.
# (c) 2007-2014, all entities within the AUTHORS file
# :copyright: (c) 2013-2015 Isis Lovecruft
# (c) 2007-2015, The Tor Project, Inc.
# (c) 2007-2015, all entities within the AUTHORS file
# :license: 3-clause BSD, see included LICENSE for information

"""Parsers for bridge nicknames.
Expand Down

0 comments on commit 3a1aa0d

Please sign in to comment.