[tor-commits] [translation/communitytpo-contentspot] new translations in communitytpo-contentspot

2021-11-23 Thread translation
commit 9664581b918d5ca795062ef0d21c64c671387aea
Author: Translation commit bot 
Date:   Wed Nov 24 01:45:12 2021 +

new translations in communitytpo-contentspot
---
 contents+es.po | 154 -
 1 file changed, 121 insertions(+), 33 deletions(-)

diff --git a/contents+es.po b/contents+es.po
index 681c18f849..8862305ab6 100644
--- a/contents+es.po
+++ b/contents+es.po
@@ -21720,7 +21720,7 @@ msgstr "Cómo desplegar un repetidor 
Intermedio/Guardián en CentOS/RHEL"
 #: https//community.torproject.org/relay/setup/guard/centos-rhel/
 #: (content/relay/setup/guard/centos-rhel/contents+en.lrpage.body)
 msgid "### 2. Install `epel-release`"
-msgstr ""
+msgstr "### 2. Instala `epel-release`"
 
 #: https//community.torproject.org/relay/setup/guard/centos-rhel/
 #: (content/relay/setup/guard/centos-rhel/contents+en.lrpage.body)
@@ -21740,6 +21740,7 @@ msgstr "# yum install epel-release"
 #: (content/relay/setup/guard/centos-rhel/contents+en.lrpage.body)
 msgid "Recent versions of CentOS/RHEL are using `dnf` instead of `yum`:"
 msgstr ""
+"Versiones recientes de CentOS/RHEL están usando `dnf` en vez de `yum`:"
 
 #: https//community.torproject.org/relay/setup/guard/centos-rhel/
 #: (content/relay/setup/guard/centos-rhel/contents+en.lrpage.body)
@@ -21752,11 +21753,14 @@ msgid ""
 "If you are on a recent version that uses `dnf`, please keep using it for the"
 " following steps where `yum` is called on this setup guide."
 msgstr ""
+"Si estás sobre una versión reciente que usa `dnf`, por favor sigue 
usándola "
+"para los siguientes pasos, donde `yum` sea llamado en esta guía de "
+"configuración."
 
 #: https//community.torproject.org/relay/setup/guard/centos-rhel/
 #: (content/relay/setup/guard/centos-rhel/contents+en.lrpage.body)
 msgid "### 3. Configure Tor Project's Repository"
-msgstr ""
+msgstr "### 3. Configura el Repositorio del Tor Project"
 
 #: https//community.torproject.org/relay/setup/guard/centos-rhel/
 #: (content/relay/setup/guard/centos-rhel/contents+en.lrpage.body)
@@ -21764,11 +21768,14 @@ msgid ""
 "Configuring the Tor Project's Repository for CentOS/RHEL consists basically "
 "on setting up `/etc/yum.repos.d/Tor.repo` with the following content:"
 msgstr ""
+"Configurar el Repositorio del Tor Project para CentOS/RHEL consiste "
+"básicamente en incorporar a `/etc/yum.repos.d/Tor.repo` el siguiente "
+"contenido:"
 
 #: https//community.torproject.org/relay/setup/guard/centos-rhel/
 #: (content/relay/setup/guard/centos-rhel/contents+en.lrpage.body)
 msgid "### 4. Package installation"
-msgstr ""
+msgstr "### 4. Instalación del paquete"
 
 #: https//community.torproject.org/relay/setup/guard/centos-rhel/
 #: (content/relay/setup/guard/centos-rhel/contents+en.lrpage.body)
@@ -21776,6 +21783,8 @@ msgid ""
 "Once you are set with EPEL and the Tor repositories, you are now able to "
 "install the package:"
 msgstr ""
+"Una vez que hayas configurado los repositorios de EPEL y de Tor, ya estás "
+"habilitado para instalar el paquete:"
 
 #: https//community.torproject.org/relay/setup/guard/centos-rhel/
 #: (content/relay/setup/guard/centos-rhel/contents+en.lrpage.body)
@@ -21792,26 +21801,34 @@ msgid ""
 "installing packages from Tor's repository for the first time - again you "
 "must ensure the key matches."
 msgstr ""
+"Por favor ten en cuenta que cuando estés instalando el primer paquete desde "
+"el repositorio EPEL, te será solicitado verificar la clave de firma GPG de "
+"EPEL. Por favor asegúrate de que la clave se corresponda con la que está "
+"disponible en el [sitio web del Fedora "
+"Project](https://getfedora.org/keys/). Esto también pasará cuando instales "
+"paquetes desde el repositorio de Tor por primera vez - de nuevo, debes "
+"asegurarte que la clave se corresponda."
 
 #: https//community.torproject.org/relay/setup/guard/centos-rhel/
 #: (content/relay/setup/guard/centos-rhel/contents+en.lrpage.body)
 msgid "### 5. Configuration file"
-msgstr ""
+msgstr "### 5. Archivo de configuración"
 
 #: https//community.torproject.org/relay/setup/guard/centos-rhel/
 #: (content/relay/setup/guard/centos-rhel/contents+en.lrpage.body)
 msgid "### 6. Enable and Start `tor`"
-msgstr ""
+msgstr "### 6. Habilita e Inicia `tor`"
 
 #: https//community.torproject.org/relay/setup/guard/centos-rhel/
 #: (content/relay/setup/guard/centos-rhel/contents+en.lrpage.body)
 msgid "Recent versions os CentOS/RHEL which ship with systemd:"
-msgstr ""
+msgstr "Versiones recientes de CentOS/RHEL que vienen con systemd:"
 
 #: https//community.torproject.org/relay/setup/guard/centos-rhel/
 #: (content/relay/setup/guard/centos-rhel/contents+en.lrpage.body)
 msgid "Should you use an older release like CentOS/RHEL 6, that will be:"
 msgstr ""
+"En caso que usaras una versión más vieja, como CentOS/RHEL 6, eso será:"
 
 #: https//community.torproject.org/relay/setup/guard/centos-rhel/
 #: 

[tor-commits] [translation/gettor-website-contentspot] new translations in gettor-website-contentspot

2021-11-23 Thread translation
commit 35cb542e5f6adc581f31332eedbcc6d9dd26cadd
Author: Translation commit bot 
Date:   Tue Nov 23 17:15:25 2021 +

new translations in gettor-website-contentspot
---
 contents+pt-PT.po | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/contents+pt-PT.po b/contents+pt-PT.po
index 8682535d9c..fb3db279d8 100644
--- a/contents+pt-PT.po
+++ b/contents+pt-PT.po
@@ -164,6 +164,10 @@ msgid ""
 "want to use bridges. To use pluggable transports, click 'Configure' in the "
 "Tor Launcher window that appears when you first run Tor Browser."
 msgstr ""
+"Quando inicia o Tor Browser pela primeira vez, será perguntado se deseja "
+"utilizar pontes. Para utilizar \"pluggable transports\", clique em "
+"\"Configurar\" na janela de iniciação do Tor que aparece quando executa o "
+"Tor Browser pela primeira vez."
 
 #: https//gettor.torproject.org/ (content/contents+en.lrpage.body)
 msgid ""
@@ -172,6 +176,10 @@ msgid ""
 "bar. Once in Preferences, navigate to 'Tor' from the menu on the left of the"
 " screen."
 msgstr ""
+"Também pode configurar \"pluggable transports\" enquanto o Tor Browser está 
"
+"em execução, selecionando 'Preferências' no menu de configurações, à 
direita"
+" da barra de endereço. Uma vez nas 'Preferências', navegue até 'Tor' no 
menu"
+" à esquerda do ecrã."
 
 #: https//gettor.torproject.org/ (content/contents+en.lrpage.body)
 msgid ""
@@ -179,6 +187,9 @@ msgid ""
 "bridge.' Click on the drop-down menu and select the pluggable transport "
 "you'd like to use."
 msgstr ""
+"Na seção de 'Pontes', selecione 'Utilizar uma ponte' e selecione 
'Selecionar"
+" uma ponte integrada'. Clique no menu suspenso e selecione o transporte "
+"ligável que deseja utilizar."
 
 #: https//gettor.torproject.org/ (content/contents+en.lrpage.body)
 msgid "Click 'OK' to save your settings."

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/communitytpo-contentspot] new translations in communitytpo-contentspot

2021-11-23 Thread translation
commit 60e29d8381b1acf8642c9ed30a580b2aca89b5a8
Author: Translation commit bot 
Date:   Tue Nov 23 17:15:12 2021 +

new translations in communitytpo-contentspot
---
 contents+pt-PT.po | 49 ++---
 1 file changed, 26 insertions(+), 23 deletions(-)

diff --git a/contents+pt-PT.po b/contents+pt-PT.po
index 582e18230c..4ee70bafda 100644
--- a/contents+pt-PT.po
+++ b/contents+pt-PT.po
@@ -2,15 +2,12 @@
 # Translators:
 # 425fe09b3064b9f906f637fff94056ae_a00ea56 
<0fa3588fa89906bfcb3a354600956e0e_308047>, 2019
 # A Russo , 2019
-# Nuno Miguel Macedo Batalha , 2020
 # Cass Teixeira , 2020
-# Transifex Bot <>, 2021
 # erinm, 2021
-# Manuela Silva , 2021
 # Rui , 2021
-# Marco Lopes, 2021
 # Emma Peel, 2021
 # Hugo Costa , 2021
+# Manuela Silva , 2021
 # 
 msgid ""
 msgstr ""
@@ -18,7 +15,7 @@ msgstr ""
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2021-11-11 20:06+UTC\n"
 "PO-Revision-Date: 2019-12-11 10:50+\n"
-"Last-Translator: Hugo Costa , 2021\n"
+"Last-Translator: Manuela Silva , 2021\n"
 "Language-Team: Portuguese (Portugal) 
(https://www.transifex.com/otf/teams/1519/pt_PT/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -40,7 +37,7 @@ msgstr ""
 #: (dynamic) https//community.torproject.org/outreach/
 #: (content/outreach/contents+en.lrpage.section)
 msgid "community"
-msgstr "community"
+msgstr "comunidade"
 
 #: https//community.torproject.org/ (content/contents+en.lrpage.body)
 msgid "The Tor community is made up of all kinds of contributors."
@@ -88,11 +85,15 @@ msgstr "Privacidade é um direito humano"
 
 #: (dynamic)
 msgid "Your donation will be matched by Friends of Tor, up to $150,000."
-msgstr "A sua doação corresponde á de Amigos do Tor, até $150,000."
+msgstr ""
+"Os «Amigos do Tor» farão uma doação do mesmo valor do seu donativo, até 
ao "
+"limite de $150,000.00."
 
 #: (dynamic)
 msgid "Your donation will be matched by Friends of Tor, up to $100,000."
-msgstr "O seu donativo será igualado pelos Amigos do Tor, até $100.000,00 "
+msgstr ""
+"Os «Amigos do Tor» farão uma doação do mesmo valor do seu donativo, até 
ao "
+"limite de $100,000.00."
 
 #: (dynamic)
 msgid "Donate now"
@@ -181,7 +182,7 @@ msgstr "Alcançar"
 #: (dynamic) https//community.torproject.org/user-research/
 #: (content/user-research/contents+en.lrpage.title)
 msgid "User Research"
-msgstr "Pesquisa de usuária(o)"
+msgstr "Pesquisa do Utilizador"
 
 #: (dynamic) https//community.torproject.org/relay/
 #: (content/relay/contents+en.lrpage.title)
@@ -226,7 +227,7 @@ msgstr ""
 #: (dynamic) https//community.torproject.org/onion-services/advanced/
 #: (content/onion-services/advanced/contents+en.lrpage.title)
 msgid "Advanced settings"
-msgstr "Configurações avançadas"
+msgstr "Configurações Avançadas"
 
 #: (dynamic) https//community.torproject.org/onion-services/advanced/
 #: (content/onion-services/advanced/contents+en.lrpage.subtitle)
@@ -323,8 +324,8 @@ msgid ""
 "Onion services help you and your users defeat surveillance and censorship. "
 "Learn how you can deploy onion services."
 msgstr ""
-"Os serviços onion ajudam-te e a quem usa, a enfrentar a vigilânica e "
-"censura. Vê como podes implementar os serviços Onion."
+"Os serviços Onion ajudam-no e aos seus utilizadores a enfrentar a 
vigilância"
+" e censura. Saiba como pode implementar os serviços Onion."
 
 #: https//community.torproject.org/onion-services/
 #: (content/onion-services/contents+en.lrpage.cta)
@@ -364,7 +365,7 @@ msgstr "GSoC"
 
 #: https//community.torproject.org/gsoc/ (content/gsoc/contents+en.lrpage.cta)
 msgid "Get coding"
-msgstr "Começa a programar"
+msgstr "Comece a programar"
 
 #: https//community.torproject.org/gsoc/
 #: (content/gsoc/contents+en.lrpage.body)
@@ -692,18 +693,20 @@ msgstr ""
 #: (content/user-research/contents+en.lrpage.subtitle)
 msgid "We respect our users' privacy when we conduct research."
 msgstr ""
-"Respeitamos a privacidade de quem utiliza quando realizamos pesquisas."
+"Nós respeitamos a privacidade dos nossos utilizadores quando nós realizamos 
"
+"pesquisas."
 
 #: https//community.torproject.org/user-research/
 #: (content/user-research/contents+en.lrpage.cta)
 msgid "Learn about Tor users"
-msgstr "Sabe mais sobre quem utiliza o Tor"
+msgstr "Saiba mais sobre os utilizadores do Tor"
 
 #: https//community.torproject.org/user-research/
 #: (content/user-research/contents+en.lrpage.body)
 msgid "## We respect our users' privacy when we conduct research."
 msgstr ""
-"## Respeitamos a privacidade de quem utiliza quando realizamos pesquisas"
+"## Nós respeitamos a privacidade dos nossos utilizadores quando nós "
+"realizamos pesquisas"
 
 #: https//community.torproject.org/user-research/
 #: (content/user-research/contents+en.lrpage.body)
@@ -960,7 +963,7 @@ msgstr ""
 
 #: (dynamic)
 msgid "Edit this page"
-msgstr "Edite esta página"
+msgstr "Editar esta página"
 
 #: 

[tor-commits] [tor/main] Don't kill managed proxy on method error

2021-11-23 Thread nickm
commit 809b636b6ec9039262c1feb874a9d167046bf515
Author: Cecylia Bocovich 
Date:   Fri Nov 19 14:50:36 2021 -0500

Don't kill managed proxy on method error

Some PT applications support more than one transport. For example,
obfs4proxy supports obfs4, obfs3, and meek. If one or more transports
specified in the torrc file are supported, we shouldn't kill the managed
proxy on a {C,S}METHOD-ERROR. Instead, we should log a warning.

We were already logging warnings on method errors. This change just
makes sure that the managed proxy isn't killed, and then if no
transports are configured for the managed proxy, bumps the log level up
from a notice to a warning.

Closes #7362
---
 src/feature/client/transports.c | 6 +++---
 src/test/test_pt.c  | 4 
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/feature/client/transports.c b/src/feature/client/transports.c
index 167beb96c6..5eda63ce8e 100644
--- a/src/feature/client/transports.c
+++ b/src/feature/client/transports.c
@@ -843,7 +843,7 @@ handle_methods_done(const managed_proxy_t *mp)
   tor_assert(mp->transports);
 
   if (smartlist_len(mp->transports) == 0)
-log_notice(LD_GENERAL, "Managed proxy '%s' was spawned successfully, "
+log_warn(LD_GENERAL, "Managed proxy '%s' was spawned successfully, "
"but it didn't launch any pluggable transport listeners!",
mp->argv[0]);
 
@@ -904,13 +904,13 @@ handle_proxy_line(const char *line, managed_proxy_t *mp)
   goto err;
 
 parse_client_method_error(line);
-goto err;
+return;
   } else if (!strcmpstart(line, PROTO_SMETHOD_ERROR)) {
 if (mp->conf_state != PT_PROTO_ACCEPTING_METHODS)
   goto err;
 
 parse_server_method_error(line);
-goto err;
+return;
   } else if (!strcmpstart(line, PROTO_CMETHOD)) {
 if (mp->conf_state != PT_PROTO_ACCEPTING_METHODS)
   goto err;
diff --git a/src/test/test_pt.c b/src/test/test_pt.c
index 27e74d5ebf..07c5032933 100644
--- a/src/test/test_pt.c
+++ b/src/test/test_pt.c
@@ -233,6 +233,10 @@ test_pt_protocol(void *arg)
   handle_proxy_line(line, mp);
   tt_assert(mp->conf_state == PT_PROTO_ACCEPTING_METHODS);
 
+  strlcpy(line,"CMETHOD-ERROR fakename not supported",sizeof(line));
+  handle_proxy_line(line, mp);
+  tt_assert(mp->conf_state == PT_PROTO_ACCEPTING_METHODS);
+
   strlcpy(line,"CMETHODS DONE",sizeof(line));
   handle_proxy_line(line, mp);
   tt_assert(mp->conf_state == PT_PROTO_CONFIGURED);



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/main] changes: Describe when bug 7362 began.

2021-11-23 Thread nickm
commit b4c55f3a700b9c071c7f8466499ed9cf5ef76fc7
Author: Nick Mathewson 
Date:   Tue Nov 23 11:28:30 2021 -0500

changes: Describe when bug 7362 began.
---
 changes/ticket7362 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/changes/ticket7362 b/changes/ticket7362
index fd64350465..4df58e048a 100644
--- a/changes/ticket7362
+++ b/changes/ticket7362
@@ -1,4 +1,4 @@
   o Minor bugfix (pluggable transport):
 - Do not kill a managed proxy if one of its transport configurations
   emits a method error. Instead log a warning and continue processing
-  method arguments. Closes ticket 7362.
+  method arguments. Fixes bug 7362; bugfix on 0.2.3.6-alpha.

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/main] Add documentation on {C, S}METHOD parsing behaviour

2021-11-23 Thread nickm
commit 0d3894dbbcde9f45fbbf53c451c8b1c4d290280c
Author: Cecylia Bocovich 
Date:   Tue Nov 23 10:40:43 2021 -0500

Add documentation on {C,S}METHOD parsing behaviour
---
 changes/ticket7362  | 4 
 src/feature/client/transports.c | 8 
 2 files changed, 12 insertions(+)

diff --git a/changes/ticket7362 b/changes/ticket7362
new file mode 100644
index 00..fd64350465
--- /dev/null
+++ b/changes/ticket7362
@@ -0,0 +1,4 @@
+  o Minor bugfix (pluggable transport):
+- Do not kill a managed proxy if one of its transport configurations
+  emits a method error. Instead log a warning and continue processing
+  method arguments. Closes ticket 7362.
diff --git a/src/feature/client/transports.c b/src/feature/client/transports.c
index 5eda63ce8e..80903ac9e5 100644
--- a/src/feature/client/transports.c
+++ b/src/feature/client/transports.c
@@ -903,12 +903,20 @@ handle_proxy_line(const char *line, managed_proxy_t *mp)
 if (mp->conf_state != PT_PROTO_ACCEPTING_METHODS)
   goto err;
 
+/* Log the error but do not kill the managed proxy.
+ * A proxy may contain several transports and if one
+ * of them is misconfigured, we still want to use
+ * the other transports. A managed proxy with no usable
+ * transports will log a warning.
+ * See https://gitlab.torproject.org/tpo/core/tor/-/issues/7362
+ * */
 parse_client_method_error(line);
 return;
   } else if (!strcmpstart(line, PROTO_SMETHOD_ERROR)) {
 if (mp->conf_state != PT_PROTO_ACCEPTING_METHODS)
   goto err;
 
+/* Log the error but do not kill the managed proxy */
 parse_server_method_error(line);
 return;
   } else if (!strcmpstart(line, PROTO_CMETHOD)) {



___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [bridgedb/main] Delete unused code

2021-11-23 Thread meskio
commit 11d6545a10df2fa0151dde36b63eff26b4a8f43c
Author: meskio 
Date:   Fri Nov 5 15:33:33 2021 +0100

Delete unused code

Just removing the obvious easy to remove.
---
 bridgedb/bridgerings.py   | 117 
 bridgedb/metrics.py   |  21 --
 bridgedb/test/test_bridgerings.py | 137 --
 bridgedb/test/test_metrics.py |  13 
 4 files changed, 288 deletions(-)

diff --git a/bridgedb/bridgerings.py b/bridgedb/bridgerings.py
index 5b55610..ebbaa9b 100644
--- a/bridgedb/bridgerings.py
+++ b/bridgedb/bridgerings.py
@@ -412,123 +412,6 @@ class UnallocatedHolder(object):
 f.write("%s %s\n" % (bridge.hex_key, " ".join(desc).strip()))
 
 
-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)
-self.ringsByName = {}
-self.totalP = 0
-self.pValues = []
-self.rings = []
-self.statsHolders = []
-
-def __len__(self):
-n = 0
-for r in self.ringsByName.values():
-n += len(r)
-return n
-
-def addRing(self, ring, ringname, p=1):
-"""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 relative proportion of bridges to assign to this
-bridgeholder.
-"""
-self.ringsByName[ringname] = ring
-self.pValues.append(self.totalP)
-self.rings.append(ringname)
-self.totalP += p
-
-def addTracker(self, t):
-"""Adds a statistics tracker that gets told about every bridge we see.
-"""
-self.statsHolders.append(t)
-
-def clear(self):
-for r in self.ringsByName.values():
-r.clear()
-
-def insert(self, bridge):
-assert self.rings
-
-for s in self.statsHolders:
-s.insert(bridge)
-
-# The bridge must be running to insert it:
-if not bridge.flags.running:
-return
-
-validRings = self.rings
-distribution_method = orig_method = None
-
-with bridgedb.Storage.getDB() as db:
-orig_method = db.getBridgeDistributor(bridge, validRings)
-if orig_method is not None:
-distribution_method = orig_method
-logging.info("So far, bridge %s was in hashring %s" %
- (bridge, orig_method))
-
-# Check if the bridge requested a distribution method and if so, try to
-# use it.
-if bridge.distribution_request:
-distribution_method = bridge.distribution_request
-logging.info("Bridge %s requested placement in hashring %s" %
- (bridge, distribution_method))
-
-# Is the bridge requesting a distribution method that's different
-# from the one we have on record?  If so, we have to delete it from
-# its previous ring.
-if orig_method is not None and \
-   orig_method != distribution_method and \
-   distribution_method in (validRings + ["none"]):
-logging.info("Bridge %s is in %s but wants to be in %s." %
-(bridge, orig_method, distribution_method))
-prevRing = self.ringsByName.get(orig_method)
-prevRing.remove(bridge)
-
-# If they requested not to be distributed, honor the request:
-if distribution_method == "none":
-logging.info("Bridge %s requested to not be distributed." % bridge)
-return
-
-# If we didn't know what they are talking about, or they requested
-# "any" distribution method, and we've never seen this bridge
-# before, then deterministically determine where to place it.
-if ((distribution_method not in validRings) or
-(distribution_method == "any")):
-
-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)
-distribution_method = self.rings[pos]
-logging.info(("%s placing bridge %s into hashring %s (via n=%s,"
-" pos=%s).") % (self.__class__.__name__, bridge,
-distribution_method, n, pos))
-
-with bridgedb.Storage.getDB() as db:
-ringname = db.insertBridgeAndGetRing(bridge, distribution_method,
- time.time(), validRings)
-db.commit()
-
-ring = self.ringsByName.get(ringname)
-

[tor-commits] [bridgedb/main] Use rdsys as bridgedb backend

2021-11-23 Thread meskio
commit d3a4cb06bf62dfa49d9a3850c76dfe6922f82089
Author: meskio 
Date:   Thu Nov 4 20:00:26 2021 +0100

Use rdsys as bridgedb backend

Closes: #40031
---
 bridgedb.conf |   6 +
 bridgedb/bridges.py   |  33 -
 bridgedb/main.py  | 297 --
 bridgedb/rdsys.py | 100 ++
 bridgedb/test/test_Storage.py |  55 
 bridgedb/test/test_main.py| 145 +++--
 6 files changed, 175 insertions(+), 461 deletions(-)

diff --git a/bridgedb.conf b/bridgedb.conf
index 6d4839d..9e1374a 100644
--- a/bridgedb.conf
+++ b/bridgedb.conf
@@ -150,6 +150,12 @@ STATUS_FILE = "networkstatus-bridges"
 #
 IGNORE_NETWORKSTATUS = True
 
+# The token to access the rdsys backend
+RDSYS_TOKEN = "ApiTokenPlaceholder"
+
+# The address of the rdsys backend
+RDSYS_ADDRESS = "localhost:7100"
+
 #
 # Output Files   \  Where to store created data
 #--
diff --git a/bridgedb/bridges.py b/bridgedb/bridges.py
index 6ec864d..83d6e95 100644
--- a/bridgedb/bridges.py
+++ b/bridgedb/bridges.py
@@ -34,7 +34,6 @@ import codecs
 import hashlib
 import ipaddr
 import logging
-import os
 import warnings
 
 from Crypto.Util import asn1
@@ -52,14 +51,12 @@ from bridgedb import safelog
 from bridgedb import bridgerequest
 from bridgedb.crypto import removePKCS1Padding
 from bridgedb.parse.addr import isIPAddress
-from bridgedb.parse.addr import isIPv4
 from bridgedb.parse.addr import isIPv6
 from bridgedb.parse.addr import isValidIP
 from bridgedb.parse.addr import PortList
 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 isascii_noncontrol
 
 
@@ -1549,6 +1546,36 @@ class Bridge(BridgeBackwardsCompatibility):
 """
 return list(set([pt.methodname for pt in self.transports]))
 
+def updateFromResource(self, resource):
+"""Update this bridge's attributes from an rdsys resource
+
+:type resource: dict
+:param resource: The rdsys resource dict
+"""
+self.fingerprint = resource["fingerprint"]
+self.address = resource["address"]
+self.orPort = resource["port"]
+
+self.flags.running = resource["flags"]["running"]
+self.flags.stable = resource["flags"]["stable"]
+self.flags.valid = resource["flags"]["valid"]
+self.flags.fast = resource["flags"]["fast"]
+
+if resource["or-addresses"]:
+for oa in resource["or-addresses"]:
+validatedAddress = isIPAddress(oa["address"], compressed=False)
+if validatedAddress:
+self.orAddresses.append( (validatedAddress, oa["port"], 
oa["ip-version"],) )
+
+transport = PluggableTransport(
+fingerprint=self.fingerprint,
+methodname=resource["type"],
+address=self.address,
+port=self.port,
+arguments=resource.get("params", {})
+)
+self.transports = [transport]
+
 def updateFromNetworkStatus(self, descriptor, ignoreNetworkstatus=False):
 """Update this bridge's attributes from a parsed networkstatus
 document.
diff --git a/bridgedb/main.py b/bridgedb/main.py
index 8fdec23..72c1f0e 100644
--- a/bridgedb/main.py
+++ b/bridgedb/main.py
@@ -27,6 +27,7 @@ from bridgedb import runner
 from bridgedb import util
 from bridgedb import metrics
 from bridgedb import antibot
+from bridgedb import rdsys
 from bridgedb.bridges import MalformedBridgeInfo
 from bridgedb.bridges import MissingServerDescriptorDigest
 from bridgedb.bridges import ServerDescriptorDigestMismatch
@@ -57,24 +58,6 @@ def expandBridgeAuthDir(authdir, filename):
 
 return path
 
-def writeAssignments(hashring, filename):
-"""Dump bridge distributor assignments to disk.
-
-:type hashring: A :class:`~bridgedb.bridgerings.BridgeSplitter`
-:ivar hashring: A class which takes an HMAC key and splits bridges
-into their hashring assignments.
-:param str filename: The filename to write the assignments to.
-"""
-logging.debug("Dumping pool assignments to file: '%s'" % filename)
-
-try:
-with open(filename, 'a') as fh:
-fh.write("bridge-pool-assignment %s\n" %
- time.strftime("%Y-%m-%d %H:%M:%S"))
-hashring.dumpAssignments(fh)
-except IOError:
-logging.info("I/O error while writing assignments to: '%s'" % filename)
-
 def writeMetrics(filename, measurementInterval):
 """Dump usage metrics to disk.
 
@@ -91,178 +74,18 @@ def writeMetrics(filename, measurementInterval):
 except IOError as err:
 logging.error("Failed to write metrics to '%s': %s" % (filename, err))
 

[tor-commits] [bridgedb/main] Skip all the tests that needs rdsys running

2021-11-23 Thread meskio
commit fdb29089d2e9d77f4c06f73e19987ff34cbfd2b4
Author: meskio 
Date:   Thu Nov 11 13:31:10 2021 +0100

Skip all the tests that needs rdsys running

We don't run rdsys for the tests, let's skip the tests that requires
getting bridges from it.
---
 bridgedb/test/test_bridgedb_script.py |  4 
 bridgedb/test/test_https.py   | 12 
 2 files changed, 16 insertions(+)

diff --git a/bridgedb/test/test_bridgedb_script.py 
b/bridgedb/test/test_bridgedb_script.py
index 5bf9e4e..b2d5ace 100644
--- a/bridgedb/test/test_bridgedb_script.py
+++ b/bridgedb/test/test_bridgedb_script.py
@@ -60,6 +60,8 @@ class BridgeDBCliTest(unittest.TestCase):
 This test ensures that an ``assignments.log`` file is created after a
 BridgeDB process was started.
 """
+raise SkipTest("We can't get bridges as rdsys is not running")
+
 if os.environ.get("CI"):
 if not self.pid or not processExists(self.pid):
 raise FailTest("Could not start BridgeDB process on CI 
server!")
@@ -73,6 +75,8 @@ class BridgeDBCliTest(unittest.TestCase):
 """Test that BridgeDB creates a new ``assignments.log`` file after
 receiving a SIGHUP.
 """
+raise SkipTest("We can't get bridges as rdsys is not running")
+
 if os.environ.get("CI"):
 if not self.pid or not processExists(self.pid):
 raise FailTest("Could not start BridgeDB process on CI 
server!")
diff --git a/bridgedb/test/test_https.py b/bridgedb/test/test_https.py
index 8e3de1b..8af43ff 100644
--- a/bridgedb/test/test_https.py
+++ b/bridgedb/test/test_https.py
@@ -189,6 +189,8 @@ class HTTPTests(unittest.TestCase):
 self.assertRaises(mechanize.HTTPError, self.br.open, page)
 
 def test_get_vanilla_ipv4(self):
+raise SkipTest("We can't get bridges as rdsys is not running")
+
 self.openBrowser()
 self.goToOptionsPage()
 
@@ -202,6 +204,8 @@ class HTTPTests(unittest.TestCase):
 self.assertIsInstance(ipaddress.ip_address(addr), 
ipaddress.IPv4Address)
 
 def test_get_vanilla_ipv6(self):
+raise SkipTest("We can't get bridges as rdsys is not running")
+
 self.openBrowser()
 self.goToOptionsPage()
 
@@ -221,6 +225,8 @@ class HTTPTests(unittest.TestCase):
 This is a regression test for #12932, see
 https://bugs.torproject.org/12932.
 """
+raise SkipTest("We can't get bridges as rdsys is not running")
+
 self.openBrowser()
 self.goToOptionsPage()
 
@@ -246,6 +252,8 @@ class HTTPTests(unittest.TestCase):
 """Ask for obfs4 bridges and check that there is an 'iat-mode' PT
 argument in the bridge lines.
 """
+raise SkipTest("We can't get bridges as rdsys is not running")
+
 self.openBrowser()
 self.goToOptionsPage()
 
@@ -273,6 +281,8 @@ class HTTPTests(unittest.TestCase):
 """Ask for obfs4 bridges and check that there is an 'public-key' PT
 argument in the bridge lines.
 """
+raise SkipTest("We can't get bridges as rdsys is not running")
+
 self.openBrowser()
 self.goToOptionsPage()
 
@@ -300,6 +310,8 @@ class HTTPTests(unittest.TestCase):
 """Ask for obfs4 bridges and check that there is an 'node-id' PT
 argument in the bridge lines.
 """
+raise SkipTest("We can't get bridges as rdsys is not running")
+
 self.openBrowser()
 self.goToOptionsPage()
 

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/gettor-website-contentspot] new translations in gettor-website-contentspot

2021-11-23 Thread translation
commit bff6b216cabb0328faee177716c8bfdb9b6fd823
Author: Translation commit bot 
Date:   Tue Nov 23 15:15:20 2021 +

new translations in gettor-website-contentspot
---
 contents+pt-PT.po | 31 +--
 1 file changed, 17 insertions(+), 14 deletions(-)

diff --git a/contents+pt-PT.po b/contents+pt-PT.po
index 1c9f2ea9b9..8682535d9c 100644
--- a/contents+pt-PT.po
+++ b/contents+pt-PT.po
@@ -49,23 +49,26 @@ msgid ""
 "- Step 1: Send a request to GetTor (get...@torproject.org) specifying your "
 "operating system (and your locale). Ex: \"windows es\""
 msgstr ""
-"- Etapa 1: Envie uma pedido para GetTor (get...@torproject.org) "
-"especificando seu sistema operativo (e a sua localização). Ex: \"windows "
-"pt\""
+"- Etapa 1: Enviar uma pedido para GetTor (get...@torproject.org) "
+"especificando o seu sistema operativo (e a sua localização). Exemplo: "
+"\"windows pt\""
 
 #: https//gettor.torproject.org/ (content/contents+en.lrpage.body)
 msgid ""
 "- Step 2: GetTor will send you back a reply with links to download Tor "
 "Browser from our supported providers."
 msgstr ""
-"- Etapa 2: GetTor enviará de volta uma resposta com links para baixar o "
-"navegador Tor de nossos provedores compatíveis."
+"- Etapa 2: GetTor irá enviar-lhe de volta uma resposta com hiperligações "
+"para transferir o navegador Tor a p+artir dos nossos provedores compatíveis."
 
 #: https//gettor.torproject.org/ (content/contents+en.lrpage.body)
 msgid ""
 "- Step 3: Download Tor Browser from one of the providers. When done, check "
 "the integrity of the downloaded file by verifying its signature."
 msgstr ""
+"- Etapa 3: Transferir o Tor Browser de um dos provedores. Quando a "
+"transferência estiver concluída, verifique a integridade do ficheiro "
+"transferido, verificando a sua assinatura."
 
 #: https//gettor.torproject.org/ (content/contents+en.lrpage.body)
 msgid "- Step 4: If required, get some bridges!"
@@ -77,7 +80,7 @@ msgstr "## GetTor Responder no Twitter"
 
 #: https//gettor.torproject.org/ (content/contents+en.lrpage.body)
 msgid "GetTor is currently not working on Twitter."
-msgstr "GetTor não está a funcionar atualmente no Twitter."
+msgstr "Atualmente, o GetTor não está a funcionar no Twitter."
 
 #: https//gettor.torproject.org/ (content/contents+en.lrpage.body)
 msgid "## How to verify a digital signature"
@@ -112,15 +115,15 @@ msgid ""
 "For example, `torbrowser-install-win64-8.5.4_en-US.exe` is accompanied by "
 "`torbrowser-install-win64-8.5.4_en-US.exe.asc`."
 msgstr ""
-"Por exemplo, `torbrowser-install-win64-8.5.4_en-US.exe` é acompanhado por` "
-"torbrowser-install-win64-8.5.4_en-US.exe.asc`."
+"Por exemplo, `torbrowser-install-win64-8.5.4_en-US.exe` é acompanhado por "
+"`torbrowser-install-win64-8.5.4_en-US.exe.asc`."
 
 #: https//gettor.torproject.org/ (content/contents+en.lrpage.body)
 msgid ""
 "Check [how to verify a digital signature](https://support.torproject.org/tbb;
 "/how-to-verify-signature/)."
 msgstr ""
-"Verificar [como verificar uma assinatura "
+"Consulte [como verificar uma assinatura "
 "digital](https://support.torproject.org/tbb/how-to-verify-signature/)."
 
 #: https//gettor.torproject.org/ (content/contents+en.lrpage.body)
@@ -151,9 +154,9 @@ msgid ""
 "recognize that they are contacting a public Tor relay IP address."
 msgstr ""
 "As pontes são úteis para os utilizadores do Tor que estejam em regimes "
-"repressivos e para pessoas que queiram uma segurança extra porque estão "
-"preocupados que alguém saiba que estão a contactar um endereço IP público 
de"
-" um retransmissor Tor."
+"opressivos e para as pessoas que querem uma segurança extra porque estão "
+"preocupados que alguém saiba que estão a contactar um endereço de IP 
público"
+" de um retransmissor Tor."
 
 #: https//gettor.torproject.org/ (content/contents+en.lrpage.body)
 msgid ""
@@ -311,7 +314,7 @@ msgid ""
 "Click the “Tor” button to see what data is visible to observers when 
you're "
 "using Tor. The button will turn green to indicate that Tor is on."
 msgstr ""
-"Clique no botão \"Tor\" para ver quais dados que estão visíveis para os "
+"Clique no botão \"Tor\" para ver quais os dados que estão visíveis para os 
"
 "observadores quando utiliza o Tor. Este botão ficará verde para indicar que 
"
 "o Tor está ativo."
 
@@ -320,7 +323,7 @@ msgid ""
 "Click the “HTTPS” button to see what data is visible to observers when "
 "you're using HTTPS. The button will turn green to indicate that HTTPS is on."
 msgstr ""
-"Clique no botão \"HTTPS\" para ver os dados que são visíveis para os "
+"Clique no botão \"HTTPS\" para ver os dados que estão visíveis para os "
 "observadores quando está a utilizar HTTPS. O botão ficará verde para 
indicar"
 " que o HTTPS está ativo."
 

___
tor-commits mailing list
tor-commits@lists.torproject.org

[tor-commits] [translation/torbutton-torbuttondtd] new translations in torbutton-torbuttondtd

2021-11-23 Thread translation
commit 8dca6161e1005aeec05a35bcfabeec36e2301c08
Author: Translation commit bot 
Date:   Tue Nov 23 14:47:54 2021 +

new translations in 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 5b4b049e29..cfa050e8d7 100644
--- a/pt-BR/torbutton.dtd
+++ b/pt-BR/torbutton.dtd
@@ -45,7 +45,7 @@
 
 
 
-
+
 
 
 

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/tails-misc_release] new translations in tails-misc_release

2021-11-23 Thread translation
commit c17aed0909db7ca34da6ffc02bb8b6fb4e96835a
Author: Translation commit bot 
Date:   Tue Nov 23 14:47:03 2021 +

new translations in tails-misc_release
---
 pt_BR.po | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pt_BR.po b/pt_BR.po
index 4f60a0c7a6..2153bbd5a3 100644
--- a/pt_BR.po
+++ b/pt_BR.po
@@ -38,8 +38,8 @@ msgstr ""
 "Project-Id-Version: Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2021-11-04 12:14+0100\n"
-"PO-Revision-Date: 2021-11-04 12:25+\n"
-"Last-Translator: Transifex Bot <>\n"
+"PO-Revision-Date: 2021-11-23 14:23+\n"
+"Last-Translator: Henrique Casellato\n"
 "Language-Team: Portuguese (Brazil) 
(http://www.transifex.com/otf/torproject/language/pt_BR/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\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] new translations in tails-misc

2021-11-23 Thread translation
commit 1c100fb312a91098e1075b6c7b672f905e4dd181
Author: Translation commit bot 
Date:   Tue Nov 23 14:46:01 2021 +

new translations in tails-misc
---
 pt_BR.po | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pt_BR.po b/pt_BR.po
index 45b5d1786d..0372d59d21 100644
--- a/pt_BR.po
+++ b/pt_BR.po
@@ -38,8 +38,8 @@ msgstr ""
 "Project-Id-Version: Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2021-11-04 12:14+0100\n"
-"PO-Revision-Date: 2021-11-04 12:25+\n"
-"Last-Translator: Transifex Bot <>\n"
+"PO-Revision-Date: 2021-11-23 14:23+\n"
+"Last-Translator: Henrique Casellato\n"
 "Language-Team: Portuguese (Brazil) 
(http://www.transifex.com/otf/torproject/language/pt_BR/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -912,18 +912,18 @@ msgid ""
 "\n"
 "\n"
 "The persistent storage on this USB stick will be lost."
-msgstr ""
+msgstr "\n\nO volume de armazenamento persistente deste dispositivo USB será 
perdido."
 
 #: 
config/chroot_local-includes/usr/lib/python3/dist-packages/tails_installer/gui.py:638
 msgid "Delete Persistent Storage and Reinstall"
-msgstr ""
+msgstr "Delete o Armazenamento Persistente e reinstale"
 
 #: 
config/chroot_local-includes/usr/lib/python3/dist-packages/tails_installer/gui.py:640
 msgid ""
 "\n"
 "\n"
 "All data on this USB stick will be lost."
-msgstr ""
+msgstr "\n\nTodos os dados neste dispositivo USB será perdido."
 
 #: 
config/chroot_local-includes/usr/lib/python3/dist-packages/tails_installer/gui.py:641
 msgid "Delete All Data and Install"

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/orfox-stringsxml] new translations in orfox-stringsxml

2021-11-23 Thread translation
commit 00e2da8ddc6be54b3c1a5d10db97a2d3e1f762be
Author: Translation commit bot 
Date:   Tue Nov 23 08:15:45 2021 +

new translations in orfox-stringsxml
---
 bs/strings.xml | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/bs/strings.xml b/bs/strings.xml
index cb5acbb4f3..8b923439e8 100644
--- a/bs/strings.xml
+++ b/bs/strings.xml
@@ -1,2 +1,10 @@
 
-
+OrfoxRIP
+Isprobajte Tor Browser
+Orfox je sada Tor Browser za 
Android.
+Nabavite ga iz željenog izvora:
+Idite na F-DROID
+Idite na GOOGLE PLAY
+PREUZMITE .APK
+Izvezi oznake
+

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/https_everywhere] new translations in https_everywhere

2021-11-23 Thread translation
commit 8693c72ce40de3f5ee759c0804a78856fabbf952
Author: Translation commit bot 
Date:   Tue Nov 23 08:15:30 2021 +

new translations in https_everywhere
---
 bs/https-everywhere.dtd | 56 -
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/bs/https-everywhere.dtd b/bs/https-everywhere.dtd
index c5cc05531f..def3621995 100644
--- a/bs/https-everywhere.dtd
+++ b/bs/https-everywhere.dtd
@@ -45,37 +45,37 @@
 
 
 
-
-
-
-
-
-
+
+
+
+
+
+
 
 
-
-
+
+
 
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
 
-
-
-
-
-
+
+
+
+
+
 
 
-
-
-
+
+
+

___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits