[tor-bugs] #12872 [BridgeDB]: Know within which country a bridge is located
Tor Bug Tracker & Wiki
blackhole at torproject.org
Thu Sep 4 01:37:51 UTC 2014
#12872: Know within which country a bridge is located
--------------------------+---------------------------
Reporter: sysrqb | Owner: isis
Type: defect | Status: accepted
Priority: blocker | Milestone:
Component: BridgeDB | Version:
Resolution: | Keywords: bridgedb-dist
Actual Points: | Parent ID: #12843
Points: |
--------------------------+---------------------------
Changes (by isis):
* keywords: => bridgedb-dist
* status: new => accepted
* cc: isis, sysrqb (added)
* priority: normal => blocker
Comment:
Updating priority to "blocker" because this is preventing #12843.
FWIW, most of the functionality should already be in place to do this, but
it needs some ♥ and definitely some tests. I'm also marking this ticket as
"easy" because this is 99% done.
To fix this, you'd want to look at the
`bridgedb.HTTPServer.WebResourceBridges.getBridgeRequestAnswer()` method,
which, incidentally, has many `XXX`s that I put in it because I believe
the entire thing is... lacking. Particularly, you want
[https://gitweb.torproject.org/bridgedb.git/blob/HEAD:/lib/bridgedb/HTTPServer.py#l692
these lines where the country code is obtained]:
{{{
# XXX This can also be a separate function
# XXX if the ip is None, this throws an exception
if geoip:
countryCode = geoip.country_code_by_addr(ip)
if countryCode:
logging.debug("Client request from GeoIP CC: %s" %
countryCode)
}}}
And, of course, no complaints if some of those `XXX`s can be removed. :)
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/12872#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list