Unverified Commit f23c0213 authored by Philipp Winter's avatar Philipp Winter
Browse files

Merge branch 'enhancement/33008' into develop

parents ef9ea5c1 bdf192de
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
        * FIXES https://bugs.torproject.org/33008
        Add an info page, available at bridges.torproject.org/info.  Relay
        Search links to this info page to explain to bridge operators what their
        bridge distribution mechanism means.

Changes in version 0.9.4 - 2020-02-19
Changes in version 0.9.4 - 2020-02-19


        * FIXES https://bugs.torproject.org/30946
        * FIXES https://bugs.torproject.org/30946
+11 −2
Original line number Original line Diff line number Diff line
@@ -389,13 +389,14 @@ class TranslatedTemplateResource(CustomErrorHandlingResource, CSPResource):
    """
    """
    isLeaf = True
    isLeaf = True


    def __init__(self, template=None):
    def __init__(self, template=None, showFaq=True):
        """Create a new :api:`Resource <twisted.web.resource.Resource>` for a
        """Create a new :api:`Resource <twisted.web.resource.Resource>` for a
        Mako-templated webpage.
        Mako-templated webpage.
        """
        """
        gettext.install("bridgedb")
        gettext.install("bridgedb")
        CSPResource.__init__(self)
        CSPResource.__init__(self)
        self.template = template
        self.template = template
        self.showFaq = showFaq


    def render_GET(self, request):
    def render_GET(self, request):
        self.setCSPHeader(request)
        self.setCSPHeader(request)
@@ -409,7 +410,8 @@ class TranslatedTemplateResource(CustomErrorHandlingResource, CSPResource):
                                       getSortedLangList(),
                                       getSortedLangList(),
                                       rtl=rtl,
                                       rtl=rtl,
                                       lang=langs[0],
                                       lang=langs[0],
                                       langOverride=translations.isLangOverridden(request))
                                       langOverride=translations.isLangOverridden(request),
                                       showFaq=self.showFaq)
        except Exception as err:  # pragma: no cover
        except Exception as err:  # pragma: no cover
            rendered = replaceErrorPage(request, err)
            rendered = replaceErrorPage(request, err)
        request.setHeader("Content-Type", "text/html; charset=utf-8")
        request.setHeader("Content-Type", "text/html; charset=utf-8")
@@ -435,6 +437,11 @@ class OptionsResource(TranslatedTemplateResource):
        TranslatedTemplateResource.__init__(self, 'options.html')
        TranslatedTemplateResource.__init__(self, 'options.html')




class InfoResource(TranslatedTemplateResource):
    def __init__(self):
        TranslatedTemplateResource.__init__(self, 'info.html', showFaq=False)


class HowtoResource(TranslatedTemplateResource):
class HowtoResource(TranslatedTemplateResource):
    """A resource which explains how to use bridges."""
    """A resource which explains how to use bridges."""


@@ -1133,6 +1140,7 @@ def addWebServer(config, distributor):
    index   = IndexResource()
    index   = IndexResource()
    options = OptionsResource()
    options = OptionsResource()
    howto   = HowtoResource()
    howto   = HowtoResource()
    info    = InfoResource()
    robots  = static.File(os.path.join(TEMPLATE_DIR, 'robots.txt'))
    robots  = static.File(os.path.join(TEMPLATE_DIR, 'robots.txt'))
    assets  = static.File(os.path.join(TEMPLATE_DIR, 'assets/'))
    assets  = static.File(os.path.join(TEMPLATE_DIR, 'assets/'))
    keys    = static.Data(strings.BRIDGEDB_OPENPGP_KEY.encode('utf-8'), 'text/plain')
    keys    = static.Data(strings.BRIDGEDB_OPENPGP_KEY.encode('utf-8'), 'text/plain')
@@ -1148,6 +1156,7 @@ def addWebServer(config, distributor):
    root.putChild(b'assets', assets)
    root.putChild(b'assets', assets)
    root.putChild(b'options', options)
    root.putChild(b'options', options)
    root.putChild(b'howto', howto)
    root.putChild(b'howto', howto)
    root.putChild(b'info', info)
    root.putChild(b'maintenance', maintenance)
    root.putChild(b'maintenance', maintenance)
    root.putChild(b'error', resource500)
    root.putChild(b'error', resource500)
    root.putChild(CSPResource.reportURI, csp)
    root.putChild(CSPResource.reportURI, csp)
+3 −1
Original line number Original line Diff line number Diff line
## -*- coding: utf-8 -*-
## -*- coding: utf-8 -*-


<%namespace name="base" file="base.html" inheritable="True"/>
<%namespace name="base" file="base.html" inheritable="True"/>
<%page args="strings, langs, rtl=False, lang='en', langOverride=False, **kwargs"/>
<%page args="strings, langs, rtl=False, lang='en', langOverride=False, showFaq=True, **kwargs"/>


<!DOCTYPE html>
<!DOCTYPE html>
<html lang="${lang}">
<html lang="${lang}">
@@ -59,6 +59,7 @@


${next.body(strings, langs, rtl=rtl, lang=lang, langOverride=langOverride, **kwargs)}
${next.body(strings, langs, rtl=rtl, lang=lang, langOverride=langOverride, **kwargs)}


        % if showFaq:
        <div class="faq">
        <div class="faq">
          <div class="row-fluid marketing">
          <div class="row-fluid marketing">


@@ -84,6 +85,7 @@ ${next.body(strings, langs, rtl=rtl, lang=lang, langOverride=langOverride, **kwa
            </p>
            </p>
          </div>
          </div>
        </div> <!-- end faq -->
        </div> <!-- end faq -->
        % endif


        <div class="footer footer-small">
        <div class="footer footer-small">
        <hr>
        <hr>
+40 −0
Original line number Original line Diff line number Diff line
## -*- coding: utf-8 -*-

<%inherit file="base.html"/>
<%page args="strings, langs, rtl=False, lang='en', langOverride=False, **kwargs"/>

<div class="container-fluid container-fluid-outer-96">
  <div class="container-fluid container-fluid-inner">
    <p>
      <h3>${_(strings.BRIDGEDB_INFO[0])}</h3>
      <p>${_(strings.BRIDGEDB_INFO[1]) % \
         ("""<a href="https://metrics.torproject.org/bridgedb-distributor.html">""",
          """</a>""")}</p>

      <div class="row-fluid marketing">
        <h4><a name="https">HTTPS</a></h4>
        <p>${_(strings.BRIDGEDB_INFO[2]) % \
           ("""<a href="https://bridges.torproject.org/options">""",
            """</a>""")}</p>

        <h4><a name="moat">Moat</a></h4>
        <p>${_(strings.BRIDGEDB_INFO[3]) % \
           ("""<a href="about:preferences#tor">""",
            """</a>""")}</p>

        <h4><a name="email">Email</a></h4>
        <p>${_(strings.BRIDGEDB_INFO[4]) % \
           ("""<a href="mailto:bridges@torproject.org">""",
            """</a>""")}</p>

        <h4><a name="reserved">${_(strings.BRIDGEDB_INFO[5])}</a></h4>
        <p>${_(strings.BRIDGEDB_INFO[6]) % \
           ("""<a href="https://collector.torproject.org/archive/bridge-pool-assignments/">""",
            """</a>""")}</p>

        <h4><a name="none">${_(strings.BRIDGEDB_INFO[7])}</a></h4>
        <p>${_(strings.BRIDGEDB_INFO[8])}</p>
      </div>
    </p>
  </div>
</div>
+107 −21
Original line number Original line Diff line number Diff line
@@ -5,11 +5,11 @@
#
#
msgid ""
msgid ""
msgstr ""
msgstr ""
"Project-Id-Version: bridgedb 0.9.2+5.gfd960bd.dirty\n"
"Project-Id-Version: bridgedb 0.9.4+6.g963ce80.dirty\n"
"Report-Msgid-Bugs-To: "
"Report-Msgid-Bugs-To: "
"'https://trac.torproject.org/projects/tor/newticket?component=BridgeDB&keywords"
"'https://trac.torproject.org/projects/tor/newticket?component=BridgeDB&keywords"
"=bridgedb-reported,msgid&cc=isis,sysrqb&owner=isis'\n"
"=bridgedb-reported,msgid&cc=isis,sysrqb&owner=isis'\n"
"POT-Creation-Date: 2020-02-18 13:39-0800\n"
"POT-Creation-Date: 2020-03-18 09:23-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -37,6 +37,7 @@ msgstr ""
#. variable.
#. variable.
#. We use our metrics singleton to keep track of BridgeDB metrics such as
#. We use our metrics singleton to keep track of BridgeDB metrics such as
#. "number of failed HTTPS bridge requests."
#. "number of failed HTTPS bridge requests."
#. Convert all key/value pairs from bytes to str.
#. TRANSLATORS: Please DO NOT translate the following words and/or phrases in
#. TRANSLATORS: Please DO NOT translate the following words and/or phrases in
#. any string (regardless of capitalization and/or punctuation):
#. any string (regardless of capitalization and/or punctuation):
#. "BridgeDB"
#. "BridgeDB"
@@ -45,7 +46,7 @@ msgstr ""
#. "obfs4"
#. "obfs4"
#. "Tor"
#. "Tor"
#. "Tor Browser"
#. "Tor Browser"
#: bridgedb/distributors/https/server.py:135
#: bridgedb/distributors/https/server.py:154
msgid "Sorry! Something went wrong with your request."
msgid "Sorry! Something went wrong with your request."
msgstr ""
msgstr ""


@@ -53,15 +54,15 @@ msgstr ""
msgid "Language"
msgid "Language"
msgstr ""
msgstr ""


#: bridgedb/distributors/https/templates/base.html:92
#: bridgedb/distributors/https/templates/base.html:94
msgid "Report a Bug"
msgid "Report a Bug"
msgstr ""
msgstr ""


#: bridgedb/distributors/https/templates/base.html:95
#: bridgedb/distributors/https/templates/base.html:97
msgid "Source Code"
msgid "Source Code"
msgstr ""
msgstr ""


#: bridgedb/distributors/https/templates/base.html:98
#: bridgedb/distributors/https/templates/base.html:100
msgid "Changelog"
msgid "Changelog"
msgstr ""
msgstr ""


@@ -214,7 +215,7 @@ msgstr ""
msgid "Hello, friend!"
msgid "Hello, friend!"
msgstr ""
msgstr ""


#: bridgedb/distributors/https/templates/base.html:100 bridgedb/strings.py:58
#: bridgedb/distributors/https/templates/base.html:102 bridgedb/strings.py:58
msgid "Public Keys"
msgid "Public Keys"
msgstr ""
msgstr ""


@@ -314,32 +315,117 @@ msgid "Get Bridges!"
msgstr ""
msgstr ""


#: bridgedb/strings.py:130
#: bridgedb/strings.py:130
msgid "Bridge distribution mechanisms"
msgstr ""

#. TRANSLATORS: Please DO NOT translate "BridgeDB", "HTTPS", and "Moat".
#: bridgedb/strings.py:132
#, python-format
msgid ""
"BridgeDB implements four mechanisms to distribute bridges: \"HTTPS\", "
"\"Moat\",\n"
"\"Email\", and \"Reserved\".  Bridges that are not distributed over BridgeDB "
"use\n"
"the pseudo-mechanism \"None\".  The following list briefly explains how these"
"\n"
"mechanisms work and our %sBridgeDB metrics%s visualize how popular each of "
"the\n"
"mechanisms is."
msgstr ""

#: bridgedb/strings.py:138
#, python-format
msgid ""
"The \"HTTPS\" distribution mechanism hands out bridges over this website.  To"
" get\n"
"bridges, go to %sbridges.torproject.org%s, select your preferred options, and"
"\n"
"solve the subsequent CAPTCHA."
msgstr ""

#: bridgedb/strings.py:142
#, python-format
msgid ""
"The \"Moat\" distribution mechanism is part of Tor Browser, allowing users to"
"\n"
"request bridges from inside their Tor Browser settings.  To get bridges, go "
"to\n"
"your Tor Browser's %sTor settings%s, click on \"request a new bridge\", solve"
" the\n"
"subsequent CAPTCHA, and Tor Browser will automatically add your new\n"
"bridges."
msgstr ""

#: bridgedb/strings.py:148
#, python-format
msgid ""
"Users can request bridges from the \"Email\" distribution mechanism by "
"sending an\n"
"email to %sbridges@torproject.org%s and writing \"get transport obfs4\" in "
"the\n"
"email body."
msgstr ""

#: bridgedb/strings.py:152
msgid "Reserved"
msgstr ""

#: bridgedb/strings.py:153
#, python-format
msgid ""
"BridgeDB maintains a small number of bridges that are not distributed\n"
"automatically.  Instead, we reserve these bridges for manual distribution and"
"\n"
"hand them out to NGOs and other organizations and individuals that need\n"
"bridges.  Bridges that are distributed over the \"Reserved\" mechanism may "
"not\n"
"see users for a long time.  Note that the \"Reserved\" distribution mechanism"
" is\n"
"called \"Unallocated\" in %sbridge pool assignment%s files."
msgstr ""

#: bridgedb/strings.py:160
msgid "None"
msgstr ""

#: bridgedb/strings.py:161
msgid ""
"Bridges whose distribution mechanism is \"None\" are not distributed by "
"BridgeDB.\n"
"It is the bridge operator's responsibility to distribute their bridges to\n"
"users.  Note that on Relay Search, a freshly set up bridge's distribution\n"
"mechanism says \"None\" for up to approximately one day.  Be a bit patient, "
"and\n"
"it will then change to the bridge's actual distribution mechanism.\n"
msgstr ""

#: bridgedb/strings.py:171
msgid "Please select options for bridge type:"
msgid "Please select options for bridge type:"
msgstr ""
msgstr ""


#: bridgedb/strings.py:131
#: bridgedb/strings.py:172
msgid "Do you need IPv6 addresses?"
msgid "Do you need IPv6 addresses?"
msgstr ""
msgstr ""


#: bridgedb/strings.py:132
#: bridgedb/strings.py:173
#, python-format
#, python-format
msgid "Do you need a %s?"
msgid "Do you need a %s?"
msgstr ""
msgstr ""


#: bridgedb/strings.py:136
#: bridgedb/strings.py:177
msgid "Your browser is not displaying images properly."
msgid "Your browser is not displaying images properly."
msgstr ""
msgstr ""


#: bridgedb/strings.py:137
#: bridgedb/strings.py:178
msgid "Enter the characters from the image above..."
msgid "Enter the characters from the image above..."
msgstr ""
msgstr ""


#: bridgedb/strings.py:141
#: bridgedb/strings.py:182
msgid "How to start using your bridges"
msgid "How to start using your bridges"
msgstr ""
msgstr ""


#. TRANSLATORS: Please DO NOT translate "Tor Browser".
#. TRANSLATORS: Please DO NOT translate "Tor Browser".
#: bridgedb/strings.py:143
#: bridgedb/strings.py:184
#, python-format
#, python-format
msgid ""
msgid ""
"To enter bridges into Tor Browser, first go to the %s Tor Browser download\n"
"To enter bridges into Tor Browser, first go to the %s Tor Browser download\n"
@@ -348,7 +434,7 @@ msgid ""
msgstr ""
msgstr ""


#. TRANSLATORS: Please DO NOT translate "Tor".
#. TRANSLATORS: Please DO NOT translate "Tor".
#: bridgedb/strings.py:148
#: bridgedb/strings.py:189
msgid ""
msgid ""
"When the 'Tor Network Settings' dialogue pops up, click 'Configure' and "
"When the 'Tor Network Settings' dialogue pops up, click 'Configure' and "
"follow\n"
"follow\n"
@@ -356,7 +442,7 @@ msgid ""
msgstr ""
msgstr ""


#. TRANSLATORS: Please DO NOT translate "Tor".
#. TRANSLATORS: Please DO NOT translate "Tor".
#: bridgedb/strings.py:152
#: bridgedb/strings.py:193
msgid ""
msgid ""
"Does your Internet Service Provider (ISP) block or otherwise censor "
"Does your Internet Service Provider (ISP) block or otherwise censor "
"connections\n"
"connections\n"
@@ -364,7 +450,7 @@ msgid ""
msgstr ""
msgstr ""


#. TRANSLATORS: Please DO NOT translate "Tor".
#. TRANSLATORS: Please DO NOT translate "Tor".
#: bridgedb/strings.py:156
#: bridgedb/strings.py:197
msgid ""
msgid ""
"Select 'Yes' and then click 'Next'. To configure your new bridges, copy and\n"
"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"
"paste the bridge lines into the text input box. Finally, click 'Connect', and"
@@ -373,29 +459,29 @@ msgid ""
"button in the 'Tor Network Settings' wizard for further assistance."
"button in the 'Tor Network Settings' wizard for further assistance."
msgstr ""
msgstr ""


#: bridgedb/strings.py:164
#: bridgedb/strings.py:205
msgid "Displays this message."
msgid "Displays this message."
msgstr ""
msgstr ""


#. TRANSLATORS: Please try to make it clear that "vanilla" here refers to the
#. TRANSLATORS: Please try to make it clear that "vanilla" here refers to the
#. same non-Pluggable Transport bridges described above as being
#. same non-Pluggable Transport bridges described above as being
#. "plain-ol'-vanilla" bridges.
#. "plain-ol'-vanilla" bridges.
#: bridgedb/strings.py:168
#: bridgedb/strings.py:209
msgid "Request vanilla bridges."
msgid "Request vanilla bridges."
msgstr ""
msgstr ""


#: bridgedb/strings.py:169
#: bridgedb/strings.py:210
msgid "Request IPv6 bridges."
msgid "Request IPv6 bridges."
msgstr ""
msgstr ""


#. TRANSLATORS: Please DO NOT translate the word the word "TYPE".
#. TRANSLATORS: Please DO NOT translate the word the word "TYPE".
#: bridgedb/strings.py:171
#: bridgedb/strings.py:212
msgid "Request a Pluggable Transport by TYPE."
msgid "Request a Pluggable Transport by TYPE."
msgstr ""
msgstr ""


#. TRANSLATORS: Please DO NOT translate "BridgeDB".
#. TRANSLATORS: Please DO NOT translate "BridgeDB".
#. TRANSLATORS: Please DO NOT translate "GnuPG".
#. TRANSLATORS: Please DO NOT translate "GnuPG".
#: bridgedb/strings.py:174
#: bridgedb/strings.py:215
msgid "Get a copy of BridgeDB's public GnuPG key."
msgid "Get a copy of BridgeDB's public GnuPG key."
msgstr ""
msgstr ""
Loading