commit 9c1175441de0c7a9a9c5ca6ff327cfb9556b9842 Author: Philipp Winter phw@nymity.ch Date: Tue Mar 24 10:23:25 2020 -0700
Update instructions on how to add bridges.
In addition to updating the existing instructions, this patch adds instructions for adding bridges on Android.
This fixes https://bugs.torproject.org/30317. --- CHANGELOG | 5 +++ bridgedb/distributors/email/templates.py | 9 +---- bridgedb/distributors/https/templates/bridges.html | 20 ++++----- bridgedb/distributors/https/templates/howto.html | 20 ++++----- bridgedb/i18n/templates/bridgedb.pot | 47 +++++----------------- bridgedb/strings.py | 27 ++++--------- bridgedb/test/test_https_server.py | 8 ++-- 7 files changed, 44 insertions(+), 92 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG index 5db8fb2..f57c168 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,8 @@ + * FIXES https://bugs.torproject.org/30317 + Update our "howto" box, which explains how one adds bridges to Tor + Browser. In addition to updating the instructions, this patch also + links to instructions for Android. + * FIXES https://bugs.torproject.org/31967 Use a CSPRNG for selecting cached CAPTCHAs.
diff --git a/bridgedb/distributors/email/templates.py b/bridgedb/distributors/email/templates.py index 188f052..570341a 100644 --- a/bridgedb/distributors/email/templates.py +++ b/bridgedb/distributors/email/templates.py @@ -96,14 +96,9 @@ def addHowto(template): """ howToTBB = template.gettext(strings.HOWTO_TBB[1]) % strings.EMAIL_SPRINTF["HOWTO_TBB1"] howToTBB += u'\n\n' - howToTBB += template.gettext(strings.HOWTO_TBB[2]) - howToTBB += u'\n\n' - howToTBB += u'\n'.join(["> {0}".format(ln) for ln in - template.gettext(strings.HOWTO_TBB[3]).split('\n')]) - howToTBB += u'\n\n' - howToTBB += template.gettext(strings.HOWTO_TBB[4]) - howToTBB += u'\n\n' howToTBB += strings.EMAIL_REFERENCE_LINKS.get("HOWTO_TBB1") + howToTBB += strings.EMAIL_REFERENCE_LINKS.get("HOWTO_TBB2") + howToTBB += strings.EMAIL_REFERENCE_LINKS.get("HOWTO_TBB3") howToTBB += u'\n\n' return howToTBB
diff --git a/bridgedb/distributors/https/templates/bridges.html b/bridgedb/distributors/https/templates/bridges.html index a7503f5..55a9e79 100644 --- a/bridgedb/distributors/https/templates/bridges.html +++ b/bridgedb/distributors/https/templates/bridges.html @@ -91,21 +91,15 @@ ${_("""This QRCode contains your bridge lines. Scan it with a QRCode """ \ <div class="container-fluid" id="howto"> <p> ${_(strings.HOWTO_TBB[1]) % \ - ("""<a href="https://www.torproject.org/projects/torbrowser.html" + ("""<a href="https://www.torproject.org/download/" + target="_blank">""", + """</a>""", + """<a href="https://tb-manual.torproject.org/bridges/#entering-bridge-addresses" + target="_blank">""", + """</a>""", + """<a href="https://tb-manual.torproject.org/mobile-tor/#circumvention" target="_blank">""", """</a>""")} - ${_(strings.HOWTO_TBB[2])} - </p> - <br /> - <div class="bs-component"> - <blockquote> - <p> - ${_(strings.HOWTO_TBB[3])} - </p> - </blockquote> - </div> - <p> - ${_(strings.HOWTO_TBB[4])} </p> </div> </div> diff --git a/bridgedb/distributors/https/templates/howto.html b/bridgedb/distributors/https/templates/howto.html index 70fca6a..1d31491 100644 --- a/bridgedb/distributors/https/templates/howto.html +++ b/bridgedb/distributors/https/templates/howto.html @@ -15,21 +15,15 @@ <div class="container-fluid" id="howto"> <p> ${_(strings.HOWTO_TBB[1]) % \ - ("""<a href="https://www.torproject.org/projects/torbrowser.html" + ("""<a href="https://www.torproject.org/download/" + target="_blank">""", + """</a>""", + """<a href="https://tb-manual.torproject.org/bridges/#entering-bridge-addresses" + target="_blank">""", + """</a>""", + """<a href="https://tb-manual.torproject.org/mobile-tor/#circumvention" target="_blank">""", """</a>""")} - ${_(strings.HOWTO_TBB[2])} - </p> - <br /> - <div class="bs-component"> - <blockquote> - <p> - ${_(strings.HOWTO_TBB[3])} - </p> - </blockquote> - </div> - <p> - ${_(strings.HOWTO_TBB[4])} </p> </div> </div> diff --git a/bridgedb/i18n/templates/bridgedb.pot b/bridgedb/i18n/templates/bridgedb.pot index 8d442df..8fa69c6 100644 --- a/bridgedb/i18n/templates/bridgedb.pot +++ b/bridgedb/i18n/templates/bridgedb.pot @@ -5,11 +5,11 @@ # msgid "" msgstr "" -"Project-Id-Version: bridgedb 0.9.4+6.g963ce80.dirty\n" +"Project-Id-Version: bridgedb 0.9.4+8.g5afd164.dirty\n" "Report-Msgid-Bugs-To: " "'https://trac.torproject.org/projects/tor/newticket?component=BridgeDB&ke..." "=bridgedb-reported,msgid&cc=isis,sysrqb&owner=isis'\n" -"POT-Creation-Date: 2020-03-18 09:23-0700\n" +"POT-Creation-Date: 2020-03-24 10:22-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME EMAIL@ADDRESS\n" "Language-Team: LANGUAGE LL@li.org\n" @@ -428,60 +428,35 @@ msgstr "" #: bridgedb/strings.py:184 #, python-format msgid "" -"To enter bridges into Tor Browser, first go to the %s Tor Browser download\n" -"page %s and then follow the instructions there for downloading and starting\n" -"Tor Browser." +" First, you need to %sdownload Tor Browser%s. Our Tor Browser User\n" +" Manual explains how you can add your bridges to Tor Browser. If you are\n" +" using Windows, Linux, or OS X, %sclick here%s to learn more. If you\n" +" are using Android, %sclick here%s." msgstr ""
-#. TRANSLATORS: Please DO NOT translate "Tor". -#: bridgedb/strings.py:189 -msgid "" -"When the 'Tor Network Settings' dialogue pops up, click 'Configure' and " -"follow\n" -"the wizard until it asks:" -msgstr "" - -#. TRANSLATORS: Please DO NOT translate "Tor". -#: bridgedb/strings.py:193 -msgid "" -"Does your Internet Service Provider (ISP) block or otherwise censor " -"connections\n" -"to the Tor network?" -msgstr "" - -#. TRANSLATORS: Please DO NOT translate "Tor". -#: bridgedb/strings.py:197 -msgid "" -"Select 'Yes' and then click 'Next'. To configure your new bridges, copy and\n" -"paste the bridge lines into the text input box. Finally, click 'Connect', and" -"\n" -"you should be good to go! If you experience trouble, try clicking the 'Help'\n" -"button in the 'Tor Network Settings' wizard for further assistance." -msgstr "" - -#: bridgedb/strings.py:205 +#: bridgedb/strings.py:192 msgid "Displays this message." msgstr ""
#. TRANSLATORS: Please try to make it clear that "vanilla" here refers to the #. same non-Pluggable Transport bridges described above as being #. "plain-ol'-vanilla" bridges. -#: bridgedb/strings.py:209 +#: bridgedb/strings.py:196 msgid "Request vanilla bridges." msgstr ""
-#: bridgedb/strings.py:210 +#: bridgedb/strings.py:197 msgid "Request IPv6 bridges." msgstr ""
#. TRANSLATORS: Please DO NOT translate the word the word "TYPE". -#: bridgedb/strings.py:212 +#: bridgedb/strings.py:199 msgid "Request a Pluggable Transport by TYPE." msgstr ""
#. TRANSLATORS: Please DO NOT translate "BridgeDB". #. TRANSLATORS: Please DO NOT translate "GnuPG". -#: bridgedb/strings.py:215 +#: bridgedb/strings.py:202 msgid "Get a copy of BridgeDB's public GnuPG key." msgstr ""
diff --git a/bridgedb/strings.py b/bridgedb/strings.py index ca2feaa..b6a7f1f 100644 --- a/bridgedb/strings.py +++ b/bridgedb/strings.py @@ -182,23 +182,10 @@ HOWTO_TBB = { 0: _("""How to start using your bridges"""), # TRANSLATORS: Please DO NOT translate "Tor Browser". 1: _("""\ -To enter bridges into Tor Browser, first go to the %s Tor Browser download -page %s and then follow the instructions there for downloading and starting -Tor Browser."""), - # TRANSLATORS: Please DO NOT translate "Tor". - 2: _("""\ -When the 'Tor Network Settings' dialogue pops up, click 'Configure' and follow -the wizard until it asks:"""), - # TRANSLATORS: Please DO NOT translate "Tor". - 3: _("""\ -Does your Internet Service Provider (ISP) block or otherwise censor connections -to the Tor network?"""), - # TRANSLATORS: Please DO NOT translate "Tor". - 4: _("""\ -Select 'Yes' and then click 'Next'. To configure your new bridges, copy and -paste the bridge lines into the text input box. Finally, click 'Connect', and -you should be good to go! If you experience trouble, try clicking the 'Help' -button in the 'Tor Network Settings' wizard for further assistance."""), + First, you need to %sdownload Tor Browser%s. Our Tor Browser User + Manual explains how you can add your bridges to Tor Browser. If you are + using Windows, Linux, or OS X, %sclick here%s to learn more. If you + are using Android, %sclick here%s."""), }
EMAIL_COMMANDS = { @@ -307,7 +294,7 @@ EMAIL_SPRINTF = { # Goes into the "%s without Pluggable Transport %s" part of ``WELCOME[2]`` "WELCOME2": ("-", "-"), # For the "%s Tor Browser download page %s" part of ``HOWTO_TBB[1]`` - "HOWTO_TBB1": ("", "[0]"), + "HOWTO_TBB1": ("", "[0]", "", "[1]", "", "[2]"), # For the "you should email %s" in ``HELP[0]`` "HELP0": ("frontdesk@torproject.org"), } @@ -344,7 +331,9 @@ BridgeDB can provide bridges with several types of Pluggable Transports[0],
EMAIL_REFERENCE_LINKS = { "WELCOME0": "[0]: https://www.torproject.org/docs/pluggable-transports.html", - "HOWTO_TBB1": "[0]: https://www.torproject.org/projects/torbrowser.html", + "HOWTO_TBB1": "[0]: https://www.torproject.org/download/", + "HOWTO_TBB2": "[1]: https://tb-manual.torproject.org/bridges/#entering-bridge-addresses", + "HOWTO_TBB3": "[2]: https://tb-manual.torproject.org/mobile-tor/#circumvention", }
BRIDGEDB_OPENPGP_KEY = """\ diff --git a/bridgedb/test/test_https_server.py b/bridgedb/test/test_https_server.py index ff7a1e3..54bda2e 100644 --- a/bridgedb/test/test_https_server.py +++ b/bridgedb/test/test_https_server.py @@ -243,7 +243,7 @@ class HowtoResourceTests(unittest.TestCase): request = DummyRequest([self.pagename]) request.method = b'GET' page = self.howtoResource.render_GET(request) - self.assertSubstring(b"the wizard", page) + self.assertSubstring(b"How to start using your bridges", page)
def test_HowtoResource_render_GET_lang_ru(self): """renderGet() with ?lang=ru should return the howto page in Russian.""" @@ -255,7 +255,7 @@ class HowtoResourceTests(unittest.TestCase): request.method = b'GET' request.addArg(b'lang', 'ru') page = self.howtoResource.render_GET(request) - self.assertSubstring("следовать инструкциям установщика".encode("utf-8"), page) + self.assertSubstring("Как использовать мосты".encode("utf-8"), page)
class CaptchaProtectedResourceTests(unittest.TestCase): @@ -765,7 +765,7 @@ class BridgesResourceTests(unittest.TestCase): page = self.bridgesResource.render(request)
# The response should explain how to use the bridge lines: - self.assertTrue("To enter bridges into Tor Browser" in str(page)) + self.assertTrue("How to start using your bridges" in str(page))
for b in self.parseBridgesFromHTMLPage(page): # Check that each bridge line had the expected number of fields: @@ -798,7 +798,7 @@ class BridgesResourceTests(unittest.TestCase): self.bridgesResource.useForwardedHeader = False # Reset it
# The response should explain how to use the bridge lines: - self.assertTrue("To enter bridges into Tor Browser" in str(page)) + self.assertTrue("How to start using your bridges" in str(page))
def test_render_GET_RTLlang(self): """Test rendering a request for plain bridges in Arabic."""