[tor-commits] [translation/tails-greeter_completed] Update translations for tails-greeter_completed
commit 0e2c324f774c587dcd0fede800d188748cc57971 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 08:15:26 2015 + Update translations for tails-greeter_completed --- fi/fi.po |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fi/fi.po b/fi/fi.po index e1552e1..1dce3df 100644 --- a/fi/fi.po +++ b/fi/fi.po @@ -9,8 +9,8 @@ msgid 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-17 00:48+\n +POT-Creation-Date: 2015-06-28 19:25+0200\n +PO-Revision-Date: 2015-07-25 07:53+\n Last-Translator: Jorma Karvonen karvonen.jo...@gmail.com\n Language-Team: Finnish (http://www.transifex.com/projects/p/torproject/language/fi/)\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 4fb1b5788cc7e9175160afd3ca764f7b7a477f76 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 08:15:22 2015 + Update translations for tails-greeter --- fi/fi.po |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fi/fi.po b/fi/fi.po index e1552e1..1dce3df 100644 --- a/fi/fi.po +++ b/fi/fi.po @@ -9,8 +9,8 @@ msgid 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-17 00:48+\n +POT-Creation-Date: 2015-06-28 19:25+0200\n +PO-Revision-Date: 2015-07-25 07:53+\n Last-Translator: Jorma Karvonen karvonen.jo...@gmail.com\n Language-Team: Finnish (http://www.transifex.com/projects/p/torproject/language/fi/)\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/tor_animation] Update translations for tor_animation
commit c2afbdbd29e23857681a7ebaa7f76e09a8149fab Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 08:15:58 2015 + Update translations for tor_animation --- fi.srt | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/fi.srt b/fi.srt index 5713c7b..ee2297e 100644 --- a/fi.srt +++ b/fi.srt @@ -83,13 +83,11 @@ which tries to control and surveil the Internet. 20 00:01:07,900 -- 00:01:11,800 -Or perhaps you don't want big corporations -taking advantage of your personal information. +Tai ehkäpä et halua isojen yrityksien tekevän rahaa henkilökohtaisista tiedoistasi. 21 00:01:12,880 -- 00:01:15,640 -Tor makes all of its users -to look the same +Tor tekee kaikista sen käyttäjistä näyttävän samanlaiselta. 22 00:01:15,920 -- 00:01:18,800 @@ -98,8 +96,7 @@ and makes you anonymous. 23 00:01:19,500 -- 00:01:22,980 -So, the more people use the Tor network, -the stronger it gets +Joten, mitä enemmän Tor verkkoa käytetään, sitä vahvemmaksi se muuttuu. 24 00:01:23,140 -- 00:01:27,800 @@ -146,8 +143,7 @@ By downloading and using Tor, 33 00:01:56,200 -- 00:01:58,560 -you can protect the people -who need anonymity, +voit suojata niitä ketkä tarvitsevat anonymiteettiä, 34 00:01:58,880 -- 00:02:01,640 ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor-messenger-authdtd] Update translations for tor-messenger-authdtd
commit a8150354d6211697e2055983a2cc4089411b3747 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 08:16:09 2015 + Update translations for tor-messenger-authdtd --- fi/auth.dtd |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fi/auth.dtd b/fi/auth.dtd index d0c2789..1805515 100644 --- a/fi/auth.dtd +++ b/fi/auth.dtd @@ -17,5 +17,5 @@ !ENTITY authDialog.secretInstruction To verify their identity, pick a secret known only to you and your contact. Enter this secret, then wait for your contact to enter it as well. If the secrets do not match, then you may be talking to an imposter. !ENTITY authDialog.question Enter question here: !ENTITY authDialog.answer Enter secret answer here (case sensitive): -!ENTITY authDialog.secret Enter secret here: -!ENTITY authDialog.waiting Waiting for contact ... \ No newline at end of file +!ENTITY authDialog.secret Kirjoita salaisuus tähän: +!ENTITY authDialog.waiting Odotetaan yhteyttä... \ No newline at end of file ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor-messenger-ircproperties] Update translations for tor-messenger-ircproperties
commit 2f55cecdb8555a07d5c973223d2b90d39aae78b2 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 09:18:54 2015 + Update translations for tor-messenger-ircproperties --- ach/irc.properties |4 ady/irc.properties |4 af/irc.properties |4 ak/irc.properties |4 am/irc.properties |4 ar/irc.properties |4 arn/irc.properties |4 ast/irc.properties |4 az/irc.properties |4 ba/irc.properties |4 be/irc.properties |4 bg/irc.properties |4 bn/irc.properties |4 bn_IN/irc.properties |4 bo/irc.properties |4 br/irc.properties |4 bs/irc.properties |4 ca/irc.properties |4 cs/irc.properties |4 csb/irc.properties |4 cv/irc.properties |4 cy/irc.properties |4 cy_GB/irc.properties |4 da/irc.properties |4 de/irc.properties |4 dz/irc.properties |4 el/irc.properties |4 en/irc.properties |4 en_GB/irc.properties |4 eo/irc.properties |4 es/irc.properties |4 es_AR/irc.properties |4 es_CL/irc.properties |4 es_CO/irc.properties |4 es_MX/irc.properties |4 et/irc.properties |4 eu/irc.properties |4 fa/irc.properties |4 fi/irc.properties |4 fil/irc.properties |4 fo/irc.properties |4 fr/irc.properties |4 fr_CA/irc.properties |4 fur/irc.properties |4 fy/irc.properties |4 ga/irc.properties |4 gd/irc.properties |4 gl/irc.properties |4 gu/irc.properties |4 gu_IN/irc.properties |4 gun/irc.properties |4 ha/irc.properties |4 he/irc.properties |4 hi/irc.properties |4 hr/irc.properties |4 hr_HR/irc.properties |4 ht/irc.properties |4 hu/irc.properties |4 hy/irc.properties |4 hy_AM/irc.properties |4 ia/irc.properties |4 id/irc.properties |4 is/irc.properties |4 it/irc.properties |4 ja/irc.properties |4 jbo/irc.properties |4 jv/irc.properties |4 ka/irc.properties |4 kk/irc.properties |4 km/irc.properties |4 kn/irc.properties |4 ko/irc.properties |4 ko_KR/irc.properties |4 ku/irc.properties |4 ku_IQ/irc.properties |4 kw/irc.properties |4 ky/irc.properties |4 la/irc.properties |4 lb/irc.properties |4 lg/irc.properties |4 ln/irc.properties |4 lo/irc.properties |4 lt/irc.properties |4 lv/irc.properties |4 mg/irc.properties |4 mi/irc.properties |4 mk/irc.properties |4 ml/irc.properties |4 mn/irc.properties |4 mr/irc.properties |4 ms_MY/irc.properties |4 mt/irc.properties |4 my/irc.properties |4 nah/irc.properties |4 nap/irc.properties |4 nb/irc.properties |4 nds/irc.properties |4 ne/irc.properties |4 nl/irc.properties |4 nl_BE/irc.properties |4 nn/irc.properties |4 nso/irc.properties |4 oc/irc.properties |4 or/irc.properties |4 pa/irc.properties |4 pap/irc.properties |4 pl/irc.properties |4 pms/irc.properties |4 ps/irc.properties |4 pt/irc.properties |4 pt_BR/irc.properties |4 ro/irc.properties |4 ru/irc.properties |4 ru@petr1708/irc.properties |4 sa/irc.properties |4 scn/irc.properties |4 sco/irc.properties |4 si/irc.properties |4 si_LK/irc.properties |4 sk/irc.properties |
[tor-commits] [translation/tor-messenger-ircproperties_completed] Update translations for tor-messenger-ircproperties_completed
commit 402693adbad06104a1d47d2bb1e9441b744f797c Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 09:19:04 2015 + Update translations for tor-messenger-ircproperties_completed --- de/irc.properties|4 en/irc.properties|4 es/irc.properties|4 fr/irc.properties|4 fr_CA/irc.properties |4 hu/irc.properties|4 it/irc.properties|4 nb/irc.properties|4 pt_BR/irc.properties |4 ro/irc.properties|4 zh_CN/irc.properties |4 11 files changed, 44 deletions(-) diff --git a/de/irc.properties b/de/irc.properties index d9e92a3..ebf9d19 100644 --- a/de/irc.properties +++ b/de/irc.properties @@ -96,10 +96,6 @@ message.usermode=Modus %1$S für %2$S wurde von %3$S gesetzt. message.channelmode=Kanalmodus %1$S wurde von %2$S festgelegt. #%S is the user's mode. message.yourmode=Ihr Modus ist %S. -#%1$S is the old nick and %2$S is the new nick. -message.nick=%1$S ist nun bekannt als %2$S. -#%S is your new nick. -message.nick.you=Sie sind nun bekannt als %S. #Could not change the nickname. %S is the user's nick. message.nick.fail=Der gewünschte Benutzername konnte nicht verwendet werden. Ihr Benutzername bleibt %S. #The parameter is the message.parted.reason, if a part message is given. diff --git a/en/irc.properties b/en/irc.properties index ec61335..3fd93d9 100644 --- a/en/irc.properties +++ b/en/irc.properties @@ -96,10 +96,6 @@ message.usermode=Mode %1$S for %2$S set by %3$S. message.channelmode=Channel mode %1$S set by %2$S. #%S is the user's mode. message.yourmode=Your mode is %S. -#%1$S is the old nick and %2$S is the new nick. -message.nick=%1$S is now known as %2$S. -#%S is your new nick. -message.nick.you=You are now known as %S. #Could not change the nickname. %S is the user's nick. message.nick.fail=Could not use the desired nickname. Your nick remains %S. #The parameter is the message.parted.reason, if a part message is given. diff --git a/es/irc.properties b/es/irc.properties index 02c10a2..770a441 100644 --- a/es/irc.properties +++ b/es/irc.properties @@ -96,10 +96,6 @@ message.usermode=Modo %1$S para %2$S establecido por %3$S. message.channelmode=Modo de canal %1$S establecido por %2$S. #%S is the user's mode. message.yourmode=Su modo es %S. -#%1$S is the old nick and %2$S is the new nick. -message.nick=%1$S ahora es conocido como %2$S. -#%S is your new nick. -message.nick.you=Usted ahora es conocido como %S. #Could not change the nickname. %S is the user's nick. message.nick.fail=No se pudo usar el apodo (nick) deseado. Su apodo continúa siendo %S. #The parameter is the message.parted.reason, if a part message is given. diff --git a/fr/irc.properties b/fr/irc.properties index a0e361f..0cfad32 100644 --- a/fr/irc.properties +++ b/fr/irc.properties @@ -96,10 +96,6 @@ message.usermode=Mode %1$S sur %2$S ajusté par %3$S. message.channelmode=Mode de salon %1$S ajusté par %2$S. #%S is the user's mode. message.yourmode=Votre mode est %S. -#%1$S is the old nick and %2$S is the new nick. -message.nick=%1$S s'appelle maintenant %2$S. -#%S is your new nick. -message.nick.you=Vous vous appelez dorénavant %S. #Could not change the nickname. %S is the user's nick. message.nick.fail=Impossible d'utiliser ce surnom. Votre surnom demeure %S. #The parameter is the message.parted.reason, if a part message is given. diff --git a/fr_CA/irc.properties b/fr_CA/irc.properties index 2a208e0..72d4aba 100644 --- a/fr_CA/irc.properties +++ b/fr_CA/irc.properties @@ -96,10 +96,6 @@ message.usermode=Le mode %1$S a été défini par %3$S pour %2$S . message.channelmode=Le mode de canal %1$S a été défini par %2$S. #%S is the user's mode. message.yourmode=Votre mode est %S. -#%1$S is the old nick and %2$S is the new nick. -message.nick=%1$S est connu en tant que %2$S. -#%S is your new nick. -message.nick.you=Vous êtes connu en tant que %S. #Could not change the nickname. %S is the user's nick. message.nick.fail=Impossible d'utiliser le pseudonyme souhaité. Votre pseudo reste %S. #The parameter is the message.parted.reason, if a part message is given. diff --git a/hu/irc.properties b/hu/irc.properties index 7a7b1f4..4c48ca8 100644 --- a/hu/irc.properties +++ b/hu/irc.properties @@ -96,10 +96,6 @@ message.usermode=Mód %1$S neki: %2$S általa beállÃtva: %3$S. message.channelmode=Csatorna mód %1$S általa beállÃtva: %2$S. #%S is the user's mode. message.yourmode=A te módod %S. -#%1$S is the old nick and %2$S is the new nick. -message.nick=%1$S jelenleg %2$S-ként ismert. -#%S is your new nick. -message.nick.you=%S-ként vagy ismert. #Could not change the nickname. %S is the user's nick. message.nick.fail=Nem sikerült használni a kÃvánt nicknevet. A nickneved marad %S. #The parameter is the
[tor-commits] [translation/tor-messenger-conversationsproperties_completed] Update translations for tor-messenger-conversationsproperties_completed
commit 734eff80bcf60ab11ade1083566d434f5e61446b Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 09:17:30 2015 + Update translations for tor-messenger-conversationsproperties_completed --- en/conversations.properties | 11 +++ 1 file changed, 11 insertions(+) diff --git a/en/conversations.properties b/en/conversations.properties index 19b5aca..1a5564a 100644 --- a/en/conversations.properties +++ b/en/conversations.properties @@ -56,6 +56,17 @@ topicChanged=%1$S has changed the topic to: %2$S. # %1$S is the user who cleared the topic. topicCleared=%1$S has cleared the topic. +# LOCALIZATION NOTE (nickSet): +# This is displayed as a system message when a participant changes his/her +# nickname in a conversation. +# %1$S is the old nick. +# %2$S is the new nick. +nickSet=%1$S is now known as %2$S. +# LOCALIZATION NOTE (nickSet.you): +# This is displayed as a system message when your nickname is changed. +# %S is your new nick. +nickSet.you=You are now known as %S. + # LOCALIZATION NOTE (messenger.conversations.selections.ellipsis): # ellipsis is used when copying a part of a message to show that the message was cut messenger.conversations.selections.ellipsis=[â¦] ___ 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 a2a13357c262384f26d7fda69ec06952cc35bff0 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 07:45:43 2015 + Update translations for tails-misc_completed --- fi.po |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fi.po b/fi.po index f57f9ab..3e59d1b 100644 --- a/fi.po +++ b/fi.po @@ -14,7 +14,7 @@ msgstr Project-Id-Version: The Tor Project\n Report-Msgid-Bugs-To: \n POT-Creation-Date: 2015-06-28 19:40+0200\n -PO-Revision-Date: 2015-07-25 03:30+\n +PO-Revision-Date: 2015-07-25 07:32+\n Last-Translator: Thomas lab77...@hotmail.com\n Language-Team: Finnish (http://www.transifex.com/projects/p/torproject/language/fi/)\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/mat-gui_completed] Update translations for mat-gui_completed
commit 7aff85023edc35dac48a9b9e3f1fb8d6f9301392 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 07:45:31 2015 + Update translations for mat-gui_completed --- fi.po |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fi.po b/fi.po index b623da0..10f7273 100644 --- a/fi.po +++ b/fi.po @@ -11,7 +11,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-17 07:30+\n +PO-Revision-Date: 2015-07-25 07:32+\n Last-Translator: runasand runa.sand...@gmail.com\n Language-Team: Finnish (http://www.transifex.com/projects/p/torproject/language/fi/)\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 7a9076871c746ff92f0ae8efddc19a5ac4d928dc Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 07:45:40 2015 + Update translations for tails-misc --- fi.po |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fi.po b/fi.po index f57f9ab..3e59d1b 100644 --- a/fi.po +++ b/fi.po @@ -14,7 +14,7 @@ msgstr Project-Id-Version: The Tor Project\n Report-Msgid-Bugs-To: \n POT-Creation-Date: 2015-06-28 19:40+0200\n -PO-Revision-Date: 2015-07-25 03:30+\n +PO-Revision-Date: 2015-07-25 07:32+\n Last-Translator: Thomas lab77...@hotmail.com\n Language-Team: Finnish (http://www.transifex.com/projects/p/torproject/language/fi/)\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/mat-gui] Update translations for mat-gui
commit 5add5ae7d2c3cf9c1ff7c08b47755aa2d648b3a8 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 07:45:27 2015 + Update translations for mat-gui --- fi.po |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fi.po b/fi.po index b623da0..10f7273 100644 --- a/fi.po +++ b/fi.po @@ -11,7 +11,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-17 07:30+\n +PO-Revision-Date: 2015-07-25 07:32+\n Last-Translator: runasand runa.sand...@gmail.com\n Language-Team: Finnish (http://www.transifex.com/projects/p/torproject/language/fi/)\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/tor-messenger-ircproperties] Update translations for tor-messenger-ircproperties
commit ff9bb83348111de0b028661dd2668ac9cbe87e72 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 07:46:27 2015 + Update translations for tor-messenger-ircproperties --- fi/irc.properties | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fi/irc.properties b/fi/irc.properties index a494e0b..43e2144 100644 --- a/fi/irc.properties +++ b/fi/irc.properties @@ -164,14 +164,14 @@ error.wasNoSuchNick=There was no nickname: %S error.noSuchChannel=There is no channel: %S. error.unavailable=%S is temporarily unavailable. #%S is the channel name. -error.channelBanned=You have been banned from %S. +error.channelBanned=Sinut on estetty %S. error.cannotSendToChannel=You cannot send messages to %S. -error.channelFull=The channel %S is full. +error.channelFull=Kanava %S on täynnä. error.inviteOnly=You must be invited to join %S. error.nonUniqueTarget=%S is not a unique user@host or shortname or you have tried to join too many channels at once. error.notChannelOp=You are not a channel operator on %S. error.notChannelOwner=You are not a channel owner of %S. -error.wrongKey=Cannot join %S, invalid channel password. +error.wrongKey=Ei voida liittyä %S, virheellinen kanavan salasana. error.sendMessageFailed=An error occurred while sending your last message. Please try again once the connection has been reestablished. #%1$S is the channel the user tried to join, %2$S is the channel #he was forwarded to. @@ -181,8 +181,8 @@ error.channelForward=You may not join %1$S, and were automatically redirected to #These are the descriptions given in a tooltip with information received #from a whois response. #The human readable (realname) description of the user. -tooltip.realname=Name -tooltip.server=Connected to +tooltip.realname=Nimi +tooltip.server=Yhdistetty #The username and hostname that the user connects from (usually based on the #reverse DNS of the user's IP, but often mangled by the server to #protect users). @@ -192,7 +192,7 @@ tooltip.registeredAs=Registered as tooltip.secure=Using a secure connection # The away message of the user tooltip.away=Poissa -tooltip.ircOp=IRC Operator +tooltip.ircOp=IRC Operaattori tooltip.bot=Bot tooltip.lastActivity=Last activity # %S is the timespan elapsed since the last activity. ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor-messenger-authproperties] Update translations for tor-messenger-authproperties
commit b410a8e23f318bad595e99d42bc4c819de42a7c6 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 08:16:14 2015 + Update translations for tor-messenger-authproperties --- fi/auth.properties |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fi/auth.properties b/fi/auth.properties index f76c719..a5a2c34 100644 --- a/fi/auth.properties +++ b/fi/auth.properties @@ -4,7 +4,7 @@ auth.theirFingerprint=Purported fingerprint for %S:\n%S auth.help=Verifying a contact's identity helps ensure that the person you are talking to is who they claim to be. auth.helpTitle=Verification help auth.question=This is the question asked by your contact:\n\n%S\n\nEnter secret answer here (case sensitive): -auth.secret=Enter secret here: +auth.secret=Kirjoita salaisuus tähän: auth.error=An error occurred while verifying your contact's identity. auth.success=Verifying your contact's identity completed successfully. auth.successThem=Your contact has successfully verified your identity. You may want to verify their identity as well by asking your own question. ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor-messenger-conversationsproperties_completed] Update translations for tor-messenger-conversationsproperties_completed
commit 8338f5b298c2d2473a9510ef37fa211444a84317 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 09:46:16 2015 + Update translations for tor-messenger-conversationsproperties_completed --- zh_CN/conversations.properties | 11 +++ 1 file changed, 11 insertions(+) diff --git a/zh_CN/conversations.properties b/zh_CN/conversations.properties index 1a357e4..e8abac3 100644 --- a/zh_CN/conversations.properties +++ b/zh_CN/conversations.properties @@ -56,6 +56,17 @@ topicChanged=%1$S å·²å°ä¸»é¢æ´æ¹ä¸ºï¼%2$Sã # %1$S is the user who cleared the topic. topicCleared=%1$S æ´æ¹äºä¸»é¢ã +# LOCALIZATION NOTE (nickSet): +# This is displayed as a system message when a participant changes his/her +# nickname in a conversation. +# %1$S is the old nick. +# %2$S is the new nick. +nickSet=%1$S ç°å¨è¢«ç§°ä¸º %2$Sã +# LOCALIZATION NOTE (nickSet.you): +# This is displayed as a system message when your nickname is changed. +# %S is your new nick. +nickSet.you=æ¨ç°å¨è¢«ç§°ä¸º %Sã + # LOCALIZATION NOTE (messenger.conversations.selections.ellipsis): # ellipsis is used when copying a part of a message to show that the message was cut messenger.conversations.selections.ellipsis=[â¦] ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor-messenger-conversationsproperties] Update translations for tor-messenger-conversationsproperties
commit 138a09ce14ee8ae0ff39d181771645d3407e728f Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 09:46:12 2015 + Update translations for tor-messenger-conversationsproperties --- zh_CN/conversations.properties |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zh_CN/conversations.properties b/zh_CN/conversations.properties index 4648d38..e8abac3 100644 --- a/zh_CN/conversations.properties +++ b/zh_CN/conversations.properties @@ -61,11 +61,11 @@ topicCleared=%1$S æ´æ¹äºä¸»é¢ã # nickname in a conversation. # %1$S is the old nick. # %2$S is the new nick. -nickSet=%1$S is now known as %2$S. +nickSet=%1$S ç°å¨è¢«ç§°ä¸º %2$Sã # LOCALIZATION NOTE (nickSet.you): # This is displayed as a system message when your nickname is changed. # %S is your new nick. -nickSet.you=You are now known as %S. +nickSet.you=æ¨ç°å¨è¢«ç§°ä¸º %Sã # LOCALIZATION NOTE (messenger.conversations.selections.ellipsis): # ellipsis is used when copying a part of a message to show that the message was cut ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor-messenger-otrproperties] Update translations for tor-messenger-otrproperties
commit 5117945bea7f9a8e714b98a223f424966f3d8147 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 16:46:25 2015 + Update translations for tor-messenger-otrproperties --- tr/otr.properties | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tr/otr.properties b/tr/otr.properties index b85f0c6..8742d80 100644 --- a/tr/otr.properties +++ b/tr/otr.properties @@ -10,14 +10,14 @@ msgevent.rcvdmsg_unreadable=%S kullanıcısından okunamayan bir ÅifrelenmiÅ m msgevent.rcvdmsg_malformed=%S kullanıcısından hatalı biçimlendirilmiÅ bir veri mesajı aldık. msgevent.log_heartbeat_rcvd=Heartbeat received from %S. msgevent.log_heartbeat_sent=Heartbeat sent to %S. -msgevent.rcvdmsg_general_err=An OTR error occured. -msgevent.rcvdmsg_unecrypted=We received an unencrypted message from %S. -msgevent.rcvdmsg_unrecognized=We received an unrecognized OTR message from %S. -msgevent.rcvdmsg_for_other_instance=%S has sent a message intended for a different session. If you are logged in multiple times, another session may have received the message. -context.gone_secure_private=Private conversation with %S started. -context.gone_secure_unverified=Private conversation with %S started. However, their identity has not been verified. -context.still_secure=Successfully refreshed the private conversation with %S. -error.enc=Error occurred encrypting message. +msgevent.rcvdmsg_general_err=Bir OTR hatası meydana geldi. +msgevent.rcvdmsg_unecrypted=%S kullanıcısından ÅifrelenmemiÅ bir mesaj aldık. +msgevent.rcvdmsg_unrecognized=%S kullanıcısından tanınmayan bir OTR mesajı aldık. +msgevent.rcvdmsg_for_other_instance=%S farklı bir oturuma yönelik bir mesaj gönderdi. EÄer birden çok kez oturum açtıysanız, baÅka oturum mesajı almıŠolabilir. +context.gone_secure_private=%S ile özel sohbet baÅladı. +context.gone_secure_unverified=%S ile özel görüÅme baÅladı. Ancak, kimliÄi doÄrulanmadı. +context.still_secure=%S ile olan özel sohbet baÅarıyla yenilendi. +error.enc=Åifreleme sırasında hata oluÅtu. error.not_priv=You sent encrypted data to %S, who wasn't expecting it. error.unreadable=You transmitted an unreadable encrypted message. error.malformed=You transmitted a malformed data message. @@ -27,5 +27,5 @@ query.msg=%S has requested an Off-the Record private conversation. However, you trust.unused=Kullanılmayan trust.not_private=Ãzel Olmayan trust.unverified=OnaylanmamıŠ-trust.private=Private -trust.finished=Finished +trust.private=Ãzel +trust.finished=Biten ___ 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 6ef849b161aa6132762686a758233c3cfe5812ff Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 13:45:54 2015 + Update translations for tails-misc --- pt_BR.po |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pt_BR.po b/pt_BR.po index 726e5bb..5843e05 100644 --- a/pt_BR.po +++ b/pt_BR.po @@ -17,7 +17,7 @@ msgstr Project-Id-Version: The Tor Project\n Report-Msgid-Bugs-To: \n POT-Creation-Date: 2015-06-28 19:40+0200\n -PO-Revision-Date: 2015-07-05 05:23+\n +PO-Revision-Date: 2015-07-25 13:16+\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 @@ -60,7 +60,7 @@ msgid When you reboot Tails, all of Electrum's data will be lost, including your Bitcoin wallet. It is strongly recommended to only run Electrum when its persistence feature is activated. -msgstr Ao reiniciar o Tails, todos os dados do Electrum serão perdidos, inclusive as carteiras de Bitcoin. à fortemente recomendado executar Electrum quando o persistência deste estiver ativado. +msgstr Ao reiniciar o Tails, todos os dados do Electrum serão perdidos, inclusive as carteiras de Bitcoin. Assim, o mais recomendado é executar Electrum quando o persistência deste estiver ativado. #: config/chroot_local-includes/usr/local/bin/electrum:18 msgid Do you want to start Electrum anyway? ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/https_everywhere_completed] Update translations for https_everywhere_completed
commit 027c56b30741e7b7b8c1731a24f616ab7a337f35 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 13:45:25 2015 + Update translations for https_everywhere_completed --- pt_BR/https-everywhere.dtd |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt_BR/https-everywhere.dtd b/pt_BR/https-everywhere.dtd index e9cdf50..a79b25d 100644 --- a/pt_BR/https-everywhere.dtd +++ b/pt_BR/https-everywhere.dtd @@ -1,6 +1,6 @@ !ENTITY https-everywhere.about.title Sobre o HTTPS Everywhere !ENTITY https-everywhere.about.ext_name HTTPS Everywhere -!ENTITY https-everywhere.about.ext_description Encripte a Web! Use automaticamente a segurança HTTPS em diversos sites. +!ENTITY https-everywhere.about.ext_description Criptografar a Web! Use automaticamente a segurança HTTPS em diversos sites. !ENTITY https-everywhere.about.version Versão !ENTITY https-everywhere.about.created_by Criado por !ENTITY https-everywhere.about.librarians Biblioteca de Conjunto de Regras ___ 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 ff0aa3225c9b89d2501d70c1e7405a25582787a1 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 13:45:44 2015 + Update translations for mat-gui_completed --- pt_BR.po |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pt_BR.po b/pt_BR.po index 310fccf..f515e26 100644 --- a/pt_BR.po +++ b/pt_BR.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the PACKAGE package. # # Translators: -# Communia ameanean...@riseup.net, 2013-2014 +# Communia ameanean...@riseup.net, 2013-2015 # carlo giusepe tadei valente sasaki carlo.gt.vale...@gmail.com, 2014 # Eduardo Bonsi, 2013-2014 # Eduardo Luis Voltolini Tafner, 2013 @@ -13,8 +13,8 @@ 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-07-05 05:21+\n -Last-Translator: runasand runa.sand...@gmail.com\n +PO-Revision-Date: 2015-07-25 13: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 Content-Type: text/plain; charset=UTF-8\n @@ -78,7 +78,7 @@ msgstr Reduzir o tamanho e a qualidade do PDF produzido #: mat-gui:229 msgid Add unsupported file to archives -msgstr Adicionar arquivo não suportados aos arquivos +msgstr Adicionar documentos que não possuam suporte aos arquivos #: mat-gui:232 msgid Add non-supported (and so non-anonymised) file to output archive ___ 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 adc2cfa7bcd831c04db06cafa29452b2f9e4b615 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 13:45:40 2015 + Update translations for mat-gui --- pt_BR.po |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pt_BR.po b/pt_BR.po index 310fccf..f515e26 100644 --- a/pt_BR.po +++ b/pt_BR.po @@ -3,7 +3,7 @@ # This file is distributed under the same license as the PACKAGE package. # # Translators: -# Communia ameanean...@riseup.net, 2013-2014 +# Communia ameanean...@riseup.net, 2013-2015 # carlo giusepe tadei valente sasaki carlo.gt.vale...@gmail.com, 2014 # Eduardo Bonsi, 2013-2014 # Eduardo Luis Voltolini Tafner, 2013 @@ -13,8 +13,8 @@ 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-07-05 05:21+\n -Last-Translator: runasand runa.sand...@gmail.com\n +PO-Revision-Date: 2015-07-25 13: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 Content-Type: text/plain; charset=UTF-8\n @@ -78,7 +78,7 @@ msgstr Reduzir o tamanho e a qualidade do PDF produzido #: mat-gui:229 msgid Add unsupported file to archives -msgstr Adicionar arquivo não suportados aos arquivos +msgstr Adicionar documentos que não possuam suporte aos arquivos #: mat-gui:232 msgid Add non-supported (and so non-anonymised) file to output archive ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/bridgedb_completed] Update translations for bridgedb_completed
commit 934cc64984b6c138b48da7c72479b7dcb0e35147 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 13:45:08 2015 + Update translations for bridgedb_completed --- pt_BR/LC_MESSAGES/bridgedb.po |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pt_BR/LC_MESSAGES/bridgedb.po b/pt_BR/LC_MESSAGES/bridgedb.po index baf2f48..570f2e2 100644 --- a/pt_BR/LC_MESSAGES/bridgedb.po +++ b/pt_BR/LC_MESSAGES/bridgedb.po @@ -14,7 +14,7 @@ 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-06-16 19:39+\n +PO-Revision-Date: 2015-07-25 13:18+\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 @@ -67,7 +67,7 @@ msgstr Bem vindo ao BridgeDB! #. TRANSLATORS: Please DO NOT translate the words transport or TYPE. #: lib/bridgedb/strings.py:30 msgid Currently supported transport TYPEs: -msgstr TYPEs de transport que possuem suporte atualmente: +msgstr Tipos de transport que possuem suporte atualmente: #: lib/bridgedb/strings.py:31 #, python-format ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor_animation] Update translations for tor_animation
commit 60c1514158a6533187a469d965333d057815067f Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 13:46:23 2015 + Update translations for tor_animation --- pt_BR.srt |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pt_BR.srt b/pt_BR.srt index 478f14b..0b46dfc 100644 --- a/pt_BR.srt +++ b/pt_BR.srt @@ -109,7 +109,7 @@ mais forte ela fica 24 00:01:23,140 -- 00:01:27,800 -pois é mais fácil se esconder em um grupo +pois é mais fácil se esconder em uma multidão de pessoas que parecem idênticas. 25 @@ -124,7 +124,7 @@ se o censor sabe o que você faz 27 00:01:36,540 -- 00:01:39,440 -Os anúncios de publicidade não o acompanharão +Os anúncios de publicidade não acompanharão você em todos os lugares durante meses, 28 ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/torbutton-branddtd] Update translations for torbutton-branddtd
commit b09970a384a477d43d70adc36ea98daf5d0c2731 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 13:46:05 2015 + Update translations for torbutton-branddtd --- pt_BR/brand.dtd |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt_BR/brand.dtd b/pt_BR/brand.dtd index 84d77b7..960990d 100644 --- a/pt_BR/brand.dtd +++ b/pt_BR/brand.dtd @@ -12,4 +12,4 @@ !ENTITY plugins.installed.find Clique para carregar os plugins de sistema instalados !ENTITY plugins.installed.enable Ativar plugins !ENTITY plugins.installed.disable Desativar plugins -!ENTITY plugins.installed.disable.tip Clique para evitar o carregamento dos plugins do sistema +!ENTITY plugins.installed.disable.tip Clique para evitar o carregamento dos plugins de sistema ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor_animation_completed] Update translations for tor_animation_completed
commit 873f712a32de514618d01c2726fcb3e4ee41d4d8 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 13:46:27 2015 + Update translations for tor_animation_completed --- pt_BR.srt |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pt_BR.srt b/pt_BR.srt index 478f14b..0b46dfc 100644 --- a/pt_BR.srt +++ b/pt_BR.srt @@ -109,7 +109,7 @@ mais forte ela fica 24 00:01:23,140 -- 00:01:27,800 -pois é mais fácil se esconder em um grupo +pois é mais fácil se esconder em uma multidão de pessoas que parecem idênticas. 25 @@ -124,7 +124,7 @@ se o censor sabe o que você faz 27 00:01:36,540 -- 00:01:39,440 -Os anúncios de publicidade não o acompanharão +Os anúncios de publicidade não acompanharão você em todos os lugares durante meses, 28 ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor-messenger-conversationsproperties] Update translations for tor-messenger-conversationsproperties
commit aead9d588e79274300e1b48f8677cf4a46ba2d40 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 13:46:50 2015 + Update translations for tor-messenger-conversationsproperties --- tr/conversations.properties | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tr/conversations.properties b/tr/conversations.properties index 1a5564a..7ee20c5 100644 --- a/tr/conversations.properties +++ b/tr/conversations.properties @@ -5,43 +5,43 @@ # LOCALIZATION NOTE (targetChanged): # %1$S is the new conversation title (display name of the new target), # %2$S is the protocol name used for the new target. -targetChanged=The conversation will continue with %1$S, using %2$S. +targetChanged=Sohbet %2$S kullanarak %1$S ile devam edecek. # LOCALIZATION NOTE (statusChanged): # %1$S is the display name of the contact. # %2$S is the new status type (a value from status.properties). -statusChanged=%1$S is now %2$S. +statusChanged=%1$S Åimdi %2$S. # LOCALIZATION NOTE (statusChangedWithStatusText): # %1$S is the display name of the contact. # %2$S is the new status type (a value from status.properties). # %3$S is the status text (eg. I'm currently away from the computer). -statusChangedWithStatusText=%1$S is now %2$S: %3$S. +statusChangedWithStatusText=%1$S Åimdi %2$S: %3$S. # LOCALIZATION NOTE (statusChangedFromUnknown[WithStatusText]): # special case of the previous 2 strings for when the status was # previously unknown. These 2 strings should not mislead the user # into thinking the person's status has just changed. -statusChangedFromUnknown=%1$S is %2$S. -statusChangedFromUnknownWithStatusText=%1$S is %2$S: %3$S. +statusChangedFromUnknown=%1$S %2$S oldu. +statusChangedFromUnknownWithStatusText=%1$S, %2$S: %3$S oldu. # LOCALIZATION NOTE (statusKnown[WithStatusText]): # special case of the previous 2 strings for when an account has just # been reconnected, so the status is now known. These 2 strings should not # mislead the user into thinking the person's status has just changed. -statusKnown=Your account has been reconnected (%1$S is %2$S). -statusKnownWithStatusText=Your account has been reconnected (%1$S is %2$S: %3$S). +statusKnown=Hesabınız yeniden baÄlandı (%1$S, %2$S oldu). +statusKnownWithStatusText=Hesabınız yeniden baÄlandı (%1$S, %2$S: %3$S oldu). # LOCALIZATION NOTE (statusUnknown): # %S is the display name of the contact. -statusUnknown=Your account is disconnected (the status of %S is no longer known). +statusUnknown=Hesabınızın baÄlantısı kesildi (%S durumu artık bilinmiyor). -accountDisconnected=Your account is disconnected. -accountReconnected=Your account has been reconnected. +accountDisconnected=Hesabınızın baÄlantısı kesildi. +accountReconnected=Hesabınız yeniden baÄlandı. # LOCALIZATION NOTE (autoReply): # %S is replaced by the text of a message that was sent as an automatic reply. -autoReply=Auto-reply - %S +autoReply=Otomatik cevap - %S # LOCALIZATION NOTE (noTopic): # Displayed instead of the topic when no topic is set. -noTopic=No topic message for this room. +noTopic=Bu oda için hiçbir konu mesajı yok. # LOCALIZATION NOTE (topicSet): # %1$S is the conversation name, %2$S is the topic. ___ 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 8cbc443c6e23e13c05366700455d99da331dec34 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 13:45:58 2015 + Update translations for tails-misc_completed --- pt_BR.po |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pt_BR.po b/pt_BR.po index 726e5bb..5843e05 100644 --- a/pt_BR.po +++ b/pt_BR.po @@ -17,7 +17,7 @@ msgstr Project-Id-Version: The Tor Project\n Report-Msgid-Bugs-To: \n POT-Creation-Date: 2015-06-28 19:40+0200\n -PO-Revision-Date: 2015-07-05 05:23+\n +PO-Revision-Date: 2015-07-25 13:16+\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 @@ -60,7 +60,7 @@ msgid When you reboot Tails, all of Electrum's data will be lost, including your Bitcoin wallet. It is strongly recommended to only run Electrum when its persistence feature is activated. -msgstr Ao reiniciar o Tails, todos os dados do Electrum serão perdidos, inclusive as carteiras de Bitcoin. à fortemente recomendado executar Electrum quando o persistência deste estiver ativado. +msgstr Ao reiniciar o Tails, todos os dados do Electrum serão perdidos, inclusive as carteiras de Bitcoin. Assim, o mais recomendado é executar Electrum quando o persistência deste estiver ativado. #: config/chroot_local-includes/usr/local/bin/electrum:18 msgid Do you want to start Electrum anyway? ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/torbutton-branddtd_completed] Update translations for torbutton-branddtd_completed
commit 13a3658e5732c79521bd3b14fbfea2f19293a121 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 13:46:09 2015 + Update translations for torbutton-branddtd_completed --- pt_BR/brand.dtd |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt_BR/brand.dtd b/pt_BR/brand.dtd index 84d77b7..960990d 100644 --- a/pt_BR/brand.dtd +++ b/pt_BR/brand.dtd @@ -12,4 +12,4 @@ !ENTITY plugins.installed.find Clique para carregar os plugins de sistema instalados !ENTITY plugins.installed.enable Ativar plugins !ENTITY plugins.installed.disable Desativar plugins -!ENTITY plugins.installed.disable.tip Clique para evitar o carregamento dos plugins do sistema +!ENTITY plugins.installed.disable.tip Clique para evitar o carregamento dos plugins de sistema ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor-messenger-authdtd_completed] Update translations for tor-messenger-authdtd_completed
commit e9a5e8040ddd0438696c7bf2b447fac7660648ba Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 13:46:40 2015 + Update translations for tor-messenger-authdtd_completed --- pt_BR/auth.dtd |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt_BR/auth.dtd b/pt_BR/auth.dtd index 6d672d5..260f591 100644 --- a/pt_BR/auth.dtd +++ b/pt_BR/auth.dtd @@ -14,7 +14,7 @@ !ENTITY authDialog.choose Escolher !ENTITY authDialog.how Como você gostaria de verificar a identidade da pessoa do seu contato? !ENTITY authDialog.qaInstruction Para verificar a identidade de seu contato, escolha uma pergunta cuja resposta seja conhecida apenas por você e pelo contato. Insira a pergunta e a resposta, então aguarde o seu contato colocar a resposta também. Se as respostas não coincidirem, então você pode estar falando com um impostor. -!ENTITY authDialog.secretInstruction Para verificar a identidade de seu contato, escolha um segredo que seja conhecido apenas por você e pelo contato. Insira o segredo, então aguarde o seu contato fazer o mesmo. Se os segredos não coincidirem, então você pode estar falando com um impostor. +!ENTITY authDialog.secretInstruction Para verificar a identidade de seu contato, escolha um segredo que seja conhecido apenas por você e pelo contato. Insira o segredo e aguarde o seu contato fazer o mesmo. Se os segredos não coincidirem, pode ser que você esteja falando com um impostor. !ENTITY authDialog.question Insira a pergunta aqui: !ENTITY authDialog.answer Insira a pergunta secreta aqui !ENTITY authDialog.secret Insira o segredo aqui: ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/https_everywhere] Update translations for https_everywhere
commit 0b677f1164a9b6de05816380c126ecfb2403f0cb Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 13:45:20 2015 + Update translations for https_everywhere --- pt_BR/https-everywhere.dtd |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt_BR/https-everywhere.dtd b/pt_BR/https-everywhere.dtd index e9cdf50..a79b25d 100644 --- a/pt_BR/https-everywhere.dtd +++ b/pt_BR/https-everywhere.dtd @@ -1,6 +1,6 @@ !ENTITY https-everywhere.about.title Sobre o HTTPS Everywhere !ENTITY https-everywhere.about.ext_name HTTPS Everywhere -!ENTITY https-everywhere.about.ext_description Encripte a Web! Use automaticamente a segurança HTTPS em diversos sites. +!ENTITY https-everywhere.about.ext_description Criptografar a Web! Use automaticamente a segurança HTTPS em diversos sites. !ENTITY https-everywhere.about.version Versão !ENTITY https-everywhere.about.created_by Criado por !ENTITY https-everywhere.about.librarians Biblioteca de Conjunto de Regras ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor-messenger-authdtd] Update translations for tor-messenger-authdtd
commit 4922accb552d48356ab9d1d71354149e3724b990 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 13:46:37 2015 + Update translations for tor-messenger-authdtd --- pt_BR/auth.dtd |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt_BR/auth.dtd b/pt_BR/auth.dtd index 6d672d5..260f591 100644 --- a/pt_BR/auth.dtd +++ b/pt_BR/auth.dtd @@ -14,7 +14,7 @@ !ENTITY authDialog.choose Escolher !ENTITY authDialog.how Como você gostaria de verificar a identidade da pessoa do seu contato? !ENTITY authDialog.qaInstruction Para verificar a identidade de seu contato, escolha uma pergunta cuja resposta seja conhecida apenas por você e pelo contato. Insira a pergunta e a resposta, então aguarde o seu contato colocar a resposta também. Se as respostas não coincidirem, então você pode estar falando com um impostor. -!ENTITY authDialog.secretInstruction Para verificar a identidade de seu contato, escolha um segredo que seja conhecido apenas por você e pelo contato. Insira o segredo, então aguarde o seu contato fazer o mesmo. Se os segredos não coincidirem, então você pode estar falando com um impostor. +!ENTITY authDialog.secretInstruction Para verificar a identidade de seu contato, escolha um segredo que seja conhecido apenas por você e pelo contato. Insira o segredo e aguarde o seu contato fazer o mesmo. Se os segredos não coincidirem, pode ser que você esteja falando com um impostor. !ENTITY authDialog.question Insira a pergunta aqui: !ENTITY authDialog.answer Insira a pergunta secreta aqui !ENTITY authDialog.secret Insira o segredo aqui: ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/bridgedb_completed] Update translations for bridgedb_completed
commit b6f8d69629d10df3b8605ad03a2943d18e992b37 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 14:15:08 2015 + Update translations for bridgedb_completed --- pt_BR/LC_MESSAGES/bridgedb.po |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt_BR/LC_MESSAGES/bridgedb.po b/pt_BR/LC_MESSAGES/bridgedb.po index 570f2e2..0157f31 100644 --- a/pt_BR/LC_MESSAGES/bridgedb.po +++ b/pt_BR/LC_MESSAGES/bridgedb.po @@ -14,7 +14,7 @@ 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-07-25 13:18+\n +PO-Revision-Date: 2015-07-25 13:49+\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/bridgedb] Update translations for bridgedb
commit 1321d9e3b059fdd4244eb6989f1f031624f51a3b Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 13:45:03 2015 + Update translations for bridgedb --- pt_BR/LC_MESSAGES/bridgedb.po |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pt_BR/LC_MESSAGES/bridgedb.po b/pt_BR/LC_MESSAGES/bridgedb.po index baf2f48..570f2e2 100644 --- a/pt_BR/LC_MESSAGES/bridgedb.po +++ b/pt_BR/LC_MESSAGES/bridgedb.po @@ -14,7 +14,7 @@ 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-06-16 19:39+\n +PO-Revision-Date: 2015-07-25 13:18+\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 @@ -67,7 +67,7 @@ msgstr Bem vindo ao BridgeDB! #. TRANSLATORS: Please DO NOT translate the words transport or TYPE. #: lib/bridgedb/strings.py:30 msgid Currently supported transport TYPEs: -msgstr TYPEs de transport que possuem suporte atualmente: +msgstr Tipos de transport que possuem suporte atualmente: #: lib/bridgedb/strings.py:31 #, python-format ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor-messenger-conversationsproperties] Update translations for tor-messenger-conversationsproperties
commit 407d18b0cbd13bbe1e2f3e06324df35bcb6a084d Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 14:16:29 2015 + Update translations for tor-messenger-conversationsproperties --- tr/conversations.properties | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tr/conversations.properties b/tr/conversations.properties index 7ee20c5..ed279ba 100644 --- a/tr/conversations.properties +++ b/tr/conversations.properties @@ -45,27 +45,27 @@ noTopic=Bu oda için hiçbir konu mesajı yok. # LOCALIZATION NOTE (topicSet): # %1$S is the conversation name, %2$S is the topic. -topicSet=The topic for %1$S is: %2$S. +topicSet=%1$S için konu: %2$S. # LOCALIZATION NOTE (topicNotSet): # %S is the conversation name. -topicNotSet=There is no topic for %S. +topicNotSet=%S için konu yok. # LOCALIZATION NOTE (topicChanged): # %1$S is the user who changed the topic, %2$S is the new topic. -topicChanged=%1$S has changed the topic to: %2$S. +topicChanged=%1$S konuyu deÄiÅtirdi: %2$S # LOCALIZATION NOTE (topicCleared): # %1$S is the user who cleared the topic. -topicCleared=%1$S has cleared the topic. +topicCleared=%1$S konuyu temizledi. # LOCALIZATION NOTE (nickSet): # This is displayed as a system message when a participant changes his/her # nickname in a conversation. # %1$S is the old nick. # %2$S is the new nick. -nickSet=%1$S is now known as %2$S. +nickSet=%1$S Åimdi %2$S olarak biliniyor. # LOCALIZATION NOTE (nickSet.you): # This is displayed as a system message when your nickname is changed. # %S is your new nick. -nickSet.you=You are now known as %S. +nickSet.you=Artık %S olarak biliniyorsunuz. # LOCALIZATION NOTE (messenger.conversations.selections.ellipsis): # ellipsis is used when copying a part of a message to show that the message was cut ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor-messenger-conversationsproperties_completed] Update translations for tor-messenger-conversationsproperties_completed
commit 130d188ad5373b248fbc34aed63f71b3a7d555d6 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 14:16:32 2015 + Update translations for tor-messenger-conversationsproperties_completed --- tr/conversations.properties | 80 +++ 1 file changed, 80 insertions(+) diff --git a/tr/conversations.properties b/tr/conversations.properties new file mode 100644 index 000..ed279ba --- /dev/null +++ b/tr/conversations.properties @@ -0,0 +1,80 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +# LOCALIZATION NOTE (targetChanged): +# %1$S is the new conversation title (display name of the new target), +# %2$S is the protocol name used for the new target. +targetChanged=Sohbet %2$S kullanarak %1$S ile devam edecek. + +# LOCALIZATION NOTE (statusChanged): +# %1$S is the display name of the contact. +# %2$S is the new status type (a value from status.properties). +statusChanged=%1$S Åimdi %2$S. +# LOCALIZATION NOTE (statusChangedWithStatusText): +# %1$S is the display name of the contact. +# %2$S is the new status type (a value from status.properties). +# %3$S is the status text (eg. I'm currently away from the computer). +statusChangedWithStatusText=%1$S Åimdi %2$S: %3$S. +# LOCALIZATION NOTE (statusChangedFromUnknown[WithStatusText]): +# special case of the previous 2 strings for when the status was +# previously unknown. These 2 strings should not mislead the user +# into thinking the person's status has just changed. +statusChangedFromUnknown=%1$S %2$S oldu. +statusChangedFromUnknownWithStatusText=%1$S, %2$S: %3$S oldu. +# LOCALIZATION NOTE (statusKnown[WithStatusText]): +# special case of the previous 2 strings for when an account has just +# been reconnected, so the status is now known. These 2 strings should not +# mislead the user into thinking the person's status has just changed. +statusKnown=Hesabınız yeniden baÄlandı (%1$S, %2$S oldu). +statusKnownWithStatusText=Hesabınız yeniden baÄlandı (%1$S, %2$S: %3$S oldu). +# LOCALIZATION NOTE (statusUnknown): +# %S is the display name of the contact. +statusUnknown=Hesabınızın baÄlantısı kesildi (%S durumu artık bilinmiyor). + +accountDisconnected=Hesabınızın baÄlantısı kesildi. +accountReconnected=Hesabınız yeniden baÄlandı. + +# LOCALIZATION NOTE (autoReply): +# %S is replaced by the text of a message that was sent as an automatic reply. +autoReply=Otomatik cevap - %S + +# LOCALIZATION NOTE (noTopic): +# Displayed instead of the topic when no topic is set. +noTopic=Bu oda için hiçbir konu mesajı yok. + +# LOCALIZATION NOTE (topicSet): +# %1$S is the conversation name, %2$S is the topic. +topicSet=%1$S için konu: %2$S. +# LOCALIZATION NOTE (topicNotSet): +# %S is the conversation name. +topicNotSet=%S için konu yok. +# LOCALIZATION NOTE (topicChanged): +# %1$S is the user who changed the topic, %2$S is the new topic. +topicChanged=%1$S konuyu deÄiÅtirdi: %2$S +# LOCALIZATION NOTE (topicCleared): +# %1$S is the user who cleared the topic. +topicCleared=%1$S konuyu temizledi. + +# LOCALIZATION NOTE (nickSet): +# This is displayed as a system message when a participant changes his/her +# nickname in a conversation. +# %1$S is the old nick. +# %2$S is the new nick. +nickSet=%1$S Åimdi %2$S olarak biliniyor. +# LOCALIZATION NOTE (nickSet.you): +# This is displayed as a system message when your nickname is changed. +# %S is your new nick. +nickSet.you=Artık %S olarak biliniyorsunuz. + +# LOCALIZATION NOTE (messenger.conversations.selections.ellipsis): +# ellipsis is used when copying a part of a message to show that the message was cut +messenger.conversations.selections.ellipsis=[â¦] + +# LOCALIZATION NOTE (messenger.conversations.selections.{system,content,action}MessagesTemplate): +# These 3 templates are used to format selected messages before copying them. +# Do not translate the texts between % characters, but feel free to adjust +# whitespace and separators to make them fit your locale. +messenger.conversations.selections.systemMessagesTemplate=%time% - %message% +messenger.conversations.selections.contentMessagesTemplate=%time% - %sender%: %message% +messenger.conversations.selections.actionMessagesTemplate=%time% * %sender% %message% ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/bridgedb] Update translations for bridgedb
commit e5785c63a2f380def5ed9051efc0e02c190f6989 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 14:15:03 2015 + Update translations for bridgedb --- pt_BR/LC_MESSAGES/bridgedb.po |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt_BR/LC_MESSAGES/bridgedb.po b/pt_BR/LC_MESSAGES/bridgedb.po index 570f2e2..0157f31 100644 --- a/pt_BR/LC_MESSAGES/bridgedb.po +++ b/pt_BR/LC_MESSAGES/bridgedb.po @@ -14,7 +14,7 @@ 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-07-25 13:18+\n +PO-Revision-Date: 2015-07-25 13:49+\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-persistence-setup_completed] Update translations for tails-persistence-setup_completed
commit dbb1d43072ecacbcd299ce4faf473962a34bc89e Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 14:15:30 2015 + Update translations for tails-persistence-setup_completed --- tr/tr.po |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tr/tr.po b/tr/tr.po index 598166c..36d723b 100644 --- a/tr/tr.po +++ b/tr/tr.po @@ -11,8 +11,8 @@ msgid msgstr Project-Id-Version: The Tor Project\n Report-Msgid-Bugs-To: Tails developers ta...@boum.org\n -POT-Creation-Date: 2015-02-23 13:07+0100\n -PO-Revision-Date: 2015-02-24 23:27+\n +POT-Creation-Date: 2015-05-02 21:08+0200\n +PO-Revision-Date: 2015-07-25 14:01+\n Last-Translator: Volkan Gezer volkange...@gmail.com\n Language-Team: Turkish (http://www.transifex.com/projects/p/torproject/language/tr/)\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-persistence-setup] Update translations for tails-persistence-setup
commit 98c3ec86f1c34426b13dacac0eaaea4e15207809 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 14:15:27 2015 + Update translations for tails-persistence-setup --- tr/tr.po |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tr/tr.po b/tr/tr.po index 598166c..36d723b 100644 --- a/tr/tr.po +++ b/tr/tr.po @@ -11,8 +11,8 @@ msgid msgstr Project-Id-Version: The Tor Project\n Report-Msgid-Bugs-To: Tails developers ta...@boum.org\n -POT-Creation-Date: 2015-02-23 13:07+0100\n -PO-Revision-Date: 2015-02-24 23:27+\n +POT-Creation-Date: 2015-05-02 21:08+0200\n +PO-Revision-Date: 2015-07-25 14:01+\n Last-Translator: Volkan Gezer volkange...@gmail.com\n Language-Team: Turkish (http://www.transifex.com/projects/p/torproject/language/tr/)\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/torbutton-torbuttondtd] Update translations for torbutton-torbuttondtd
commit bf491572a2ebd4313799d9c0edaebd379cce0f21 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 14:16:02 2015 + Update translations for torbutton-torbuttondtd --- pt_BR/torbutton.dtd |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pt_BR/torbutton.dtd b/pt_BR/torbutton.dtd index 7db22a7..d46d421 100644 --- a/pt_BR/torbutton.dtd +++ b/pt_BR/torbutton.dtd @@ -34,7 +34,7 @@ !ENTITY torbutton.context_menu.about.key A !ENTITY torbutton.context_menu.networksettings Configurações da Rede Tor... !ENTITY torbutton.context_menu.networksettings.key S -!ENTITY torbutton.context_menu.downloadUpdate Checar por atualizações do Navegador Tor... +!ENTITY torbutton.context_menu.downloadUpdate Procurar por atualizações do Navegador Tor... !ENTITY torbutton.context_menu.downloadUpdate.key U !ENTITY torbutton.context_menu.cookieProtections Proteção contra Cookies... !ENTITY torbutton.context_menu.cookieProtections.key C ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor-messenger-otrproperties] Update translations for tor-messenger-otrproperties
commit e40dd350208bb403d6d1a1f5ed70a3d4d501a953 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 16:16:27 2015 + Update translations for tor-messenger-otrproperties --- tr/otr.properties | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tr/otr.properties b/tr/otr.properties index 49361ff..b85f0c6 100644 --- a/tr/otr.properties +++ b/tr/otr.properties @@ -1,13 +1,13 @@ msgevent.encryption_required_part1=ÅifrelenmemiÅ bir mesajı %S kullanıcısına göndermeye çalıÅtınız. Politika gereÄi ÅifrelenmemiÅ mesajlara izin verilmez. -msgevent.encryption_required_part2=Attempting to start a private conversation. Your message will be retransmitted when the private conversation starts. -msgevent.encryption_error=An error occurred when encrypting your message. The message was not sent. -msgevent.connection_ended=%S has already closed their private connection to you. Your message was not sent. Either end your private conversation, or restart it. -msgevent.setup_error=An error occured while setting up a private conversation with %S. -msgevent.msg_reflected=You are receiving your own OTR messages. You are either trying to talk to yourself, or someone is reflecting your messages back at you. -msgevent.msg_resent=The last message to %S was resent. -msgevent.rcvdmsg_not_private=The encrypted message received from %S is unreadable, as you are not currently communicating privately. -msgevent.rcvdmsg_unreadable=We received an unreadable encrypted message from %S. -msgevent.rcvdmsg_malformed=We received a malformed data message from %S. +msgevent.encryption_required_part2=Ãzel sohbet baÅlatmak için giriÅimde bulunuluyor. Ãzel sohbet baÅladıÄında mesajınız yeniden iletilecek. +msgevent.encryption_error=Mesajınızı Åifrelerken bir hata oluÅtu. Mesaj gönderilmedi. +msgevent.connection_ended=%S özel baÄlantısını artık size kapattı. Mesajınız gönderilmedi. Ãzel sohbetinizi bitirin veya yeniden baÅlatın. +msgevent.setup_error=%S ile özel sohbet kurulurken bir hata meydana geldi. +msgevent.msg_reflected=Kendi OTR mesajlarınızı alıyorsunuz. Ya kendiniz ile konuÅmaya çalıÅıyorsunuz ya da bir baÅkası mesajlarınızı size geri yansıtıyor. +msgevent.msg_resent=%S için olan son mesaj yeniden gönderildi. +msgevent.rcvdmsg_not_private=Åu an özel iletiÅim kurmadıÄınız üzere, %S kullanıcısından alınan ÅifrelenmiÅ mesaj okunamaz. +msgevent.rcvdmsg_unreadable=%S kullanıcısından okunamayan bir ÅifrelenmiÅ mesaj aldık. +msgevent.rcvdmsg_malformed=%S kullanıcısından hatalı biçimlendirilmiÅ bir veri mesajı aldık. msgevent.log_heartbeat_rcvd=Heartbeat received from %S. msgevent.log_heartbeat_sent=Heartbeat sent to %S. msgevent.rcvdmsg_general_err=An OTR error occured. @@ -24,8 +24,8 @@ error.malformed=You transmitted a malformed data message. resent=[resent] tlv.disconnected=%S sizinle gizli konuÅmayı sonlandırdı, siz de aynısını yapmalısınız. query.msg=%S has requested an Off-the Record private conversation. However, you do not have a plugin to support that. See http://otr.cypherpunks.ca/ for more information. -trust.unused=Unused -trust.not_private=Not Private -trust.unverified=Unverified +trust.unused=Kullanılmayan +trust.not_private=Ãzel Olmayan +trust.unverified=OnaylanmamıŠtrust.private=Private trust.finished=Finished ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor-messenger-conversationsproperties] Update translations for tor-messenger-conversationsproperties
commit cfccb9d52fe58d758ec5c65eaa9ffdcebb34c918 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 15:16:14 2015 + Update translations for tor-messenger-conversationsproperties --- de/conversations.properties |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/de/conversations.properties b/de/conversations.properties index b5175b0..e282790 100644 --- a/de/conversations.properties +++ b/de/conversations.properties @@ -61,11 +61,11 @@ topicCleared=%1$S hat das Thema geleert. # nickname in a conversation. # %1$S is the old nick. # %2$S is the new nick. -nickSet=%1$S is now known as %2$S. +nickSet=%1$S ist nun bekannt als %2$S. # LOCALIZATION NOTE (nickSet.you): # This is displayed as a system message when your nickname is changed. # %S is your new nick. -nickSet.you=You are now known as %S. +nickSet.you=Sie sind nun bekannt als %S. # LOCALIZATION NOTE (messenger.conversations.selections.ellipsis): # ellipsis is used when copying a part of a message to show that the message was cut ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor-messenger-conversationsproperties_completed] Update translations for tor-messenger-conversationsproperties_completed
commit 976a60bbeb9d26a109ea6975fe6a06d1b61468a4 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 15:16:18 2015 + Update translations for tor-messenger-conversationsproperties_completed --- de/conversations.properties | 11 +++ 1 file changed, 11 insertions(+) diff --git a/de/conversations.properties b/de/conversations.properties index 313e6ab..e282790 100644 --- a/de/conversations.properties +++ b/de/conversations.properties @@ -56,6 +56,17 @@ topicChanged=%1$S hat das Thema geändert auf: %2$S. # %1$S is the user who cleared the topic. topicCleared=%1$S hat das Thema geleert. +# LOCALIZATION NOTE (nickSet): +# This is displayed as a system message when a participant changes his/her +# nickname in a conversation. +# %1$S is the old nick. +# %2$S is the new nick. +nickSet=%1$S ist nun bekannt als %2$S. +# LOCALIZATION NOTE (nickSet.you): +# This is displayed as a system message when your nickname is changed. +# %S is your new nick. +nickSet.you=Sie sind nun bekannt als %S. + # LOCALIZATION NOTE (messenger.conversations.selections.ellipsis): # ellipsis is used when copying a part of a message to show that the message was cut messenger.conversations.selections.ellipsis=[â¦] ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor-messenger-otrproperties] Update translations for tor-messenger-otrproperties
commit d0f3fd3ac721baf47ca2f4ae21ff42f34fa85057 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 15:16:32 2015 + Update translations for tor-messenger-otrproperties --- tr/otr.properties |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tr/otr.properties b/tr/otr.properties index dea88ec..49361ff 100644 --- a/tr/otr.properties +++ b/tr/otr.properties @@ -1,4 +1,4 @@ -msgevent.encryption_required_part1=You attempted to send an unencrypted message to %S. As a policy, unencrypted messages are not allowed. +msgevent.encryption_required_part1=ÅifrelenmemiÅ bir mesajı %S kullanıcısına göndermeye çalıÅtınız. Politika gereÄi ÅifrelenmemiÅ mesajlara izin verilmez. msgevent.encryption_required_part2=Attempting to start a private conversation. Your message will be retransmitted when the private conversation starts. msgevent.encryption_error=An error occurred when encrypting your message. The message was not sent. msgevent.connection_ended=%S has already closed their private connection to you. Your message was not sent. Either end your private conversation, or restart it. ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor-messenger-otrproperties] Update translations for tor-messenger-otrproperties
commit bb9950cbf19bd6a6328404c4245d70c71e7098c6 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 17:16:27 2015 + Update translations for tor-messenger-otrproperties --- tr/otr.properties | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tr/otr.properties b/tr/otr.properties index 8742d80..0025295 100644 --- a/tr/otr.properties +++ b/tr/otr.properties @@ -8,8 +8,8 @@ msgevent.msg_resent=%S için olan son mesaj yeniden gönderildi. msgevent.rcvdmsg_not_private=Åu an özel iletiÅim kurmadıÄınız üzere, %S kullanıcısından alınan ÅifrelenmiÅ mesaj okunamaz. msgevent.rcvdmsg_unreadable=%S kullanıcısından okunamayan bir ÅifrelenmiÅ mesaj aldık. msgevent.rcvdmsg_malformed=%S kullanıcısından hatalı biçimlendirilmiÅ bir veri mesajı aldık. -msgevent.log_heartbeat_rcvd=Heartbeat received from %S. -msgevent.log_heartbeat_sent=Heartbeat sent to %S. +msgevent.log_heartbeat_rcvd=%S kullanıcısından kalp atıÅı alındı. +msgevent.log_heartbeat_sent=%S kullanıcısına kalp atıÅı gönderildi. msgevent.rcvdmsg_general_err=Bir OTR hatası meydana geldi. msgevent.rcvdmsg_unecrypted=%S kullanıcısından ÅifrelenmemiÅ bir mesaj aldık. msgevent.rcvdmsg_unrecognized=%S kullanıcısından tanınmayan bir OTR mesajı aldık. @@ -18,12 +18,12 @@ context.gone_secure_private=%S ile özel sohbet baÅladı. context.gone_secure_unverified=%S ile özel görüÅme baÅladı. Ancak, kimliÄi doÄrulanmadı. context.still_secure=%S ile olan özel sohbet baÅarıyla yenilendi. error.enc=Åifreleme sırasında hata oluÅtu. -error.not_priv=You sent encrypted data to %S, who wasn't expecting it. -error.unreadable=You transmitted an unreadable encrypted message. -error.malformed=You transmitted a malformed data message. +error.not_priv=%S kullanıcısına böyle bir beklentisi olmamasına raÄmen ÅifrelenmiÅ veri gönderdiniz. +error.unreadable=Bir okunamaz Åifreli mesaj ilettiniz. +error.malformed=YanlıŠbiçimlendirilmiÅ bir veri mesajı gönderdiniz. resent=[resent] tlv.disconnected=%S sizinle gizli konuÅmayı sonlandırdı, siz de aynısını yapmalısınız. -query.msg=%S has requested an Off-the Record private conversation. However, you do not have a plugin to support that. See http://otr.cypherpunks.ca/ for more information. +query.msg=%S kayıt dıÅı özel sohbet talep etti. Ancak, bunu desteklemek için bir eklentiye sahip deÄilsiniz. Daha fazla bilgi için bakınız: http://otr.cypherpunks.ca/. trust.unused=Kullanılmayan trust.not_private=Ãzel Olmayan trust.unverified=OnaylanmamıŠ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [translation/tor-messenger-otrproperties_completed] Update translations for tor-messenger-otrproperties_completed
commit 47788b80d25aa286b9469907d1f632c86a04562c Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 17:16:31 2015 + Update translations for tor-messenger-otrproperties_completed --- tr/otr.properties | 31 +++ 1 file changed, 31 insertions(+) diff --git a/tr/otr.properties b/tr/otr.properties new file mode 100644 index 000..0025295 --- /dev/null +++ b/tr/otr.properties @@ -0,0 +1,31 @@ +msgevent.encryption_required_part1=ÅifrelenmemiÅ bir mesajı %S kullanıcısına göndermeye çalıÅtınız. Politika gereÄi ÅifrelenmemiÅ mesajlara izin verilmez. +msgevent.encryption_required_part2=Ãzel sohbet baÅlatmak için giriÅimde bulunuluyor. Ãzel sohbet baÅladıÄında mesajınız yeniden iletilecek. +msgevent.encryption_error=Mesajınızı Åifrelerken bir hata oluÅtu. Mesaj gönderilmedi. +msgevent.connection_ended=%S özel baÄlantısını artık size kapattı. Mesajınız gönderilmedi. Ãzel sohbetinizi bitirin veya yeniden baÅlatın. +msgevent.setup_error=%S ile özel sohbet kurulurken bir hata meydana geldi. +msgevent.msg_reflected=Kendi OTR mesajlarınızı alıyorsunuz. Ya kendiniz ile konuÅmaya çalıÅıyorsunuz ya da bir baÅkası mesajlarınızı size geri yansıtıyor. +msgevent.msg_resent=%S için olan son mesaj yeniden gönderildi. +msgevent.rcvdmsg_not_private=Åu an özel iletiÅim kurmadıÄınız üzere, %S kullanıcısından alınan ÅifrelenmiÅ mesaj okunamaz. +msgevent.rcvdmsg_unreadable=%S kullanıcısından okunamayan bir ÅifrelenmiÅ mesaj aldık. +msgevent.rcvdmsg_malformed=%S kullanıcısından hatalı biçimlendirilmiÅ bir veri mesajı aldık. +msgevent.log_heartbeat_rcvd=%S kullanıcısından kalp atıÅı alındı. +msgevent.log_heartbeat_sent=%S kullanıcısına kalp atıÅı gönderildi. +msgevent.rcvdmsg_general_err=Bir OTR hatası meydana geldi. +msgevent.rcvdmsg_unecrypted=%S kullanıcısından ÅifrelenmemiÅ bir mesaj aldık. +msgevent.rcvdmsg_unrecognized=%S kullanıcısından tanınmayan bir OTR mesajı aldık. +msgevent.rcvdmsg_for_other_instance=%S farklı bir oturuma yönelik bir mesaj gönderdi. EÄer birden çok kez oturum açtıysanız, baÅka oturum mesajı almıŠolabilir. +context.gone_secure_private=%S ile özel sohbet baÅladı. +context.gone_secure_unverified=%S ile özel görüÅme baÅladı. Ancak, kimliÄi doÄrulanmadı. +context.still_secure=%S ile olan özel sohbet baÅarıyla yenilendi. +error.enc=Åifreleme sırasında hata oluÅtu. +error.not_priv=%S kullanıcısına böyle bir beklentisi olmamasına raÄmen ÅifrelenmiÅ veri gönderdiniz. +error.unreadable=Bir okunamaz Åifreli mesaj ilettiniz. +error.malformed=YanlıŠbiçimlendirilmiÅ bir veri mesajı gönderdiniz. +resent=[resent] +tlv.disconnected=%S sizinle gizli konuÅmayı sonlandırdı, siz de aynısını yapmalısınız. +query.msg=%S kayıt dıÅı özel sohbet talep etti. Ancak, bunu desteklemek için bir eklentiye sahip deÄilsiniz. Daha fazla bilgi için bakınız: http://otr.cypherpunks.ca/. +trust.unused=Kullanılmayan +trust.not_private=Ãzel Olmayan +trust.unverified=OnaylanmamıŠ+trust.private=Ãzel +trust.finished=Biten ___ 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 4265ea0b9ce45e1a40bf7f40e48194a91f9d1403 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 14:45:23 2015 + Update translations for tails-greeter --- tr/tr.po |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tr/tr.po b/tr/tr.po index 118e661..a99a9ff 100644 --- a/tr/tr.po +++ b/tr/tr.po @@ -13,8 +13,8 @@ msgid 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-20 14:58+\n +POT-Creation-Date: 2015-06-28 19:25+0200\n +PO-Revision-Date: 2015-07-25 14:37+\n Last-Translator: Bullgeschichte bullgeschic...@riseup.net\n Language-Team: Turkish (http://www.transifex.com/projects/p/torproject/language/tr/)\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_completed] Update translations for tails-greeter_completed
commit cf7198c11fe6df33977d3ab6dfce76ba1e547647 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 14:45:26 2015 + Update translations for tails-greeter_completed --- tr/tr.po |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tr/tr.po b/tr/tr.po index 118e661..a99a9ff 100644 --- a/tr/tr.po +++ b/tr/tr.po @@ -13,8 +13,8 @@ msgid 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-20 14:58+\n +POT-Creation-Date: 2015-06-28 19:25+0200\n +PO-Revision-Date: 2015-07-25 14:37+\n Last-Translator: Bullgeschichte bullgeschic...@riseup.net\n Language-Team: Turkish (http://www.transifex.com/projects/p/torproject/language/tr/)\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/tor-messenger-privproperties_completed] Update translations for tor-messenger-privproperties_completed
commit 3a34e86685004e993ee4ddda95eb17cde68e7952 Author: Translation commit bot translat...@torproject.org Date: Sat Jul 25 22:46:33 2015 + Update translations for tor-messenger-privproperties_completed --- bg/priv.properties |1 + 1 file changed, 1 insertion(+) diff --git a/bg/priv.properties b/bg/priv.properties new file mode 100644 index 000..c7070ee --- /dev/null +++ b/bg/priv.properties @@ -0,0 +1 @@ +priv.account=СÑздаване на лиÑен клÑÑ Ð·Ð° %S (%S) ... ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[bridgedb/master] Remove most splitters — they're just crappy consistent hashrings.
commit d83438d24104c5834cd0230a757b17a8e1941edb Author: Isis Lovecruft i...@torproject.org Date: Tue Apr 14 09:23:40 2015 + Remove most splittersâââthey're just crappy consistent hashrings. --- lib/bridgedb/Bridges.py |2 +- lib/bridgedb/Dist.py | 60 ++-- lib/bridgedb/Main.py | 66 +++--- lib/bridgedb/test/legacy_Tests.py |4 +- lib/bridgedb/test/test_Main.py| 80 ++--- lib/bridgedb/test/test_bridges.py | 24 +-- 6 files changed, 118 insertions(+), 118 deletions(-) diff --git a/lib/bridgedb/Bridges.py b/lib/bridgedb/Bridges.py index c727c9a..b06ffc4 100644 --- a/lib/bridgedb/Bridges.py +++ b/lib/bridgedb/Bridges.py @@ -569,7 +569,7 @@ class FilteredBridgeSplitter(BridgeHolder): return index = 0 -logging.debug(Inserting %s into splitter +logging.debug(Inserting %s into hashring % (logSafely(bridge.fingerprint))) for old_bridge in self.bridges[:]: if bridge.fingerprint == old_bridge.fingerprint: diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index 445d2d8..44cb526 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -81,14 +81,14 @@ class Distributor(object): ipDist = Dist.IPBasedDistributor(5, 'fake-hmac-key') ipDist.setDistributorName('HTTPS Distributor') ipDist.prepopulateRings() - hashrings = ipDist.splitter.filterRings + hashrings = ipDist.hashring.filterRings firstSubring = hashrings.items()[0][1][1] assert firstSubring.name :param str name: A name for this distributor. self.name = name -self.splitter.distributorName = name +self.hashring.distributorName = name class IPBasedDistributor(Distributor): @@ -98,8 +98,8 @@ class IPBasedDistributor(Distributor): :type proxies: :class:`~bridgedb.proxies.ProxySet` :ivar proxies: All known proxies, which we treat differently. See :param:`proxies`. -:type splitter: :class:`bridgedb.Bridges.FixedBridgeSplitter` -:ivar splitter: A hashring that assigns bridges to subrings with fixed +:type hashring: :class:`bridgedb.Bridges.FixedBridgeSplitter` +:ivar hashring: A hashring that assigns bridges to subrings with fixed proportions. Used to assign bridges into the subrings of this distributor. @@ -150,9 +150,9 @@ class IPBasedDistributor(Distributor): self._clientToPositionHMAC = getHMACFunc(key3, hex=False) self._subnetToSubringHMAC = getHMACFunc(key4, hex=True) -self.splitter = FilteredBridgeSplitter(key2, self.ringCacheSize) +self.hashring = FilteredBridgeSplitter(key2, self.ringCacheSize) logging.debug(Added %s to HTTPS distributor. % - self.splitter.__class__.__name__) + self.hashring.__class__.__name__) self.setDistributorName('HTTPS') @@ -311,16 +311,16 @@ class IPBasedDistributor(Distributor): # distributor's proxies: if subring == self.proxySubring: ring.setName('{0} Proxy Ring'.format(self.name)) -self.splitter.addRing(ring, filters, +self.hashring.addRing(ring, filters, filterBridgesByRules(filters), - populate_from=self.splitter.bridges) + populate_from=self.hashring.bridges) def insert(self, bridge): Assign a bridge to this distributor. -self.splitter.insert(bridge) +self.hashring.insert(bridge) def _buildHashringFilters(self, previousFilters, subring): -f = filterAssignBridgesToRing(self.splitter.hmac, self.totalSubrings, subring) +f = filterAssignBridgesToRing(self.hashring.hmac, self.totalSubrings, subring) previousFilters.append(f) return frozenset(previousFilters) @@ -343,8 +343,8 @@ class IPBasedDistributor(Distributor): logging.info(Attempting to return %d bridges to client %s... % (N, bridgeRequest.client)) -if not len(self.splitter): -logging.warn(Bailing! Splitter has zero bridges!) +if not len(self.hashring): +logging.warn(Bailing! Hashring has zero bridges!) return [] usingProxy = False @@ -373,16 +373,16 @@ class IPBasedDistributor(Distributor): logging.debug(Bridge filters: %s % ' '.join([x.func_name for x in filters])) # Check wheth we have a cached copy of the hashring: -if filters in self.splitter.filterRings.keys(): +if filters in self.hashring.filterRings.keys(): logging.debug(Cache hit %s % filters) -_, ring = self.splitter.filterRings[filters] +_, ring =
[tor-commits] [bridgedb/master] Refactor getBridgesForEmail() to use EmailBridgeRequests.
commit 7c339c18cd3f190521369d5047bbd7ccf369 Author: Isis Lovecruft i...@torproject.org Date: Wed Apr 1 05:54:53 2015 + Refactor getBridgesForEmail() to use EmailBridgeRequests. * RENAME b.D.EmailBasedDistributor.getBridgesForEmail() â b.D.EmailBasedDistributor.getBridges(). * CHANGE b.D.EmailBasedDistributor.getBridges() to use bridgedb.email.request.EmailBridgeRequest. --- lib/bridgedb/Dist.py| 60 --- lib/bridgedb/email/autoresponder.py | 16 -- lib/bridgedb/test/email_helpers.py | 24 +++--- lib/bridgedb/test/legacy_Tests.py |6 ++-- 4 files changed, 48 insertions(+), 58 deletions(-) diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index 39e70be..26e952e 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -473,65 +473,63 @@ class EmailBasedDistributor(Distributor): Assign a bridge to this distributor. self.splitter.insert(bridge) -def getBridgesForEmail(self, emailaddress, epoch, N=1, parameters=None, - countryCode=None, bridgeFilterRules=None): +def getBridges(self, bridgeRequest, epoch, N=1): Return a list of bridges to give to a user. -:param str emailaddress: The user's email address, as given in a -:header:`From:` line. +:type bridgeRequest: :class:`~bridgedb.email.request.EmailBridgeRequest` +:param bridgeRequest: A :class:`~bridgedb.bridgerequest.BridgeRequestBase` +with the :data:`~bridgedb.bridgerequest.BridgeRequestBase.client` +attribute set to a string containing the client's full, canonicalized +email address. :param epoch: The time period when we got this request. This can be any string, so long as it changes with every period. :param int N: The number of bridges to try to give back. -:param parameters: DOCDOC -:param countryCode: DOCDOC -:param bridgeFilterRules: DOCDOC -if not bridgeFilterRules: -bridgeFilterRules=[] -now = time.time() - # All checks on the email address, such as checks for whitelisting and # canonicalization of domain name, are done in # :meth:`bridgedb.email.autoresponder.getMailTo` and # :meth:`bridgedb.email.autoresponder.SMTPAutoresponder.runChecks`. -if not emailaddress: -logging.error((%s distributor can't get bridges for blank email - address!) % (self.name, emailaddress)) -return [] +if (not bridgeRequest.client) or (bridgeRequest.client == 'default'): +raise addr.BadEmail( +(%s distributor can't get bridges for invalid email email + address: %s) % (self.name, bridgeRequest.client)) + +now = time.time() with bridgedb.Storage.getDB() as db: -wasWarned = db.getWarnedEmail(emailaddress) -lastSaw = db.getEmailTime(emailaddress) +wasWarned = db.getWarnedEmail(bridgeRequest.client) +lastSaw = db.getEmailTime(bridgeRequest.client) logging.info(Attempting to return for %d bridges for %s... - % (N, emailaddress)) + % (N, bridgeRequest.client)) if lastSaw is not None: -if emailaddress in self.whitelist.keys(): +if bridgeRequest.client in self.whitelist.keys(): logging.info((Whitelisted email address %s was last seen %d seconds ago.) - % (emailaddress, now - lastSaw)) + % (bridgeRequest.client, now - lastSaw)) elif (lastSaw + MAX_EMAIL_RATE) = now: wait = (lastSaw + MAX_EMAIL_RATE) - now logging.info(Client %s must wait another %d seconds. - % (emailaddress, wait)) + % (bridgeRequest.client, wait)) if wasWarned: -raise IgnoreEmail(Client was warned., emailaddress) +raise IgnoreEmail(Client was warned., + bridgeRequest.client) else: logging.info(Sending duplicate request warning.) -db.setWarnedEmail(emailaddress, True, now) +db.setWarnedEmail(bridgeRequest.client, True, now) db.commit() raise TooSoonEmail(Must wait %d seconds % wait, - emailaddress) + bridgeRequest.client) # warning period is over elif wasWarned: -db.setWarnedEmail(emailaddress, False) +
[tor-commits] [bridgedb/master] Remove IPBasedDistributor.rings.
commit 809f447f3c8a7e0023a399de469b77a8b4c2735f Author: Isis Lovecruft i...@torproject.org Date: Tue Apr 14 07:25:45 2015 + Remove IPBasedDistributor.rings. It was never used. --- lib/bridgedb/Dist.py |5 - 1 file changed, 5 deletions(-) diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index 082f002..c9d82c1 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -95,10 +95,6 @@ class IPBasedDistributor(Distributor): A Distributor that hands out bridges based on the IP address of an incoming request and the current time period. -:ivar list rings: A list of :class:`bridgedb.Bridges.BridgeHolder` -hashrings, one for each area in the ``areaMapper``. Every inserted -bridge will go into one of these rings, and every area is associated -with one. :type proxies: :class:`~bridgedb.proxies.ProxySet` :ivar proxies: All known proxies, which we treat differently. See :param:`proxies`. @@ -133,7 +129,6 @@ class IPBasedDistributor(Distributor): parameters, i.e. that an answer has at least two obfsproxy bridges or at least one bridge on port 443, etc. -self.rings = [] self.answerParameters = answerParameters self.numberOfClusters = numberOfClusters ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Make subhashring cache size relative to numberOfClusters.
commit 397cc7d316a618bcadfca6663f318d3b798f4405 Author: Isis Lovecruft i...@torproject.org Date: Sat Apr 11 02:53:20 2015 + Make subhashring cache size relative to numberOfClusters. * RENAME ring_cache_size â IPBasedDistributor.ringCacheSize. * CHANGE IPBasedDistributor.ringCacheSize to be relative to the total number of clusters, rather than equal to the total number of clusters plus five. --- lib/bridgedb/Dist.py | 19 +++ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index 129bc7c..1a01543 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -21,6 +21,7 @@ import bridgedb.Bridges import bridgedb.Storage from bridgedb import proxy +from bridgedb.Bridges import FilteredBridgeSplitter from bridgedb.crypto import getHMAC from bridgedb.crypto import getHMACFunc from bridgedb.Filters import filterAssignBridgesToRing @@ -193,23 +194,17 @@ class IPBasedDistributor(Distributor): self.proxies = proxy.ProxySet() self.proxyCluster = 0 +self.ringCacheSize = self.numberOfClusters * 3 key2 = getHMAC(key, Assign-Bridges-To-Rings) key3 = getHMAC(key, Order-Areas-In-Rings) -self.areaOrderHmac = getHMACFunc(key3, hex=False) key4 = getHMAC(key, Assign-Areas-To-Rings) -self.areaClusterHmac = getHMACFunc(key4, hex=True) -# add splitter and cache the default rings -# plus leave room for dynamic filters -# -# XXX Why is the extra room hardcoded to be 5? Shouldn't it be some -# fraction of the number of clusters/categories? --isis -ring_cache_size = self.numberOfClusters + 5 -self.splitter = bridgedb.Bridges.FilteredBridgeSplitter( -key2, max_cached_rings=ring_cache_size) -logging.debug(Added splitter %s to IPBasedDistributor. - % self.splitter.__class__) +self.areaOrderHmac = getHMACFunc(key3, hex=False) +self.areaClusterHmac = getHMACFunc(key4, hex=True) +self.splitter = FilteredBridgeSplitter(key2, self.ringCacheSize) +logging.debug(Added %s to HTTPS distributor. % + self.splitter.__class__.__name__) self.setDistributorName('HTTPS') ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[bridgedb/master] Rename ipCategories → proxySets.
commit 423f75d309abe304297cad2449e9a210347877da Author: Isis Lovecruft i...@torproject.org Date: Fri Apr 10 07:37:24 2015 + Rename ipCategories â proxySets. --- lib/bridgedb/Dist.py | 16 lib/bridgedb/test/test_HTTPServer.py |4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index f9f61de..2f63574 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -134,7 +134,7 @@ class IPBasedDistributor(Distributor): hashrings, one for each area in the ``areaMapper``. Every inserted bridge will go into one of these rings, and every area is associated with one. -:ivar categories: DOCDOC See :param:`ipCategories`. +:ivar categories: DOCDOC See :param:`proxySets`. :type splitter: :class:`bridgedb.Bridges.FixedBridgeSplitter` :ivar splitter: A hashring that assigns bridges to subrings with fixed proportions. Used to assign bridges into the subrings of this @@ -142,7 +142,7 @@ class IPBasedDistributor(Distributor): def __init__(self, areaMapper, numberOfClusters, key, - ipCategories=None, answerParameters=None): + proxySets=None, answerParameters=None): Create a Distributor that decides which bridges to distribute based upon the client's IP address and the current time. @@ -160,8 +160,8 @@ class IPBasedDistributor(Distributor): :param bytes key: The master HMAC key for this distributor. All added bridges are HMACed with this key in order to place them into the hashrings. -:type ipCategories: iterable or None -:param ipCategories: DOCDOC +:type proxySets: iterable or None +:param proxySets: DOCDOC :type answerParameters: :class:`bridgedb.Bridges.BridgeRingParameters` :param answerParameters: A mechanism for ensuring that the set of bridges that this distributor answers a client with fit certain @@ -172,14 +172,14 @@ class IPBasedDistributor(Distributor): self.numberOfClusters = numberOfClusters self.answerParameters = answerParameters -if not ipCategories: -ipCategories = [] +if not proxySets: +proxySets = [] if not answerParameters: answerParameters = [] self.rings = [] self.categories = [] -for c in ipCategories: +for c in proxySets: self.categories.append(c) key2 = getHMAC(key, Assign-Bridges-To-Rings) @@ -193,7 +193,7 @@ class IPBasedDistributor(Distributor): # # XXX Why is the extra room hardcoded to be 5? Shouldn't it be some # fraction of the number of clusters/categories? --isis -ring_cache_size = self.numberOfClusters + len(ipCategories) + 5 +ring_cache_size = self.numberOfClusters + len(proxySets) + 5 self.splitter = bridgedb.Bridges.FilteredBridgeSplitter( key2, max_cached_rings=ring_cache_size) logging.debug(Added splitter %s to IPBasedDistributor. diff --git a/lib/bridgedb/test/test_HTTPServer.py b/lib/bridgedb/test/test_HTTPServer.py index c3cf79a..103976e 100644 --- a/lib/bridgedb/test/test_HTTPServer.py +++ b/lib/bridgedb/test/test_HTTPServer.py @@ -488,7 +488,7 @@ class DummyIPBasedDistributor(object): def _dumbAreaMapper(ip): return ip def __init__(self, areaMapper=None, numberOfClusters=None, key=None, - ipCategories=None, answerParameters=None): + proxySets=None, answerParameters=None): None of the parameters are really used, they are just there to retain an identical method signature. @@ -496,7 +496,7 @@ class DummyIPBasedDistributor(object): self.numberOfClusters = 3 self.nBridgesToGive = 3 self.key = self.__class__.__name__ -self.ipCategories = ipCategories +self.proxySets = proxySets self.answerParameters = answerParameters def getBridges(self, bridgeRequest=None, epoch=None, N=1): ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Add module docstring for bridgedb.parse.fingerprint.
commit 217f8e2785c02d1e8edf784aac9dd9a1b83978a9 Author: Isis Lovecruft i...@torproject.org Date: Thu Jun 18 04:51:30 2015 + Add module docstring for bridgedb.parse.fingerprint. --- lib/bridgedb/parse/fingerprint.py | 18 ++ 1 file changed, 18 insertions(+) diff --git a/lib/bridgedb/parse/fingerprint.py b/lib/bridgedb/parse/fingerprint.py index f825271..bf12ee5 100644 --- a/lib/bridgedb/parse/fingerprint.py +++ b/lib/bridgedb/parse/fingerprint.py @@ -10,6 +10,24 @@ # :license: see LICENSE for licensing information #_ +Utility functions for converting between various relay fingerprint formats, +and checking their validity. + +.. py:module:: bridgedb.parse.fingerprints +:synopsis: Parsers for Tor Bridge fingerprints. + +.. todo: This module is very small; it could possibly be combined with another +module, e.g. :mod:`bridgedb.parse.descriptors`. + +bridgedb.parse.fingerprints + +:: + + toHex - Convert a fingerprint from its binary representation to hexadecimal. + fromHex - Convert a fingerprint from hexadecimal to binary. + isValidFingerprint - Validate a fingerprint. +.. + import binascii import logging ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Add integration tests for post- prop#220 and prop#228 descriptor parsing.
commit 87bd6e2d0ec9522ed40be8175c046516ce42fc1a Author: Isis Lovecruft i...@torproject.org Date: Wed Jun 10 06:57:28 2015 + Add integration tests for post- prop#220 and prop#228 descriptor parsing. --- lib/bridgedb/test/test_parse_descriptors.py | 121 +++ 1 file changed, 121 insertions(+) diff --git a/lib/bridgedb/test/test_parse_descriptors.py b/lib/bridgedb/test/test_parse_descriptors.py index 46d86f1..dd6d146 100644 --- a/lib/bridgedb/test/test_parse_descriptors.py +++ b/lib/bridgedb/test/test_parse_descriptors.py @@ -179,6 +179,107 @@ U36EY4UoN5ABPowhNZFeyr5A3vKiDr6j0hCOqYOhxPY= -END SIGNATURE- ''' +BRIDGE_SERVER_DESCRIPTOR_ED25519 = '''\ +@purpose bridge +router piratepartei 80.92.79.70 80 0 0 +identity-ed25519 +-BEGIN ED25519 CERT- +AQQABhauAccW2uNOkPPWU7h9x9FFWtUJXCnw423dKqL/89pTHFRcAQAgBADfGmFI +//1tBiZZxZ2aXNvvLbEdS/0XHYCWY6Oz3lHCU2xHCJzW03U7htLpq95lWStr2bMm +D9N1MJp8Zufal71nFV5dgCm0DvMoeCN0d1F6zYnrGvyq+2E6p32x/DG33Qs= +-END ED25519 CERT- +master-key-ed25519 3xphSP/9bQYmWcWdmlzb7y2xHUv9Fx2AlmOjs95RwlM +platform Tor 0.2.7.1-alpha-dev on Linux +protocols Link 1 2 Circuit 1 +published 2015-06-09 21:59:40 +fingerprint 312D 6427 4C29 1560 0584 3EEC B19C 6865 FA3C C10C +uptime 0 +bandwidth 14971520 104857600 64512 +extra-info-digest 30E10A35CCEA6AA1E04C15FD5F99022F4CACEBC6 pph/KzxlcGa20Sl6/nQl7noyKctzcWkRkTbBX7aIapQ +onion-key +-BEGIN RSA PUBLIC KEY- +MIGJAoGBALRXlkmBc96bz/WFSJ0/NoNYuOivpRBkMDqE0617x63EE9zA+BQGVk81 +5mbF50IQRS12J3F7x+m7USGF7xcUw+id9pe1jzyyqOTo2BPf2Wemif+CvVc9uD0v +BLO38iImiret0yZtxq3RQ2KaCg2z0y+RPDudR6z/d6V3ASFSlPgBAgMBAAE= +-END RSA PUBLIC KEY- +signing-key +-BEGIN RSA PUBLIC KEY- +MIGJAoGBALGE2wcWNpWczHlLOa3MbRMKYGDMNe3MsTDKqxftImHuUdMV758q5/4c +2d0znZ1k5zma7TIKXM1xblVWaHmSZ65jMyy0jgZl7SNbxibP3xM8mfHAJOoWfnQu +LSj8tKSir2BdA8rncajrDmtQe0C8mxA/RgUHuB6ZF42kAB9lm/33AgMBAAE= +-END RSA PUBLIC KEY- +onion-key-crosscert +-BEGIN CROSSCERT- +EPpvZluK8YLLXU00HVskixVqpJfkCeKWXkQPv5Vq87n7E/gtzrVM9A0DasSPHgor +0Y1jP2K/6G0nuloeDZuNNqPxxz7LEKom5q66UO0Tk4Xdnmj1yp/hSsqi/8sUGe9R +BmZmuz45UJGmADiYwwFnwec/bKkX3al4BwuQRHwcZd0= +-END CROSSCERT- +ntor-onion-key-crosscert 1 +-BEGIN ED25519 CERT- +AQoABhSGAd8aYUj//W0GJlnFnZpc2+8tsR1L/RcdgJZjo7PeUcJTABR4eqhKqYNN +Sgpojtm7C+QRvD3mTk06EEbFly9VrXOaSK4BVxTlsHadm4ti7vdqGHbTWN7DRRu6 +nnUKJPMOsAk= +-END ED25519 CERT- +hidden-service-dir +contact 0x02225522 Frenn vun der Enn (FVDE) info AT enn DOT lu +ntor-onion-key ycFwQVUCqJlPaLwJNvlrpgNLwkU780t4pKiILLWZw0o= +reject *:* +router-sig-ed25519 /uWcpQeWcwywFwy+O1WGfLQFuxkLMsy8u+rTTum4CQd8uN7bt3VCHRG82X9sc18rMv2VHUs7b+WZcfX39ADMDw +router-signature +-BEGIN SIGNATURE- +FpF1a2jF1gkVbSUEuuDrw8ggeyQl4HLqHGXJM/J3SPQDky0OhvqPEV8E0CpONG38 +YNumnkSJ0vjI0YUuVyOZKpODHS/dlXnz5F/Yz8vwQfC7IsNRQgNgf5tbT3iAF8yh +VC4FdHgFlAkXbiqkpWtD0ojJJjLlEeXbmGILjC1Ls2I= +-END SIGNATURE- +''' + +BRIDGE_EXTRA_INFO_DESCRIPTOR_ED25519 = '''\ +extra-info piratepartei 312D64274C29156005843EECB19C6865FA3CC10C +identity-ed25519 +-BEGIN ED25519 CERT- +AQQABhauAccW2uNOkPPWU7h9x9FFWtUJXCnw423dKqL/89pTHFRcAQAgBADfGmFI +//1tBiZZxZ2aXNvvLbEdS/0XHYCWY6Oz3lHCU2xHCJzW03U7htLpq95lWStr2bMm +D9N1MJp8Zufal71nFV5dgCm0DvMoeCN0d1F6zYnrGvyq+2E6p32x/DG33Qs= +-END ED25519 CERT- +published 2015-06-09 21:59:40 +write-history 2015-06-09 19:41:54 (14400 s) 1093632,3138560,1309696,1641472,1064960,1799168 +read-history 2015-06-09 19:41:54 (14400 s) 4406272,6537216,5197824,5701632,5342208,5817344 +dirreq-write-history 2015-06-09 19:17:22 (14400 s) 28672,1727488,575488,589824,43008,618496 +dirreq-read-history 2015-06-09 19:17:22 (14400 s) 0,0,0,0,0,0 +geoip-db-digest 0A1F9C09E08F6F2490E8880664D4E863D1680A12 +geoip6-db-digest A6E9B5DE6F887315749B29F9C9F698215BE5240A +dirreq-stats-end 2015-06-09 12:33:11 (86400 s) +dirreq-v3-ips ir=8,us=8 +dirreq-v3-reqs ir=8,us=8 +dirreq-v3-resp ok=8,not-enough-sigs=0,unavailable=0,not-found=0,not-modified=0,busy=0 +dirreq-v3-direct-dl complete=0,timeout=0,running=0 +dirreq-v3-tunneled-dl complete=8,timeout=4,running=0 +transport scramblesuit 80.92.79.70:7333 password=S3DVRHWD5375I3AA5NMQBG4WED5MBIYD +transport fte 80.92.79.70:7331 +transport websocket 80.92.79.70:9901 +transport obfs3 80.92.79.70:7332 +transport obfs4 80.92.79.70:7334 cert=/Q8QygIhLarhjvB+rKiFvSmXdjhO9AF6OXACR8JH+voMwKF0s5uMaG3H3uEBiZNQI79jPw,iat-mode=0 +bridge-stats-end 2015-06-09 12:33:17 (86400 s) +bridge-ips us=24 +bridge-ip-versions v4=24,v6=0 +bridge-ip-transports obfs4=24 +router-sig-ed25519 O+yrUnkHXZ16Cf0+a3gfDl2ggygbxQUal4kRi5BD2v3NW8CrWjqGJLBjked8g5eJCThUXZuraHwkapeu8gtAAg +router-signature +-BEGIN SIGNATURE- +HbZs8ckBwKbJ4vg0LJztGosNaDqSRD+pHiWgBAmx9ARbz7niJMY/ql+Qxh7NFifQ +xa39dJvObxE65qeaZJvcznSyEkUDcHBFcHLWZev7XQjXf2no9vUL86JvwBKHHKC1 +GnoYumyiqlKn3MOiqVYN5KXhO5i6qN/W8SjMVvywxZI= +-END SIGNATURE- +extra-info Unnamed 9673B58C3A72BC279C4FADEA678DEDCF63E524D2 +published 2015-06-09
[tor-commits] [bridgedb/master] Revert Also forbid bogus characters in PT fingerprint and address
commit 2254b859abf24f437376b94c6c4907f91a04d957 Author: Isis Lovecruft i...@torproject.org Date: Wed May 6 20:41:31 2015 + Revert Also forbid bogus characters in PT fingerprint and address This reverts commit 44e31908090a0e70dfdd82020a5b89c80e04a6d2. In the @property setters for b.bridges.BridgeAddressBase.fingerprint and b.bridges.BridgeAddressBase.address, the functions b.p.fingerprints.isValidFingerprint() and b.p.addr.isValidIP() respectively determine whether the attribute will be set. My tests show that all of {non-ASCII characters, control characters, double quotes, backslashes} will not make it through either of those validation functions. --- lib/bridgedb/bridges.py | 26 -- 1 file changed, 26 deletions(-) diff --git a/lib/bridgedb/bridges.py b/lib/bridgedb/bridges.py index 01bbdd0..4e9ecd1 100644 --- a/lib/bridgedb/bridges.py +++ b/lib/bridgedb/bridges.py @@ -351,10 +351,6 @@ class PluggableTransport(BridgeAddressBase): characters or double quotes or backslashes, in keys or in values. - 3. The :data:`fingerprint` and :data:`address` do not - contain non-ASCII or control characters or double quotes - or backslashes. - :raises MalformedPluggableTransport: if any of the above checks fails. if not self.fingerprint: @@ -390,28 +386,6 @@ class PluggableTransport(BridgeAddressBase): % (k, v)) pass -if not isascii_noncontrol(self.fingerprint): -raise MalformedPluggableTransport( -(Cannot create PluggableTransport with non-ASCII or - control characters in fingerprint: %r) -% self.fingerprint) -if '' in self.fingerprint or '\\' in self.fingerprint: -raise MalformedPluggableTransport( -(Cannot create PluggableTransport with double quotes or - backslashes in fingerprint: %r) -% self.fingerprint) - -if not isascii_noncontrol(self.address): -raise MalformedPluggableTransport( -(Cannot create PluggableTransport with non-ASCII or - control characters in address: %r) -% self.address) -if '' in self.address or '\\' in self.address: -raise MalformedPluggableTransport( -(Cannot create PluggableTransport with double quotes or - backslashes in address: %r) -% self.address) - if not self._checkArguments(): raise MalformedPluggableTransport( (Can't use %s transport with missing arguments. Arguments: ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Fix Filters.filterBridgesByNotBlockedIn to work with new Bridge class.
commit 98cf68d778480aa005e5914cac47164f169b87b9 Author: Isis Lovecruft i...@torproject.org Date: Thu Apr 16 20:37:24 2015 + Fix Filters.filterBridgesByNotBlockedIn to work with new Bridge class. --- lib/bridgedb/Filters.py | 37 + lib/bridgedb/bridgerequest.py |4 +--- lib/bridgedb/test/legacy_Tests.py |2 +- 3 files changed, 19 insertions(+), 24 deletions(-) diff --git a/lib/bridgedb/Filters.py b/lib/bridgedb/Filters.py index 94d4325..41df297 100644 --- a/lib/bridgedb/Filters.py +++ b/lib/bridgedb/Filters.py @@ -92,28 +92,25 @@ def filterBridgesByTransport(methodname, addressClass=None): funcs[ruleset] = _filterByTransport return _filterByTransport -def filterBridgesByNotBlockedIn(countryCode, addressClass=None, methodname=None): - if at least one address:port of the selected addressClass and -(optional) transport type is not blocked in countryCode, return True +def filterBridgesByNotBlockedIn(countryCode): +Return ``True`` if at least one of a bridge's (transport) bridgelines isn't +known to be blocked in **countryCode**. + +:param str countryCode: A two-letter country code. +:rtype: bool +:returns: ``True`` if at least one address of the bridge isn't blocked. +``False`` otherwise. -# default to IPv4 if not specified -if addressClass is None: addressClass = IPv4Address -assert (addressClass) in (IPv4Address, IPv6Address) -ruleset = frozenset([countryCode, addressClass, methodname]) +countryCode = countryCode.lower() +ruleset = frozenset([countryCode]) try: return funcs[ruleset] except KeyError: -def f(bridge): -if bridge.isBlocked(countryCode, addressClass, methodname): -if addressClass is IPv4Address: ac = IPv4 -else: ac = IPv6 -logmsg = Removing %s from set of results for country -logmsg += '%s' with address class %s and transport %s -logging.debug(logmsg % ( bridge.fingerprint, countryCode, ac, -methodname)) +def _filterByNotBlockedIn(bridge): +if bridge.isBlockedIn(countryCode): return False -return True # not blocked -f.__name__ = filterBridgesNotBlockedIn(%s,%s,%s) % \ -(countryCode,methodname,addressClass) -funcs[ruleset] = f -return f +return True +_filterByNotBlockedIn.__name__ = filterBridgesByNotBlockedIn(%s) % countryCode +setattr(_filterByNotBlockedIn, description, unblocked=%s % countryCode) +funcs[ruleset] = _filterByNotBlockedIn +return _filterByNotBlockedIn diff --git a/lib/bridgedb/bridgerequest.py b/lib/bridgedb/bridgerequest.py index f4eaaa4..532558d 100644 --- a/lib/bridgedb/bridgerequest.py +++ b/lib/bridgedb/bridgerequest.py @@ -182,6 +182,4 @@ class BridgeRequestBase(object): self.addFilter(Filters.filterBridgesByTransport(transport, self.addressClass)) for country in self.notBlockedIn: -self.addFilter(Filters.filterBridgesByNotBlockedIn(country.lower(), - self.addressClass, - transport)) + self.addFilter(Filters.filterBridgesByNotBlockedIn(country.lower())) diff --git a/lib/bridgedb/test/legacy_Tests.py b/lib/bridgedb/test/legacy_Tests.py index cc1ba6d..5621515 100644 --- a/lib/bridgedb/test/legacy_Tests.py +++ b/lib/bridgedb/test/legacy_Tests.py @@ -357,7 +357,7 @@ class IPBridgeDistTests(unittest.TestCase): for i in xrange(5): b = d.getBridges(randomIPString(), x, 1, bridgeFilterRules=[ -filterBridgesByNotBlockedIn(cn, methodname='obfs2'), +filterBridgesByNotBlockedIn(cn), filterBridgesByTransport('obfs2'), ]) try: assert len(b) 0 ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Add additional test utilities for generating random valid IPs.
commit 372206bb8a73f5229b606a60f40de1c71e4804fe Author: Isis Lovecruft i...@torproject.org Date: Sat Apr 18 03:15:19 2015 + Add additional test utilities for generating random valid IPs. --- lib/bridgedb/test/util.py | 25 + 1 file changed, 25 insertions(+) diff --git a/lib/bridgedb/test/util.py b/lib/bridgedb/test/util.py index 4aa2709..2d0c020 100644 --- a/lib/bridgedb/test/util.py +++ b/lib/bridgedb/test/util.py @@ -25,6 +25,7 @@ from functools import wraps from twisted.trial import unittest from bridgedb import util as bdbutil +from bridgedb.parse.addr import isIPAddress def fileCheckDecorator(func): @@ -121,6 +122,9 @@ def bracketIPv6(ip): def randomPort(): return random.randint(1, 65535) +def randomHighPort(): +return random.randint(1024, 65535) + def randomIPv4(): return ipaddr.IPv4Address(random.getrandbits(32)) @@ -143,6 +147,27 @@ def randomIPString(): return randomIPv4String() return randomIPv6String() +def valid(func): +Wrapper for the above ``randomIPv*`` functions to ensure they only +return addresses which BridgeDB considers valid. + +.. seealso:: :func:`bridgedb.parse.addr.isIPAddress` + +@wraps(func) +def wrapper(): +ip = None +while not isIPAddress(ip): +ip = func() +return ip +return wrapper + +randomValidIPv4 = valid(randomIPv4) +randomValidIPv6 = valid(randomIPv6) +randomValidIP = valid(randomIP) +randomValidIPv4String = valid(randomIPv4String) +randomValidIPv6String = valid(randomIPv6String) +randomValidIPString = valid(randomIPString) + #: Mixin class for use with :api:`~twisted.trial.unittest.TestCase`. A #: ``TestCaseMixin`` can be used to add additional methods, which should be ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Add another test for Bridge.getBridgeLine() when the bridge is blocked.
commit 1d44a42fdec2763ab868c091756a1446eb839737 Author: Isis Lovecruft i...@torproject.org Date: Sat Apr 18 03:27:28 2015 + Add another test for Bridge.getBridgeLine() when the bridge is blocked. --- lib/bridgedb/test/test_bridges.py | 18 ++ 1 file changed, 18 insertions(+) diff --git a/lib/bridgedb/test/test_bridges.py b/lib/bridgedb/test/test_bridges.py index e48e20a..d7dd810 100644 --- a/lib/bridgedb/test/test_bridges.py +++ b/lib/bridgedb/test/test_bridges.py @@ -1466,6 +1466,24 @@ class BridgeTests(unittest.TestCase): self.assertIn('179.178.155.140:36489', line) self.assertIn('2C3225C4805331025E211F4B6E5BF45C333FDD2C', line) +def test_Bridge_getBridgeLine_blocked_and_request_without_block(self): +Calling getBridgeLine() with a valid request for bridges not blocked in +Iran, when the bridge is completely blocked in Iran, shouldn't return +a bridge line. + +self.bridge.updateFromNetworkStatus(self.networkstatus) +self.bridge.updateFromServerDescriptor(self.serverdescriptor) +self.bridge.updateFromExtraInfoDescriptor(self.extrainfo) + +self.bridge.setBlockedIn('ir') + +request = BridgeRequestBase() +request.isValid(True) +request.withoutBlockInCountry('IR') +line = self.bridge.getBridgeLine(request) + +self.assertIsNone(line) + def test_Bridge_getBridgeLine_IPv6(self): Calling getBridgeLine() with a valid request for IPv6 bridges should return a bridge line. ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Add bridgedb.distribute module with IDistribute and Distributor classes.
commit fe0efec8b00250756d36c7fb2cd061fd8ef3d3d3 Author: Isis Lovecruft i...@torproject.org Date: Sun Apr 19 00:05:02 2015 + Add bridgedb.distribute module with IDistribute and Distributor classes. * ADD distribute.IDistibute interface. * ADD distribute.Distributor class, an implementation of IDistribute. * REMOVE bridgedb.Dist.Distributor. * RENAME HTTPSDistributor.getBridgesForIP() â HTTPSDistributor.getBridges(). * RENAME EmailBasedDistributor.getBridgesForEmail() â EmailBasedDistributor.getBridges(). * FIXES part of #12506: https://bugs.torproject.org/12506 * FIXES part of #12029: https://bugs.torproject.org/12029 --- lib/bridgedb/Dist.py | 104 +++-- lib/bridgedb/distribute.py | 275 ++ lib/bridgedb/email/autoresponder.py |5 +- lib/bridgedb/interfaces.py | 56 ++- lib/bridgedb/test/email_helpers.py | 10 +- lib/bridgedb/test/https_helpers.py |2 +- lib/bridgedb/test/legacy_Tests.py| 64 lib/bridgedb/test/test_Dist.py | 11 +- lib/bridgedb/test/test_distribute.py | 44 ++ lib/bridgedb/test/test_interfaces.py | 55 +++ 10 files changed, 495 insertions(+), 131 deletions(-) diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index 93c08c1..fe81c04 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -17,20 +17,19 @@ import logging import re import time -import bridgedb.Bridges import bridgedb.Storage from bridgedb import proxy +from bridgedb.Bridges import BridgeRing from bridgedb.Bridges import FilteredBridgeSplitter from bridgedb.crypto import getHMAC from bridgedb.crypto import getHMACFunc +from bridgedb.distribute import Distributor from bridgedb.Filters import filterAssignBridgesToRing from bridgedb.Filters import filterBridgesByRules from bridgedb.Filters import filterBridgesByIP4 from bridgedb.Filters import filterBridgesByIP6 from bridgedb.parse import addr -from bridgedb.parse.addr import UnsupportedDomain -from bridgedb.safelog import logSafely MAX_EMAIL_RATE = 3*3600 @@ -48,50 +47,6 @@ class EmailRequestedKey(Exception): Raised when an incoming email requested a copy of our GnuPG keys. -class Distributor(object): -Distributes bridges to clients. - -def __init__(self): -super(Distributor, self).__init__() -self.name = None -self.hashring = None - -def setDistributorName(self, name): -Set a **name** for identifying this distributor. - -This is used to identify the distributor in the logs; the **name** -doesn't necessarily need to be unique. The hashrings created for this -distributor will be named after this distributor's name in -:meth:`propopulateRings`, and any sub hashrings of each of those -hashrings will also carry that name. - - from bridgedb import Dist - dist = Dist.HTTPSDistributor(2, 'masterkey') - dist.setDistributorName('Excellent Distributor') - dist.name -'Excellent Distributor' - -:param str name: A name for this distributor. - -self.name = name -self.hashring.distributorName = name - -def bridgesPerResponse(self, hashring=None, maximum=3): -if hashring is None: -hashring = self.hashring - -if len(hashring) 20: -n = 1 -if 20 = len(hashring) 100: -n = min(2, maximum) -if len(hashring) = 100: -n = maximum - -logging.debug(Returning %d bridges from ring of len: %d % - (n, len(hashring))) -return n - - class HTTPSDistributor(Distributor): A Distributor that hands out bridges based on the IP address of an incoming request and the current time period. @@ -129,9 +84,7 @@ class HTTPSDistributor(Distributor): parameters, i.e. that an answer has at least two obfsproxy bridges or at least one bridge on port 443, etc. -super(HTTPSDistributor, self).__init__() - -self.key = key +super(HTTPSDistributor, self).__init__(key) self.totalSubrings = totalSubrings self.answerParameters = answerParameters @@ -154,13 +107,12 @@ class HTTPSDistributor(Distributor): self._clientToPositionHMAC = getHMACFunc(key3, hex=False) self._subnetToSubringHMAC = getHMACFunc(key4, hex=True) self.hashring = FilteredBridgeSplitter(key2, self.ringCacheSize) -logging.debug(Added %s to HTTPS distributor. % - self.hashring.__class__.__name__) +self.name = 'HTTPS' +logging.debug(Added %s to %s distributor. % + (self.hashring.__class__.__name__, self.name)) -self.setDistributorName('HTTPS') - -def bridgesPerResponse(self, hashring=None,
[tor-commits] [bridgedb/master] Update documentation on IPBasedDistributor area mapping.
commit 33cb6c45d12d83c441595ff0fc2bf6cc21e46623 Author: Isis Lovecruft i...@torproject.org Date: Sat Apr 11 02:52:31 2015 + Update documentation on IPBasedDistributor area mapping. --- lib/bridgedb/Dist.py | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index ab7ae6e..129bc7c 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -151,9 +151,12 @@ class IPBasedDistributor(Distributor): :type areaMapper: callable :param areaMapper: A function that maps IP addresses arbitrarily to -strings, such that addresses which map to identical strings are -considered to be in the same area (for some arbitrary definition -of area). See :func:`bridgedb.Dist.uniformMap` for an example. +strings, such that IP addresses which map to identical strings are +considered to be in the same area. The default **areaMapper** +is :func:`bridgedb.Dist.uniformMap`, which maps all IPv4 addresses +within the same /16 and all IPv6 addresses within the same /32 to +the same area. Areas are then grouped into the number of rings +specified by the ``N_IP_CLUSTERS`` configuration option. :param integer numberOfClusters: The number of clusters to group IP addresses into. Note that if PROXY_LIST_FILES is set in bridgedb.conf, then the actual number of clusters is one higher than ``numberOfClusters``, @@ -327,8 +330,6 @@ class IPBasedDistributor(Distributor): # based upon the client's area (i.e. the /16 of the client's IP # address): else: -# Areas (i.e. /16s) are grouped into the number of rings specified -# by the N_IP_CLUSTERS configuration option. area = self.areaMapper(bridgeRequest.client) cluster = (int(self.areaClusterHmac(area)[:8], 16) % (self.numberOfClusters - 1)) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[bridgedb/master] Rename nCluster → numberOfClusters.
commit d85f4f710ebd67a32f43ea3db0426a9a7e67036b Author: Isis Lovecruft i...@torproject.org Date: Fri Apr 10 07:34:44 2015 + Rename nCluster â numberOfClusters. --- lib/bridgedb/Dist.py | 24 lib/bridgedb/test/test_HTTPServer.py |4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index 770198a..f9f61de 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -141,7 +141,7 @@ class IPBasedDistributor(Distributor): distributor. -def __init__(self, areaMapper, nClusters, key, +def __init__(self, areaMapper, numberOfClusters, key, ipCategories=None, answerParameters=None): Create a Distributor that decides which bridges to distribute based upon the client's IP address and the current time. @@ -151,9 +151,9 @@ class IPBasedDistributor(Distributor): strings, such that addresses which map to identical strings are considered to be in the same area (for some arbitrary definition of area). See :func:`bridgedb.Dist.uniformMap` for an example. -:param integer nClusters: The number of clusters to group IP addresses +:param integer numberOfClusters: The number of clusters to group IP addresses into. Note that if PROXY_LIST_FILES is set in bridgedb.conf, then -the actual number of clusters is one higher than ``nClusters``, +the actual number of clusters is one higher than ``numberOfClusters``, because the set of known open proxies constitutes its own category. DOCDOC What exactly does a cluster *do*? @@ -169,7 +169,7 @@ class IPBasedDistributor(Distributor): bridges or at least one bridge on port 443, etc. self.areaMapper = areaMapper -self.nClusters = nClusters +self.numberOfClusters = numberOfClusters self.answerParameters = answerParameters if not ipCategories: @@ -193,7 +193,7 @@ class IPBasedDistributor(Distributor): # # XXX Why is the extra room hardcoded to be 5? Shouldn't it be some # fraction of the number of clusters/categories? --isis -ring_cache_size = self.nClusters + len(ipCategories) + 5 +ring_cache_size = self.numberOfClusters + len(ipCategories) + 5 self.splitter = bridgedb.Bridges.FilteredBridgeSplitter( key2, max_cached_rings=ring_cache_size) logging.debug(Added splitter %s to IPBasedDistributor. @@ -207,13 +207,13 @@ class IPBasedDistributor(Distributor): The hashring structure for this distributor is influenced by the ``N_IP_CLUSTERS`` configuration option, as well as the number of -``PROXY_LIST_FILES``. Essentially, :data:`nClusters` is set to the +``PROXY_LIST_FILES``. Essentially, :data:`numberOfClusters` is set to the specified ``N_IP_CLUSTERS``. The ``PROXY_LIST_FILES`` (plus the :class:`bridgedb.proxy.ProxySet` for the Tor Exit list downloaded into memory with :script:`get-tor-exits`) are stored in :data:`categories`. The number of subhashrings which this :class:`Distributor` has active -in its hashring is then the :data:`nClusters` plus the number of +in its hashring is then the :data:`numberOfClusters` plus the number of :data:`categories`. As an example, if BridgeDB was configured with ``N_IP_CLUSTERS=4`` and @@ -255,14 +255,14 @@ class IPBasedDistributor(Distributor): # XXX Distributors should have a totalClusters property in order # to avoid reusing this unclear construct all over the place. (Or # just get rid of the idea of categories.) -for cluster in range(self.nClusters + len(self.categories)): +for cluster in range(self.numberOfClusters + len(self.categories)): filters = self._buildHashringFilters([filterFn,], cluster) key1 = getHMAC(self.splitter.key, Order-Bridges-In-Ring-%d % cluster) ring = bridgedb.Bridges.BridgeRing(key1, self.answerParameters) # For consistency with previous implementation of this method, # only set the name for clusters which are in this # distributor's categories: -if cluster = self.nClusters: +if cluster = self.numberOfClusters: ring.setName('{0} Ring'.format(self.name)) self.splitter.addRing(ring, filters, filterBridgesByRules(filters), @@ -273,7 +273,7 @@ class IPBasedDistributor(Distributor): self.splitter.insert(bridge) def _buildHashringFilters(self, previousFilters, clientCluster): -totalRings = self.nClusters + len(self.categories) +totalRings = self.numberOfClusters +
[tor-commits] [bridgedb/master] Make `areaMapper` built into the IPBasedDistributor class.
commit 34a97ccc019ca5b9956b8566d81d893293ae5f00 Author: Isis Lovecruft i...@torproject.org Date: Tue Apr 14 07:12:23 2015 + Make `areaMapper` built into the IPBasedDistributor class. * MOVE Dist.uniformMap() â Dist.IPBasedDistributor.getSubnet(). * REMOVE IPBasedDistributor `areaMapper` parameter. * RENAME IPBasedDistributor.areaOrderHmac â IPBasedDistributor._clientToPositionHMAC. * RENAME IPBasedDistributor.areaClusterHmac â IPBasedDistributor._subnetToSubringHMAC. * ADD IPBasedDistributor.mapClientToHashringPosition() to replace and simplify inline use of IPBasedDistributor._clientToPositionHMAC. * ADD IPBasedDistributor.mapSubnetToSubring() to replace and simplify inline use of IPBasedDistributor._subnetToSubringHMAC. --- lib/bridgedb/Dist.py | 184 ++ lib/bridgedb/Main.py |1 - 2 files changed, 111 insertions(+), 74 deletions(-) diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index 1a01543..082f002 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -48,39 +48,6 @@ class EmailRequestedKey(Exception): Raised when an incoming email requested a copy of our GnuPG keys. -def uniformMap(ip): -Map an IP to an arbitrary 'area' string, such that any two IPv4 -addresses in the same ``/16`` subnet, or any two IPv6 addresses in the -same ``/32`` subnet, get the same string. - - from bridgedb import Dist - Dist.uniformMap('1.2.3.4') -'1.2.0.0/16' - Dist.uniformMap('1.2.211.154') -'1.2.0.0/16' - Dist.uniformMap('2001:f::bc1:b13:2808') -'2001:f::/32' - Dist.uniformMap('2a00:c98:2030:a020:2::42') -'2a00:c98::/32' - -:param str ip: A string representing an IPv4 or IPv6 address. -:rtype: str -:returns: The appropriately sized CIDR subnet representation of the **ip**. - -# We aren't using bridgedb.parse.addr.isIPAddress(ip, compressed=False) -# here because adding the string False into the map would land any and -# all clients whose IP address appeared to be invalid at the same position -# in a hashring. -address = ipaddr.IPAddress(ip) -if address.version == 6: -truncated = ':'.join(address.exploded.split(':')[:2]) -subnet = str(ipaddr.IPv6Network(truncated + ::/32)) -return subnet -else: -truncated = '.'.join(address.exploded.split('.')[:2]) -subnet = str(ipaddr.IPv4Network(truncated + '.0.0/16')) -return subnet - def getNumBridgesPerAnswer(ring, max_bridges_per_answer=3): if len(ring) 20: n_bridges_per_answer = 1 @@ -111,9 +78,7 @@ class Distributor(object): hashrings will also carry that name. from bridgedb import Dist - ipDist = Dist.IPBasedDistributor(Dist.uniformMap, -... 5, -... 'fake-hmac-key') + ipDist = Dist.IPBasedDistributor(5, 'fake-hmac-key') ipDist.setDistributorName('HTTPS Distributor') ipDist.prepopulateRings() hashrings = ipDist.splitter.filterRings @@ -130,8 +95,6 @@ class IPBasedDistributor(Distributor): A Distributor that hands out bridges based on the IP address of an incoming request and the current time period. -:ivar areaOrderHmac: An HMAC function used to order areas within rings. -:ivar areaClusterHmac: An HMAC function used to assign areas to rings. :ivar list rings: A list of :class:`bridgedb.Bridges.BridgeHolder` hashrings, one for each area in the ``areaMapper``. Every inserted bridge will go into one of these rings, and every area is associated @@ -145,19 +108,10 @@ class IPBasedDistributor(Distributor): distributor. -def __init__(self, areaMapper, numberOfClusters, key, - proxies=None, answerParameters=None): +def __init__(self, numberOfClusters, key, proxies=None, answerParameters=None): Create a Distributor that decides which bridges to distribute based upon the client's IP address and the current time. -:type areaMapper: callable -:param areaMapper: A function that maps IP addresses arbitrarily to -strings, such that IP addresses which map to identical strings are -considered to be in the same area. The default **areaMapper** -is :func:`bridgedb.Dist.uniformMap`, which maps all IPv4 addresses -within the same /16 and all IPv6 addresses within the same /32 to -the same area. Areas are then grouped into the number of rings -specified by the ``N_IP_CLUSTERS`` configuration option. :param integer numberOfClusters: The number of clusters to group IP addresses into. Note that if PROXY_LIST_FILES is set in bridgedb.conf, then the actual number of
[tor-commits] [bridgedb/master] Bump Stem version to latest git master.
commit 42f19f52002c16da545e5e27ccb689c47cb7491c Author: Isis Lovecruft i...@torproject.org Date: Wed Jun 10 06:07:08 2015 + Bump Stem version to latest git master. --- .travis.requirements.txt |2 +- requirements.txt |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.requirements.txt b/.travis.requirements.txt index e106d8f..ebda8e0 100644 --- a/.travis.requirements.txt +++ b/.travis.requirements.txt @@ -28,5 +28,5 @@ gnupg==2.0.1 pillow=2.6.1 qrcode==5.0.1 service_identity==14.0.0 -stem==1.3.0 +git+https://git.torproject.org/stem.git@ba8cee36a0348c1509ad3562051723b7948e19ce#egg=stem-1.4.1.dev0-py2.7 zope.interface==3.6.1 diff --git a/requirements.txt b/requirements.txt index 40daca6..9e4aac1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,5 +10,5 @@ gnupg==2.0.1 pillow=2.6.1 qrcode==5.0.1 service_identity==14.0.0 -stem==1.3.0 +git+https://git.torproject.org/stem.git@ba8cee36a0348c1509ad3562051723b7948e19ce#egg=stem-1.4.1.dev0-py2.7 zope.interface==3.6.1 ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Deduplicate subhashring logic in IPBasedDistributor.prepopulateRings().
commit 023596e567e17fd801a7cbc4827b4836908c73fe Author: Isis Lovecruft i...@torproject.org Date: Thu Apr 9 23:27:36 2015 + Deduplicate subhashring logic in IPBasedDistributor.prepopulateRings(). --- lib/bridgedb/Dist.py | 51 ++ 1 file changed, 14 insertions(+), 37 deletions(-) diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index 0658504..127004a 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -250,45 +250,22 @@ class IPBasedDistributor(Distributor): Thus, in this example, we end up with **12 total subhashrings**. logging.info(Prepopulating %s distributor hashrings... % self.name) -# populate all rings (for dumping assignments and testing) -for filterFn in [filterBridgesByIP4, filterBridgesByIP6]: -n = self.nClusters -for category in self.categories: -g = filterAssignBridgesToRing(self.splitter.hmac, - self.nClusters + - len(self.categories), - n) -bridgeFilterRules = [g] -if filterFn: -bridgeFilterRules.append(filterFn) -ruleset = frozenset(bridgeFilterRules) -key1 = getHMAC(self.splitter.key, - Order-Bridges-In-Ring-%d % n) -n += 1 -ring = bridgedb.Bridges.BridgeRing(key1, self.answerParameters) -ring.setName('{0} Ring'.format(self.name)) -self.splitter.addRing(ring, - ruleset, - filterBridgesByRules(bridgeFilterRules), - populate_from=self.splitter.bridges) - -# populate all ip clusters -for clusterNum in xrange(self.nClusters): -g = filterAssignBridgesToRing(self.splitter.hmac, - self.nClusters + - len(self.categories), - clusterNum) -bridgeFilterRules = [g] -if filterFn: -bridgeFilterRules.append(filterFn) -ruleset = frozenset(bridgeFilterRules) -key1 = getHMAC(self.splitter.key, - Order-Bridges-In-Ring-%d % clusterNum) +for filterFn in [filterBridgesByIP4, filterBridgesByIP6]: +# XXX Distributors should have a totalClusters property in order +# to avoid reusing this unclear construct all over the place. (Or +# just get rid of the idea of categories.) +for cluster in range(self.nClusters + len(self.categories)): +filters = self._buildHashringFilters([filterFn,], cluster) +key1 = getHMAC(self.splitter.key, Order-Bridges-In-Ring-%d % cluster) ring = bridgedb.Bridges.BridgeRing(key1, self.answerParameters) -self.splitter.addRing(ring, - ruleset, - filterBridgesByRules(bridgeFilterRules), +# For consistency with previous implementation of this method, +# only set the name for clusters which are in this +# distributor's categories: +if cluster = self.nClusters: +ring.setName('{0} Ring'.format(self.name)) +self.splitter.addRing(ring, filters, + filterBridgesByRules(filters), populate_from=self.splitter.bridges) def clear(self): ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Separate BridgeHolder class from Distributor.
commit de555a5908d18cbb04c34afa88a7138ab204753f Author: Isis Lovecruft i...@torproject.org Date: Thu Apr 9 06:35:27 2015 + Separate BridgeHolder class from Distributor. * FIXES part of #12506: https://bugs.torproject.org/12506 --- lib/bridgedb/Bridges.py|1 - lib/bridgedb/Dist.py |3 ++- lib/bridgedb/test/test_Main.py |7 +-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/bridgedb/Bridges.py b/lib/bridgedb/Bridges.py index d9b28e2..c727c9a 100644 --- a/lib/bridgedb/Bridges.py +++ b/lib/bridgedb/Bridges.py @@ -449,7 +449,6 @@ class BridgeSplitter(BridgeHolder): p -- the relative proportion of bridges to assign to this bridgeholder. -assert isinstance(ring, BridgeHolder) self.ringsByName[ringname] = ring self.pValues.append(self.totalP) self.rings.append(ringname) diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index 69d9eb6..954b570 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -92,7 +92,8 @@ def getNumBridgesPerAnswer(ring, max_bridges_per_answer=3): return n_bridges_per_answer -class Distributor(bridgedb.Bridges.BridgeHolder): + +class Distributor(object): Distributes bridges to clients. def __init__(self): diff --git a/lib/bridgedb/test/test_Main.py b/lib/bridgedb/test/test_Main.py index 5ae4025..9c8b68c 100644 --- a/lib/bridgedb/test/test_Main.py +++ b/lib/bridgedb/test/test_Main.py @@ -27,7 +27,6 @@ from twisted.internet.threads import deferToThread from twisted.trial import unittest from bridgedb import Main -from bridgedb.Bridges import BridgeHolder from bridgedb.parse.options import parseOptions @@ -59,13 +58,17 @@ def mockUpdateBridgeHistory(bridges, timestamps): (fingerprint, timestamp)) -class MockBridgeHolder(BridgeHolder): +class MockBridgeHolder(object): def __init__(self): self._bridges = {} def __len__(self): return len(self._bridges.keys()) def insert(self, bridge): self._bridges[bridge.fingerprint] = bridge +def clear(self): +pass +def dumpAssignments(self): +pass class MainTests(unittest.TestCase): ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Remove IPBasedDistributor.clear() and EmailBasedDistributor.clear().
commit de631604e282c92bc3f54e56cfa0faa3416503b4 Author: Isis Lovecruft i...@torproject.org Date: Fri Apr 10 07:14:12 2015 + Remove IPBasedDistributor.clear() and EmailBasedDistributor.clear(). These were never used anywhere. --- lib/bridgedb/Dist.py |7 --- 1 file changed, 7 deletions(-) diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index 127004a..770198a 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -268,9 +268,6 @@ class IPBasedDistributor(Distributor): filterBridgesByRules(filters), populate_from=self.splitter.bridges) -def clear(self): -self.splitter.clear() - def insert(self, bridge): Assign a bridge to this distributor. self.splitter.insert(bridge) @@ -410,10 +407,6 @@ class EmailBasedDistributor(Distributor): self.setDistributorName('Email') -def clear(self): -self.splitter.clear() -#self.ring.clear() # should be take care of by above - def insert(self, bridge): Assign a bridge to this distributor. self.splitter.insert(bridge) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Why were there ever unreachable subhashrings? Kill them with fire.
commit a45591af98741f5b4d7cf9a6cd5fbd1603c3bfe8 Author: Isis Lovecruft i...@torproject.org Date: Thu Apr 9 06:44:43 2015 + Why were there ever unreachable subhashrings? Kill them with fire. As part of #4297, $SOMEONE added the prepopulateRings() methods, which are used when BridgeDB parses incoming descriptors. These methods add subhashrings and allocate bridges to them. When a client requests bridges, they are either requesting IPv4 or IPv6 bridges, and thus clients *always* have either filterBridgesByIPv4 or filterBridgesByIPv6, respectively. So why is there an extra subhashring with no IP version filters if clients *can never get to it*? Blame $SOMEONE. The $SOMEONE who authored the commit below would be a good start. * BUGFIX on e6ce57e728802689544c130867edcadfeecd38ec. * REMOVE the filterless subhashring from the IPBasedDistributor. * UPDATE documentation for IPBasedDistributor.prepopulateRings(). --- lib/bridgedb/Dist.py | 34 +- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index 954b570..0658504 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -233,33 +233,25 @@ class IPBasedDistributor(Distributor): | Subhashrings |||| ||| | (total, assigned)| (6,0) | (6,1) | (6,2) | (6,3) | (6,4) | (6,5) | +--+++++++ -| Filtered | (6,0) | (6,1) | (6,2) | (6,3) | (6,4) | (6,5) | -| Subhashrings +++++++ -| bBy requested| (6,0)-IPv4 | (6,1)-IPv4 | (6,2)-IPv4 | (6,3)-IPv4 | (6,4)-IPv4 | (6,5)-IPv4 | -| bridge type) +++++++ -| | (6,0)-IPv6 | (6,1)-IPv6 | (6,2)-IPv6 | (6,3)-IPv6 | (6,4)-IPv6 | (6,5)-IPv6 | +| Filtered | (6,0)-IPv4 | (6,1)-IPv4 | (6,2)-IPv4 | (6,3)-IPv4 | (6,4)-IPv4 | (6,5)-IPv4 | +| Subhashrings |||| ||| +| bBy requested +++++++ +| bridge type) | (6,0)-IPv6 | (6,1)-IPv6 | (6,2)-IPv6 | (6,3)-IPv6 | (6,4)-IPv6 | (6,5)-IPv6 | +| |||| ||| +--+++++++ -The filtered subhashrings are essentially copies of their respective -subhashring, that is, subhashring ``(6,0)`` contains both IPv4 and -IPv6 bridges, meaning that its contents are a superset of the filtered -subhashrings ``(6,0)-IPv4`` and ``(6,0)-IPv6``. (I have no idea of -the relation between ``(6,0)-IPv4`` and ``(6,0)-IPv6``, including -whether or not their contents are disjoint. I didn't design this shit, -I'm just redesigning it.) - -Why does the ``(6,0)`` superset subhashring exist then? +The filtered subhashrings are essentially filtered copies of their +respective subhashring, such that they only contain bridges which +support IPv4 or IPv6, respectively. (I have no idea of the relation +between ``(6,0)-IPv4`` and ``(6,0)-IPv6``, including whether or not +their contents are disjoint. I didn't design this shit, I'm just +redesigning it.) -you might ask. That's a very good question. I don't know either. -I'm inclined to think it shouldn't exist, unless we wish to allow -clients to request IPv4 bridges and IPv6 bridges simultaneously -(there's currently no interface to do this, however). - -Thus, in this example, we end up with **18 total subhashrings**. +Thus, in this example, we end up with **12 total subhashrings**. logging.info(Prepopulating %s distributor hashrings... % self.name) # populate all rings (for dumping assignments and testing) -for filterFn in [None, filterBridgesByIP4, filterBridgesByIP6]: +for filterFn in [filterBridgesByIP4, filterBridgesByIP6]: n = self.nClusters for category in self.categories: g = filterAssignBridgesToRing(self.splitter.hmac, ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Fix non-deterministic CI errors with use of Queue in test_smtp.
commit 069659d51d06a86cd1b609b42106774f536b58e4 Author: Isis Lovecruft i...@torproject.org Date: Sat Apr 18 03:37:50 2015 + Fix non-deterministic CI errors with use of Queue in test_smtp. See https://travis-ci.org/isislovecruft/bridgedb/jobs/58996136#L3281 --- lib/bridgedb/test/test_smtp.py | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/bridgedb/test/test_smtp.py b/lib/bridgedb/test/test_smtp.py index 1cbafba..de443b3 100644 --- a/lib/bridgedb/test/test_smtp.py +++ b/lib/bridgedb/test/test_smtp.py @@ -84,11 +84,21 @@ class EmailServer(SMTPServer): assert self._thread.is_alive() == False, Thread is alive and kicking def getAndCheckMessageContains(self, text, timeoutInSecs=2.0): -#print(Checking for reponse) -message = self.message_queue.get(block=True, timeout=timeoutInSecs) -assert message.find(text) != -1, (Message did not contain text '%s'. - Full message is:\n %s - % (text, message)) +try: +message = self.message_queue.get(block=True, timeout=timeoutInSecs) +# Queue.Empty, according to its documentation, is only supposed to be +# raised when Queue.get(block=False) or Queue.get_nowait() are called. +# I've no idea why it's getting raised here, when we're blocking for +# it, but nonetheless it causes occasional, non-deterministic CI +# failures: +# +# https://travis-ci.org/isislovecruft/bridgedb/jobs/58996136#L3281 +except Queue.Empty: +pass +else: +assert message.find(text) != -1, (Message did not contain text '%s'. + Full message is:\n %s + % (text, message)) def checkNoMessageReceived(self, timeoutInSecs=2.0): try: ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Teach Bridge._getVanillaForRequest() to filter blocked addresses.
commit 53c8e7a1aefc6a25c3a7cdc56d19c62137ad4066 Author: Isis Lovecruft i...@torproject.org Date: Sat Apr 18 03:28:31 2015 + Teach Bridge._getVanillaForRequest() to filter blocked addresses. --- lib/bridgedb/bridges.py | 36 +--- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/lib/bridgedb/bridges.py b/lib/bridgedb/bridges.py index c8c7a30..8f4f853 100644 --- a/lib/bridgedb/bridges.py +++ b/lib/bridgedb/bridges.py @@ -997,6 +997,10 @@ class Bridge(BridgeBackwardsCompatibility): return address, port, version = addrport + +if not address or not port: +return + bridgeLine = [] if bridgePrefix: @@ -1094,26 +1098,28 @@ class Bridge(BridgeBackwardsCompatibility): Bridge %s answering request for IPv%s vanilla address... % (self, 6 if bridgeRequest.addressClass is ipaddr.IPv6Address else 4)) -if not bridgeRequest.filters: -logging.debug((Request %s didn't have any filters; - generating them now...) % bridgeRequest) -bridgeRequest.generateFilters() +addresses = [] -addresses = self.allVanillaAddresses - -# Filter ``allVanillaAddresses`` by whether IPv4 or IPv6 was requested: -addresses = filter( -# ``address`` here is a 3-tuple: -# ``(ipaddr.IPAddress, int(port), int(ipaddr.IPAddress.version))`` -lambda address: isinstance(address[0], bridgeRequest.addressClass), -self.allVanillaAddresses) +for address, port, version in self.allVanillaAddresses: +# Filter ``allVanillaAddresses`` by whether IPv4 or IPv6 was requested: +if isinstance(address, bridgeRequest.addressClass): +# Determine if the address is blocked in any of the country +# codes. Because :meth:`addressIsBlockedIn` returns a bool, +# we get a list like: ``[True, False, False, True]``, and +# because bools are ints, they may be summed. What we care +# about is that there are no ``True``s, for any country code, +# so we check that the sum is zero (meaning the list was full +# of ``False``s). +# +# XXX Do we want to add a method for this construct? +if not sum([self.addressIsBlockedIn(cc, address, port) +for cc in bridgeRequest.notBlockedIn]): +addresses.append((address, port, version)) if addresses: # Use the client's unique data to HMAC them into their position in # the hashring of filtered bridges addresses: -position = bridgeRequest.getHashringPlacement('Order-Or-Addresses', - bridgeRequest.client) -logging.debug(Client's hashring position is %r % position) +position = bridgeRequest.getHashringPlacement('Order-Or-Addresses') vanilla = addresses[position % len(addresses)] logging.info(Got vanilla bridge for client.) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Add Bridge.identity property and replace all usage of getID().
commit 5fec5eb3e5f8901a08a741ab57cf48b9126e41ee Author: Isis Lovecruft i...@torproject.org Date: Sat Apr 18 00:48:26 2015 + Add Bridge.identity property and replace all usage of getID(). --- lib/bridgedb/Bridges.py | 25 ++--- lib/bridgedb/Filters.py |2 +- lib/bridgedb/bridges.py | 33 +++-- 3 files changed, 42 insertions(+), 18 deletions(-) diff --git a/lib/bridgedb/Bridges.py b/lib/bridgedb/Bridges.py index b8fdd2e..5742794 100644 --- a/lib/bridgedb/Bridges.py +++ b/lib/bridgedb/Bridges.py @@ -25,8 +25,6 @@ import bridgedb.Bucket from bridgedb.bridges import Bridge from bridgedb.crypto import getHMACFunc from bridgedb.parse import addr -from bridgedb.parse.fingerprint import toHex -from bridgedb.parse.fingerprint import fromHex from bridgedb.parse.fingerprint import isValidFingerprint from bridgedb.safelog import logSafely @@ -221,13 +219,12 @@ class BridgeRing(BridgeHolder): if val == 'stable' and bridge.flags.stable: subring.insert(bridge) -ident = bridge.getID() -pos = self.hmac(ident) -if not self.bridges.has_key(pos): +pos = self.hmac(bridge.identity) +if not pos in self.bridges: self.sortedKeys.append(pos) self.isSorted = False self.bridges[pos] = bridge -self.bridgesByID[ident] = bridge +self.bridgesByID[bridge.identity] = bridge logging.debug(Adding %s to %s % (bridge.address, self.name)) def _sort(self): @@ -330,11 +327,11 @@ class BridgeRing(BridgeHolder): logging.info(Dumping bridge assignments for %s... % self.name) for b in self.bridges.itervalues(): desc = [ description ] -ident = b.getID() for tp,val,_,subring in self.subrings: -if subring.getBridgeByID(ident): +if subring.getBridgeByID(b.identity): desc.append(%s=%s%(tp,val)) -f.write(%s %s\n%( toHex(ident), .join(desc).strip())) +f.write(%s %s\n % (b.fingerprint, .join(desc).strip())) + class FixedBridgeSplitter(BridgeHolder): A bridgeholder that splits bridges up based on an hmac and assigns @@ -348,7 +345,7 @@ class FixedBridgeSplitter(BridgeHolder): def insert(self, bridge): # Grab the first 4 bytes -digest = self.hmac(bridge.getID()) +digest = self.hmac(bridge.identity) pos = long( digest[:8], 16 ) which = pos % len(self.rings) self.rings[which].insert(bridge) @@ -467,11 +464,9 @@ class BridgeSplitter(BridgeHolder): if not bridge.flags.running: return -bridgeID = bridge.fingerprint - # Determine which ring to put this bridge in if we haven't seen it # before. -pos = self.hmac(bridgeID) +pos = self.hmac(bridge.identity) n = int(pos[:8], 16) % self.totalP pos = bisect.bisect_right(self.pValues, n) - 1 assert 0 = pos len(self.rings) @@ -668,7 +663,7 @@ class FilteredBridgeSplitter(BridgeHolder): if g(b): # ghetto. get subring flags, ports for tp,val,_,subring in r.subrings: -if subring.getBridgeByID(b.getID()): +if subring.getBridgeByID(b.identity): desc.append(%s=%s%(tp,val)) try: desc.extend(g.description.split()) @@ -693,4 +688,4 @@ class FilteredBridgeSplitter(BridgeHolder): # add to assignments desc = %s %s % (description.strip(), .join([v for k,v in grouped.items()]).strip()) -f.write(%s %s\n%( toHex(b.getID()), desc)) +f.write(%s %s\n % (b.fingerprint, desc)) diff --git a/lib/bridgedb/Filters.py b/lib/bridgedb/Filters.py index 41df297..fb0197b 100644 --- a/lib/bridgedb/Filters.py +++ b/lib/bridgedb/Filters.py @@ -17,7 +17,7 @@ def filterAssignBridgesToRing(hmac, numRings, assignedRing): return funcs[ruleset] except KeyError: def _assignBridgesToRing(bridge): -digest = hmac(bridge.getID()) +digest = hmac(bridge.identity) pos = long( digest[:8], 16 ) which = pos % numRings + 1 diff --git a/lib/bridgedb/bridges.py b/lib/bridgedb/bridges.py index 541e735..c8c7a30 100644 --- a/lib/bridgedb/bridges.py +++ b/lib/bridgedb/bridges.py @@ -178,6 +178,36 @@ class BridgeAddressBase(object): self._fingerprint = None @property +def identity(self): +Get this Bridge's identity digest. + +:rtype: bytes +:returns: The binary-encoded SHA-1 hash digest of the public half of +this Bridge's identity key, if available; otherwise, returns +``None``. + +if self.fingerprint: +return fromHex(self.fingerprint) + +
[tor-commits] [bridgedb/master] Remove dumpAssignments() for all Distributors.
commit 69becd92ceb3b55777acddbe4734f7aa912cb425 Author: Isis Lovecruft i...@torproject.org Date: Sun Apr 19 04:49:24 2015 + Remove dumpAssignments() for all Distributors. These methods were never used. Hashrings dump the bridges assigned to them. --- lib/bridgedb/Dist.py |6 -- 1 file changed, 6 deletions(-) diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index e149d17..fe6b8da 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -346,9 +346,6 @@ class HTTPSDistributor(Distributor): return answer -def dumpAssignments(self, f, description=): -self.hashring.dumpAssignments(f, description) - class EmailBasedDistributor(Distributor): Object that hands out bridges based on the email address of an incoming @@ -483,9 +480,6 @@ class EmailBasedDistributor(Distributor): else: db.commit() -def dumpAssignments(self, f, description=): -self.hashring.dumpAssignments(f, description) - def prepopulateRings(self): # populate all rings (for dumping assignments and testing) for filterFn in [filterBridgesByIP4, filterBridgesByIP6]: ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Remove the idea of clusters. Clusters are just subhashrings.
commit 1a676f343a7a5a854106c9e90c8418d1f7b2c09e Author: Isis Lovecruft i...@torproject.org Date: Tue Apr 14 07:33:38 2015 + Remove the idea of clusters. Clusters are just subhashrings. --- lib/bridgedb/Dist.py| 60 +++ lib/bridgedb/Filters.py |2 +- 2 files changed, 30 insertions(+), 32 deletions(-) diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index c9d82c1..58f0a2d 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -104,16 +104,15 @@ class IPBasedDistributor(Distributor): distributor. -def __init__(self, numberOfClusters, key, proxies=None, answerParameters=None): +def __init__(self, totalSubrings, key, proxies=None, answerParameters=None): Create a Distributor that decides which bridges to distribute based upon the client's IP address and the current time. -:param integer numberOfClusters: The number of clusters to group IP addresses -into. Note that if PROXY_LIST_FILES is set in bridgedb.conf, then -the actual number of clusters is one higher than ``numberOfClusters``, -because the set of known open proxies constitutes its own -category. -DOCDOC What exactly does a cluster *do*? +:param int totalSubrings: The number of subhashrings to group clients +into. Note that if ``PROXY_LIST_FILES`` is set in bridgedb.conf, +then the actual number of clusters is one higher than +``totalSubrings``, because the set of all known open proxies is +given its own subhashring. :param bytes key: The master HMAC key for this distributor. All added bridges are HMACed with this key in order to place them into the hashrings. @@ -129,20 +128,20 @@ class IPBasedDistributor(Distributor): parameters, i.e. that an answer has at least two obfsproxy bridges or at least one bridge on port 443, etc. +self.totalSubrings = totalSubrings self.answerParameters = answerParameters -self.numberOfClusters = numberOfClusters if proxies: logging.info(Added known proxies to HTTPS distributor...) self.proxies = proxies -self.numberOfClusters += 1 -self.proxyCluster = self.numberOfClusters +self.totalSubrings += 1 +self.proxySubring = self.totalSubrings else: logging.warn(No known proxies were added to HTTPS distributor!) self.proxies = proxy.ProxySet() -self.proxyCluster = 0 +self.proxySubring = 0 -self.ringCacheSize = self.numberOfClusters * 3 +self.ringCacheSize = self.totalSubrings * 3 key2 = getHMAC(key, Assign-Bridges-To-Rings) key3 = getHMAC(key, Order-Areas-In-Rings) @@ -223,13 +222,13 @@ class IPBasedDistributor(Distributor): # If the client wasn't using a proxy, select the client's subring # based upon the client's subnet (modulo the total subrings): if not usingProxy: -mod = self.numberOfClusters +mod = self.totalSubrings # If there is a proxy subring, don't count it for the modulus: -if self.proxyCluster: +if self.proxySubring: mod -= 1 -return int(self._subnetToSubringHMAC(subnet)[:8], 16) % mod +return (int(self._subnetToSubringHMAC(subnet)[:8], 16) % mod) + 1 else: -return self.proxyCluster +return self.proxySubring def mapClientToHashringPosition(self, interval, subnet): Map the client to a position on a (sub)hashring, based upon the @@ -260,14 +259,14 @@ class IPBasedDistributor(Distributor): ``N_IP_CLUSTERS`` configuration option, as well as the number of ``PROXY_LIST_FILES``. -Essentially, :data:`numberOfClusters` is set to the specified +Essentially, :data:`totalSubrings` is set to the specified ``N_IP_CLUSTERS``. All of the ``PROXY_LIST_FILES``, plus the list of Tor Exit relays (downloaded into memory with :script:`get-tor-exits`), are stored in :data:`proxies`, and the latter is added as an -additional cluster (such that :data:`numberOfClusters` becomes +additional cluster (such that :data:`totalSubrings` becomes ``N_IP_CLUSTERS + 1``). The number of subhashrings which this :class:`Distributor` has active in its hashring is then -:data:`numberOfClusters`, where the last cluster is reserved for all +:data:`totalSubrings`, where the last cluster is reserved for all :data:`proxies`. As an example, if BridgeDB was configured with ``N_IP_CLUSTERS=4`` and @@ -302,14 +301,14 @@ class IPBasedDistributor(Distributor): logging.info(Prepopulating %s distributor hashrings... % self.name)
[tor-commits] [bridgedb/master] Add tests for bridgedb.Dist module.
commit 6c10de805e607e9c27c1f3ba4d79097c11c76dbb Author: Isis Lovecruft i...@torproject.org Date: Sat Apr 18 03:16:31 2015 + Add tests for bridgedb.Dist module. --- lib/bridgedb/test/test_Dist.py | 245 1 file changed, 245 insertions(+) diff --git a/lib/bridgedb/test/test_Dist.py b/lib/bridgedb/test/test_Dist.py new file mode 100644 index 000..a3c8308 --- /dev/null +++ b/lib/bridgedb/test/test_Dist.py @@ -0,0 +1,245 @@ +# -*- coding: utf-8 -*- +# +# This file is part of BridgeDB, a Tor bridge distribution system. +# +# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 i...@torproject.org +# please also see AUTHORS file +# :copyright: (c) 2013-2015 Isis Lovecruft +# (c) 2007-2015, The Tor Project, Inc. +# (c) 2007-2015, all entities within the AUTHORS file +# :license: 3-clause BSD, see included LICENSE for information + +Tests for :mod:`bridgedb.Dist`. + +from __future__ import print_function + +import hashlib +import ipaddr +import random + +from twisted.trial import unittest + +from bridgedb import Dist +from bridgedb.bridges import Bridge +from bridgedb.bridges import PluggableTransport +from bridgedb.Bridges import BridgeRing +from bridgedb.Filters import filterBridgesByNotBlockedIn +from bridgedb.https.request import HTTPSBridgeRequest +from bridgedb.proxy import ProxySet +from bridgedb.test.util import randomHighPort +from bridgedb.test.util import randomValidIPv4String +from bridgedb.test.util import randomValidIPv6 +from bridgedb.test.https_helpers import DummyRequest + + +def _generateFakeBridges(n=500): +bridges = [] + +for i in range(n): +addr = randomValidIPv4String() +nick = 'bridge-%d' % i +port = randomHighPort() +# Real tor currently only supports one extra ORAddress, and it can +# only be IPv6. +addrs = [(randomValidIPv6(), randomHighPort(), 6)] +fpr = .join(random.choice('abcdef0123456789') for _ in xrange(40)) + +# We only support the ones without PT args, because they're easier to fake. +supported = [obfs2, obfs3, fte] +transports = [] +for j, method in zip(range(1, len(supported) + 1), supported): +pt = PluggableTransport(fpr, method, addr, port - j, {}) +transports.append(pt) + +bridge = Bridge(nick, addr, port, fpr) +bridge.flags.update(Running Stable) +bridge.transports = transports +bridge.orAddresses = addrs +bridges.append(bridge) + +return bridges + + +BRIDGES = _generateFakeBridges() + + +class GetNumBridgesPerAnswerTests(unittest.TestCase): +Unittests for :func:`bridgedb.Dist.getNumBridgesPerAnswer`. + +def setUp(self): +self.key = 'aQpeOFIj8q20s98awfoiq23rpOIjFaqpEWFoij1X' +self.ring = BridgeRing(self.key) +self.bridges = _generateFakeBridges() + +def test_Dist_getNumBridgesPerAnswer_120(self): +[self.ring.insert(bridge) for bridge in self.bridges[:120]] +self.assertEqual(Dist.getNumBridgesPerAnswer(self.ring), 3) + +def test_Dist_getNumBridgesPerAnswer_100(self): +[self.ring.insert(bridge) for bridge in self.bridges[:100]] +self.assertEqual(Dist.getNumBridgesPerAnswer(self.ring), 3) + +def test_Dist_getNumBridgesPerAnswer_50(self): +[self.ring.insert(bridge) for bridge in self.bridges[:60]] +self.assertEqual(Dist.getNumBridgesPerAnswer(self.ring), 2) + +def test_Dist_getNumBridgesPerAnswer_15(self): +[self.ring.insert(bridge) for bridge in self.bridges[:15]] +self.assertEqual(Dist.getNumBridgesPerAnswer(self.ring), 1) + +def test_Dist_getNumBridgesPerAnswer_100_max_5(self): +[self.ring.insert(bridge) for bridge in self.bridges[:100]] +self.assertEqual( +Dist.getNumBridgesPerAnswer(self.ring, max_bridges_per_answer=5), +5) + + +class HTTPSDistributorTests(unittest.TestCase): +Tests for :class:`HTTPSDistributor`. + +def setUp(self): +self.key = 'aQpeOFIj8q20s98awfoiq23rpOIjFaqpEWFoij1X' +self.bridges = BRIDGES + +def tearDown(self): +Reset all bridge blocks in between test method runs. +for bridge in self.bridges: +bridge._blockedIn = {} + +def coinFlip(self): +return bool(random.getrandbits(1)) + +def randomClientRequest(self): +bridgeRequest = HTTPSBridgeRequest(addClientCountryCode=False) +bridgeRequest.client = randomValidIPv4String() +bridgeRequest.isValid(True) +bridgeRequest.generateFilters() +return bridgeRequest + +def randomClientRequestForNotBlockedIn(self, cc): +httpRequest = DummyRequest(['']) +httpRequest.args.update({'unblocked': [cc]}) +bridgeRequest = self.randomClientRequest() +bridgeRequest.withoutBlockInCountry(httpRequest) +bridgeRequest.generateFilters() +return bridgeRequest + +def
[tor-commits] [bridgedb/master] Add tests for https.request.HTTPSBridgeRequest and BridgeRequestBase.
commit 8cd195e2a518694094f53bb24921eb499e31c270 Author: Isis Lovecruft i...@torproject.org Date: Tue Apr 14 10:15:23 2015 + Add tests for https.request.HTTPSBridgeRequest and BridgeRequestBase. --- lib/bridgedb/test/test_bridgerequest.py | 18 +++- lib/bridgedb/test/test_https_request.py | 75 +++ 2 files changed, 91 insertions(+), 2 deletions(-) diff --git a/lib/bridgedb/test/test_bridgerequest.py b/lib/bridgedb/test/test_bridgerequest.py index b4da71b..3392a4e 100644 --- a/lib/bridgedb/test/test_bridgerequest.py +++ b/lib/bridgedb/test/test_bridgerequest.py @@ -40,5 +40,19 @@ class BridgeRequestBaseTests(unittest.TestCase): BridgeRequestBase.withPluggableTransportType() should add the pluggable transport type to the ``transport`` attribute. -self.request.withPluggableTransportType('huggable-transport') -self.assertIn('huggable-transport', self.request.transports) +self.request.withPluggableTransportType('huggable_transport') +self.assertIn('huggable_transport', self.request.transports) + +def test_BridgeRequestBase_getHashringPlacement_without_client(self): +BridgeRequestBase.getHashringPlacement() without a client parameter +should use the default client identifier string. + +self.assertEqual(self.request.getHashringPlacement(''), + 3486762050L) + +def test_BridgeRequestBase_getHashringPlacement_with_client(self): +BridgeRequestBase.getHashringPlacement() with a client parameter +should use the client identifier string. + +self.assertEqual(self.request.getHashringPlacement('', client='you'), + 2870307088L) diff --git a/lib/bridgedb/test/test_https_request.py b/lib/bridgedb/test/test_https_request.py new file mode 100644 index 000..f4f6640 --- /dev/null +++ b/lib/bridgedb/test/test_https_request.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +#_ +# +# This file is part of BridgeDB, a Tor bridge distribution system. +# +# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 i...@torproject.org +# please also see AUTHORS file +# :copyright: (c) 2007-2015, The Tor Project, Inc. +# (c) 2014-2015, Isis Lovecruft +# :license: see LICENSE for licensing information +#_ + + +from twisted.trial import unittest + +from bridgedb.bridgerequest import IRequestBridges +from bridgedb.https import request + + +class MockRequest(object): +def __init__(self, args): +self.args = args + + +class HTTPSBridgeRequestTests(unittest.TestCase): +Unittests for :class:`bridgedb.https.request.HTTPSBridgeRequest`. + +def setUp(self): +Setup test run. +self.request = request.HTTPSBridgeRequest() + +def test_HTTPSBridgeRequest_implements_IRequestBridges(self): +HTTPSBridgeRequest should implement IRequestBridges interface. + self.assertTrue(IRequestBridges.implementedBy(request.HTTPSBridgeRequest)) + +def test_HTTPSBridgeRequest_withIPversion(self): +HTTPSBridgeRequest.withIPversion({ipv6=[â¦]}) should store that the +client wanted IPv6 bridges. +parameters = {'ipv6': 'wo'} +self.request.withIPversion(parameters) + +def test_HTTPSBridgeRequest_withoutBlockInCountry_IR(self): +HTTPSBridgeRequest.withoutBlockInCountry() should add the country CC +to the ``notBlockedIn`` attribute. + +httprequest = MockRequest({'unblocked': ['IR']}) +self.request.withoutBlockInCountry(httprequest) +self.assertIn('IR', self.request.notBlockedIn) + +def test_HTTPSBridgeRequest_withoutBlockInCountry_US(self): +HTTPSBridgeRequest.withoutBlockInCountry() should add the country CC +to the ``notBlockedIn`` attribute (and not any other countries). + +httprequest = MockRequest({'unblocked': ['US']}) +self.request.withoutBlockInCountry(httprequest) +self.assertNotIn('IR', self.request.notBlockedIn) + +def test_HTTPSBridgeRequest_withoutBlockInCountry_no_addClientCountryCode(self): +HTTPSBridgeRequest.withoutBlockInCountry(), when +addClientCountryCode=False, shouldn't add the client's country code to the +``notBlockedIn`` attribute. + +httprequest = MockRequest({'unblocked': ['NL']}) +self.request = request.HTTPSBridgeRequest(addClientCountryCode=False) +self.request.client = '5.5.5.5' +self.request.withoutBlockInCountry(httprequest) +self.assertItemsEqual(['NL'], self.request.notBlockedIn) + +def test_HTTPSBridgeRequest_withPluggableTransportType(self): +HTTPSBridgeRequest.withPluggableTransportType() should add the +pluggable transport type to the ``transport``
[bridgedb/master] Rename in EmailBasedDistributor.getBridges() `epoch` → `interval`.
commit 53732c492d29f094d17530bf60d740d957b21eab Author: Isis Lovecruft i...@torproject.org Date: Thu Apr 9 05:03:37 2015 + Rename in EmailBasedDistributor.getBridges() `epoch` â `interval`. --- lib/bridgedb/Dist.py |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index 3f7835b..69d9eb6 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -448,7 +448,7 @@ class EmailBasedDistributor(Distributor): Assign a bridge to this distributor. self.splitter.insert(bridge) -def getBridges(self, bridgeRequest, epoch, N=1): +def getBridges(self, bridgeRequest, interval, N=1): Return a list of bridges to give to a user. :type bridgeRequest: :class:`~bridgedb.email.request.EmailBridgeRequest` @@ -456,7 +456,7 @@ class EmailBasedDistributor(Distributor): with the :data:`~bridgedb.bridgerequest.BridgeRequestBase.client` attribute set to a string containing the client's full, canonicalized email address. -:param epoch: The time period when we got this request. This can be +:param interval: The time period when we got this request. This can be any string, so long as it changes with every period. :param int N: The number of bridges to try to give back. @@ -501,7 +501,7 @@ class EmailBasedDistributor(Distributor): elif wasWarned: db.setWarnedEmail(bridgeRequest.client, False) -pos = self.emailHmac(%s%s % (epoch, bridgeRequest.client)) +pos = self.emailHmac(%s%s % (interval, bridgeRequest.client)) ring = None ruleset = frozenset(bridgeRequest.filters) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Remove the idea of categories. Proxies constitute another cluster.
commit 9ba68b455a8adeaef34785ecccbe7ac5a5d5ac26 Author: Isis Lovecruft i...@torproject.org Date: Sat Apr 11 01:10:05 2015 + Remove the idea of categories. Proxies constitute another cluster. This completely removes the half-baked idea of IP categories from BridgeDB's codebase. An IPBasedDistributor now holds a bunch of proxies (in one single bridgedb.proxy.ProxySet). These proxies have their own cluster. End of story. No more messing around with both categories and clusters, because nobody ever knew what either of those were anyway, much less why they were different. * CHANGE IPBasedDistributor.categories to be a single bridgedb.proxy.ProxySet, rather than a list of lists. ProxySets have tags for each proxy within them, and can efficiently separate proxies based upon tag(s), so there is no longer any need to have a list of lists to keep the proxies separate. Besides, in the end, we treat all clients coming from any proxy the same, regardless of whether the proxy is a Tor Exit relay or some other known open proxy. * RENAME IPBasedDistributor.categories â IPBasedDistributor.proxies, because no one ever understood what an IP category was. * CHANGE IPBasedDistributor.numberOfClusters to always include the cluster for clients coming from proxies, if IPBasedDistributor.proxies is configured. * ADD IPBasedDistributor.proxyCluster, which is an integer pointing to the cluster number for the proxies cluster. If there is no cluster for proxies, it is set to 0. Otherwise, it points to the last cluster. * CHANGE the numbering of clusters in IPBasedDistributor to start from 1 instead of 0. While this might make iteration over all of the clusters increasingly subject to fencepost errors, it still makes the code feel more intuitive, i.e. The first cluster is 1 out of 5 total clusters, and the last cluster is 5/5 rather than The first cluster is number 0 out of 5 total clusters, and the last 4/5. * CHANGE a couple test cases which expected IPBasedDistributor.categories to exist. * UPDATE documentation pertaining to all of the above, as well as the documentation on (sub)hashring structure. --- lib/bridgedb/Dist.py | 172 +++-- lib/bridgedb/Main.py | 41 +++-- lib/bridgedb/test/legacy_Tests.py | 11 ++- lib/bridgedb/test/test_Main.py|4 +- 4 files changed, 107 insertions(+), 121 deletions(-) diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index 2f63574..ab7ae6e 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -20,6 +20,7 @@ import time import bridgedb.Bridges import bridgedb.Storage +from bridgedb import proxy from bridgedb.crypto import getHMAC from bridgedb.crypto import getHMACFunc from bridgedb.Filters import filterAssignBridgesToRing @@ -134,7 +135,9 @@ class IPBasedDistributor(Distributor): hashrings, one for each area in the ``areaMapper``. Every inserted bridge will go into one of these rings, and every area is associated with one. -:ivar categories: DOCDOC See :param:`proxySets`. +:type proxies: :class:`~bridgedb.proxies.ProxySet` +:ivar proxies: All known proxies, which we treat differently. See +:param:`proxies`. :type splitter: :class:`bridgedb.Bridges.FixedBridgeSplitter` :ivar splitter: A hashring that assigns bridges to subrings with fixed proportions. Used to assign bridges into the subrings of this @@ -142,7 +145,7 @@ class IPBasedDistributor(Distributor): def __init__(self, areaMapper, numberOfClusters, key, - proxySets=None, answerParameters=None): + proxies=None, answerParameters=None): Create a Distributor that decides which bridges to distribute based upon the client's IP address and the current time. @@ -160,27 +163,33 @@ class IPBasedDistributor(Distributor): :param bytes key: The master HMAC key for this distributor. All added bridges are HMACed with this key in order to place them into the hashrings. -:type proxySets: iterable or None -:param proxySets: DOCDOC +:type proxies: :class:`~bridgedb.proxy.ProxySet` +:param proxies: A :class:`bridgedb.proxy.ProxySet` containing known +Tor Exit relays and other known proxies. These will constitute +the extra cluster, and any client requesting bridges from one of +these **proxies** will be distributed bridges from a separate +subhashring that is specific to Tor/proxy users. :type answerParameters: :class:`bridgedb.Bridges.BridgeRingParameters` :param answerParameters: A mechanism for ensuring that the set of bridges that this
[tor-commits] [bridgedb/master] Whitespace fixes in bridgedb.https.server module.
commit e62191b6d484074d3d1fa30ef0cd4906822eaf2c Author: Isis Lovecruft i...@torproject.org Date: Thu Apr 16 05:10:47 2015 + Whitespace fixes in bridgedb.https.server module. --- lib/bridgedb/https/server.py | 106 +- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/lib/bridgedb/https/server.py b/lib/bridgedb/https/server.py index ab15ef3..6010218 100644 --- a/lib/bridgedb/https/server.py +++ b/lib/bridgedb/https/server.py @@ -6,8 +6,8 @@ # :copyright: (c) 2007-2015, The Tor Project, Inc. # (c) 2013-2015, Isis Lovecruft # :license: see LICENSE for licensing information - - + + .. py:module:: bridgedb.https.server :synopsis: Servers which interface with clients and distribute bridges over HTTP(S). @@ -16,16 +16,16 @@ bridgedb.https.server = Servers which interface with clients and distribute bridges over HTTP(S). - - -import base64 -import gettext -import logging + + +import base64 +import gettext +import logging import random -import re -import time -import os - +import re +import time +import os + from functools import partial from ipaddr import IPv4Address @@ -34,14 +34,14 @@ import mako.exceptions from mako.template import Template from mako.lookup import TemplateLookup -from twisted.internet import reactor +from twisted.internet import reactor from twisted.internet.error import CannotListenError from twisted.web import resource -from twisted.web import static +from twisted.web import static from twisted.web.server import NOT_DONE_YET from twisted.web.server import Site -from twisted.web.util import redirectTo - +from twisted.web.util import redirectTo + from bridgedb import captcha from bridgedb import crypto from bridgedb import strings @@ -49,8 +49,8 @@ from bridgedb import translations from bridgedb import txrecaptcha from bridgedb.Filters import filterBridgesByIP4 from bridgedb.Filters import filterBridgesByIP6 -from bridgedb.Filters import filterBridgesByTransport -from bridgedb.Filters import filterBridgesByNotBlockedIn +from bridgedb.Filters import filterBridgesByTransport +from bridgedb.Filters import filterBridgesByNotBlockedIn from bridgedb.https.request import HTTPSBridgeRequest from bridgedb.parse import headers from bridgedb.parse.addr import isIPAddress @@ -63,7 +63,7 @@ from bridgedb.util import replaceControlChars TEMPLATE_DIR = os.path.join(os.path.dirname(__file__), 'templates') rtl_langs = ('ar', 'he', 'fa', 'gu_IN', 'ku') - + # Setting `filesystem_checks` to False is recommended for production servers, # due to potential speed increases. This means that the atimes of the Mako # template files aren't rechecked every time the template is requested @@ -214,10 +214,10 @@ class CaptchaProtectedResource(resource.Resource): resource.Resource.__init__(self) self.publicKey = publicKey self.secretKey = secretKey -self.useForwardedHeader = useForwardedHeader +self.useForwardedHeader = useForwardedHeader self.resource = protectedResource - -def getClientIP(self, request): + +def getClientIP(self, request): Get the client's IP address from the :header:`X-Forwarded-For` header, or from the :api:`request twisted.web.server.Request`. @@ -228,7 +228,7 @@ class CaptchaProtectedResource(resource.Resource): :returns: The client's IP address, if it was obtainable. return getClientIP(request, self.useForwardedHeader) - + def getCaptchaImage(self, request=None): Get a CAPTCHA image. @@ -269,7 +269,7 @@ class CaptchaProtectedResource(resource.Resource): return False -def render_GET(self, request): +def render_GET(self, request): Retrieve a ReCaptcha from the API server and serve it to the client. :type request: :api:`twisted.web.http.Request` @@ -298,8 +298,8 @@ class CaptchaProtectedResource(resource.Resource): request.setHeader(Content-Type, text/html; charset=utf-8) return rendered - -def render_POST(self, request): + +def render_POST(self, request): Process a client's CAPTCHA solution. If the client's CAPTCHA solution is valid (according to @@ -328,8 +328,8 @@ class CaptchaProtectedResource(resource.Resource): logging.debug(Client failed a CAPTCHA; returning redirect to %s % request.uri) return redirectTo(request.uri, request) - - + + class GimpCaptchaProtectedResource(CaptchaProtectedResource): A web resource which uses a local cache of CAPTCHAs, generated with gimp-captcha_, to protect another resource. @@ -626,9 +626,9 @@ class ReCaptchaProtectedResource(CaptchaProtectedResource): class BridgesResource(resource.Resource): This resource displays bridge lines in response to a request. -isLeaf = True - -def __init__(self, distributor,
[tor-commits] [bridgedb/master] Remove Bridges.BridgeHolder class.
commit 346d321fa4f78626c49cd4ff6d82a346267f6c0c Author: Isis Lovecruft i...@torproject.org Date: Sun Apr 19 03:25:11 2015 + Remove Bridges.BridgeHolder class. It wasn't a real metaclass, base class, or interface; its methods were never used; it didn't provide any decent documentation; not everything which inherited from it used its methods; nothing called super() for it, or otherwise called methods on it. Totally useless. * REMOVE bridgedb.Bridges.BridgeHolder class. * CHANGE everything which previously inherited from BridgeHolder to simply inherit from object instead. --- lib/bridgedb/Bridges.py| 63 lib/bridgedb/Main.py |4 +-- lib/bridgedb/persistent.py |3 +- lib/bridgedb/test/test_Main.py |6 ++-- 4 files changed, 32 insertions(+), 44 deletions(-) diff --git a/lib/bridgedb/Bridges.py b/lib/bridgedb/Bridges.py index 5742794..1a06dd8 100644 --- a/lib/bridgedb/Bridges.py +++ b/lib/bridgedb/Bridges.py @@ -39,18 +39,6 @@ DIGEST_LEN = 20 PORTSPEC_LEN = 16 -class BridgeHolder(object): -Abstract base class for all classes that hold bridges. -def insert(self, bridge): -raise NotImplementedError - -def clear(self): -pass - -def dumpAssignments(self, f, description=): -pass - - class BridgeRingParameters(object): Store validated settings on minimum number of Bridges with certain attributes which should be included in any generated subring of a @@ -99,7 +87,8 @@ class BridgeRingParameters(object): self.needPorts = needPorts[:] self.needFlags = [(flag.lower(), count) for flag, count in needFlags[:]] -class BridgeRing(BridgeHolder): + +class BridgeRing(object): Arranges bridges into a hashring based on an hmac function. def __init__(self, key, answerParameters=None): @@ -333,15 +322,13 @@ class BridgeRing(BridgeHolder): f.write(%s %s\n % (b.fingerprint, .join(desc).strip())) -class FixedBridgeSplitter(BridgeHolder): -A bridgeholder that splits bridges up based on an hmac and assigns - them to several sub-bridgeholders with equal probability. +class FixedBridgeSplitter(object): +Splits bridges up based on an HMAC and assigns them to one of several +subhashrings with equal probability. def __init__(self, key, rings): self.hmac = getHMACFunc(key, hex=True) self.rings = rings[:] -for r in self.rings: -assert(isinstance(r, BridgeHolder)) def insert(self, bridge): # Grab the first 4 bytes @@ -366,7 +353,7 @@ class FixedBridgeSplitter(BridgeHolder): Write all bridges assigned to this hashring to ``filename``. :param string description: If given, include a description next to the -index number of the ring from :attr:`FilteredBridgeHolder.rings` +index number of the ring from :attr:`FilteredBridgeSplitter.rings` the following bridges were assigned to. For example, if the description is ``IPv6 obfs2 bridges`` the line would read: ``IPv6 obfs2 bridges ring=3``. @@ -374,7 +361,8 @@ class FixedBridgeSplitter(BridgeHolder): for index, ring in zip(xrange(len(self.rings)), self.rings): ring.dumpAssignments(filename, %s ring=%s % (description, index)) -class UnallocatedHolder(BridgeHolder): + +class UnallocatedHolder(object): A pseudo-bridgeholder that ignores its bridges and leaves them unassigned. @@ -407,10 +395,11 @@ class UnallocatedHolder(BridgeHolder): continue f.write(%s %s\n % (bridge.hex_key, .join(desc).strip())) -class BridgeSplitter(BridgeHolder): -A BridgeHolder that splits incoming bridges up based on an hmac, - and assigns them to sub-bridgeholders with different probabilities. - Bridge-to-bridgeholder associations are recorded in a store. + +class BridgeSplitter(object): +Splits incoming bridges up based on an HMAC, and assigns them to +sub-bridgeholders with different probabilities. Bridge ââ BridgeSplitter +associations are recorded in a store. def __init__(self, key): self.hmac = getHMACFunc(key, hex=True) @@ -428,12 +417,13 @@ class BridgeSplitter(BridgeHolder): return n def addRing(self, ring, ringname, p=1): -Add a new bridgeholder. - ring -- the bridgeholder to add. - ringname -- a string representing the bridgeholder. This is used - to record which bridges have been assigned where in the store. - p -- the relative proportion of bridges to assign to this - bridgeholder. +Add a new subring. + +:param ring: The subring to add. +:param str ringname: This is used to record which bridges have been +assigned where in the store. +:param int p: The
[bridgedb/master] Rename IPBasedDistributor → HTTPSDistributor.
commit ae7acb11669b380de4f7873857ca30167cd493b9 Author: Isis Lovecruft i...@torproject.org Date: Thu Apr 16 05:44:32 2015 + Rename IPBasedDistributor â HTTPSDistributor. --- lib/bridgedb/Bridges.py|2 +- lib/bridgedb/Dist.py | 25 + lib/bridgedb/Main.py |6 +++--- lib/bridgedb/bridges.py|2 +- lib/bridgedb/https/request.py |2 +- lib/bridgedb/https/server.py |4 ++-- lib/bridgedb/test/https_helpers.py |4 ++-- lib/bridgedb/test/legacy_Tests.py | 20 ++-- lib/bridgedb/test/test_Main.py | 10 +- lib/bridgedb/test/test_https_server.py |6 +++--- 10 files changed, 41 insertions(+), 40 deletions(-) diff --git a/lib/bridgedb/Bridges.py b/lib/bridgedb/Bridges.py index a13a73e..b8fdd2e 100644 --- a/lib/bridgedb/Bridges.py +++ b/lib/bridgedb/Bridges.py @@ -523,7 +523,7 @@ class FilteredBridgeSplitter(BridgeHolder): :ivar bridges: DOCDOC :type distributorName: str :ivar distributorName: The name of this splitter's distributor. See - :meth:`bridgedb.Dist.IPBasedDistributor.setDistributorName`. + :meth:`bridgedb.Dist.HTTPSDistributor.setDistributorName`. self.key = key self.filterRings = {} diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index ff9a85d..e66c1e6 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -67,6 +67,7 @@ class Distributor(object): def __init__(self): super(Distributor, self).__init__() +self.name = None def setDistributorName(self, name): Set a **name** for identifying this distributor. @@ -78,12 +79,10 @@ class Distributor(object): hashrings will also carry that name. from bridgedb import Dist - ipDist = Dist.IPBasedDistributor(5, 'fake-hmac-key') - ipDist.setDistributorName('HTTPS Distributor') - ipDist.prepopulateRings() - hashrings = ipDist.hashring.filterRings - firstSubring = hashrings.items()[0][1][1] - assert firstSubring.name + dist = Dist.HTTPSDistributor(2, 'masterkey') + dist.setDistributorName('Excellent Distributor') + dist.name +'Excellent Distributor' :param str name: A name for this distributor. @@ -91,7 +90,7 @@ class Distributor(object): self.hashring.distributorName = name -class IPBasedDistributor(Distributor): +class HTTPSDistributor(Distributor): A Distributor that hands out bridges based on the IP address of an incoming request and the current time period. @@ -128,6 +127,8 @@ class IPBasedDistributor(Distributor): parameters, i.e. that an answer has at least two obfsproxy bridges or at least one bridge on port 443, etc. +super(HTTPSDistributor, self).__init__() + self.key = key self.totalSubrings = totalSubrings self.answerParameters = answerParameters @@ -171,14 +172,14 @@ class IPBasedDistributor(Distributor): ``1.2.178.234``) are placed within the same cluster, but Carol (with address ``1.3.11.33``) *might* end up in a different cluster. - from bridgedb.Dist import IPBasedDistributor - IPBasedDistributor.getSubnet('1.2.3.4') + from bridgedb.Dist import HTTPSDistributor + HTTPSDistributor.getSubnet('1.2.3.4') '1.2.0.0/16' - IPBasedDistributor.getSubnet('1.2.211.154') + HTTPSDistributor.getSubnet('1.2.211.154') '1.2.0.0/16' - IPBasedDistributor.getSubnet('2001:f::bc1:b13:2808') + HTTPSDistributor.getSubnet('2001:f::bc1:b13:2808') '2001:f::/32' - IPBasedDistributor.getSubnet('2a00:c98:2030:a020:2::42') + HTTPSDistributor.getSubnet('2a00:c98:2030:a020:2::42') '2a00:c98::/32' :param str ip: A string representing an IPv4 or IPv6 address. diff --git a/lib/bridgedb/Main.py b/lib/bridgedb/Main.py index 1262122..0bb319d 100644 --- a/lib/bridgedb/Main.py +++ b/lib/bridgedb/Main.py @@ -194,7 +194,7 @@ def createBridgeRings(cfg, proxyList, key): known open proxies. :param bytes key: Hashring master key :rtype: tuple -:returns: A BridgeSplitter hashring, an IPBasedDistributor or None, +:returns: A BridgeSplitter hashring, an HTTPSDistributor or None, and an EmailBasedDistributor or None. # Create a BridgeSplitter to assign the bridges to the different @@ -210,7 +210,7 @@ def createBridgeRings(cfg, proxyList, key): # As appropriate, create an IP-based distributor. if cfg.HTTPS_DIST and cfg.HTTPS_SHARE: logging.debug(Setting up HTTPS Distributor...) -ipDistributor = Dist.IPBasedDistributor( +ipDistributor = Dist.HTTPSDistributor( cfg.N_IP_CLUSTERS,
[tor-commits] [bridgedb/master] Remove the __len__() method from all Distributors.
commit e6357735d612074fe32f2273c52d9254427caa37 Author: Isis Lovecruft i...@torproject.org Date: Sun Apr 19 03:51:43 2015 + Remove the __len__() method from all Distributors. --- lib/bridgedb/Dist.py |6 -- lib/bridgedb/Main.py |4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index fe81c04..e149d17 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -346,9 +346,6 @@ class HTTPSDistributor(Distributor): return answer -def __len__(self): -return len(self.hashring) - def dumpAssignments(self, f, description=): self.hashring.dumpAssignments(f, description) @@ -475,9 +472,6 @@ class EmailBasedDistributor(Distributor): return result -def __len__(self): -return len(self.hashring) - def cleanDatabase(self): with bridgedb.Storage.getDB() as db: try: diff --git a/lib/bridgedb/Main.py b/lib/bridgedb/Main.py index f382cc5..ba74b66 100644 --- a/lib/bridgedb/Main.py +++ b/lib/bridgedb/Main.py @@ -215,7 +215,7 @@ def createBridgeRings(cfg, proxyList, key): crypto.getHMAC(key, HTTPS-IP-Dist-Key), proxyList, answerParameters=ringParams) -hashring.addRing(ipDistributor, https, cfg.HTTPS_SHARE) +hashring.addRing(ipDistributor.hashring, https, cfg.HTTPS_SHARE) # As appropriate, create an email-based distributor. if cfg.EMAIL_DIST and cfg.EMAIL_SHARE: @@ -226,7 +226,7 @@ def createBridgeRings(cfg, proxyList, key): cfg.EMAIL_DOMAIN_RULES.copy(), answerParameters=ringParams, whitelist=cfg.EMAIL_WHITELIST.copy()) -hashring.addRing(emailDistributor, email, cfg.EMAIL_SHARE) +hashring.addRing(emailDistributor.hashring, email, cfg.EMAIL_SHARE) # As appropriate, tell the hashring to leave some bridges unallocated. if cfg.RESERVED_SHARE: ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Add two more tests for Bridge.getBridgeLine() for blocked PTs.
commit 534969dff39cd0307838bda213f0b183f6c5b24f Author: Isis Lovecruft i...@torproject.org Date: Sat Apr 18 05:12:12 2015 + Add two more tests for Bridge.getBridgeLine() for blocked PTs. --- lib/bridgedb/test/test_bridges.py | 41 + 1 file changed, 41 insertions(+) diff --git a/lib/bridgedb/test/test_bridges.py b/lib/bridgedb/test/test_bridges.py index d7dd810..499a8c2 100644 --- a/lib/bridgedb/test/test_bridges.py +++ b/lib/bridgedb/test/test_bridges.py @@ -1484,6 +1484,47 @@ class BridgeTests(unittest.TestCase): self.assertIsNone(line) +def test_Bridge_getBridgeLine_blocked_pt_and_request_without_block_pt(self): +Calling getBridgeLine() with a valid request for obfs3 bridges not +blocked in Iran, when the obfs3 line is blocked in Iran, shouldn't +return a bridge line. + +self.bridge.updateFromNetworkStatus(self.networkstatus) +self.bridge.updateFromServerDescriptor(self.serverdescriptor) +self.bridge.updateFromExtraInfoDescriptor(self.extrainfo) + +self.bridge.setBlockedIn('ir', methodname=obfs3) + +request = BridgeRequestBase() +request.isValid(True) +request.withoutBlockInCountry('IR') +request.withPluggableTransportType('obfs3') +line = self.bridge.getBridgeLine(request) + +self.assertIsNone(line) + +def test_Bridge_getBridgeLine_blocked_obfs3_and_request_without_block_obfs4(self): +Calling getBridgeLine() with a valid request for obfs4 bridges not +blocked in Iran, when the obfs3 line is blocked in Iran, should return +a bridge line. + +self.bridge.updateFromNetworkStatus(self.networkstatus) +self.bridge.updateFromServerDescriptor(self.serverdescriptor) +self.bridge.updateFromExtraInfoDescriptor(self.extrainfo) + +self.bridge.setBlockedIn('ir', methodname=obfs3) + +request = BridgeRequestBase() +request.isValid(True) +request.withoutBlockInCountry('IR') +request.withPluggableTransportType('obfs4') +line = self.bridge.getBridgeLine(request) + +self.assertIsNotNone(line) +self.assertIn('obfs4', line) +self.assertIn('179.178.155.140:36493', line) +self.assertIn('2C3225C4805331025E211F4B6E5BF45C333FDD2C', line) + def test_Bridge_getBridgeLine_IPv6(self): Calling getBridgeLine() with a valid request for IPv6 bridges should return a bridge line. ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Teach Bridge._getTransportForRequest() to filter blocked addresses.
commit b77e0126da7132c02453111310231d4912818a66 Author: Isis Lovecruft i...@torproject.org Date: Sat Apr 18 06:25:49 2015 + Teach Bridge._getTransportForRequest() to filter blocked addresses. --- lib/bridgedb/bridges.py | 52 +-- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/lib/bridgedb/bridges.py b/lib/bridgedb/bridges.py index 8f4f853..dc5b78d 100644 --- a/lib/bridgedb/bridges.py +++ b/lib/bridgedb/bridges.py @@ -1040,6 +1040,13 @@ class Bridge(BridgeBackwardsCompatibility): :term:`Bridge Line` based upon the client identifier in the **bridgeRequest**. +.. warning:: If this bridge doesn't have any of the requested +pluggable transport type (optionally, not blocked in whichever +countries the user doesn't want their bridges to be blocked in), +then this method returns ``None``. This should only happen +rarely, because the bridges are filtered into the client's +hashring based on the **bridgeRequest** options. + :type bridgeRequest: :class:`bridgedb.bridgerequest.BridgeRequestBase` :param bridgeRequest: A ``BridgeRequest`` which stores all of the client-specified options for which type of bridge they want to @@ -1056,29 +1063,40 @@ class Bridge(BridgeBackwardsCompatibility): return a :term:`Bridge Line` for the requested pluggable transport type. +desired = bridgeRequest.justOnePTType() addressClass = bridgeRequest.addressClass -desiredTransport = bridgeRequest.justOnePTType() -hashringPosition = bridgeRequest.getHashringPlacement(bridgeRequest.client, - 'Order-Or-Addresses') logging.info(Bridge %s answering request for %s transport... % - (safelog.logSafely(self.fingerprint), desiredTransport)) + (self, desired)) + # Filter all this Bridge's ``transports`` according to whether or not -# their ``methodname`` matches the requested transport, i.e. only -# 'obfs3' transports, or only 'scramblesuit' transports: -transports = filter(lambda pt: desiredTransport == pt.methodname, -self.transports) +# their ``methodname`` matches the requested transport: +transports = filter(lambda pt: pt.methodname == desired, self.transports) # Filter again for whichever of IPv4 or IPv6 was requested: transports = filter(lambda pt: isinstance(pt.address, addressClass), transports) -if transports: -return transports[hashringPosition % len(transports)] -else: +if not transports: raise PluggableTransportUnavailable( -(Client requested transport %s from bridge %s, but this - bridge doesn't have any of that transport!) % -(desiredTransport, self.fingerprint)) +(Client requested transport %s, but bridge %s doesn't +have any of that transport!) % (desired, self)) + + +unblocked = [] +for pt in transports: +if not sum([self.transportIsBlockedIn(cc, pt.methodname) +for cc in bridgeRequest.notBlockedIn]): +unblocked.append(pt) + +if unblocked: +position = bridgeRequest.getHashringPlacement('Order-Or-Addresses') +return transports[position % len(unblocked)] +else: +logging.warn((Client requested transport %s%s, but bridge %s + doesn't have any of that transport!) % + (desired, not blocked in %s % + .join(bridgeRequest.notBlockedIn) + if bridgeRequest.notBlockedIn else , self)) def _getVanillaForRequest(self, bridgeRequest): If vanilla bridges were requested, return the assigned @@ -1235,9 +1253,13 @@ class Bridge(BridgeBackwardsCompatibility): logging.info(Bridge request was not valid. Dropping request.) return # XXX raise error perhaps? +bridgeLine = None + if bridgeRequest.transports: pt = self._getTransportForRequest(bridgeRequest) -bridgeLine = pt.getTransportLine(includeFingerprint, bridgePrefix) +if pt: +bridgeLine = pt.getTransportLine(includeFingerprint, + bridgePrefix) else: addrport = self._getVanillaForRequest(bridgeRequest) bridgeLine = self._constructBridgeLine(addrport, ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[bridgedb/master] Move Dist.getNumBridgesPerAnswer() → Distributor.bridgesPerResponse().
commit a51f553e281091bc365d4161da2fb8d1b33923d9 Author: Isis Lovecruft i...@torproject.org Date: Sat Apr 18 22:41:27 2015 + Move Dist.getNumBridgesPerAnswer() â Distributor.bridgesPerResponse(). It was meant to be a method; it operates on the length of the primary hashring of a Distributor. Having it outside of the class that it interacts with is just wacky. * CHANGE getNumBridgesPerAnswer into a method for the Distributor class. * CHANGE the unittests for the function to take this into account. --- lib/bridgedb/Dist.py | 43 +- lib/bridgedb/test/test_Dist.py | 56 ++-- 2 files changed, 50 insertions(+), 49 deletions(-) diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index e66c1e6..93c08c1 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -48,26 +48,13 @@ class EmailRequestedKey(Exception): Raised when an incoming email requested a copy of our GnuPG keys. -def getNumBridgesPerAnswer(ring, max_bridges_per_answer=3): -if len(ring) 20: -n_bridges_per_answer = 1 -if 20 = len(ring) 100: -n_bridges_per_answer = min(2, max_bridges_per_answer) -if len(ring) = 100: -n_bridges_per_answer = max_bridges_per_answer - -logging.debug(Returning %d bridges from ring of len: %d % - (n_bridges_per_answer, len(ring))) - -return n_bridges_per_answer - - class Distributor(object): Distributes bridges to clients. def __init__(self): super(Distributor, self).__init__() self.name = None +self.hashring = None def setDistributorName(self, name): Set a **name** for identifying this distributor. @@ -89,6 +76,21 @@ class Distributor(object): self.name = name self.hashring.distributorName = name +def bridgesPerResponse(self, hashring=None, maximum=3): +if hashring is None: +hashring = self.hashring + +if len(hashring) 20: +n = 1 +if 20 = len(hashring) 100: +n = min(2, maximum) +if len(hashring) = 100: +n = maximum + +logging.debug(Returning %d bridges from ring of len: %d % + (n, len(hashring))) +return n + class HTTPSDistributor(Distributor): A Distributor that hands out bridges based on the IP address of an @@ -157,6 +159,9 @@ class HTTPSDistributor(Distributor): self.setDistributorName('HTTPS') +def bridgesPerResponse(self, hashring=None, maximum=3): +return super(HTTPSDistributor, self).bridgesPerResponse(hashring, maximum) + @classmethod def getSubnet(cls, ip, usingProxy=False, proxySubnets=4): Map all clients whose **ip**s are within the same subnet to the same @@ -386,7 +391,7 @@ class HTTPSDistributor(Distributor): populate_from=self.hashring.bridges) # Determine the appropriate number of bridges to give to the client: -returnNum = getNumBridgesPerAnswer(ring, max_bridges_per_answer=N) +returnNum = self.bridgesPerResponse(ring, maximum=N) answer = ring.getBridges(position, returnNum) return answer @@ -440,6 +445,9 @@ class EmailBasedDistributor(Distributor): self.setDistributorName('Email') +def bridgesPerResponse(self, hashring=None, maximum=3): +return super(EmailBasedDistributor, self).bridgesPerResponse(hashring, maximum) + def insert(self, bridge): Assign a bridge to this distributor. self.hashring.insert(bridge) @@ -515,9 +523,8 @@ class EmailBasedDistributor(Distributor): filterBridgesByRules(ruleset), populate_from=self.hashring.bridges) -numBridgesToReturn = getNumBridgesPerAnswer(ring, - max_bridges_per_answer=N) -result = ring.getBridges(pos, numBridgesToReturn) +returnNum = self.bridgesPerResponse(ring, maximum=N) +result = ring.getBridges(pos, returnNum) db.setEmailTime(bridgeRequest.client, now) db.commit() diff --git a/lib/bridgedb/test/test_Dist.py b/lib/bridgedb/test/test_Dist.py index a3c8308..f47449c 100644 --- a/lib/bridgedb/test/test_Dist.py +++ b/lib/bridgedb/test/test_Dist.py @@ -63,37 +63,6 @@ def _generateFakeBridges(n=500): BRIDGES = _generateFakeBridges() -class GetNumBridgesPerAnswerTests(unittest.TestCase): -Unittests for :func:`bridgedb.Dist.getNumBridgesPerAnswer`. - -def setUp(self): -self.key = 'aQpeOFIj8q20s98awfoiq23rpOIjFaqpEWFoij1X' -self.ring = BridgeRing(self.key) -self.bridges = _generateFakeBridges() - -def test_Dist_getNumBridgesPerAnswer_120(self): -[self.ring.insert(bridge) for bridge in self.bridges[:120]] -
[tor-commits] [bridgedb/master] Remove testDistWithFilterBlockedCountries() from legacy_Tests.
commit e9713d2a58566b761a68544d552ae5e702008a2d Author: Isis Lovecruft i...@torproject.org Date: Sun Apr 19 05:03:40 2015 + Remove testDistWithFilterBlockedCountries() from legacy_Tests. The functionality tested in testDistWithFilterBlockedCountries() is now tested in test_Dist.test_HTTPSDistributor_with_blocked_bridges() and test_Dist.test_HTTPSDistributor_with_some_blocked_bridges(). --- lib/bridgedb/test/legacy_Tests.py | 26 -- lib/bridgedb/test/test_Dist.py|2 ++ 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/lib/bridgedb/test/legacy_Tests.py b/lib/bridgedb/test/legacy_Tests.py index 4cdcc03..fc4ca5d 100644 --- a/lib/bridgedb/test/legacy_Tests.py +++ b/lib/bridgedb/test/legacy_Tests.py @@ -303,32 +303,6 @@ class IPBridgeDistTests(unittest.TestCase): filterBridgesByIP4, filterBridgesByIP6]) assert len(b) == 0 -def testDistWithFilterBlockedCountries(self): -d = bridgedb.Dist.HTTPSDistributor(3, Foo) -for _ in xrange(250): -d.insert(fakeBridge6(or_addresses=True)) -d.insert(fakeBridge(or_addresses=True)) - -for b in d.hashring.bridges: -# china blocks all :-( -for pt in b.transports: -key = %s:%s % (pt.address, pt.port) -b.blockingCountries[key] = set(['cn']) -for address, portlist in b.or_addresses.items(): -for port in portlist: -key = %s:%s % (address, port) -b.blockingCountries[key] = set(['cn']) -key = %s:%s % (b.ip, b.orport) -b.blockingCountries[key] = set(['cn']) - -for i in xrange(5): -b = d.getBridges(randomIPv4String(), x, bridgeFilterRules=[ -filterBridgesByNotBlockedIn(cn)]) -assert len(b) == 0 -b = d.getBridges(randomIPv4String(), x, bridgeFilterRules=[ -filterBridgesByNotBlockedIn(us)]) -assert len(b) 0 - def testDistWithFilterBlockedCountriesAdvanced(self): d = bridgedb.Dist.HTTPSDistributor(3, Foo) for _ in xrange(250): diff --git a/lib/bridgedb/test/test_Dist.py b/lib/bridgedb/test/test_Dist.py index 3de7945..2d93a19 100644 --- a/lib/bridgedb/test/test_Dist.py +++ b/lib/bridgedb/test/test_Dist.py @@ -230,6 +230,7 @@ class HTTPSDistributorTests(unittest.TestCase): bridges = dist.getBridges(clientRequest1, 1) for b in bridges: self.assertFalse(b.isBlockedIn('cn')) +self.assertNotIn(b.fingerprint, blockedCN) # The client *should* have gotten some bridges still. self.assertGreater(len(bridges), 0) @@ -237,4 +238,5 @@ class HTTPSDistributorTests(unittest.TestCase): bridges = dist.getBridges(clientRequest2, 1) for b in bridges: self.assertFalse(b.isBlockedIn('ir')) +self.assertNotIn(b.fingerprint, blockedIR) self.assertGreater(len(bridges), 0) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] BridgeRequest.notBlockedIn country codes should be lowercased.
commit c712736cc04b0423a18fb9582e8d11c0bf663057 Author: Isis Lovecruft i...@torproject.org Date: Thu Apr 16 07:02:44 2015 + BridgeRequest.notBlockedIn country codes should be lowercased. --- lib/bridgedb/bridgerequest.py |4 ++-- lib/bridgedb/https/request.py |4 ++-- lib/bridgedb/test/test_bridgerequest.py |2 +- lib/bridgedb/test/test_https_request.py | 12 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/bridgedb/bridgerequest.py b/lib/bridgedb/bridgerequest.py index f7aa031..f4eaaa4 100644 --- a/lib/bridgedb/bridgerequest.py +++ b/lib/bridgedb/bridgerequest.py @@ -150,7 +150,7 @@ class BridgeRequestBase(object): self.addressClass = ipaddr.IPv6Address def withoutBlockInCountry(self, country): -self.notBlockedIn.append(country) +self.notBlockedIn.append(country.lower()) def withPluggableTransportType(self, pt): self.transports.append(pt) @@ -182,6 +182,6 @@ class BridgeRequestBase(object): self.addFilter(Filters.filterBridgesByTransport(transport, self.addressClass)) for country in self.notBlockedIn: -self.addFilter(Filters.filterBridgesByNotBlockedIn(country, +self.addFilter(Filters.filterBridgesByNotBlockedIn(country.lower(), self.addressClass, transport)) diff --git a/lib/bridgedb/https/request.py b/lib/bridgedb/https/request.py index 37b3ed6..0ae52c7 100644 --- a/lib/bridgedb/https/request.py +++ b/lib/bridgedb/https/request.py @@ -106,7 +106,7 @@ class HTTPSBridgeRequest(bridgerequest.BridgeRequestBase): pass else: if country: -self.notBlockedIn.append(country) +self.notBlockedIn.append(country.lower()) logging.info(HTTPS request for bridges not blocked in: %r % country) @@ -116,7 +116,7 @@ class HTTPSBridgeRequest(bridgerequest.BridgeRequestBase): if addr.isIPAddress(self.client): country = geo.getCountryCode(ipaddr.IPAddress(self.client)) if country: -self.notBlockedIn.append(country) +self.notBlockedIn.append(country.lower()) logging.info( (HTTPS client's bridges also shouldn't be blocked in their GeoIP country code: %s) % country) diff --git a/lib/bridgedb/test/test_bridgerequest.py b/lib/bridgedb/test/test_bridgerequest.py index 3392a4e..ccbf406 100644 --- a/lib/bridgedb/test/test_bridgerequest.py +++ b/lib/bridgedb/test/test_bridgerequest.py @@ -34,7 +34,7 @@ class BridgeRequestBaseTests(unittest.TestCase): to the ``notBlockedIn`` attribute. self.request.withoutBlockInCountry('US') -self.assertIn('US', self.request.notBlockedIn) +self.assertIn('us', self.request.notBlockedIn) def test_BridgeRequestBase_withPluggableTransportType(self): BridgeRequestBase.withPluggableTransportType() should add the diff --git a/lib/bridgedb/test/test_https_request.py b/lib/bridgedb/test/test_https_request.py index 286e6eb..c39662f 100644 --- a/lib/bridgedb/test/test_https_request.py +++ b/lib/bridgedb/test/test_https_request.py @@ -43,28 +43,28 @@ class HTTPSBridgeRequestTests(unittest.TestCase): HTTPSBridgeRequest.withoutBlockInCountry() should add the country CC to the ``notBlockedIn`` attribute. -httprequest = MockRequest({'unblocked': ['IR']}) +httprequest = MockRequest({'unblocked': ['ir']}) self.request.withoutBlockInCountry(httprequest) -self.assertIn('IR', self.request.notBlockedIn) +self.assertIn('ir', self.request.notBlockedIn) def test_HTTPSBridgeRequest_withoutBlockInCountry_US(self): HTTPSBridgeRequest.withoutBlockInCountry() should add the country CC to the ``notBlockedIn`` attribute (and not any other countries). -httprequest = MockRequest({'unblocked': ['US']}) +httprequest = MockRequest({'unblocked': ['us']}) self.request.withoutBlockInCountry(httprequest) -self.assertNotIn('IR', self.request.notBlockedIn) +self.assertNotIn('ir', self.request.notBlockedIn) def test_HTTPSBridgeRequest_withoutBlockInCountry_no_addClientCountryCode(self): HTTPSBridgeRequest.withoutBlockInCountry(), when addClientCountryCode=False, shouldn't add the client's country code to the ``notBlockedIn`` attribute. -httprequest = MockRequest({'unblocked': ['NL']}) +httprequest = MockRequest({'unblocked': ['nl']}) self.request = request.HTTPSBridgeRequest(addClientCountryCode=False)
[tor-commits] [bridgedb/master] Separate DummyBridge._randomORPort() into its own test utility.
commit 0214b0e9ddceca512bd8b7a9c3b052572c4511e4 Author: Isis Lovecruft i...@torproject.org Date: Sat Apr 18 00:50:36 2015 + Separate DummyBridge._randomORPort() into its own test utility. --- lib/bridgedb/test/util.py | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/bridgedb/test/util.py b/lib/bridgedb/test/util.py index fe662da..4aa2709 100644 --- a/lib/bridgedb/test/util.py +++ b/lib/bridgedb/test/util.py @@ -118,6 +118,9 @@ def bracketIPv6(ip): Put brackets around an IPv6 address, just as tor does. return [%s] % ip +def randomPort(): +return random.randint(1, 65535) + def randomIPv4(): return ipaddr.IPv4Address(random.getrandbits(32)) @@ -185,8 +188,6 @@ class DummyBridge(object): ptArgs = {} -def _randORPort(self): return random.randint(9001, ) - def __init__(self): Create a mocked bridge suitable for testing distributors and web resource rendering. @@ -194,12 +195,10 @@ class DummyBridge(object): ipv4 = randomIPv4() self.nickname = bridge-{0}.format(ipv4) self.address = ipaddr.IPv4Address(ipv4) -self.orPort = self._randORPort() +self.orPort = randomPort() self.fingerprint = .join(random.choice('abcdef0123456789') for _ in xrange(40)) -self.orAddresses = [ -(randomIPv6(), self._randORPort(), 6) -] +self.orAddresses = [(randomIPv6(), randomPort(), 6)] def getBridgeLine(self, bridgeRequest, includeFingerprint=True): Get a torrc bridge config line to give to a client. ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Change all distributors to store their own keys.
commit d5628d5bb6244e7f8a0cbd30fa1e52941eb91867 Author: Isis Lovecruft i...@torproject.org Date: Tue Apr 14 09:11:21 2015 + Change all distributors to store their own keys. --- lib/bridgedb/Dist.py | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index 58f0a2d..445d2d8 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -128,6 +128,7 @@ class IPBasedDistributor(Distributor): parameters, i.e. that an answer has at least two obfsproxy bridges or at least one bridge on port 443, etc. +self.key = key self.totalSubrings = totalSubrings self.answerParameters = answerParameters @@ -303,7 +304,7 @@ class IPBasedDistributor(Distributor): for filterFn in [filterBridgesByIP4, filterBridgesByIP6]: for subring in range(1, self.totalSubrings + 1): filters = self._buildHashringFilters([filterFn,], subring) -key1 = getHMAC(self.splitter.key, Order-Bridges-In-Ring-%d % subring) +key1 = getHMAC(self.key, Order-Bridges-In-Ring-%d % subring) ring = bridgedb.Bridges.BridgeRing(key1, self.answerParameters) # For consistency with previous implementation of this method, # only set the name for clusters which are for this @@ -378,7 +379,7 @@ class IPBasedDistributor(Distributor): # Otherwise, construct a new hashring and populate it: else: logging.debug(Cache miss %s % filters) -key1 = getHMAC(self.splitter.key, Order-Bridges-In-Ring-%d % subring) +key1 = getHMAC(self.key, Order-Bridges-In-Ring-%d % subring) ring = bridgedb.Bridges.BridgeRing(key1, self.answerParameters) self.splitter.addRing(ring, filters, filterBridgesByRules(filters), populate_from=self.splitter.bridges) @@ -420,6 +421,8 @@ class EmailBasedDistributor(Distributor): :param whitelist: A dictionary that maps whitelisted email addresses to GnuPG fingerprints. +self.key = key + key1 = getHMAC(key, Map-Addresses-To-Ring) self.emailHmac = getHMACFunc(key1, hex=False) @@ -505,7 +508,7 @@ class EmailBasedDistributor(Distributor): logging.debug(Cache miss %s % ruleset) # add new ring -key1 = getHMAC(self.splitter.key, Order-Bridges-In-Ring) +key1 = getHMAC(self.key, Order-Bridges-In-Ring) ring = bridgedb.Bridges.BridgeRing(key1, self.answerParameters) self.splitter.addRing(ring, ruleset, filterBridgesByRules(ruleset), @@ -541,7 +544,7 @@ class EmailBasedDistributor(Distributor): # populate all rings (for dumping assignments and testing) for filterFn in [filterBridgesByIP4, filterBridgesByIP6]: ruleset = frozenset([filterFn]) -key1 = getHMAC(self.splitter.key, Order-Bridges-In-Ring) +key1 = getHMAC(self.key, Order-Bridges-In-Ring) ring = bridgedb.Bridges.BridgeRing(key1, self.answerParameters) self.splitter.addRing(ring, ruleset, filterBridgesByRules([filterFn]), ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Remove `countryCode` parameter from BridgeRing.getBridges().
commit 509fb2094d6cc02ba889bbc0a6883447e3131e7e Author: Isis Lovecruft i...@torproject.org Date: Thu Apr 16 04:14:52 2015 + Remove `countryCode` parameter from BridgeRing.getBridges(). It was never used. And it's unnecessary. --- lib/bridgedb/Bridges.py | 21 + 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/lib/bridgedb/Bridges.py b/lib/bridgedb/Bridges.py index 988d464..a13a73e 100644 --- a/lib/bridgedb/Bridges.py +++ b/lib/bridgedb/Bridges.py @@ -283,28 +283,17 @@ class BridgeRing(BridgeHolder): assert len(r) == N return r -def getBridges(self, pos, N=1, countryCode=None): +def getBridges(self, pos, N=1): Return **N** bridges appearing in this hashring after a position. :param bytes pos: The position to jump to. Any bridges returned will - start at this position in the hashring, if there is - a bridge assigned to that position. Otherwise, - indexing will start at the first position after this - one which has a bridge assigned to it. +start at this position in the hashring, if there is a bridge +assigned to that position. Otherwise, indexing will start at the +first position after this one which has a bridge assigned to it. :param int N: The number of bridges to return. -:type countryCode: str or None -:param countryCode: DOCDOC :rtype: list -:returns: A list of :class:`~bridgedb.Bridges.Bridge`s. +:returns: A list of :class:`~bridgedb.bridges.Bridge`s. -# XXX This can be removed after we determine if countryCode is ever -# actually being used. It seems the countryCode should be passed in -# from bridgedb.https.server.WebResource.getBridgeRequestAnswer() in -# order to hand out bridges which are believed to not be blocked in a -# given country. -if countryCode: -logging.debug(getBridges: countryCode=%r % countryCode) - forced = [] for _, _, count, subring in self.subrings: if len(subring) count: ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Merge remote-tracking branch 'rr/2015-04-30-01-misc-fixes' into develop
commit be58b8f8a70b3e1e4f3cd6d3e10b6fe2a82a7998 Merge: e6e7ea1 d84d884 Author: Isis Lovecruft i...@torproject.org Date: Wed May 6 20:03:28 2015 + Merge remote-tracking branch 'rr/2015-04-30-01-misc-fixes' into develop lib/bridgedb/bridges.py |2 +- lib/bridgedb/parse/descriptors.py |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Remove unnecessary database initialisation from bridgedb.Main.
commit 3bad1b9fcb698ba5d74a07499dcdd23409d5b044 Author: Isis Lovecruft i...@torproject.org Date: Mon May 11 21:24:07 2015 + Remove unnecessary database initialisation from bridgedb.Main. Conflicts: lib/bridgedb/Main.py --- lib/bridgedb/Main.py |1 - 1 file changed, 1 deletion(-) diff --git a/lib/bridgedb/Main.py b/lib/bridgedb/Main.py index 1714a53..76c122c 100644 --- a/lib/bridgedb/Main.py +++ b/lib/bridgedb/Main.py @@ -378,7 +378,6 @@ def run(options, reactor=reactor): # Initialize our DB. bridgedb.Storage.initializeDBLock() -db = bridgedb.Storage.openDatabase(cfg.DB_FILE + .sqlite) bridgedb.Storage.setDBFilename(cfg.DB_FILE + .sqlite) load(state, splitter, clear=False) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Add tests for Bridge.allVanillaAddresses idempotency and reentrancy.
commit f8b5300f81aca52a6b34f36201fecf58ff817628 Author: Isis Lovecruft i...@torproject.org Date: Sun May 10 22:24:32 2015 + Add tests for Bridge.allVanillaAddresses idempotency and reentrancy. --- lib/bridgedb/test/test_bridges.py | 113 + 1 file changed, 113 insertions(+) diff --git a/lib/bridgedb/test/test_bridges.py b/lib/bridgedb/test/test_bridges.py index 7778b02..99fc458 100644 --- a/lib/bridgedb/test/test_bridges.py +++ b/lib/bridgedb/test/test_bridges.py @@ -988,6 +988,119 @@ class BridgeTests(unittest.TestCase): bridgePrefix=True) self.assertEqual(bridgeline, 'Bridge [6bf3:806b:78cd::4ced:cfad:dad4]:36488') +def test_Bridge_allVanillaAddresses_idempotency_self(self): +Bridge.allVanillaAddresses should be idempotent, i.e. calling +allVanillaAddresses should not affect the results of subsequent calls. + +self.bridge.address = '1.1.1.1' +self.bridge.orPort = 443 +self.assertItemsEqual(self.bridge.allVanillaAddresses, + [(ipaddr.IPv4Address('1.1.1.1'), 443, 4)]) +self.assertItemsEqual(self.bridge.allVanillaAddresses, + [(ipaddr.IPv4Address('1.1.1.1'), 443, 4)]) +self.assertItemsEqual(self.bridge.allVanillaAddresses, + [(ipaddr.IPv4Address('1.1.1.1'), 443, 4)]) + +def test_Bridge_allVanillaAddresses_idempotency_others(self): +Bridge.allVanillaAddresses should be idempotent, i.e. calling +allVanillaAddresses should not affect any of the Bridge's other +attributes (such as Bridge.orAddresses). + +self.bridge.address = '1.1.1.1' +self.bridge.orPort = 443 +self.assertItemsEqual(self.bridge.orAddresses, []) +self.assertItemsEqual(self.bridge.allVanillaAddresses, + [(ipaddr.IPv4Address('1.1.1.1'), 443, 4)]) +self.assertItemsEqual(self.bridge.orAddresses, []) +self.assertItemsEqual(self.bridge.allVanillaAddresses, + [(ipaddr.IPv4Address('1.1.1.1'), 443, 4)]) +self.assertItemsEqual(self.bridge.allVanillaAddresses, + [(ipaddr.IPv4Address('1.1.1.1'), 443, 4)]) +self.assertItemsEqual(self.bridge.allVanillaAddresses, + [(ipaddr.IPv4Address('1.1.1.1'), 443, 4)]) +self.assertItemsEqual(self.bridge.orAddresses, []) + +def test_Bridge_allVanillaAddresses_reentrancy_all(self): +Bridge.allVanillaAddresses should be reentrant, i.e. updating the +Bridge's address, orPort, or orAddresses should update the value +returned by allVanillaAddresses. + +self.bridge.address = '1.1.1.1' +self.assertItemsEqual(self.bridge.allVanillaAddresses, + [(ipaddr.IPv4Address('1.1.1.1'), None, 4)]) +self.assertEqual(self.bridge.address, ipaddr.IPv4Address('1.1.1.1')) +self.assertEqual(self.bridge.orPort, None) +self.assertItemsEqual(self.bridge.orAddresses, []) + +self.bridge.orPort = 443 +self.assertItemsEqual(self.bridge.allVanillaAddresses, + [(ipaddr.IPv4Address('1.1.1.1'), 443, 4)]) +self.assertEqual(self.bridge.address, ipaddr.IPv4Address('1.1.1.1')) +self.assertEqual(self.bridge.orPort, 443) +self.assertItemsEqual(self.bridge.orAddresses, []) + +self.bridge.address = '2.2.2.2' +self.assertItemsEqual(self.bridge.allVanillaAddresses, + [(ipaddr.IPv4Address('2.2.2.2'), 443, 4)]) +self.assertEqual(self.bridge.address, ipaddr.IPv4Address('2.2.2.2')) +self.assertEqual(self.bridge.orPort, 443) +self.assertItemsEqual(self.bridge.orAddresses, []) + +self.bridge.orAddresses.append( +(ipaddr.IPv6Address('200::6ffb:11bb:a129'), 4443, 6)) +self.assertItemsEqual(self.bridge.allVanillaAddresses, + [(ipaddr.IPv4Address('2.2.2.2'), 443, 4), + (ipaddr.IPv6Address('200::6ffb:11bb:a129'), 4443, 6)]) +self.assertEqual(self.bridge.address, ipaddr.IPv4Address('2.2.2.2')) +self.assertEqual(self.bridge.orPort, 443) +self.assertItemsEqual(self.bridge.orAddresses, + [(ipaddr.IPv6Address('200::6ffb:11bb:a129'), 4443, 6)]) + +def test_Bridge_allVanillaAddresses_reentrancy_orPort(self): +Calling Bridge.allVanillaAddresses before Bridge.orPort is set +should return ``None`` for the port value, and after Bridge.orPort is +set, it should return the orPort. + +self.bridge.address = '1.1.1.1' +self.assertItemsEqual(self.bridge.orAddresses, []) +self.assertItemsEqual(self.bridge.allVanillaAddresses, +
[tor-commits] [bridgedb/master] Revert Remove clear abuses of str.strip() and str.rstrip()
commit 9a4cf49b975fd219bac868884bd573f705bf629e Author: Isis Lovecruft i...@torproject.org Date: Wed May 6 20:22:14 2015 + Revert Remove clear abuses of str.strip() and str.rstrip() This reverts commit 4e773f346f2b442a1726af94b7b2da231b73c1d6. --- lib/bridgedb/Bridges.py |3 +-- lib/bridgedb/bridges.py |6 ++ lib/bridgedb/test/test_Main.py|3 +-- lib/bridgedb/test/test_Tests.py |3 +-- lib/bridgedb/test/test_bridgedb.py|3 +-- lib/bridgedb/test/test_captcha.py |7 +++ lib/bridgedb/test/test_configure.py |3 +-- lib/bridgedb/test/test_crypto.py |3 +-- lib/bridgedb/test/test_email_autoresponder.py |3 +-- lib/bridgedb/test/test_https.py |3 +-- lib/bridgedb/test/test_smtp.py|3 +-- lib/bridgedb/util.py |9 - 12 files changed, 14 insertions(+), 35 deletions(-) diff --git a/lib/bridgedb/Bridges.py b/lib/bridgedb/Bridges.py index eb39d47..58a81cd 100644 --- a/lib/bridgedb/Bridges.py +++ b/lib/bridgedb/Bridges.py @@ -29,7 +29,6 @@ from bridgedb.parse.fingerprint import toHex from bridgedb.parse.fingerprint import fromHex from bridgedb.parse.fingerprint import isValidFingerprint from bridgedb.safelog import logSafely -from bridgedb.util import remove_prefix try: from cStringIO import StringIO @@ -651,7 +650,7 @@ class FilteredBridgeSplitter(BridgeHolder): subringName = [self.distributorName] for filterName in filterNames: if filterName != 'filterAssignBridgesToRing': -subringName.append(remove_prefix(filterName, 'filterBridgesBy')) +subringName.append(filterName.strip('filterBridgesBy')) subringName = '-'.join([x for x in subringName]) subring.setName(subringName) diff --git a/lib/bridgedb/bridges.py b/lib/bridgedb/bridges.py index 6ea7d3f..2922fa1 100644 --- a/lib/bridgedb/bridges.py +++ b/lib/bridgedb/bridges.py @@ -38,8 +38,6 @@ from bridgedb.parse.fingerprint import isValidFingerprint from bridgedb.parse.fingerprint import toHex from bridgedb.parse.fingerprint import fromHex from bridgedb.parse.nickname import isValidRouterNickname -from bridgedb.util import remove_prefix -from bridgedb.util import remove_suffix class PluggableTransportUnavailable(Exception): @@ -1499,8 +1497,8 @@ class Bridge(BridgeBackwardsCompatibility): sequence = asn1.DerSequence() key = self.signingKey -key = remove_prefix(key, TOR_SIGNING_KEY_HEADER) -key = remove_suffix(key, TOR_SIGNING_KEY_FOOTER) +key = key.strip(TOR_SIGNING_KEY_HEADER) +key = key.strip(TOR_SIGNING_KEY_FOOTER) key = key.replace('\n', '') key = base64.b64decode(key) diff --git a/lib/bridgedb/test/test_Main.py b/lib/bridgedb/test/test_Main.py index 6c603fb..5ae4025 100644 --- a/lib/bridgedb/test/test_Main.py +++ b/lib/bridgedb/test/test_Main.py @@ -29,14 +29,13 @@ from twisted.trial import unittest from bridgedb import Main from bridgedb.Bridges import BridgeHolder from bridgedb.parse.options import parseOptions -from bridgedb.util import remove_suffix logging.getLogger().disabled = True HERE = os.getcwd() -TOPDIR = remove_suffix(HERE, '_trial_temp') +TOPDIR = HERE.rstrip('_trial_temp') CI_RUNDIR = os.path.join(TOPDIR, 'run') # A networkstatus descriptor with two invalid ORAddress (127.0.0.1 and ::1) diff --git a/lib/bridgedb/test/test_Tests.py b/lib/bridgedb/test/test_Tests.py index 01fc1ca..84c3f8b 100644 --- a/lib/bridgedb/test/test_Tests.py +++ b/lib/bridgedb/test/test_Tests.py @@ -29,7 +29,6 @@ from twisted.trial import unittest from bridgedb.test import legacy_Tests as Tests from bridgedb.test import deprecated -from bridgedb.util import remove_suffix warnings.filterwarnings('ignore', module=bridgedb\.test\.legacy_Tests) @@ -181,7 +180,7 @@ class DynamicTestCaseMeta(type): origFunc = origName.split('.')[-2:] origName = '_'.join(origFunc) if origName.endswith('_py'): # this happens with doctests -origName = remove_suffix(origName, '_py') +origName = origName.strip('_py') methName = str(methodPrefix + origName).replace('.', '_') meth = testMethodFactory(test, methName) logging.debug(Set %s.%s=%r % (cls.__name__, methName, meth)) diff --git a/lib/bridgedb/test/test_bridgedb.py b/lib/bridgedb/test/test_bridgedb.py index 301309a..70c71f0 100644 --- a/lib/bridgedb/test/test_bridgedb.py +++ b/lib/bridgedb/test/test_bridgedb.py @@ -23,7 +23,6 @@ from twisted.trial.unittest import SkipTest from bridgedb.test.util import processExists from bridgedb.test.util import getBridgeDBPID -from bridgedb.util import remove_suffix class
[tor-commits] [bridgedb/master] Update URLs for new gitweb.
commit dea3d6c78cc124ae2aa08dc209b1662969c8b7d4 Author: David Fifield da...@bamsoftware.com Date: Tue Jun 2 12:15:34 2015 -0700 Update URLs for new gitweb. --- doc/proposals/XXX-bridgedb-database-improvements.txt |4 ++-- doc/proposals/XXX-bridgedb-social-distribution.txt |2 +- lib/bridgedb/Bridges.py |2 +- lib/bridgedb/bridges.py |4 ++-- lib/bridgedb/templates/base.html |2 +- lib/bridgedb/test/deprecated.py |2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/proposals/XXX-bridgedb-database-improvements.txt b/doc/proposals/XXX-bridgedb-database-improvements.txt index 2d25bd2..fcbd579 100644 --- a/doc/proposals/XXX-bridgedb-database-improvements.txt +++ b/doc/proposals/XXX-bridgedb-database-improvements.txt @@ -240,9 +240,9 @@ Status: Open [0]: https://bridges.torproject.org mailto:brid...@bridges.torproject.org [1]: See proposals 199-bridgefinder-integration.txt at - https://gitweb.torproject.org/torspec.git/blob/HEAD:/proposals/199-bridgefinder-integration.txt + https://gitweb.torproject.org/torspec.git/tree/proposals/199-bridgefinder-integration.txt [2]: See XXX-social-bridge-distribution.txt at - https://gitweb.torproject.org/user/isis/bridgedb.git/blob/refs/heads/feature/7520-social-dist-design:/doc/proposals/XXX-bridgedb-social-distribution.txt + https://gitweb.torproject.org/user/isis/bridgedb.git/tree/doc/proposals/XXX-bridgedb-social-distribution.txt?h=feature/7520-social-dist-design [3]: https://metrics.torproject.org/formats.html#descriptortypes [4]: https://github.com/couchbase/couchbase-python-client#twisted-api [5]: https://twistedmatrix.com/documents/current/api/twisted.protocols.memcache.MemCacheProtocol.html diff --git a/doc/proposals/XXX-bridgedb-social-distribution.txt b/doc/proposals/XXX-bridgedb-social-distribution.txt index cd211c6..e424d34 100644 --- a/doc/proposals/XXX-bridgedb-social-distribution.txt +++ b/doc/proposals/XXX-bridgedb-social-distribution.txt @@ -481,7 +481,7 @@ Status: Draft Proceedings of the twelfth annual ACM-SIAM symposium on Discrete algorithms. Society for Industrial and Applied Mathematics, 2001. http://www.wisdom.weizmann.ac.il/%7Enaor/PAPERS/eotp.ps - https://gitweb.torproject.org/user/isis/bridgedb.git/tree/refs/heads/feature/7520-social-dist-design:/doc/papers/naor2001efficient.pdf + https://gitweb.torproject.org/user/isis/bridgedb.git/tree/doc/papers/naor2001efficient.pdf?h=feature/7520-social-dist-design [3]: https://crypto.stanford.edu/pbc/ http://repo.or.cz/r/pbc.git [4]: https://www.gitorious.org/pypbc/pages/Documentation diff --git a/lib/bridgedb/Bridges.py b/lib/bridgedb/Bridges.py index 191dc08..d4e331e 100644 --- a/lib/bridgedb/Bridges.py +++ b/lib/bridgedb/Bridges.py @@ -63,7 +63,7 @@ class BridgeRingParameters(object): :ivar list needFlags: List of two-tuples of desired flags_ assigned to a Bridge by the Bridge DirAuth. -.. _flags: https://gitweb.torproject.org/torspec.git/blob/HEAD:/dir-spec.txt#l1696 +.. _flags: https://gitweb.torproject.org/torspec.git/tree/dir-spec.txt#n1696 def __init__(self, needPorts=[], needFlags=[]): diff --git a/lib/bridgedb/bridges.py b/lib/bridgedb/bridges.py index 0dfc4b1..5fe3355 100644 --- a/lib/bridgedb/bridges.py +++ b/lib/bridgedb/bridges.py @@ -109,7 +109,7 @@ class Flags(object): | Valid if the router has been 'validated'. .. _dir-spec.txt: - https://gitweb.torproject.org/torspec.git/blob/7647f6d4d:/dir-spec.txt#l1603 + https://gitweb.torproject.org/torspec.git/tree/dir-spec.txt?id=7647f6d4d#n1603 :param list flags: A list of strings containing each of the flags parsed from the 's'-line. @@ -223,7 +223,7 @@ class PluggableTransport(BridgeAddressBase): additional specification. .. _pt-spec.txt: -https://gitweb.torproject.org/torspec.git/blob/HEAD:/pt-spec.txt +https://gitweb.torproject.org/torspec.git/tree/pt-spec.txt :type fingerprint: str :ivar fingerprint: The uppercased, hexadecimal fingerprint of the identity diff --git a/lib/bridgedb/templates/base.html b/lib/bridgedb/templates/base.html index f26837a..4a0b92d 100644 --- a/lib/bridgedb/templates/base.html +++ b/lib/bridgedb/templates/base.html @@ -91,7 +91,7 @@ ${next.body(strings, rtl=rtl, lang=lang, **kwargs)} a href=https://gitweb.torproject.org/bridgedb.git; i class=icon icon-large icon-codenbsp;${_(Source Code)}/i/a nbsp; middot; nbsp; -a href=https://gitweb.torproject.org/bridgedb.git/blob/HEAD:/CHANGELOG; +a href=https://gitweb.torproject.org/bridgedb.git/tree/CHANGELOG; i class=icon icon-large icon-rocketnbsp;${_(Changelog)}/i/a nbsp; middot; nbsp; a href=mailto:h...@rt.torproject.org; diff --git
[tor-commits] [bridgedb/master] Remove integration test monkeypatching for very old, deprecated parsers.
commit 452f2aa9c5cfb4f6c80615c89de75f9f45c0d685 Author: Isis Lovecruft i...@torproject.org Date: Mon May 11 22:42:06 2015 + Remove integration test monkeypatching for very old, deprecated parsers. * REMOVE bridgedb.test.deprecated_networkstatus. * REMOVE descriptor parsers from bridgedb.test.deprecated (which were deprecated by bridgedb.test.deprecated_networkstatus, which was in turn deprecated by the Stem-based parsers in bridgedb.parse.descriptors as part of #9380). * REMOVE monkeypatching of old unittests with (doubly) deprecated parsers. Conflicts: lib/bridgedb/test/deprecated.py lib/bridgedb/test/test_Tests.py --- lib/bridgedb/test/deprecated.py | 254 --- lib/bridgedb/test/deprecated_networkstatus.py | 275 - lib/bridgedb/test/legacy_Tests.py |1 - lib/bridgedb/test/test_Tests.py | 11 - 4 files changed, 541 deletions(-) diff --git a/lib/bridgedb/test/deprecated.py b/lib/bridgedb/test/deprecated.py index 181814c..df660b6 100644 --- a/lib/bridgedb/test/deprecated.py +++ b/lib/bridgedb/test/deprecated.py @@ -20,260 +20,6 @@ from twisted.python import deprecate from twisted.python.versions import Version -PORTSPEC_LENGTH = 16 - -re_ipv6 = re.compile(\[([a-fA-F0-9:]+)\]:(.*$)) -re_ipv4 = re.compile(((?:\d{1,3}\.?){4}):(.*$)) - -deprecate.deprecatedModuleAttribute( -Version('bridgedb', 0, 0, 1), -Removed due to 'bridgedb.Bridges.PortList' being moved to \ -'bridgedb.parse.addr.PortList., -bridgedb.Bridges, -PORTSPEC_LENGTH) - -deprecate.deprecatedModuleAttribute( -Version('bridgedb', 0, 0, 1), -Attribute 'bridgedb.Bridges.re_ipv4' was removed due to \ -'bridgedb.Bridges.parseORAddressLine' moving to \ -'bridgedb.parse.networkstatus., -bridgedb.Bridges, -re_ipv4) - -deprecate.deprecatedModuleAttribute( -Version('bridgedb', 0, 0, 1), -Attribute 'bridgedb.Bridges.re_ipv6' was removed due to \ -'bridgedb.Bridges.parseORAddressLine' moving to \ -'bridgedb.parse.networkstatus., -bridgedb.Bridges, -re_ipv6) - -deprecate.deprecatedModuleAttribute( -Version('bridgedb', 0, 2, 3), -(Removed due to 'bridgedb.Bridges.HEX_FP_LEN' being moved to - 'bridgedb.parse.fingerprint.HEX_FINGERPRINT_LEN.), -bridgedb.Bridges, HEX_FP_LEN) - -deprecate.deprecatedModuleAttribute( -Version('bridgedb', 0, 2, 3), -(Removed due to 'bridgedb.Bridges.toHex' being moved to - 'bridgedb.parse.fingerprint.toHex.), -bridgedb.Bridges, toHex) - -deprecate.deprecatedModuleAttribute( -Version('bridgedb', 0, 2, 3), -(Removed due to 'bridgedb.Bridges.fromHex' being moved to - 'bridgedb.parse.fingerprint.fromHex.), -bridgedb.Bridges, fromHex) - - -@deprecate.deprecated( -Version('bridgedb', 0, 0, 1), -replacement='bridgedb.parse.networkstatus.parseALine') -def parseORAddressLine(line): -Deprecated :func:`bridgedb.Bridges.parseORAddressLine`, removed in -bridgedb-0.1.0, in commit 1f111e5. - -This function and the newer parsers from :mod:`bridgedb.parse.netstatus` -are alternately :api:`~twisted.python.monkey.MonkeyPatcher.patch`ed into -the :mod:`old unittests bridgedb.Tests`, so that the later functions as -a suite of regression tests. - -address = None -portlist = None -# try regexp to discover ip version -for regex in [re_ipv4, re_ipv6]: -m = regex.match(line) -if m: -# get an address and portspec, or raise ParseError -try: -address = ipaddr.IPAddress(m.group(1)) -portlist = PortList(m.group(2)) -except (IndexError, ValueError): raise ParseORAddressError(line) - -# return a valid address, portlist or raise ParseORAddressError -if address and portlist and len(portlist): return address,portlist -raise ParseORAddressError(line) - -@deprecate.deprecated(Version('bridgedb', 0, 2, 3), - replacement='bridgedb.parse.fingerprint.isValidFingerprint') -def is_valid_fingerprint(fp): -Return true iff fp in the right format to be a hex fingerprint - of a Tor server. - -if len(fp) != HEX_FP_LEN: -return False -try: -fromHex(fp) -except TypeError: -return False -else: -return True - -@deprecate.deprecated(Version('bridgedb', 0, 2, 4), - replacement='bridgedb.parse.descriptors.parseExtraInfoFiles') -def parseExtraInfoFile(f): - -parses lines in Bridges extra-info documents. -returns an object whose type corresponds to the -relevant set of extra-info lines. - -presently supported lines and the accompanying type are: - -{ 'transport': PluggableTransport, } - -'transport' lines (torspec.git/proposals/180-pluggable-transport.txt) - -Bridges put the 'transport' lines in their
[tor-commits] [bridgedb/master] Remove unused variable in bridgedb.Storage.Database.getAllBridgeHistory().
commit cbe9c2d44d4e3cd1ff37c9c97b129acad9e5739f Author: Isis Lovecruft i...@torproject.org Date: Tue May 12 08:32:32 2015 + Remove unused variable in bridgedb.Storage.Database.getAllBridgeHistory(). --- lib/bridgedb/Storage.py |1 - 1 file changed, 1 deletion(-) diff --git a/lib/bridgedb/Storage.py b/lib/bridgedb/Storage.py index 334aadb..ea9d26b 100644 --- a/lib/bridgedb/Storage.py +++ b/lib/bridgedb/Storage.py @@ -288,7 +288,6 @@ class Database(object): cur = self._cur v = cur.execute(SELECT * FROM BridgeHistory) if v is None: return -fp = {} for h in v: yield BridgeHistory(h[0],IPAddress(h[1]),h[2],h[3],h[4],h[5],h[6],h[7],h[8],h[9],h[10]) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Merge branch 'fix/16273-gitweb-urls' into develop
commit 82ede52d56571dbafbdd0db7102388267052fe2e Merge: a768c84 bd6bd83 Author: Isis Lovecruft i...@torproject.org Date: Tue Jun 2 21:06:53 2015 + Merge branch 'fix/16273-gitweb-urls' into develop doc/proposals/XXX-bridgedb-database-improvements.txt |4 ++-- doc/proposals/XXX-bridgedb-social-distribution.txt |2 +- lib/bridgedb/Bridges.py |2 +- lib/bridgedb/bridges.py |4 ++-- lib/bridgedb/templates/base.html |2 +- lib/bridgedb/test/deprecated.py |2 +- 6 files changed, 8 insertions(+), 8 deletions(-) ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Add module docstring for bridgedb.parse.descriptors.
commit 6d7180a895dc205176f34e38a1251f6aae0ef156 Author: Isis Lovecruft i...@torproject.org Date: Thu Jun 18 04:39:01 2015 + Add module docstring for bridgedb.parse.descriptors. --- lib/bridgedb/parse/descriptors.py | 23 +++ 1 file changed, 23 insertions(+) diff --git a/lib/bridgedb/parse/descriptors.py b/lib/bridgedb/parse/descriptors.py index 81cba7f..1b0108e 100644 --- a/lib/bridgedb/parse/descriptors.py +++ b/lib/bridgedb/parse/descriptors.py @@ -10,6 +10,29 @@ # :license: see LICENSE for licensing information #_ +Parsers for Tor Bridge descriptors, including ``bridge-networkstatus`` +documents, ``bridge-server-descriptor``s, and ``bridge-extrainfo`` +descriptors. + +.. py:module:: bridgedb.parse.descriptors +:synopsis: Parsers for Tor Bridge descriptors. + +bridgedb.parse.descriptors +=== +:: + + DescriptorWarning - Raised when we parse a very odd descriptor. + deduplicate - Deduplicate a container of descriptors, keeping only the newest + descriptor for each router. + parseNetworkStatusFile - Parse a bridge-networkstatus document generated and + given to us by the BridgeAuthority. + parseServerDescriptorsFile - Parse a file containing + bridge-server-descriptors. + parseExtraInfoFiles - Parse (multiple) file(s) containing bridge-extrainfo + descriptors. +.. + + from __future__ import print_function import datetime ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Refactor getBridgesForIP() to use b.https.request.HTTPSBridgeRequest.
commit 7b880a1fe0f346c85364b255eee93995a6b31b94 Author: Isis Lovecruft i...@torproject.org Date: Wed Apr 1 08:40:50 2015 + Refactor getBridgesForIP() to use b.https.request.HTTPSBridgeRequest. * RENAME b.D.IPBasedDistributor.getBridgesForIP() â b.D.IPBasedDistributor.getBridges(). * CREATE new bridgedb.https package. * CREATE new bridgedb.https.request module. * CHANGE b.D.IPBasedDistributor.getBridges() to use bridgedb.https.request.HTTPSBridgeRequest. --- doc/sphinx/source/bridgedb.https.rst | 10 +++ doc/sphinx/source/bridgedb.rst |1 + lib/bridgedb/Dist.py | 143 ++ lib/bridgedb/HTTPServer.py | 142 ++--- lib/bridgedb/https/__init__.py |1 + lib/bridgedb/https/request.py| 143 ++ lib/bridgedb/test/legacy_Tests.py| 26 +++ lib/bridgedb/test/test_HTTPServer.py | 27 --- setup.py |1 + 9 files changed, 301 insertions(+), 193 deletions(-) diff --git a/doc/sphinx/source/bridgedb.https.rst b/doc/sphinx/source/bridgedb.https.rst new file mode 100644 index 000..b0ee95c --- /dev/null +++ b/doc/sphinx/source/bridgedb.https.rst @@ -0,0 +1,10 @@ +.. _https-pkg: + +bridgedb.https +--- + +.. contents:: bridgedb.https +:depth: 3 + +.. automodule:: bridgedb.https.__init__ +.. automodule:: bridgedb.https.request diff --git a/doc/sphinx/source/bridgedb.rst b/doc/sphinx/source/bridgedb.rst index 3f87647..61ab07f 100644 --- a/doc/sphinx/source/bridgedb.rst +++ b/doc/sphinx/source/bridgedb.rst @@ -17,6 +17,7 @@ BridgeDB Package and Module Documentation bridgedb.email bridgedb.Filters bridgedb.geo +bridgedb.https bridgedb.HTTPServer bridgedb.interfaces bridgedb.Main diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index 26e952e..3f7835b 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -305,118 +305,92 @@ class IPBasedDistributor(Distributor): Assign a bridge to this distributor. self.splitter.insert(bridge) -def getBridgesForIP(self, ip, epoch, N=1, countryCode=None, -bridgeFilterRules=None): +def _buildHashringFilters(self, previousFilters, clientCluster): +totalRings = self.nClusters + len(self.categories) +g = filterAssignBridgesToRing(self.splitter.hmac, totalRings, clientCluster) +previousFilters.append(g) +return frozenset(previousFilters) + +def getBridges(self, bridgeRequest, interval, N=1): Return a list of bridges to give to a user. -:param str ip: The user's IP address, as a dotted quad. -:param str epoch: The time period when we got this request. This can - be any string, so long as it changes with every - period. +:type bridgeRequest: :class:`bridgedb.https.request.HTTPSBridgeRequest` +:param bridgeRequest: A :class:`~bridgedb.bridgerequest.BridgeRequestBase` +with the :data:`~bridgedb.bridgerequest.BridgeRequestBase.client` +attribute set to a string containing the client's IP address. +:param str interval: The time period when we got this request. This +can be any string, so long as it changes with every period. :param int N: The number of bridges to try to give back. (default: 1) -:param str countryCode: The two-letter geoip country code of the -client's IP address. If given, it is assumed that any bridges -distributed to that client should not be blocked in that -country. (default: None) -:param list bridgeFilterRules: A list of callables used filter the - bridges returned in the response to the - client. See :mod:`~bridgedb.Filters`. :rtype: list :return: A list of :class:`~bridgedb.Bridges.Bridge`s to include in - the response. See - :meth:`bridgedb.HTTPServer.WebResource.getBridgeRequestAnswer` - for an example of how this is used. +the response. See + :meth:`bridgedb.HTTPServer.WebResourceBridges.getBridgeRequestAnswer` +for an example of how this is used. logging.info(Attempting to return %d bridges to client %s... - % (N, ip)) - -if not bridgeFilterRules: -bridgeFilterRules=[] + % (N, bridgeRequest.client)) if not len(self.splitter): logging.warn(Bailing! Splitter has zero bridges!) return [] -logging.debug(Bridges in splitter:\t%d % len(self.splitter)) -logging.debug(Client request epoch:\t%s % epoch) -logging.debug(Active bridge filters:\t%s - % '
[tor-commits] [bridgedb/master] Remove annoying and unnecessary log statements with memory addresses.
commit dfbc8e0abbfba32324c4c2c9573d0671a150cf34 Author: Isis Lovecruft i...@torproject.org Date: Mon Apr 20 22:27:05 2015 + Remove annoying and unnecessary log statements with memory addresses. The information which these log statements were trying to log is captured by other log statements within the same functions, and both of them included non-human-useful data like locations of various objects in memory. Conflicts: lib/bridgedb/Bridges.py --- lib/bridgedb/Bridges.py |3 --- lib/bridgedb/Filters.py |1 - 2 files changed, 4 deletions(-) diff --git a/lib/bridgedb/Bridges.py b/lib/bridgedb/Bridges.py index 58a81cd..d9b28e2 100644 --- a/lib/bridgedb/Bridges.py +++ b/lib/bridgedb/Bridges.py @@ -634,9 +634,6 @@ class FilteredBridgeSplitter(BridgeHolder): # I suppose since it contains memory addresses, it *is* technically # likely to be a unique string, but it is messy. -logging.debug(Adding '%s' subring to %s... - % (ringname, self.__class__.__name__)) - if not isinstance(subring, BridgeHolder): logging.fatal(%s hashring can't add invalid subring: %r % (self.distributorName, subring)) diff --git a/lib/bridgedb/Filters.py b/lib/bridgedb/Filters.py index eadf012..aade069 100644 --- a/lib/bridgedb/Filters.py +++ b/lib/bridgedb/Filters.py @@ -12,7 +12,6 @@ def filterAssignBridgesToRing(hmac, numRings, assignedRing): # ruleset ensures that the same logging.debug(Creating a filter for assigning bridges to hashrings...) ruleset = frozenset([hmac, numRings, assignedRing]) -logging.debug(Filter created: %s % ruleset) try: return funcs[ruleset] ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits
[tor-commits] [bridgedb/master] Document IPBasedDistributor.prepopulateRings().
commit d229941c72e48c3d1550d45983c4ddd2c5ef8961 Author: Isis Lovecruft i...@torproject.org Date: Thu Apr 2 22:50:04 2015 + Document IPBasedDistributor.prepopulateRings(). --- lib/bridgedb/Dist.py | 55 ++ 1 file changed, 55 insertions(+) diff --git a/lib/bridgedb/Dist.py b/lib/bridgedb/Dist.py index 78741a7..39e70be 100644 --- a/lib/bridgedb/Dist.py +++ b/lib/bridgedb/Dist.py @@ -201,6 +201,61 @@ class IPBasedDistributor(Distributor): self.setDistributorName('HTTPS') def prepopulateRings(self): +Prepopulate this distributor's hashrings and subhashrings with +bridges. + +The hashring structure for this distributor is influenced by the +``N_IP_CLUSTERS`` configuration option, as well as the number of +``PROXY_LIST_FILES``. Essentially, :data:`nClusters` is set to the +specified ``N_IP_CLUSTERS``. The ``PROXY_LIST_FILES`` (plus the +:class:`bridgedb.proxy.ProxySet` for the Tor Exit list downloaded into +memory with :script:`get-tor-exits`) are stored in :data:`categories`. + +The number of subhashrings which this :class:`Distributor` has active +in its hashring is then the :data:`nClusters` plus the number of +:data:`categories`. + +As an example, if BridgeDB was configured with ``N_IP_CLUSTERS=4`` and +``PROXY_LIST_FILES=[open-socks-proxies.txt]``, then the total number +of subhashrings is sixâââfour for the clusters, and two +categories: one for everything contained within the +``open-socks-proxies.txt`` file and the other for the downloaded +list of Tor Exits. Thus, the resulting hashring-subhashring structure +would look like: + + +--+---+-+ +| | Directly connecting users | Tor / known proxy users | + +--+++++++ +| Clusters / | Cluster-1 | Cluster-2 | Cluster-3 | Cluster-4 | Cat-1 | Cat-2 | +| Categories |||| ||| + +==+++++++ +| Subhashrings |||| ||| +| (total, assigned)| (6,0) | (6,1) | (6,2) | (6,3) | (6,4) | (6,5) | + +--+++++++ +| Filtered | (6,0) | (6,1) | (6,2) | (6,3) | (6,4) | (6,5) | +| Subhashrings +++++++ +| bBy requested| (6,0)-IPv4 | (6,1)-IPv4 | (6,2)-IPv4 | (6,3)-IPv4 | (6,4)-IPv4 | (6,5)-IPv4 | +| bridge type) +++++++ +| | (6,0)-IPv6 | (6,1)-IPv6 | (6,2)-IPv6 | (6,3)-IPv6 | (6,4)-IPv6 | (6,5)-IPv6 | + +--+++++++ + +The filtered subhashrings are essentially copies of their respective +subhashring, that is, subhashring ``(6,0)`` contains both IPv4 and +IPv6 bridges, meaning that its contents are a superset of the filtered +subhashrings ``(6,0)-IPv4`` and ``(6,0)-IPv6``. (I have no idea of +the relation between ``(6,0)-IPv4`` and ``(6,0)-IPv6``, including +whether or not their contents are disjoint. I didn't design this shit, +I'm just redesigning it.) + +Why does the ``(6,0)`` superset subhashring exist then? + +you might ask. That's a very good question. I don't know either. +I'm inclined to think it shouldn't exist, unless we wish to allow +clients to request IPv4 bridges and IPv6 bridges simultaneously +(there's currently no interface to do this, however). + +Thus, in this example, we end up with **18 total subhashrings**. + logging.info(Prepopulating %s distributor hashrings... % self.name) # populate all rings (for dumping assignments and testing) for filterFn in [None, filterBridgesByIP4, filterBridgesByIP6]: ___ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits