[or-cvs] [bridgedb/master] Make the web page list which domains bridge request emails must be from.

nickm at torproject.org nickm at torproject.org
Mon Feb 14 20:54:15 UTC 2011


commit f87a57b55aacd5119389842170e8d8329796e9b2
Author: katmagic <the.magical.kat at gmail.com>
Date:   Sat Dec 11 21:47:43 2010 -0500

    Make the web page list which domains bridge request emails must be from.
---
 lib/bridgedb/I18n.py   |    4 ++--
 lib/bridgedb/Server.py |    8 ++++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/lib/bridgedb/I18n.py b/lib/bridgedb/I18n.py
index 44565b6..2774a58 100644
--- a/lib/bridgedb/I18n.py
+++ b/lib/bridgedb/I18n.py
@@ -35,8 +35,8 @@ more stable, in case some of the bridges become unreachable."""),
  _("""Another way to find public bridge addresses is to send mail to
 bridges at torproject.org with the line "get bridges" by itself in the body
 of the mail. However, so we can make it harder for an attacker to learn
-lots of bridge addresses, you must send this request from a gmail or
-yahoo account."""),
+lots of bridge addresses, you must send this request from an email address at
+one of the following domains:"""),
  # BRIDGEDB_TEXT[5]
  _("""[This is an automated message; please do not reply.]"""),
  # BRIDGEDB_TEXT[6]
diff --git a/lib/bridgedb/Server.py b/lib/bridgedb/Server.py
index 10a3ae4..0b674bf 100644
--- a/lib/bridgedb/Server.py
+++ b/lib/bridgedb/Server.py
@@ -32,7 +32,7 @@ class WebResource(twisted.web.resource.Resource):
     isLeaf = True
 
     def __init__(self, distributor, schedule, N=1, useForwardedHeader=False,
-                 includeFingerprints=True):
+                 includeFingerprints=True, domains=[]):
         """Create a new WebResource.
              distributor -- an IPBasedDistributor object
              schedule -- an IntervalSchedule object
@@ -45,6 +45,7 @@ class WebResource(twisted.web.resource.Resource):
         self.nBridgesToGive = N
         self.useForwardedHeader = useForwardedHeader
         self.includeFingerprints = includeFingerprints
+        self.domains = domains
 
     def render_GET(self, request):
         interval = self.schedule.getInterval(time.time())
@@ -103,6 +104,8 @@ class WebResource(twisted.web.resource.Resource):
                    + "<p>" + t.gettext(I18n.BRIDGEDB_TEXT[2]) + "</p>" \
                    + "<p>" + t.gettext(I18n.BRIDGEDB_TEXT[3]) + "</p>" \
                    + "<p>" + t.gettext(I18n.BRIDGEDB_TEXT[4]) + "</p>" \
+                   + "<ul>" \
+                   + "".join(("<li>%s</li>"%d for d in self.domains)) + "</ul>"\
                    + "</body></html>"
 
         return html_msg
@@ -127,7 +130,8 @@ def addWebServer(cfg, dist, sched):
         ip = cfg.HTTP_UNENCRYPTED_BIND_IP or ""
         resource = WebResource(dist, sched, cfg.HTTPS_N_BRIDGES_PER_ANSWER,
                        cfg.HTTP_USE_IP_FROM_FORWARDED_HEADER,
-                       includeFingerprints=cfg.HTTPS_INCLUDE_FINGERPRINTS)
+                       includeFingerprints=cfg.HTTPS_INCLUDE_FINGERPRINTS,
+                       domains=cfg.EMAIL_DOMAINS)
         site = Site(resource)
         reactor.listenTCP(cfg.HTTP_UNENCRYPTED_PORT, site, interface=ip)
     if cfg.HTTPS_PORT:





More information about the tor-commits mailing list