[tor-commits] [tor-messenger-build/master] Improve XMPP in-band registration UX
commit 9e71ef3507e8fc66caa2520368f6001b2747393d Author: Sukhbir Singh sukh...@torproject.org Date: Sat Jul 4 02:17:01 2015 -0400 Improve XMPP in-band registration UX - Improve registration dialog by populating the username - Add missing return if registration is cancelled - Use a groupbox to wrap the grid --- .../instantbird/xmpp-inband-registration.patch | 10 +++- projects/instantbird/xmppRegister.js | 57 projects/instantbird/xmppRegister.xul | 16 +++--- 3 files changed, 51 insertions(+), 32 deletions(-) diff --git a/projects/instantbird/xmpp-inband-registration.patch b/projects/instantbird/xmpp-inband-registration.patch index 94084ec..28a8f90 100644 --- a/projects/instantbird/xmpp-inband-registration.patch +++ b/projects/instantbird/xmpp-inband-registration.patch @@ -80,7 +80,7 @@ diff --git a/chat/protocols/xmpp/xmpp-session.jsm b/chat/protocols/xmpp/xmpp-ses return; let now = Date.now(); if (aJustSentSomething) -@@ -265,28 +268,97 @@ XMPPSession.prototype = { +@@ -265,28 +268,103 @@ XMPPSession.prototype = { _(connection.error.startTLSNotSupported)); return; } @@ -111,17 +111,23 @@ diff --git a/chat/protocols/xmpp/xmpp-session.jsm b/chat/protocols/xmpp/xmpp-ses +return; + } + ++ // Clear the existing elements from previous registrations. ++ for (let elem in this.nodes) ++delete this.nodes[elem]; ++ + this._account.reportConnecting(_(connection.gettingRegistration)); + let registerStanza = aStanza.getChildrenByNS(Stanza.NS.register)[0]; + // If we get registration data, show the form, else quit. + if (registerStanza.getElement([x])) { ++this.nodes[username] = this._jid.node; +registerStanza.wrappedJSObject = registerStanza; +let ww = Cc[@mozilla.org/embedcomp/window-watcher;1] + .getService(Ci.nsIWindowWatcher); +let win = ww.openWindow(null, registerWindow, , -+ centerscreen,chrome,modal,resizable=yes,minimizable=no, registerStanza); ++centerscreen,chrome,modal,minimizable=no, registerStanza); + } else { +this.onError(null, _(connection.error.noRegistrationSupport)); ++return; + } + + // If the user cancelled the form, we should stop the registration. diff --git a/projects/instantbird/xmppRegister.js b/projects/instantbird/xmppRegister.js index 6983ad1..003c45b 100644 --- a/projects/instantbird/xmppRegister.js +++ b/projects/instantbird/xmppRegister.js @@ -27,21 +27,17 @@ let registerAccount = { document.documentElement.getButton(accept).disabled = true; this.rows = document.getElementById(register-rows); +this.groupbox = document.getElementById(register-groupbox); this.nodes = XMPPSession.prototype.nodes; -// Clear the existing elements from previous registrations. -for (let elem in this.nodes) - delete this.nodes[elem]; - this.registerStanza = window.arguments[0].wrappedJSObject; this.dataStanza = this.registerStanza.getElement([x]); let instructions = this.dataStanza.getElement([instructions]); if (instructions) { - let instructionRow = this.createRow(); - let instructionLabel = this.createElement(label, null, instructions.innerText); - instructionRow.appendChild(instructionLabel); - this.rows.appendChild(instructionRow); + let instructionLabel = this.createElement(caption); + instructionLabel.setAttribute(label, instructions.innerText); + this.groupbox.appendChild(instructionLabel); } let title = this.dataStanza.getElement([title]); @@ -51,21 +47,30 @@ let registerAccount = { document.title = _(brandShortName); for each (let ele in this.dataStanza.getElements([field])) { - let fieldType = ele.attributes[type]; + let attrib = ele.attributes; + let fieldType = attrib[type]; switch (fieldType) { case text-single: case text-private: - let textRow = this.createRow(); - let textLabel = this.createElement(label, null, ele.attributes[label]); + let textLabel = this.createElement(label, null, + ele.getElement([required]) ? + attrib[label] + * : attrib[label]); + + let textBox = this.createElement(textbox, attrib[var], + ele.getElement([value]) ? + ele.getElement([value]).innerText : ); - let textBox = this.createElement(textbox, ele.attributes[var], - ele.getElement([value]) ? ele.getElement([value]).innerText : ); - if (fieldType == text-private) + if (attrib[var] == username) +
[tor-commits] [translation/bridgedb_completed] Update translations for bridgedb_completed
commit e3831e25e23c85893097f493c08eb210bd7e7b69 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 4 15:45:07 2015 + Update translations for bridgedb_completed --- da/LC_MESSAGES/bridgedb.po | 33 + 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/da/LC_MESSAGES/bridgedb.po b/da/LC_MESSAGES/bridgedb.po index c647db3..eda484e 100644 --- a/da/LC_MESSAGES/bridgedb.po +++ b/da/LC_MESSAGES/bridgedb.po @@ -5,16 +5,16 @@ # Translators: # Christian Villum vil...@autofunk.dk, 2014-2015 # David Nielsen gnomeu...@gmail.com, 2014 +# Mogelbjerg j...@mogelbjerg.dk, 2015 # OliverMller theoli...@live.co.uk, 2011 # Thomas Pryds tho...@pryds.eu, 2014 # Tore Bjørnson tore.bjorn...@gmail.com, 2013 msgid msgstr Project-Id-Version: The Tor Project\n -Report-Msgid-Bugs-To: 'https://trac.torproject.org/projects/tor/newticket?component=BridgeDBkeywords=bridgedb-reported,msgidcc=isis,sysrqbowner=isis'\n -POT-Creation-Date: 2015-02-03 03:24+\n -PO-Revision-Date: 2015-02-23 06:50+\n -Last-Translator: Christian Villum vil...@autofunk.dk\n +Report-Msgid-Bugs-To: 'https://trac.torproject.org/projects/tor/newticket?component=BridgeDBkeywords=bridgedb-reported,msgidcc=isis,sysrqbowner=isis'POT-Creation-Date: 2015-03-19 22:13+\n +PO-Revision-Date: 2015-07-04 15:32+\n +Last-Translator: Mogelbjerg j...@mogelbjerg.dk\n Language-Team: Danish (http://www.transifex.com/projects/p/torproject/language/da/)\n MIME-Version: 1.0\n Content-Type: text/plain; charset=UTF-8\n @@ -34,7 +34,7 @@ msgstr #. fteproxy #. Tor #. Tor Browser -#: lib/bridgedb/HTTPServer.py:122 +#: lib/bridgedb/HTTPServer.py:107 msgid Sorry! Something went wrong with your request. msgstr Beklager, noget gik galt med din anmodning. @@ -205,26 +205,27 @@ msgstr Sådan starter du med at bruge dine broer #: lib/bridgedb/strings.py:121 #, python-format msgid -To enter bridges into Tor Browser, follow the instructions on the %s Tor\n -Browser download page %s to start Tor Browser. -msgstr For at tilføje broer til Tor Browseren, følg instruktionerne på %s Tor\nBrowserens hjemmeside %s for at starte Tor Browser. +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. +msgstr For at tage broer ind i Tor-browseren, gå da først til %s Tor-bowsers\ndownloadside %s og følg instruktionerne i hvordan Tor-browseren \ndownloades og startes. #. TRANSLATORS: Please DO NOT translate Tor. -#: lib/bridgedb/strings.py:125 +#: lib/bridgedb/strings.py:126 msgid When the 'Tor Network Settings' dialogue pops up, click 'Configure' and follow\n the wizard until it asks: msgstr Når 'Tor netværksindstillinger' vinduet popper op, klik 'Indstil' og følg guiden til den siger: #. TRANSLATORS: Please DO NOT translate Tor. -#: lib/bridgedb/strings.py:129 +#: lib/bridgedb/strings.py:130 msgid Does your Internet Service Provider (ISP) block or otherwise censor connections\n to the Tor network? msgstr Blokerer eller på anden vis censurerer din internetudbyder forbindelser\ntil Tor netværket? #. TRANSLATORS: Please DO NOT translate Tor. -#: lib/bridgedb/strings.py:133 +#: lib/bridgedb/strings.py:134 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 @@ -232,29 +233,29 @@ msgid button in the 'Tor Network Settings' wizard for further assistance. msgstr Vælg 'Ja' og klik så på 'Næste'. For at konfigurere dine nye broer, kopier og indsæt brolinierne i den næste input boks. Klik til sidst 'Forbind', og så er du klar! Hvis du støder på problemer, så prøv at klikke på 'Hjælp'-knappen i 'Tor Netværksindstillinger'-guiden for at få yderligere hjælp. -#: lib/bridgedb/strings.py:141 +#: lib/bridgedb/strings.py:142 msgid Displays this message. msgstr Vis denne besked. #. 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. -#: lib/bridgedb/strings.py:145 +#: lib/bridgedb/strings.py:146 msgid Request vanilla bridges. msgstr Anmod almindelige broer. -#: lib/bridgedb/strings.py:146 +#: lib/bridgedb/strings.py:147 msgid Request IPv6 bridges. msgstr Amod IPv6 broer. #. TRANSLATORS: Please DO NOT translate the word the word TYPE. -#: lib/bridgedb/strings.py:148 +#: lib/bridgedb/strings.py:149 msgid Request a Pluggable Transport by TYPE. msgstr Anmod om Pluggable Transport efter TYPE. #. TRANSLATORS: Please DO NOT translate BridgeDB. #. TRANSLATORS: Please DO NOT translate GnuPG. -#: lib/bridgedb/strings.py:151 +#: lib/bridgedb/strings.py:152 msgid Get a copy of BridgeDB's public GnuPG key. msgstr Hent en kopi af BridgeDB's offentlige GnuPG nøgle.
[tor-commits] [translation/bridgedb] Update translations for bridgedb
commit 2be063c9681c1aae56be7643ee060acb11696873 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 4 15:45:03 2015 + Update translations for bridgedb --- da/LC_MESSAGES/bridgedb.po |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/da/LC_MESSAGES/bridgedb.po b/da/LC_MESSAGES/bridgedb.po index 26b322e..eda484e 100644 --- a/da/LC_MESSAGES/bridgedb.po +++ b/da/LC_MESSAGES/bridgedb.po @@ -5,6 +5,7 @@ # Translators: # Christian Villum vil...@autofunk.dk, 2014-2015 # David Nielsen gnomeu...@gmail.com, 2014 +# Mogelbjerg j...@mogelbjerg.dk, 2015 # OliverMller theoli...@live.co.uk, 2011 # Thomas Pryds tho...@pryds.eu, 2014 # Tore Bjørnson tore.bjorn...@gmail.com, 2013 @@ -12,8 +13,8 @@ msgid msgstr Project-Id-Version: The Tor Project\n Report-Msgid-Bugs-To: 'https://trac.torproject.org/projects/tor/newticket?component=BridgeDBkeywords=bridgedb-reported,msgidcc=isis,sysrqbowner=isis'POT-Creation-Date: 2015-03-19 22:13+\n -PO-Revision-Date: 2015-04-19 08:23+\n -Last-Translator: runasand runa.sand...@gmail.com\n +PO-Revision-Date: 2015-07-04 15:32+\n +Last-Translator: Mogelbjerg j...@mogelbjerg.dk\n Language-Team: Danish (http://www.transifex.com/projects/p/torproject/language/da/)\n MIME-Version: 1.0\n Content-Type: text/plain; charset=UTF-8\n @@ -207,7 +208,7 @@ 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. -msgstr +msgstr For at tage broer ind i Tor-browseren, gå da først til %s Tor-bowsers\ndownloadside %s og følg instruktionerne i hvordan Tor-browseren \ndownloades og startes. #. TRANSLATORS: Please DO NOT translate Tor. #: lib/bridgedb/strings.py:126 ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/torbutton-abouttorproperties] Update translations for torbutton-abouttorproperties
commit 131aa639a6a0b67728b3b6bfe3ece4ce597a63bd Author: Translation commit bot translat...@torproject.org Date: Sat Jul 4 15:16:08 2015 + Update translations for torbutton-abouttorproperties --- pt_BR/abouttor.properties |9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pt_BR/abouttor.properties b/pt_BR/abouttor.properties index 31d99a9..f4b020e 100644 --- a/pt_BR/abouttor.properties +++ b/pt_BR/abouttor.properties @@ -1,6 +1,6 @@ -!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN +!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//PT-BR http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; -html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en' +html xmlns='http://www.w3.org/1999/xhtml' xml:lang='pt-br' lang='pt-br' head titletorbutton - Extensão Firefox para navegar com segurança ao usar Tor/title meta name='generator' content='cgit v0.10.2'/ @@ -22,8 +22,9 @@ option value='gsoc2009-koryk'gsoc2009-koryk/option option value='gsoc2009-koryk'gsoc2009-koryk/option option value='gsoc2009-koryk'gsoc2009-koryk/option +option value='gsoc2009-koryk'gsoc2009-koryk/option /select input type='submit' name='' value='switch'//form/td/tr -trtd class='sub'Firefox extension for safe web browsing while using Tor/tdtd class='sub right'The Tor Project/td/tr/table +trtd class='sub'Extensão Firefox para surfar na Internet com segurança ao utilizar Tor/tdtd class='sub right'The Tor Project/td/tr/table table class='tabs'trtd a href='/torbutton.git/'summary/aa href='/torbutton.git/refs/'refs/aa href='/torbutton.git/log/src/chrome/locale/en/aboutTor.properties'log/aa class='active' href='/torbutton.git/tree/src/chrome/locale/en/aboutTor.properties'tree/aa href='/torbutton.git/commit/src/chrome/locale/en/aboutTor.properties'commit/aa href='/torbutton.git/diff/src/chrome/locale/en/aboutTor.properties'diff/a/tdtd class='form'form class='right' method='get' action='/torbutton.git/log/src/chrome/locale/en/aboutTor.properties' select name='h' onchange='this.form.submit();' @@ -38,7 +39,7 @@ /td/tr/table div id='cgit'table id='header' table class='tabs'trtd -trtd class='sub'Firefox extension for safe web browsing while using Tor/tdtd class='sub right'The Tor Project/td/tr/table +trtd class='sub'Extensão Firefox para surfar na Internet com segurança ao utilizar Tor/tdtd class='sub right'The Tor Project/td/tr/table a href='/torbutton.git/'summary/aa href='/torbutton.git/refs/'refs/aa href='/torbutton.git/log/src/chrome/locale/en/aboutTor.properties'log/aa class='active' href='/torbutton.git/tree/src/chrome/locale/en/aboutTor.properties'tree/aa href='/torbutton.git/commit/src/chrome/locale/en/aboutTor.properties'commit/aa href='/torbutton.git/diff/src/chrome/locale/en/aboutTor.properties'diff/a/tdtd class='form'form class='right' method='get' action='/torbutton.git/log/src/chrome/locale/en/aboutTor.properties' a href='/torbutton.git/'summary/aa href='/torbutton.git/refs/'refs/aa href='/torbutton.git/log/src/chrome/locale/en/aboutTor.properties'log/aa class='active' href='/torbutton.git/tree/src/chrome/locale/en/aboutTor.properties'tree/aa href='/torbutton.git/commit/src/chrome/locale/en/aboutTor.properties'commit/aa href='/torbutton.git/diff/src/chrome/locale/en/aboutTor.properties'diff/a/tdtd class='form'form class='right' method='get' action='/torbutton.git/log/src/chrome/locale/en/aboutTor.properties' a href='/torbutton.git/'summary/aa href='/torbutton.git/refs/'refs/aa href='/torbutton.git/log/src/chrome/locale/en/aboutTor.properties'log/aa class='active' href='/torbutton.git/tree/src/chrome/locale/en/aboutTor.properties'tree/aa href='/torbutton.git/commit/src/chrome/locale/en/aboutTor.properties'commit/aa href='/torbutton.git/diff/src/chrome/locale/en/aboutTor.properties'diff/a/tdtd class='form'form class='right' method='get' action='/torbutton.git/log/src/chrome/locale/en/aboutTor.properties' ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/torbutton-abouttorproperties_completed] Update translations for torbutton-abouttorproperties_completed
commit f5f3e024fcb9f0d32515118d6f2e7e22adf8c5d3 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 4 15:16:14 2015 + Update translations for torbutton-abouttorproperties_completed --- pt_BR/abouttor.properties | 166 - 1 file changed, 148 insertions(+), 18 deletions(-) diff --git a/pt_BR/abouttor.properties b/pt_BR/abouttor.properties index 7efbe86..f4b020e 100644 --- a/pt_BR/abouttor.properties +++ b/pt_BR/abouttor.properties @@ -1,21 +1,151 @@ -# Copyright (c) 2014, The Tor Project, Inc. -# See LICENSE for licensing information. -# vim: set sw=2 sts=2 ts=8 et: +!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//PT-BR +http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; +html xmlns='http://www.w3.org/1999/xhtml' xml:lang='pt-br' lang='pt-br' +head +titletorbutton - Extensão Firefox para navegar com segurança ao usar Tor/title +meta name='generator' content='cgit v0.10.2'/ +meta name='generator' content='cgit v0.10.2'/ +link rel='stylesheet' type='text/css' href='/cgit-css/cgit.css'/ +link rel='stylesheet' type='text/css' href='/cgit-css/cgit.css'/ +link rel='stylesheet' type='text/css' href='/cgit-css/cgit.css'/ +/head +body +div id='cgit'table id='header' +tr +td class='logo' rowspan='2'a href='/'img src='/static/logo.jpg' alt='cgit logo'//a/td +td class='logo' rowspan='2'a href='/'img src='/static/logo.jpg' alt='cgit logo'//a/td +select name='h' onchange='this.form.submit();' +option value='gsoc2009-koryk'gsoc2009-koryk/option +option value='gsoc2009-koryk'gsoc2009-koryk/option +option value='gsoc2009-koryk'gsoc2009-koryk/option +option value='gsoc2009-koryk'gsoc2009-koryk/option +option value='gsoc2009-koryk'gsoc2009-koryk/option +option value='gsoc2009-koryk'gsoc2009-koryk/option +option value='gsoc2009-koryk'gsoc2009-koryk/option +option value='gsoc2009-koryk'gsoc2009-koryk/option +/select input type='submit' name='' value='switch'//form/td/tr +trtd class='sub'Extensão Firefox para surfar na Internet com segurança ao utilizar Tor/tdtd class='sub right'The Tor Project/td/tr/table +table class='tabs'trtd +a href='/torbutton.git/'summary/aa href='/torbutton.git/refs/'refs/aa href='/torbutton.git/log/src/chrome/locale/en/aboutTor.properties'log/aa class='active' href='/torbutton.git/tree/src/chrome/locale/en/aboutTor.properties'tree/aa href='/torbutton.git/commit/src/chrome/locale/en/aboutTor.properties'commit/aa href='/torbutton.git/diff/src/chrome/locale/en/aboutTor.properties'diff/a/tdtd class='form'form class='right' method='get' action='/torbutton.git/log/src/chrome/locale/en/aboutTor.properties' +select name='h' onchange='this.form.submit();' +option value='gsoc2009-koryk'gsoc2009-koryk/option +option value='gsoc2009-koryk'gsoc2009-koryk/option +option value='gsoc2009-koryk'gsoc2009-koryk/option +option value='gsoc2009-koryk'gsoc2009-koryk/option +/select +input class='txt' type='text' size='10' name='q' value=''/ +input class='txt' type='text' size='10' name='q' value=''/ +/form +/td/tr/table +div id='cgit'table id='header' +table class='tabs'trtd +trtd class='sub'Extensão Firefox para surfar na Internet com segurança ao utilizar Tor/tdtd class='sub right'The Tor Project/td/tr/table +a href='/torbutton.git/'summary/aa href='/torbutton.git/refs/'refs/aa href='/torbutton.git/log/src/chrome/locale/en/aboutTor.properties'log/aa class='active' href='/torbutton.git/tree/src/chrome/locale/en/aboutTor.properties'tree/aa href='/torbutton.git/commit/src/chrome/locale/en/aboutTor.properties'commit/aa href='/torbutton.git/diff/src/chrome/locale/en/aboutTor.properties'diff/a/tdtd class='form'form class='right' method='get' action='/torbutton.git/log/src/chrome/locale/en/aboutTor.properties' +a href='/torbutton.git/'summary/aa href='/torbutton.git/refs/'refs/aa href='/torbutton.git/log/src/chrome/locale/en/aboutTor.properties'log/aa class='active' href='/torbutton.git/tree/src/chrome/locale/en/aboutTor.properties'tree/aa href='/torbutton.git/commit/src/chrome/locale/en/aboutTor.properties'commit/aa href='/torbutton.git/diff/src/chrome/locale/en/aboutTor.properties'diff/a/tdtd class='form'form class='right' method='get' action='/torbutton.git/log/src/chrome/locale/en/aboutTor.properties' +a href='/torbutton.git/'summary/aa href='/torbutton.git/refs/'refs/aa href='/torbutton.git/log/src/chrome/locale/en/aboutTor.properties'log/aa class='active' href='/torbutton.git/tree/src/chrome/locale/en/aboutTor.properties'tree/aa href='/torbutton.git/commit/src/chrome/locale/en/aboutTor.properties'commit/aa href='/torbutton.git/diff/src/chrome/locale/en/aboutTor.properties'diff/a/tdtd class='form'form class='right' method='get' action='/torbutton.git/log/src/chrome/locale/en/aboutTor.properties' +a href='/torbutton.git/'summary/aa href='/torbutton.git/refs/'refs/aa href='/torbutton.git/log/src/chrome/locale/en/aboutTor.properties'log/aa class='active'
[tor-commits] [translation/abouttor-homepage_completed] Update translations for abouttor-homepage_completed
commit 2de38d42f0b8a566b70a948882071a5dae10dd66 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 4 15:45:55 2015 + Update translations for abouttor-homepage_completed --- da/aboutTor.dtd |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/da/aboutTor.dtd b/da/aboutTor.dtd index 23fd0f5..33e5431 100644 --- a/da/aboutTor.dtd +++ b/da/aboutTor.dtd @@ -25,7 +25,7 @@ !ENTITY aboutTor.searchSPPost.link https://startpage.com/rth/search; !ENTITY aboutTor.searchDDGPost.link https://duckduckgo.com/html/; -!ENTITY aboutTor.searchDCPost.link https://search.disconnect.me/searchTerms/search?ses=Googleamp;location_option=US; +!ENTITY aboutTor.searchDCPost.link https://search.disconnect.me/searchTerms/search?ses=Googleamp;location_option=USamp;source=tor; !ENTITY aboutTor.torInfo1.label Yderligere information: !ENTITY aboutTor.torInfo2.label Land og IP Adresse: ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [stem/master] Add is_user_traffic_allowed() to the Controller
commit 842da03cdd0cbe424d8aca6e753accf55923b4c8 Author: Damian Johnson ata...@torproject.org Date: Sat Jul 4 15:24:38 2015 -0700 Add is_user_traffic_allowed() to the Controller Simple helper method to help users determine if inbound or outbound connections are possibly directly servicing users, and by extension private. --- docs/change_log.rst |1 + stem/control.py | 46 ++ 2 files changed, 47 insertions(+) diff --git a/docs/change_log.rst b/docs/change_log.rst index a6529fd..5eade67 100644 --- a/docs/change_log.rst +++ b/docs/change_log.rst @@ -47,6 +47,7 @@ The following are only available within Stem's `git repository * Dramatic, `300x performance improvement https://github.com/DonnchaC/stem/pull/1`_ for reading from the control port with python 3 * :func:`~stem.connection.connect` and :func:`~stem.control.Controller.from_port` now connect to both port 9051 (relay's default) and 9151 (Tor Browser's default) (:trac:`16075`) * Added `support for NETWORK_LIVENESS events api/response.html#stem.response.events.NetworkLivenessEvent`_ (:spec:`44aac63`) + * Added :func:`~stem.control.Controller.is_user_traffic_allowed` to the :class:`~stem.control.Controller` * IPv6 addresses could trigger errors in :func:`~stem.control.Controller.get_listeners`, :class:`~stem.response.events.ORConnEvent`, and quite a few other things (:trac:`16174`) * Don't obscure stacktraces, most notably :class:`~stem.control.Controller` getter methods with default values diff --git a/stem/control.py b/stem/control.py index f08a455..d9693cc 100644 --- a/stem/control.py +++ b/stem/control.py @@ -81,6 +81,7 @@ If you're fine with allowing your script to raise exceptions then this can be mo |- get_protocolinfo - information about the controller interface |- get_user - provides the user tor is running as |- get_pid - provides the pid of our tor process +|- is_user_traffic_allowed - checks if we send or receive direct user traffic | |- get_microdescriptor - querying the microdescriptor for a relay |- get_microdescriptors - provides all currently available microdescriptors @@ -380,6 +381,11 @@ AccountingStats = collections.namedtuple('AccountingStats', [ 'write_limit', ]) +UserTrafficAllowed = collections.namedtuple('UserTrafficAllowed', [ + 'inbound', + 'outbound', +]) + CreateHiddenServiceOutput = collections.namedtuple('CreateHiddenServiceOutput', [ 'path', 'hostname', @@ -1494,6 +1500,46 @@ class Controller(BaseController): else: raise ValueError(Unable to resolve tor's pid if self.is_localhost() else Tor isn't running locally) + def is_user_traffic_allowed(self): + +Checks if we're likely to service direct user traffic. This essentially +boils down to... + + * If we're a bridge or guard relay, inbound connections are possibly from +users. + + * If our exit policy allows traffic then output connections are possibly +from users. + +Note the word 'likely'. These is a decent guess in practice, but not always +correct. For instance, information about which flags we have are only +fetched periodically. + +This method is intended to help you avoid eavesdropping on user traffic. +Monitoring user connections is not only unethical, but likely a violation +of wiretapping laws. + +.. versionadded:: 1.5.0 + +:returns: **namedtuple** with an **inbound** and **outbound** boolean + attribute to indicate if we're likely to have user traffic there + + +inbound_allowed, outbound_allowed = False, False + +if self.get_conf('BridgeRelay', None) == '1': + inbound_allowed = True + +if self.get_conf('ORPort', None): + if not inbound_allowed: +consensus_entry = self.get_network_status(default = None) +inbound_allowed = consensus_entry and 'Guard' in consensus_entry.flags + + exit_policy = self.get_exit_policy(None) + outbound_allowed = exit_policy and exit_policy.is_exiting_allowed() + +return UserTrafficAllowed(inbound_allowed, outbound_allowed) + @with_default() def get_microdescriptor(self, relay = None, default = UNDEFINED): ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [stem/master] Client usage example didn't work with python3
commit 28cbc64f9098cccf1d74d636bce09d714b35f0a3 Author: Damian Johnson ata...@torproject.org Date: Sat Jul 4 15:54:32 2015 -0700 Client usage example didn't work with python3 Good point from Priler that our example should use BytesIO rather than StringIO to work under python3... https://trac.torproject.org/projects/tor/ticket/16502 --- docs/_static/example/client_usage_using_pycurl.py |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_static/example/client_usage_using_pycurl.py b/docs/_static/example/client_usage_using_pycurl.py index a15db5e..48ebdac 100644 --- a/docs/_static/example/client_usage_using_pycurl.py +++ b/docs/_static/example/client_usage_using_pycurl.py @@ -1,5 +1,5 @@ +import io import pycurl -import StringIO import stem.process @@ -13,7 +13,7 @@ def query(url): Uses pycurl to fetch a site using the proxy on the SOCKS_PORT. - output = StringIO.StringIO() + output = io.BytesIO() query = pycurl.Curl() query.setopt(pycurl.URL, url) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/mat-gui_completed] Update translations for mat-gui_completed
commit b3b3811fad42cfec36a408e4aa045f6aeb717b9b Author: Translation commit bot translat...@torproject.org Date: Sun Jul 5 05:45:44 2015 + Update translations for mat-gui_completed --- pt_BR.po |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt_BR.po b/pt_BR.po index 29edd3e..310fccf 100644 --- a/pt_BR.po +++ b/pt_BR.po @@ -13,7 +13,7 @@ msgstr Project-Id-Version: The Tor Project\n Report-Msgid-Bugs-To: \n POT-Creation-Date: 2014-12-31 04:53+0100\n -PO-Revision-Date: 2015-06-30 10:02+\n +PO-Revision-Date: 2015-07-05 05:21+\n Last-Translator: runasand runa.sand...@gmail.com\n Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/torproject/language/pt_BR/)\n MIME-Version: 1.0\n ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tails-misc_completed] Update translations for tails-misc_completed
commit af3d1d37c571d52f9ef365b6af84cab9be039726 Author: Translation commit bot translat...@torproject.org Date: Sun Jul 5 05:46:00 2015 + Update translations for tails-misc_completed --- pt_BR.po | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pt_BR.po b/pt_BR.po index 6e7cf9a..726e5bb 100644 --- a/pt_BR.po +++ b/pt_BR.po @@ -16,8 +16,8 @@ msgid msgstr Project-Id-Version: The Tor Project\n Report-Msgid-Bugs-To: \n -POT-Creation-Date: 2015-05-02 23:47+0200\n -PO-Revision-Date: 2015-06-18 19:17+\n +POT-Creation-Date: 2015-06-28 19:40+0200\n +PO-Revision-Date: 2015-07-05 05:23+\n Last-Translator: Communia ameanean...@riseup.net\n Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/torproject/language/pt_BR/)\n MIME-Version: 1.0\n @@ -377,19 +377,19 @@ msgid more.../a msgstr a href='file:///usr/share/doc/tails/website/doc/advanced_topics/virtualization.en.html#security'Saiba mais.../a -#: config/chroot_local-includes/usr/local/bin/tor-browser:18 +#: config/chroot_local-includes/usr/local/bin/tor-browser:24 msgid Tor is not ready msgstr O Tor não está pronto -#: config/chroot_local-includes/usr/local/bin/tor-browser:19 +#: config/chroot_local-includes/usr/local/bin/tor-browser:25 msgid Tor is not ready. Start Tor Browser anyway? msgstr O Tor não está pronto. Iniciar o Navegador Tor assim mesmo? -#: config/chroot_local-includes/usr/local/bin/tor-browser:20 +#: config/chroot_local-includes/usr/local/bin/tor-browser:26 msgid Start Tor Browser msgstr Iniciar o Navegador Tor -#: config/chroot_local-includes/usr/local/bin/tor-browser:21 +#: config/chroot_local-includes/usr/local/bin/tor-browser:27 msgid Cancel msgstr Cancelar ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/mat-gui] Update translations for mat-gui
commit 6ec40fba42ca00345ba04593b44c3bd664f4c067 Author: Translation commit bot translat...@torproject.org Date: Sun Jul 5 05:45:40 2015 + Update translations for mat-gui --- pt_BR.po |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt_BR.po b/pt_BR.po index 29edd3e..310fccf 100644 --- a/pt_BR.po +++ b/pt_BR.po @@ -13,7 +13,7 @@ msgstr Project-Id-Version: The Tor Project\n Report-Msgid-Bugs-To: \n POT-Creation-Date: 2014-12-31 04:53+0100\n -PO-Revision-Date: 2015-06-30 10:02+\n +PO-Revision-Date: 2015-07-05 05:21+\n Last-Translator: runasand runa.sand...@gmail.com\n Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/torproject/language/pt_BR/)\n MIME-Version: 1.0\n ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tails-greeter] Update translations for tails-greeter
commit d47456cf0e453e0347b015446ac82a27926867dd Author: Translation commit bot translat...@torproject.org Date: Sun Jul 5 05:45:25 2015 + Update translations for tails-greeter --- pt_BR/pt_BR.po |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt_BR/pt_BR.po b/pt_BR/pt_BR.po index d7d473e..d7800c0 100644 --- a/pt_BR/pt_BR.po +++ b/pt_BR/pt_BR.po @@ -17,7 +17,7 @@ msgstr Project-Id-Version: The Tor Project\n Report-Msgid-Bugs-To: \n POT-Creation-Date: 2014-10-15 16:05+0200\n -PO-Revision-Date: 2015-06-16 19:39+\n +PO-Revision-Date: 2015-07-05 05:22+\n Last-Translator: Communia ameanean...@riseup.net\n Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/torproject/language/pt_BR/)\n MIME-Version: 1.0\n ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tails-misc] Update translations for tails-misc
commit 2dce87d65542cfc16c894225fb48a9f00e49b50e Author: Translation commit bot translat...@torproject.org Date: Sun Jul 5 05:45:56 2015 + Update translations for tails-misc --- pt_BR.po | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pt_BR.po b/pt_BR.po index 6e7cf9a..726e5bb 100644 --- a/pt_BR.po +++ b/pt_BR.po @@ -16,8 +16,8 @@ msgid msgstr Project-Id-Version: The Tor Project\n Report-Msgid-Bugs-To: \n -POT-Creation-Date: 2015-05-02 23:47+0200\n -PO-Revision-Date: 2015-06-18 19:17+\n +POT-Creation-Date: 2015-06-28 19:40+0200\n +PO-Revision-Date: 2015-07-05 05:23+\n Last-Translator: Communia ameanean...@riseup.net\n Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/torproject/language/pt_BR/)\n MIME-Version: 1.0\n @@ -377,19 +377,19 @@ msgid more.../a msgstr a href='file:///usr/share/doc/tails/website/doc/advanced_topics/virtualization.en.html#security'Saiba mais.../a -#: config/chroot_local-includes/usr/local/bin/tor-browser:18 +#: config/chroot_local-includes/usr/local/bin/tor-browser:24 msgid Tor is not ready msgstr O Tor não está pronto -#: config/chroot_local-includes/usr/local/bin/tor-browser:19 +#: config/chroot_local-includes/usr/local/bin/tor-browser:25 msgid Tor is not ready. Start Tor Browser anyway? msgstr O Tor não está pronto. Iniciar o Navegador Tor assim mesmo? -#: config/chroot_local-includes/usr/local/bin/tor-browser:20 +#: config/chroot_local-includes/usr/local/bin/tor-browser:26 msgid Start Tor Browser msgstr Iniciar o Navegador Tor -#: config/chroot_local-includes/usr/local/bin/tor-browser:21 +#: config/chroot_local-includes/usr/local/bin/tor-browser:27 msgid Cancel msgstr Cancelar ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tails-greeter_completed] Update translations for tails-greeter_completed
commit b5340223638567d93b3ad95782e7a9205eb901da Author: Translation commit bot translat...@torproject.org Date: Sun Jul 5 05:45:32 2015 + Update translations for tails-greeter_completed --- pt_BR/pt_BR.po |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt_BR/pt_BR.po b/pt_BR/pt_BR.po index d7d473e..d7800c0 100644 --- a/pt_BR/pt_BR.po +++ b/pt_BR/pt_BR.po @@ -17,7 +17,7 @@ msgstr Project-Id-Version: The Tor Project\n Report-Msgid-Bugs-To: \n POT-Creation-Date: 2014-10-15 16:05+0200\n -PO-Revision-Date: 2015-06-16 19:39+\n +PO-Revision-Date: 2015-07-05 05:22+\n Last-Translator: Communia ameanean...@riseup.net\n Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/torproject/language/pt_BR/)\n MIME-Version: 1.0\n ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/abouttor-homepage_completed] Update translations for abouttor-homepage_completed
commit e7318e80a9df177118fd0434b0382e61e86a5618 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 4 10:45:47 2015 + Update translations for abouttor-homepage_completed --- tr/aboutTor.dtd |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tr/aboutTor.dtd b/tr/aboutTor.dtd index 56a3fd4..1533cea 100644 --- a/tr/aboutTor.dtd +++ b/tr/aboutTor.dtd @@ -25,7 +25,7 @@ !ENTITY aboutTor.searchSPPost.link https://startpage.com/rth/search; !ENTITY aboutTor.searchDDGPost.link https://duckduckgo.com/html/; -!ENTITY aboutTor.searchDCPost.link https://search.disconnect.me/searchTerms/search?ses=Googleamp;location_option=US; +!ENTITY aboutTor.searchDCPost.link https://search.disconnect.me/searchTerms/search?ses=Googleamp;location_option=USamp;source=tor; !ENTITY aboutTor.torInfo1.label Ek bilgi: !ENTITY aboutTor.torInfo2.label Ãlke ve IP Adresi: ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits