tor-commits
Threads by month
- ----- 2025 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 1 participants
- 213854 discussions
commit ad721cbd31f2a9b2df8fc26932f7ad15197022ee
Merge: a7a3d12 04b0483
Author: Karsten Loesing <karsten.loesing(a)gmx.net>
Date: Fri Feb 25 08:39:56 2011 +0100
Merge branch 'task2603'
LICENSE | 1 +
README | 17 ++++++++++++++---
plot_results.R | 4 ++++
run_test.py | 3 +++
4 files changed, 22 insertions(+), 3 deletions(-)
1
0

[torperf/master] Update timeout script instructions for Squeeze.
by karsten@torproject.org 25 Feb '11
by karsten@torproject.org 25 Feb '11
25 Feb '11
commit 4a91835db47c59a34dc0724405ffd1c477b9b157
Author: Karsten Loesing <karsten.loesing(a)gmx.net>
Date: Wed Feb 23 15:40:14 2011 +0100
Update timeout script instructions for Squeeze.
---
measurements-HOWTO | 24 ++++++++++++++++++++++--
1 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/measurements-HOWTO b/measurements-HOWTO
index 9c78992..089073f 100644
--- a/measurements-HOWTO
+++ b/measurements-HOWTO
@@ -119,8 +119,12 @@ Install the timeout tool:
$ sudo apt-get install timeout # Lenny
$ sudo apt-get install coreutils # Squeeze
-Add crontab entries to start the regular requests (line breaks are only
-for formatting purposes here):
+Add crontab entries to start the regular requests.
+
+Note that the syntax of the timeout script in Lenny is different from the
+one in Squeeze. When in doubt, look up the correct syntax in the man
+page. For the timeout script contained in Lenny, the crontab entries
+would be as follows (line breaks are only for formatting purposes here):
$ crontab -e
@@ -134,6 +138,22 @@ $ crontab -e
torperf.torproject.org 127.0.0.1:9022 /.5mbfile >> ~/torperf/5mb.data
2>/dev/null
+For the timeout script in Squeeze, use the following crontab entries (the
+only difference is that the first command-line argument is "-s2" instead
+of "-2"; again, line breaks for formatting purposes only):
+
+$ crontab -e
+
+*/5 * * * * timeout -s2 295 ~/torperf/trivsocks-client
+ torperf.torproject.org 127.0.0.1:9020 /.50kbfile >> ~/torperf/50kb.data
+ 2>/dev/null
+2,32 * * * * timeout -s2 1795 ~/torperf/trivsocks-client
+ torperf.torproject.org 127.0.0.1:9021 /.1mbfile >> ~/torperf/1mb.data
+ 2>/dev/null
+8 * * * * timeout -s2 3595 ~/torperf/trivsocks-client
+ torperf.torproject.org 127.0.0.1:9022 /.5mbfile >> ~/torperf/5mb.data
+ 2>/dev/null
+
From now on, the three files 50kb.data, 1mb.data, and 5mb.data should
accumulate lines like this (50kb.data shown here; line breaks are only for
formatting purposes):
1
0

25 Feb '11
commit a7a3d12432a61f172caa8ed7b83e273afdf524d7
Merge: b240ae1 4a91835
Author: Karsten Loesing <karsten.loesing(a)gmx.net>
Date: Fri Feb 25 07:52:15 2011 +0100
Merge branch 'task2515' into master2
measurements-HOWTO | 24 ++++++++++++++++++++++--
1 files changed, 22 insertions(+), 2 deletions(-)
diff --combined measurements-HOWTO
index e72969e,089073f..ddd014b
--- a/measurements-HOWTO
+++ b/measurements-HOWTO
@@@ -119,8 -119,12 +119,12 @@@ Install the timeout tool
$ sudo apt-get install timeout # Lenny
$ sudo apt-get install coreutils # Squeeze
- Add crontab entries to start the regular requests (line breaks are only
- for formatting purposes here):
+ Add crontab entries to start the regular requests.
+
+ Note that the syntax of the timeout script in Lenny is different from the
+ one in Squeeze. When in doubt, look up the correct syntax in the man
+ page. For the timeout script contained in Lenny, the crontab entries
+ would be as follows (line breaks are only for formatting purposes here):
$ crontab -e
@@@ -134,6 -138,22 +138,22 @@@
torperf.torproject.org 127.0.0.1:9022 /.5mbfile >> ~/torperf/5mb.data
2>/dev/null
+ For the timeout script in Squeeze, use the following crontab entries (the
+ only difference is that the first command-line argument is "-s2" instead
+ of "-2"; again, line breaks for formatting purposes only):
+
+ $ crontab -e
+
+ */5 * * * * timeout -s2 295 ~/torperf/trivsocks-client
+ torperf.torproject.org 127.0.0.1:9020 /.50kbfile >> ~/torperf/50kb.data
+ 2>/dev/null
+ 2,32 * * * * timeout -s2 1795 ~/torperf/trivsocks-client
+ torperf.torproject.org 127.0.0.1:9021 /.1mbfile >> ~/torperf/1mb.data
+ 2>/dev/null
+ 8 * * * * timeout -s2 3595 ~/torperf/trivsocks-client
+ torperf.torproject.org 127.0.0.1:9022 /.5mbfile >> ~/torperf/5mb.data
+ 2>/dev/null
+
From now on, the three files 50kb.data, 1mb.data, and 5mb.data should
accumulate lines like this (50kb.data shown here; line breaks are only for
formatting purposes):
@@@ -163,33 -183,26 +183,33 @@@ startsec startuse
writebytes readbytes
The 50kb.extradata, 1mb.extradata, and 5mb.extradata files should
-accumulate lines like this (linebreaks for formatting reasons):
+accumulate lines with KEY=value pairs describing the following properties:
-ok 1284059486 $ED16C4DD8E9BCACDE829E6B6571B58095383897A=PPrivCom030
- $80818E35A46DEED6889818ADC596404AB94E392A=Pandora14
- $4C23C8C30C66C87E1C875A949B4841E4305FFC57~Amunet11
+CIRC_ID: The circuit id from the control port
+LAUNCH: The launch time of the circuit
+PATH: The identity fingerprints of the members of the path
+BUILDTIMES: Cumulative timer of how long before each hop was completed
+USED_AT: Closing time for the Torperf stream (should match datacomplete*sec)
+USED_BY: Control port stream id for this Torperf stream
+TIMEOUT: The current CircuitBuildTimeout (in ms, pre-rounding)
+QUANTILE: The current CircuitBuildTimeout quantile cutoff
-with column headers:
+In the event of error, the following fields may be present in lieu of
+completion data:
-ok|error timestamp firsthop secondhop thirdhop [fourthhop ...]
+FAIL_REASONS: Reasons for circuit failure
+STREAM_FAIL_REASONS: Reasons for stream failure
-The first column indicates if this circuit was actually used to fetch
-the data or if Tor chose a different circuit because this one was
-problematic. For every error entry there should be a following ok
-entry, unless the network of the torperf instance is totally dead or
-the resource it wants to fetch is unavailable.
+The files will also contain direct copies of the control port event
+BUILDTIMEOUT_SET. See control-spec.txt for details of this.
-The timestamp will NOT necessarily match the timestamps in the .data file
-exactly, because additional processing is necessary. You should allow
-for up to a minute of slack when matching the two files up. See the
-consolidate_stats.py script that fulfills this job.
+The USED_AT timestamp will NOT necessarily match the timestamps in the .data
+file exactly, because additional processing is necessary. The timestamp from
+the .data files that is closest to USED_AT is "datacompletesec
+datacompleteusec". If the times are more than a second apart, something is
+really wrong.
+
+XXX: consolidate-stats needs update, and no longer works.
Call it like this:
1
0

r24265: {arm} Reimplementing layouts for the connection panel This is most (in arm/trunk/src: interface/connections util)
by Damian Johnson 25 Feb '11
by Damian Johnson 25 Feb '11
25 Feb '11
Author: atagar
Date: 2011-02-25 05:17:40 +0000 (Fri, 25 Feb 2011)
New Revision: 24265
Modified:
arm/trunk/src/interface/connections/connPanel.py
arm/trunk/src/interface/connections/listings.py
arm/trunk/src/util/torTools.py
Log:
Reimplementing layouts for the connection panel
This is mostly functionally equivilant, but a sane implementation (there was a lot of headaches and voodoo in figuring out where previous measurements came from), plus has better space allocation. Columns have priorities for determining which are shown in the limited space. However, we're now fitting in lower priority entries that fit even if there isn't room for a bigger but higher priority column.
added: smarter space utilization, filling in smaller columns if there isn't room for higher priority but larger entries
fix: trivial crashing bug when fecthing relay nicknames
Modified: arm/trunk/src/interface/connections/connPanel.py
===================================================================
--- arm/trunk/src/interface/connections/connPanel.py 2011-02-24 22:47:15 UTC (rev 24264)
+++ arm/trunk/src/interface/connections/connPanel.py 2011-02-25 05:17:40 UTC (rev 24265)
@@ -147,7 +147,8 @@
xLoc = scrollOffset
# prefix (entry data which is largely static, plus the time label)
- entryLabel = entry.getLabel(Listing.IP, width - scrollOffset)
+ # the right content (time and type) takes seventeen columns
+ entryLabel = entry.getLabel(Listing.IP, width - scrollOffset - 17)
timeLabel = uiTools.getTimeLabel(currentTime - entry.startTime, 1)
prefixLabel = "%s%5s (" % (entryLabel, timeLabel)
Modified: arm/trunk/src/interface/connections/listings.py
===================================================================
--- arm/trunk/src/interface/connections/listings.py 2011-02-24 22:47:15 UTC (rev 24264)
+++ arm/trunk/src/interface/connections/listings.py 2011-02-25 05:17:40 UTC (rev 24265)
@@ -23,6 +23,11 @@
Category.CLIENT: "cyan", Category.DIRECTORY: "magenta",
Category.CONTROL: "red"}
+# static data for listing format
+# <src> --> <dst> <etc><padding>
+LABEL_FORMAT = "%s --> %s %s%s"
+LABEL_MIN_PADDING = 2 # min space between listing label and following data
+
class Endpoint:
"""
Collection of attributes associated with a connection endpoint. This is a
@@ -281,9 +286,15 @@
myType = self.getType()
dstAddress = self.getDestinationLabel(26, DestAttr.LOCALE)
+ # The required widths are the sum of the following:
+ # - room for LABEL_FORMAT and LABEL_MIN_PADDING (11 characters)
+ # - base data for the listing
+ # - that extra field plus any previous
+
+ usedSpace = len(LABEL_FORMAT % tuple([""] * 4)) + LABEL_MIN_PADDING
+
src, dst, etc = "", "", ""
if listingType == connPanel.Listing.IP:
- # base data requires 73 characters
myExternalIpAddr = conn.getInfo("address", self.local.getIpAddr())
addrDiffer = myExternalIpAddr != self.local.getIpAddr()
@@ -291,44 +302,50 @@
src = "%-21s" % srcAddress # ip:port = max of 21 characters
dst = "%-26s" % dstAddress # ip:port (xx) = max of 26 characters
- if width > 115:
+ usedSpace += len(src) + len(dst) # base data requires 47 characters
+
+ if width > usedSpace + 42:
# show fingerprint (column width: 42 characters)
etc += "%-40s " % self.foreign.getFingerprint()
+ usedSpace += 42
- if addrDiffer and width > 143:
+ if addrDiffer and width > usedSpace + 28:
# include the internal address in the src (extra 28 characters)
internalAddress = "%s:%s" % (self.local.getIpAddr(), self.local.getPort())
src = "%-21s --> %s" % (internalAddress, src)
+ usedSpace += 28
- if (not addrDiffer and width > 143) or width > 155:
+ if width > usedSpace + 10:
# show nickname (column width: remainder)
- nicknameSpace = width - 146
+ nicknameSpace = width - usedSpace
nicknameLabel = uiTools.cropStr(self.foreign.getNickname(), nicknameSpace, 0)
etc += ("%%-%is " % nicknameSpace) % nicknameLabel
+ usedSpace += nicknameSpace + 2
elif listingType == connPanel.Listing.HOSTNAME:
- # base data requires 80 characters
+ # 15 characters for source, and a min of 40 reserved for the destination
src = "localhost:%-5s" % self.local.getPort()
+ usedSpace += len(stc)
+ minHostnameSpace = 40
- # space available for foreign hostname (stretched to claim any free space)
- hostnameSpace = width - 42
-
- if width > 108:
+ if width > usedSpace + minHostnameSpace + 28:
# show destination ip/port/locale (column width: 28 characters)
- hostnameSpace -= 28
etc += "%-26s " % dstAddress
+ usedSpace += 28
- if width > 134:
+ if width > usedSpace + minHostnameSpace + 42:
# show fingerprint (column width: 42 characters)
- hostnameSpace -= 42
etc += "%-40s " % self.foreign.getFingerprint()
+ usedSpace += 42
- if width > 151:
+ if width > usedSpace + minHostnameSpace + 17:
# show nickname (column width: min 17 characters, uses half of the remainder)
- nicknameSpace = 15 + (width - 151) / 2
- hostnameSpace -= (nicknameSpace + 2)
+ nicknameSpace = 15 + (width - (usedSpace + minHostnameSpace + 17)) / 2
nicknameLabel = uiTools.cropStr(self.foreign.getNickname(), nicknameSpace, 0)
etc += ("%%-%is " % nicknameSpace) % nicknameLabel
+ usedSpace += (nicknameSpace + 2)
+ hostnameSpace = width - usedSpace
+ usedSpace = width
if self.isPrivate():
dst = ("%%-%is" % hostnameSpace) % "<scrubbed>"
else:
@@ -342,45 +359,58 @@
hostname = uiTools.cropStr(hostname, hostnameSpace, 0)
dst = ("%%-%is:%%-5s" % hostnameSpace) % (hostname, port)
elif listingType == connPanel.Listing.FINGERPRINT:
- # base data requires 75 characters
src = "localhost"
if myType == Category.CONTROL: dst = "localhost"
else: dst = self.foreign.getFingerprint()
dst = "%-40s" % dst
- if width > 92:
- # show nickname (column width: min 17 characters, uses remainder if extra room's available)
- nicknameSpace = width - 78 if width < 126 else width - 106
+ usedSpace += len(src) + len(dst) # base data requires 49 characters
+
+ if width > usedSpace + 17:
+ # show nickname (column width: min 17 characters, consumes any remaining space)
+ nicknameSpace = width - usedSpace
+
+ # if there's room then also show a column with the destination
+ # ip/port/locale (column width: 28 characters)
+ isIpLocaleIncluded = width > usedSpace + 45
+ if isIpLocaleIncluded: nicknameSpace -= 28
+
+ nicknameSpace = width - usedSpace - 28 if isIpLocaleVisible else width - usedSpace
nicknameLabel = uiTools.cropStr(self.foreign.getNickname(), nicknameSpace, 0)
etc += ("%%-%is " % nicknameSpace) % nicknameLabel
-
- if width > 125:
- # show destination ip/port/locale (column width: 28 characters)
- etc += "%-26s " % dstAddress
+ usedSpace += nicknameSpace + 2
+
+ if isIpLocaleIncluded:
+ etc += "%-26s " % dstAddress
+ usedSpace += 28
else:
- # base data uses whatever extra room's available (using minimun of 50 characters)
+ # base data requires 50 min characters
src = self.local.getNickname()
if myType == Category.CONTROL: dst = self.local.getNickname()
else: dst = self.foreign.getNickname()
+ minBaseSpace = 50
- # space available for foreign nickname
- nicknameSpace = width - len(src) - 27
-
- if width > 92:
+ if width > usedSpace + minBaseSpace + 42:
# show fingerprint (column width: 42 characters)
- nicknameSpace -= 42
etc += "%-40s " % self.foreign.getFingerprint()
+ usedSpace += 42
- if width > 120:
+ if width > usedSpace + minBaseSpace + 28:
# show destination ip/port/locale (column width: 28 characters)
- nicknameSpace -= 28
etc += "%-26s " % dstAddress
+ usedSpace += 28
- dst = ("%%-%is" % nicknameSpace) % dst
+ baseSpace = width - usedSpace
+ if len(src) + len(dst) > baseSpace:
+ src = uiTools.cropStr(src, baseSpace / 3)
+ dst = uiTools.cropStr(dst, baseSpace - len(src))
+
+ # pads dst entry to its max space
+ dst = ("%%-%is" % (baseSpace - len(src))) % dst
if myType == Category.INBOUND: src, dst = dst, src
- padding = width - len(src) - len(dst) - len(etc) - 27
- self._labelCache = "%s --> %s %s%s" % (src, dst, etc, " " * padding)
+ padding = " " * (width - usedSpace + LABEL_MIN_PADDING)
+ self._labelCache = LABEL_FORMAT % (src, dst, etc, padding)
self._labelCacheArgs = (listingType, width)
return self._labelCache
Modified: arm/trunk/src/util/torTools.py
===================================================================
--- arm/trunk/src/util/torTools.py 2011-02-24 22:47:15 UTC (rev 24264)
+++ arm/trunk/src/util/torTools.py 2011-02-25 05:17:40 UTC (rev 24265)
@@ -911,7 +911,7 @@
if self.isAlive():
# query the nickname if it isn't yet cached
if not relayFingerprint in self._nicknameLookupCache:
- if relayFingerprint == getInfo("fingerprint"):
+ if relayFingerprint == self.getInfo("fingerprint"):
# this is us, simply check the config
myNickname = self.getOption("Nickname", "Unnamed")
self._nicknameLookupCache[relayFingerprint] = myNickname
1
0

r24264: {} add the HFOSS presentation from today. (projects/presentations)
by Andrew Lewman 24 Feb '11
by Andrew Lewman 24 Feb '11
24 Feb '11
Author: phobos
Date: 2011-02-24 22:47:15 +0000 (Thu, 24 Feb 2011)
New Revision: 24264
Added:
projects/presentations/2011-02-24-hfoss-presentation.pdf
projects/presentations/2011-02-24-hfoss-presentation.tex
Log:
add the HFOSS presentation from today.
Added: projects/presentations/2011-02-24-hfoss-presentation.pdf
===================================================================
(Binary files differ)
Property changes on: projects/presentations/2011-02-24-hfoss-presentation.pdf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: projects/presentations/2011-02-24-hfoss-presentation.tex
===================================================================
--- projects/presentations/2011-02-24-hfoss-presentation.tex (rev 0)
+++ projects/presentations/2011-02-24-hfoss-presentation.tex 2011-02-24 22:47:15 UTC (rev 24264)
@@ -0,0 +1,266 @@
+\documentclass{beamer}
+\mode<presentation>
+\usetheme{Pittsburgh}
+\usecolortheme{beaver}
+\title{Free Software, Free Internet, Anonymity \& Tor}
+\author{Andrew Lewman \\ andrew(a)torproject.org}
+\date{24 Feb 2011}
+\begin{document}
+
+\begin{frame}
+\maketitle
+\begin{center}
+\includegraphics[height=3cm]{./images/2009-tor-logo}
+\hspace{1cm}
+\includegraphics[height=3cm]{./images/mullah}
+\end{center}
+\end{frame}
+
+\begin{frame}
+\frametitle{What is anonymity?}
+\includegraphics[width=10cm]{./images/2llg3ts}
+\end{frame}
+
+\begin{frame}
+\frametitle{Anonymity isn't cryptography}
+\begin{itemize}
+\item Cryptography protects the contents in transit
+\item You still know who is talking to whom, how often, and how much data is sent.
+\item This is the core of traffic analysis.
+\end{itemize}
+\begin{center}
+\includegraphics[width=5cm]{./images/encryption-cc-by-sa}
+\end{center}
+\end{frame}
+
+\begin{frame}
+\frametitle{Anonymity isn't steganography}
+Attacker can tell Alice is talking to someone, how often, and how much data is sent.
+\bigskip
+
+\begin{center}
+\includegraphics[width=5cm]{./images/steganography-cc-by-sa}
+\end{center}
+\end{frame}
+
+\begin{frame}
+\frametitle{Anonymity isn't just wishful thinking...}
+\begin{itemize}
+\item "You can't prove it was me!"
+\pause \item "Promise you won't look"
+\pause \item "Promise you won't remember"
+\pause \item "Promise you won't tell"
+\pause \item "I didn't write my name on it!"
+\pause \item "Isn't the Internet already anonymous?"
+\end{itemize}
+\end{frame}
+
+\begin{frame}
+\frametitle{..since "weak" isn't anonymity.}
+\begin{itemize}
+\item \textit{"You can't prove it was me!"} Proof is a very \textbf{strong} word. Statistical analysis allows suspicion to become certainty.
+\pause \item \textit{"Promise you won't look/remember/tell"} Will other parties have the abilities and incentives to keep these promises?
+\pause \item \textit{"I didn't write my name on it!"} Not what we're talking about.
+\pause \item \textit{"Isn't the Internet already anonymous?"} Nope!
+\end{itemize}
+\end{frame}
+
+\begin{frame}
+\frametitle{Anonymous communication}
+\begin{itemize}
+\item People have to hide in a crowd of other people ("anonymity loves company")
+\item The goal of the system is to make all users look as similar as possible, to give a bigger crowd
+\item Hide who is communicating with whom
+\item Layered encryption and random delays hide correlation between input traffic and output traffic
+\end{itemize}
+\end{frame}
+
+\begin{frame}
+\frametitle{Low versus High-latency anonymous communication systems}
+\begin{itemize}
+\item Tor is not the first system; ZKS, mixmaster, single-hop proxies, Crowds, Java Anon Proxy.
+\item Low-latency systems are vulnerable to end-to-end correlation attacks.
+\item High-latency systems are more resistant to end-to-end correlation attacks, but by definition, less interactive.
+\end{itemize}
+\end{frame}
+
+\begin{frame}
+\frametitle{Low-latency systems are generally more attractive to today's user}
+\begin{itemize}
+\item Interactive apps: web, instant messaging, VOIP, ssh, X11, cifs/nfs, video streaming (millions of users)
+\item Multi-hour delays: email, nntp, blog posting? (tens of thousands of users?)
+\pause \item \begin{center}\begin{Large}And if anonymity loves company...\end{Large}\end{center}
+\end{itemize}
+\end{frame}
+
+\begin{frame}
+\frametitle{What is Tor?}
+\begin{itemize}
+\item online anonymity, circumvention software and network
+\item open source, free software (BSD 3-clause \& GPLv2 licenses)
+\pause \item active research environment: \\
+Rice, UMN, NSF, NRL, Drexel, Waterloo, Cambridge UK, Bamberg Germany, Boston U, Harvard, MIT, RPI, GaTech
+\pause \item increasingly diverse toolset: \\
+Tor, Torbutton, Tor Browser Bundle, TAILS LiveCD/USB, Tor Weather, Tor auto-responder, Secure Updater, Orbot/Orlib, Tor Check, Arm, Nymble, Tor Control, Metrics, TorBEL, etc...
+\end{itemize}
+\end{frame}
+
+\begin{frame}
+\frametitle{Who is The Tor Project, Inc?}
+\begin{columns}[c]
+\column{5cm}
+\includegraphics[height=4.5cm]{./images/2009-oval_sticker_new}
+\column{5cm}
+The 501(c)(3) non-profit organization dedicated to the research and development of tools for online anonymity and privacy
+\end{columns}
+\end{frame}
+
+\begin{frame}
+\frametitle{Tor is a low-latency anonymity system}
+\begin{itemize}
+\item Based on technology developed in the Onion Routing project
+\item Privacy by design, not by policy (no data collected)
+\item Commonly used for web browsing and instant messaging (works for any TCP traffic)
+\item Originally built as a pure anonymity system (hides who is talking to whom)
+\item Now designed to resist censorship too (hides whether someone is using the system at all)
+\item Centralized directory authorities publish a list of all servers
+\end{itemize}
+
+\begin{center}
+\includegraphics[height=3cm]{./images/2009-tor-logo}
+\end{center}
+\end{frame}
+
+\begin{frame}
+\frametitle{Tor code stats}
+\includegraphics[scale=0.6]{./images/tor-lines-of-code-by-language}
+\flushright \tiny stats from ohloh.net
+\end{frame}
+
+\begin{frame}
+\frametitle{Tor code stats}
+\includegraphics[scale=0.55]{./images/ohloh-lines-of-code-by-language}
+\flushright \tiny stats from ohloh.net
+\end{frame}
+
+\begin{frame}
+\frametitle{Tor hides communication patterns by relaying data through volunteer servers}
+\begin{center}
+\begin{overlayarea}{9cm}{6cm}
+\only<1>{\includegraphics[width=9cm]{./images/tor-network}}
+\only<2>{\includegraphics[width=9cm]{./images/tor-safe-selection}}
+\only<3>{\includegraphics[width=9cm]{./images/tor-safe-path}}
+\only<4>{\includegraphics[width=9cm]{./images/tor-keys1}}
+\end{overlayarea}
+\flushright
+\tiny Diagram: Robert Watson
+\end{center}
+\end{frame}
+
+\begin{frame}
+\frametitle{Vidalia Network Map}
+\includegraphics[scale=0.35]{./images/vidalia-network-map}
+\end{frame}
+
+\begin{frame}
+\frametitle{Measuring the Tor Network}
+\begin{itemize}
+\item Measuring metrics anonymously
+\item NSF grant to find out
+\item Archive of hourly consensus, ExoneraTor, VisiTor
+\item Metrics portal: \\ \url{https://metrics.torproject.org/}
+\end{itemize}
+\end{frame}
+
+\begin{frame}
+\frametitle{How many people use Tor?}
+It's an anonymity system. \\[1cm]
+\pause \includegraphics[scale=0.5]{./images/direct-users-2011-02-22-150-all-2009-09-01}
+\end{frame}
+
+\begin{frame}
+\frametitle{Seriously, how many people use Tor?}
+\begin{flushleft}
+\includegraphics[width=12cm]{./images/2009-12-16-mozilla-stats}
+\end{flushleft}
+\end{frame}
+
+\begin{frame}
+\frametitle{How is Tor different from other systems?}
+\begin{overlayarea}{9cm}{6cm}
+\only<1>{\includegraphics[height=7cm]{./images/single_hop_relay}}
+\only<2>{\includegraphics[height=7cm]{./images/evil_single_hop_relay}}
+\only<3>{\includegraphics[height=7cm]{./images/data_snooping_single_hop_relay}}
+\end{overlayarea}
+\end{frame}
+
+\begin{frame}
+\frametitle{Hidden services allow privacy enhanced hosting}
+\includegraphics[scale=0.4]{./images/hidden-federalist}
+\end{frame}
+
+\begin{frame}
+\frametitle{Did you catch that url?}
+\includegraphics[scale=1.0]{./images/hidden-federalist-zoom}
+\end{frame}
+
+\begin{frame}
+\frametitle{Hidden services, in text}
+\begin{itemize}
+\item Distributed Hash Table (DHT) Directory
+\pause \item Rendezvous points
+\pause \item Anonymity for both the server and client
+\end{itemize}
+\end{frame}
+
+\begin{frame}
+\frametitle{Operating Systems leak info like a sieve}
+\parbox{5cm}{\sloppy \setbeamercolor{background}[\includegraphics[height=7cm]{./images/cropped-hijack-sign-south-africa}}
+\parbox{5cm}{\begin{itemize}
+\item Applications, network stacks, plugins, oh my....
+\pause some call this "sharing"
+\pause \item Did you know Microsoft Word and OpenOffice Writer are browsers?
+\pause \item \url{www.decloak.net} is a fine test
+\end{itemize}
+}
+\end{frame}
+
+\begin{frame}
+\frametitle{Mobile Operating Systems}
+\begin{itemize}
+\item Entirely new set of challenges for something designed to know where you are at all times.
+\item Orbot: Tor on Android. \url{https://guardianproject.info/apps/}
+\item Tor on iphone, maemo/meego, symbian, etc
+\item Tor on Windows CE, \url{http://www.gsmk.de} as an example.
+\item Guardian Project, \url{https://guardianproject.info/}
+\end{itemize}
+\end{frame}
+
+\begin{frame}
+\frametitle{How can coding help?}
+\includegraphics[scale=0.6]{./images/developer-projects}
+\end{frame}
+
+\begin{frame}
+\frametitle{How to get involved?}
+\begin{center}
+\begin{large}
+\url{https://torproject.org/volunteer}
+\end{large}
+\end{center}
+\end{frame}
+
+\begin{frame}
+\frametitle{Supporters}
+\includegraphics[scale=.5]{./images/167234088_08f07f0dbe_o}
+\end{frame}
+
+\begin{frame}
+\frametitle{Credits}
+\begin{itemize}
+\item Thank you to Steven J. Murdoch, \url{http://www.cl.cam.ac.uk/users/sjm217/}, for the research and basis for the latter parts of the presentation. \\
+\item Photographer and Diagram credits as listed throughout the presentation.
+\end{itemize}
+\end{frame}
+
+\end{document}
Property changes on: projects/presentations/2011-02-24-hfoss-presentation.tex
___________________________________________________________________
Added: svn:mime-type
+ text/x-tex
1
0

24 Feb '11
commit 1db3a07c7bed0a6d5d48015c6319e4371e7be818
Author: Christian Fromme <kaner(a)strace.org>
Date: Tue Feb 22 04:00:02 2011 +0100
Remove unnessecary routines from utils.py
---
lib/gettor/utils.py | 77 +--------------------------------------------------
1 files changed, 1 insertions(+), 76 deletions(-)
diff --git a/lib/gettor/utils.py b/lib/gettor/utils.py
index 72626e8..958bfdb 100644
--- a/lib/gettor/utils.py
+++ b/lib/gettor/utils.py
@@ -159,7 +159,7 @@ def lookupAddress(conf, address):
logging.info("Address '%s' is present in the blacklist." % address)
found = True
if not found:
- logging.info("Address '%s' neither in blacklist or whitelist." % address)
+ logging.info("Address '%s' neither in black or whitelist." % address)
found = True
# Always True
@@ -239,30 +239,6 @@ def verifyPassword(conf, password):
logging.error("Verifying password failed: %s" % e)
return False
-def hasExe(filename):
- """Helper routine for building the packages for GetTor:
- Check if a file ends in .exe
- """
- if re.compile(".*.exe.*").match(filename):
- return True
- else:
- return False
-
-def renameExe(filename, renameFile=True):
- """Helper routine for building the packages for GetTor:
- If we find a file ending in .exe, we rename it to .ex_RENAME
- to get past Google's spam filters
- """
- if renameFile and not os.access(filename, os.R_OK):
- logging.error("Could not access file %s" % filename)
- raise OSError
-
- newfilename = filename.replace(".exe", ".ex_RENAME", 1)
- if renameFile:
- os.rename(filename, newfilename)
-
- return newfilename
-
def fileIsOlderThan(filename, olderThanDays):
"""Return True if file 'filename' is older than 'olderThandays'
"""
@@ -277,57 +253,6 @@ def fileIsOlderThan(filename, olderThanDays):
return True
-def getVersionStringFromFile(filename):
- """Return what version string is encoded in Tor package filename
- """
- regex = "[a-z-]*-([0-9]*\.[0-9]*\.[0-9]*)"
- match = re.match(regex, filename)
- if match:
- return match.group(1)
- else:
- return None
-
-def isNewTorVersion(old, new):
- """Return True if Tor version string 'new' is newer than 'old'
- """
- oldsplit = old.split(".")
- newsplit = new.split(".")
- if len(oldsplit) != 3 or len(newsplit) != 3:
- logging.error("Tor version length fail")
- return False
- if oldsplit[0] > newsplit[0]:
- return False
- if oldsplit[0] < newsplit[0]:
- return True
- if oldsplit[0] == newsplit[0]:
- if oldsplit[1] > newsplit[1]:
- return False
- if oldsplit[1] < newsplit[1]:
- return True
- if oldsplit[1] == newsplit[1]:
- if oldsplit[2] > newsplit[2]:
- return False
- if oldsplit[2] < newsplit[2]:
- return True
- if oldsplit[2] == newsplit[2]:
- # Same version
- return False
-
-def installMo(poFile, targetDir):
- """Install a certain gettext .mo file
- """
- global log
- args = os.getcwd() + "/" + poFile + " -o " + targetDir + "/gettor.mo"
- try:
- ret = subprocess.call("msgfmt" + " " + args, shell=True)
- if ret < 0:
- logging.error("Error in msgfmt execution: %s" % ret)
- return False
- except OSError, e:
- logging.error("Comilation failed: " % e)
- return False
- return True
-
def getCurrentCrontab():
"""This returns our current crontab
"""
1
0
commit 206e3ff1a81fd9009759835b0cb1e9f00fad6f26
Author: Christian Fromme <kaner(a)strace.org>
Date: Tue Feb 22 04:06:08 2011 +0100
README enhancements
---
README | 50 ++++++++++++++++++++++++++++++--------------------
1 files changed, 30 insertions(+), 20 deletions(-)
diff --git a/README b/README
index e56c117..0f335c7 100644
--- a/README
+++ b/README
@@ -42,7 +42,7 @@ This will copy necessary files to ~/opt/gettor.
Once you have everything installed, you'll want to initialize the file store:
- gettor@hostname:~/opt/gettor$ ./GetTor.py -fp
+ gettor@hostname:~/opt/gettor$ python GetTor.py -fp
You should see an rsync and finally something like:
@@ -54,13 +54,12 @@ You should see an rsync and finally something like:
Now you'll install the cronjob. This clears the blacklist and updates packages
daily:
- gettor@hostname:~/opt/gettor$ ./GetTor.py -i
- 2009-01-05 17:34:53,911 (16646) Installing cron donee
+ gettor@hostname:~/opt/gettor$ python GetTor.py -i
Set up a password for package forwarding commands if you wish to use that
feature:
- gettor@hostname:~/opt/gettor$ ./GetTor.py -s seCreTpAssworD
+ gettor@hostname:~/opt/gettor$ python GetTor.py -s seCreTpAssworD
The secret password will be stored in whereever `PASSFILE' is configured in
the configuration.
@@ -85,30 +84,24 @@ untranslated file (called gettor.po) to that directory. This file should be
translated but partial translations are allowed. Once this file has been
created, the GetTor program does not need to be modified.
-However, if a user wished to add support in responses to users, they will need
-to modiy the 'requests.py' file like so:
-
- defaultLang = "en"
- supportedLangs = { "en": "English",·
- "ko": "Korean",·
- "de": "Deutsch" }
-
CONFIGURATION
-------------
A proper GetTor configuration file is expected in the user's home directory
and should look similar to this:
gettor@hostname:~$ cat .gettor.conf
+
+ # What `From:' address are we using by default?
+ MAIL_FROM = "GetTor <gettor(a)torproject.org>"
+
# Where it is all based at. Subdirs for GetTor start from here.
BASEDIR = "/tmp"
- # Default locale
- DEFAULT_LOCALE = "en"
-
# Should we send a `Your package will arrive soon, be patient' mail?
DELAY_ALERT = True
- # Basename of the GetTor log files. Will be expandet to $LOGFILE-YYYY-MM-DD.log
+ # Basename of the GetTor log files. Will be expandet to
+ # $LOGFILE-YYYY-MM-DD.log
LOGFILE = "/tmp/gettorlog"
# The file containing the hashed command password
@@ -117,12 +110,29 @@ and should look similar to this:
# Where do we dump erronous emails?
DUMPFILE = "./gettor.dump"
- # Do we send every mail type to every user only once before we blacklist them
- # for it?
+ # Do we send every mail type to every user only once before we blacklist
+ # them for it?
BLACKLIST_BY_TYPE = True
RSYNC_MIRROR = "rsync.torproject.org"
+ # Default locale
+ DEFAULT_LOCALE = "en"
+
+ # Which languages to we support in GetTor?
+ SUPP_LANGS = { "en": ("english", ),
+ "fa": ("farsi", ),
+ "de": ("deutsch", ),
+ "ar": ("arabic", ),
+ "es": ("spanish", ),
+ "fr": ("french", ),
+ "it": ("italian", ),
+ "nl": ("dutch", ),
+ "pl": ("polish", ),
+ "ru": ("russian", ),
+ "zh_CN": ("chinese", "zh",) }
+
+
# "bundle name": ("single file regex", "split file regex")
PACKAGES = { "tor-browser-bundle":
("tor-browser-.*_en-US.exe$", "tor-browser-.*_en-US_split"), }
@@ -213,7 +223,7 @@ directories. In reality, that looks as follows:
In addition to this automatic whitelisting, there is the possibility to add
blacklist entries by hand as follows:
- gettor@hostname:~/opt/gettor$ ./GetTor.py -b someone(a)evil.org
+ gettor@hostname:~/opt/gettor$ python GetTor.py -b someone(a)evil.org
Email addresses that are added this way, go to the general/ directory in the
blacklist directory.
@@ -221,7 +231,7 @@ blacklist directory.
Besides the blacklisting mechanism, there is a whitelisting mechanism. It works
analogous to the manual blacklisting mechanism:
- gettor@hostname:~/opt/gettor$ ./GetTor.py -w someone(a)evil.org
+ gettor@hostname:~/opt/gettor$ python GetTor.py -w someone(a)heaven.org
Whitelisting wins over blacklisting. If a user if blacklisted for X, but also
whitelisted, he will be allowed to do X.
1
0
commit 85e5a4053f2aa514a6d50af9447b906cb6bf67ce
Author: Christian Fromme <kaner(a)strace.org>
Date: Tue Feb 22 03:20:59 2011 +0100
Add missing `filters.py' file ;)
---
lib/gettor/filters.py | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/lib/gettor/filters.py b/lib/gettor/filters.py
new file mode 100644
index 0000000..558e945
--- /dev/null
+++ b/lib/gettor/filters.py
@@ -0,0 +1,45 @@
+# Copyright (c) 2008 - 2011, Jacob Appelbaum <jacob(a)appelbaum.net>,
+# Christian Fromme <kaner(a)strace.org>
+# This is Free Software. See LICENSE for license information.
+
+import re
+import logging
+
+def doFilter(reqInfo):
+ """DOCDOC
+ """
+ reqInfo['package'] = doPackageHacks(reqInfo['package'], reqInfo['locale'])
+ reqInfo['valid'] = checkAddressHack(reqInfo['user'])
+
+ return reqInfo
+
+def doPackageHacks(packageName, locale):
+ """If someone wants one of the localizable packages, add language
+ suffix. This isn't nice because we're hard-coding package names here
+ Attention: This needs to correspond to the packages in packages.py
+ """
+ if packageName == "tor-browser-bundle" \
+ or packageName == "tor-im-browser-bundle" \
+ or packageName == "linux-browser-bundle-i386" \
+ or packageName == "linux-browser-bundle-x86_64":
+ # "tor-browser-bundle" => "tor-browser-bundle_de"
+ packageName += "_" + locale
+
+ return packageName
+
+def checkAddressHack(userAddress):
+ """This makes it possible to add hardcoded blacklist entries *ugh*
+ XXX: This should merge somehow with the GetTor blacklisting
+ mechanism at some point
+ """
+ logging.debug("Checking user address %s.." % userAddress)
+ if re.compile(".*@.*torproject.org.*").match(userAddress):
+ return False
+
+ # Make sure we drop bounce mails
+ if userAddress == "<>":
+ logging.debug("We've received a bounce")
+ return False
+
+ # User address looks good.
+ return True
1
0

[gettor/master] Clean up the whole i18n infrastructure. More clean & straightforward now.
by kaner@torproject.org 24 Feb '11
by kaner@torproject.org 24 Feb '11
24 Feb '11
commit d412a5fedfdf2e227ac88311e7dfa3691c0fd5ae
Author: Christian Fromme <kaner(a)strace.org>
Date: Tue Feb 22 16:02:01 2011 +0100
Clean up the whole i18n infrastructure. More clean & straightforward now.
---
README | 90 ++++---
lib/gettor/constants.py | 703 -----------------------------------------------
lib/gettor/i18n.py | 546 ++++++++++++++++++++++++++++++++++++
lib/gettor/requests.py | 4 +-
lib/gettor/responses.py | 117 +++++++--
5 files changed, 689 insertions(+), 771 deletions(-)
diff --git a/README b/README
index 0f335c7..1988a61 100644
--- a/README
+++ b/README
@@ -68,7 +68,7 @@ Finally, you need to setup email forwarding to the GetTor bot like so:
gettor@hostname:~$ echo "|python /home/g/opt/gettor/GetTor.py" > ~/.forward
-Now GetTor.py is installed, prepared and ready to serve files. Send it email!
+Now GetTor is installed, prepared and ready to serve files. Send it email!
TRANSLATION FILES
-----------------
@@ -95,20 +95,20 @@ and should look similar to this:
MAIL_FROM = "GetTor <gettor(a)torproject.org>"
# Where it is all based at. Subdirs for GetTor start from here.
- BASEDIR = "/tmp"
+ BASEDIR = "/home/gettor/gettor"
# Should we send a `Your package will arrive soon, be patient' mail?
DELAY_ALERT = True
# Basename of the GetTor log files. Will be expandet to
# $LOGFILE-YYYY-MM-DD.log
- LOGFILE = "/tmp/gettorlog"
+ LOGFILE = "gettor_log"
# The file containing the hashed command password
PASSFILE = "gettor.pass"
# Where do we dump erronous emails?
- DUMPFILE = "./gettor.dump"
+ DUMPFILE = "gettor.dump"
# Do we send every mail type to every user only once before we blacklist
# them for it?
@@ -138,38 +138,6 @@ and should look similar to this:
("tor-browser-.*_en-US.exe$", "tor-browser-.*_en-US_split"), }
-WHAT'S DKIM / WHY DKIM?
------------------------
-
-People who send mail to gettor need to either use a mail provider that
-signs outgoing mail with DKIM, or have their email address or domain
-added to the whitelist.
-
-"DomainKeys Identified Mail", aka DKIM, is a mechanism that lets the mail
-provider prove that the mail is really coming from the domain and sender
-it claims to be from.
-
-Currently GMail and Yahoo both support DKIM, along with other more
-esoteric domains like paypal, AOL, earthlink, linkedin, etc. You can
-check if your mail provider uses DKIM by examining the headers of emails
-you send. If there's a "DomainKey-Signature:" header, then you're in
-good shape.
-
-If we didn't check the DKIM signature, people could abuse gettor into
-mailbombing innocent email addresses -- one short email resulting in a
-15MB attachment sent to an address of their choice is quite an attack
-multiplier.
-
-There are a few other alternative options (for example, Microsoft uses its
-own proprietary design called 'Sender ID'), but since GMail is already
-very common for users in blocked countries, we figured DKIM was a good
-starting point.
-
-And last, be aware that the set of domains that technically support
-DKIM is probably not exactly the same set that we should recommend for
-our users, due to other properties of each mail provider like their
-privacy policies.
-
VALIDATION OF REQUESTED FILES
-----------------------------
@@ -198,9 +166,10 @@ to hammer innocent inboxes with huge amounts of tor packages.
First of all, there is a DKIM checker (see "WHAT'S DKIM / WHY DKIM" above) that
prevents GetTor from answering useless spam emails. On top of that, there are
some hard-coded checks being performed on the sender address. Only mails coming
-from yahoo.com.cn, yahoo.com and gmail.com are allowed. However, DKIM checking
-and hard-coded domain checks are currently disabled in GetTor. Mails from all
-addresses are being passed to GetTor processing.
+from yahoo.com and gmail.com are allowed. However, DKIM checking and hard-coded
+domain checks are currently disabled in GetTor. Mails from all addresses are
+being passed to GetTor processing. But note that besides GMail and Yahoo, only
+vry few mail providers allow attachments of the size that GetTor will send out.
On top of that, there is a blacklisting mechanism. It works as follows: Each
unique email address is allowed to mail GetTor the same type of mail once each
@@ -220,13 +189,13 @@ directories. In reality, that looks as follows:
0154d8584c0afa6290e21098e7ab4cc635b7d50a
02a33e16feece8671f1274de62de32068a67cf20
-In addition to this automatic whitelisting, there is the possibility to add
-blacklist entries by hand as follows:
+In addition to this automatic blacklisting mechanism, there is the possibility
+to add blacklist entries by hand as follows:
gettor@hostname:~/opt/gettor$ python GetTor.py -b someone(a)evil.org
Email addresses that are added this way, go to the general/ directory in the
-blacklist directory.
+blacklist directory and will therefore be blocked from using GetTor in any way.
Besides the blacklisting mechanism, there is a whitelisting mechanism. It works
analogous to the manual blacklisting mechanism:
@@ -235,3 +204,40 @@ analogous to the manual blacklisting mechanism:
Whitelisting wins over blacklisting. If a user if blacklisted for X, but also
whitelisted, he will be allowed to do X.
+
+WHAT'S DKIM / WHY DKIM?
+-----------------------
+
+NOTE THAT THIS SECTION IS CURRENTLY OUTDATED, BECAUSE GETTOR DOESN'T DO DKIM
+CHECK ITSELF ANYMORE. IT RELIES ON THAT BEING DONE SOMEWHERE ELSE BEFORE THE
+EMAIL ARRIVES AT GETTOR.
+
+People who send mail to gettor need to either use a mail provider that
+signs outgoing mail with DKIM, or have their email address or domain
+added to the whitelist.
+
+"DomainKeys Identified Mail", aka DKIM, is a mechanism that lets the mail
+provider prove that the mail is really coming from the domain and sender
+it claims to be from.
+
+Currently GMail and Yahoo both support DKIM, along with other more
+esoteric domains like paypal, AOL, earthlink, linkedin, etc. You can
+check if your mail provider uses DKIM by examining the headers of emails
+you send. If there's a "DomainKey-Signature:" header, then you're in
+good shape.
+
+If we didn't check the DKIM signature, people could abuse gettor into
+mailbombing innocent email addresses -- one short email resulting in a
+15MB attachment sent to an address of their choice is quite an attack
+multiplier.
+
+There are a few other alternative options (for example, Microsoft uses its
+own proprietary design called 'Sender ID'), but since GMail is already
+very common for users in blocked countries, we figured DKIM was a good
+starting point.
+
+And last, be aware that the set of domains that technically support
+DKIM is probably not exactly the same set that we should recommend for
+our users, due to other properties of each mail provider like their
+privacy policies.
+
diff --git a/lib/gettor/constants.py b/lib/gettor/constants.py
deleted file mode 100644
index 179137a..0000000
--- a/lib/gettor/constants.py
+++ /dev/null
@@ -1,703 +0,0 @@
-# Copyright (c) 2008 - 2011, Jacob Appelbaum <jacob(a)appelbaum.net>,
-# Christian Fromme <kaner(a)strace.org>
-# This is Free Software. See LICENSE for license information.
-
-# Giant multi language help message. Add more translations as they become ready
-multilangpackagehelpmsg = """
- Hello, This is the "GetTor" robot.
-
- I will mail you a Tor package, if you tell me which one you want.
- Please select one of the following package names:
-
- tor-browser-bundle
- macosx-i386-bundle
- macosx-ppc-bundle
- linux-browser-bundle-i386
- linux-browser-bundle-x86_64
- source-bundle
-
- Please reply to this mail (to gettor), and tell me
- a single package name anywhere in the body of your email.
-
- OBTAINING LOCALIZED VERSIONS OF TOR
- ===================================
-
- To get a version of Tor translated into your language, specify the
- language you want in the address you send the mail to:
-
- gettor+zh
-
- This example will give you the requested package in a localized
- version for Chinese. Check below for a list of supported language
- codes.
-
- List of supported locales:
- -------------------------
-
- Here is a list of all available languages:
-
- gettor+ar: Arabic
- gettor+de: German
- gettor+en: English
- gettor+es: Spanish
- gettor+fa: Farsi (Iran)
- gettor+fr: French
- gettor+it: Italian
- gettor+nl: Dutch
- gettor+pl: Polish
- gettor+ru: Russian
- gettor+zh: Chinese
-
- If you select no language, you will receive the English version.
-
- SUPPORT
- =======
-
- If you have any questions or it doesn't work, you can contact a
- human at this support email address: tor-assistants
-
- --
-
- مرحبا، أنا روبوت \"احصل على تور\".
-
- سأرسل لك حزمة برامج تور، إذا أخبرتني أيها تريد.
- رجاء اختر إحدى أسماء الحزم التالية:
-
- tor-browser-bundle
- macosx-i386-bundle
- macosx-ppc-bundle
- linux-browser-bundle-i386
- linux-browser-bundle-x86_64
- source-bundle
-
- يرجى أن ترد على هذه الرسالة (إلى gettor(a)torproject.xn--org)-81f وتخبرني
- باسم حزمة واحدة فقط في أي مكان ضمن رسالة الرد.
-
- الحصول على إصدارات مترجمة من تور
- ========================
-
- لتحصل على إصدار تور مترجم إلى لغتك، يرجى أن تحدد
- اللغة التي تريد ضمن العنوان الذي سترسل الرسالة الإلكترونية إليه:
-
- gettor+zh(a)torproject.org
-
- هذا المثال يعطيك الحزمة المطلوبة مترجمة
- للغة الصينية. تحقق من القائمة أدناه لتجد رموز اللغات
- المدعومة.
-
- قائمة اللغات المدعومة:
- -------------------
-
- ها هي قائمة اللغات المتوفرة:
-
- gettor+ar(a)torproject.org: العربية
- gettor+de(a)torproject.org: الألمانية
- gettor+en(a)torproject.org: الإنكليزية
- gettor+es(a)torproject.org: الإسبانية
- gettor+fa(a)torproject.org: الفارسية
- gettor+fr(a)torproject.org: الفرنسية
- gettor+it(a)torproject.org: الإيطالية
- gettor+nl(a)torproject.org: الهولندية
- gettor+pl(a)torproject.org: البولندية
- gettor+ru(a)torproject.org: الروسية
- gettor+zh(a)torproject.org: الصينية
-
- إن لم تقم باختيار لغة فستحصل على الإصدارة الإنكليزية.
-
- الدعم الفني
- =======
-
- إن كانت لديك أية أسئلة أو إذا لم يعمل هذا الحل يمكنك الاتصال بكائن
- بشري على عنوان الدعم الفني التالي: tor-assistants(a)torproject.org
-
- --
-
- سلام! روبات "GetTor" در خدمت شماست.
-
- چنانچه به من بگویید که به کدامیک از بسته های Tor نیاز دارید، آن را برای شما
- ارسال خواهم کرد.
- لطفا یکی از بسته های را زیر با ذکر نام انتخاب کنید:
-
- tor-browser-bundle
- macosx-i386-bundle
- macosx-ppc-bundle
- linux-browser-bundle-i386
- linux-browser-bundle-x86_64
- source-bundle
-
- لطفا به این نامه پاسخ داده ( به آدرس gettor(a)torproject.org ) و در قسمتی از
- متن ایمیل خود نام یکی از بسته های فوق را ذکر کنید.
-
- تهیه نسخه ترجمه شده TOR
- ===================================
-
- برای دریافت نسخه ای از TOR ترجمه شده به زبان محلی شما، می بایستی زبان مورد
- نظر خود را در آدرس گیرنده ایمیل ذکر کنید. بعنوان مثال:
-
- gettor+zh(a)torproject.org
-
- در این مثال، فرستنده خواهان نسخه ترجمه شده به زبان چینی می باشد. برای آگاهی
- از کدهای مربوط به زبانهای قابل پشتیبانی توسط Tor ، فهرست زیر را مطالعه کنید:
- فهرست زبانهای پشتیانی شده
- -------------------------
-
- gettor+ar(a)torproject.org: Arabic
- gettor+de(a)torproject.org: German
- gettor+en(a)torproject.org: English
- gettor+es(a)torproject.org: Spanish
- gettor+fa(a)torproject.org: Farsi (Iran)
- gettor+fr(a)torproject.org: French
- gettor+it(a)torproject.org: Italian
- gettor+nl(a)torproject.org: Dutch
- gettor+pl(a)torproject.org: Polish
- gettor+ru(a)torproject.org: Russian
- gettor+zh(a)torproject.org: Chinese
-
- چنانچه هیچیک از زبانهای فوق را انتخاب نکنید، نسخه انگلیسی برای شما ارسال
- خواهد شد.
-
- پشتیبانی
- =======
-
- چنانچه سوالی دارید یا برنامه دچار اشکال بوده و کار نمی کند ، با قسمت
- پشتیبانی با آدرس زیر تماس بگیرید تا یک انسان به سوال شما پاسخ دهد: tor-assistants(a)torproject.org
-
- --
-
- Hei, dette er "GetTor"-roboten
-
- Jeg kommer til å sende deg en Tor-pakke, hvis du forteller meg hvilken du
- vil ha.
- Vennligst velg en av følgende pakkenavn:
-
- tor-browser-bundle
- macosx-i386-bundle
- macosx-ppc-bundle
- linux-browser-bundle-i386
- linux-browser-bundle-x86_64
- source-bundle
-
- Vennligst svar til denne eposten (til gettor(a)torproject.org) og nevn
- kun et enkelt pakkenavn i tekstområdet til eposten din.
-
- SKAFFE LOKALISERTE VERSJONER AV TOR
- ===================================
-
- For å skaffe en versjon av Tor som har blitt oversatt til ditt språk,
- spesifiser språket du vil i epostadressen du sender eposten til:
-
- gettor+zh(a)torproject.org
-
- Dette eksempelet vil gi deg en forespurt pakke som er en oversatt
- versjon for kinesisk. Se listen nedenfor for hvilke språk det er støtte for.
-
- Liste av støttede språk:
- -------------------------
-
- Her er en liste av språkene som er tilgjengelig:
-
- gettor+ar(a)torproject.org: Arabisk
- gettor+de(a)torproject.org: Tysk
- gettor+en(a)torproject.org: Engelsk
- gettor+es(a)torproject.org: Spansk
- gettor+fa(a)torproject.org: Farsi (Iran)
- gettor+fr(a)torproject.org: Fransk
- gettor+it(a)torproject.org: Italiensk
- gettor+nl(a)torproject.org: Nederlandsk
- gettor+pl(a)torproject.org: Polsk
- gettor+ru(a)torproject.org: Russisk
- gettor+zh(a)torproject.org: Kinesisk
-
- Hvis du ikke spesifiserer noen språk vil du motta standard Engelsk
- versjon
-
- STØTTE
- =======
-
- Hvis du har noen spørsmål eller det ikke virker, kan du kontakte et
- menneske på denne support-eposten: tor-assistants(a)torproject.org
-
- --
-
- Olá! Este é o robot "GetTor".
-
- Eu envio-lhe um pacote Tor, bastando para isso dizer qual o que quer.
- Escolha um dos seguintes pacotes:
-
- tor-browser-bundle
- macosx-i386-bundle
- macosx-ppc-bundle
- linux-browser-bundle-i386
- linux-browser-bundle-x86_64
- source-bundle
-
- Por favor responda a esta email (para gettor(a)torproject.org) e diga qual o
- pacote que deseja, colocando o seu nome no corpo do seu email.
-
- OBTER VERSÕES TRADUZIDAS DO TOR
- ===================================
-
- Para lhe ser enviado uma versão traduzida do Tor, especifique a língua no
- destinatário do seu email:
-
- gettor+zh(a)torproject.org
-
- Este exemplo vai enviar o pacote traduzido para Chinês Simplificado. Veja a
- lista de endereços de email existentes que pode utilizar:
-
- Lista de endereços de email suportados:
- -------------------------
-
- gettor+pt(a)torproject.org: Português
- gettor+ar(a)torproject.org: Arábico
- gettor+de(a)torproject.org: Alemão
- gettor+en(a)torproject.org: Inglês
- gettor+es(a)torproject.org: Espanhol
- gettor+fa(a)torproject.org: Farsi (Irão)
- gettor+fr(a)torproject.org: Francês
- gettor+it(a)torproject.org: Italiano
- gettor+nl(a)torproject.org: Holandês
- gettor+pl(a)torproject.org: Polaco
- gettor+ru(a)torproject.org: Russo
- gettor+zh(a)torproject.org: Chinês
-
- Se não escolher nenhuma língua, receberá o Tor em Inglês.
-
- SUPORTE
- =======
-
- Se tiver alguma dúvida, pode contactar um humano através do seguinte
- endereço: tor-assistants(a)torproject.org
-
- --
-
- Здравствуйте! Это "робот GetTor".
-
- Я отошлю вам пакет Tor если вы укажете который вы хотите.
- Пожалуйста выберите один из пакетов:
-
- tor-browser-bundle
- macosx-i386-bundle
- macosx-ppc-bundle
- linux-browser-bundle-i386
- linux-browser-bundle-x86_64
- source-bundle
-
- Пожалуйста свяжитесь с нами по этой элктронной почте
- (gettor(a)torproject.org) и укажите
- название одного из пакетов в любом месте в "теле" вашего письма.
-
- ПОЛУЧЕНИЕ ЛОКАЛИЗИРОВАННЫХ ВЕРСИЙ TOR
- ===================================
-
- Чтобы получить версию Tor переведенную на ваш язык,укажите
- предпочитаемый язык в адресной строке куда вы отослали электронную почту:
-
- gettor+zh(a)torproject.org
-
- Вышеуказанный пример даст вам запрошенный пакет в локализированной
- версии китайского языка. Проверьте ниже список кодов поддерживаемых
- языков.
-
- Список поддерживаемых регионов
- -------------------------
-
- Ниже указан список всех доступных языков:
-
- gettor+ar(a)torproject.org: арабский
- gettor+de(a)torproject.org: немецкий
- gettor+en(a)torproject.org: английский
- gettor+es(a)torproject.org: испанский
- gettor+fa(a)torproject.org: фарси (Иран)
- gettor+fr(a)torproject.org: французский
- gettor+it(a)torproject.org: итальянский
- gettor+nl(a)torproject.org: голландский
- gettor+pl(a)torproject.org: польский
- gettor+ru(a)torproject.org: русский
- gettor+zh(a)torproject.org: китайский
-
- Если вы не выберите язык, вы получите версию на английском языке.
-
- ПОДДЕРЖКА
- =======
-
- Если у вас вопросы или что то не сработало, вы можете связаться
- с живым представителем по этому электронному адресу:tor-assistants@torproject.org
-
- --
-
- 你好, 这里是"GetTor"自动回复。
-
- 您从这里可以得到Tor套件, 请告诉我您需要的套件种类.
- 请选择套件名称:
-
- tor-browser-bundle
- (Tor+Firefox浏览器)
- macosx-i386-bundle
- (Tor for MacOS)
- macosx-ppc-bundle
- (Tor for MacOS on PowerPC )
- linux-browser-bundle-i386
- linux-browser-bundle-x86_64
- (Tor for Linux)
- source-bundle
- (源码包)
-
- 请直接回复本邮件(gettor(a)torproject.org),
- 并在信的正文中写好您所需要的套件名称(不包括括号内的中文)。
-
- 获取其他语言的Tor套件
- ===================================
-
- 在收件人地址中指定语言代码可以获得本对应语言的版本,例如:
-
- gettor+zh(a)torproject.org
-
- 本例中,您将得到中文版的Tor套件,下面是目前支持的语种代码:
-
- 支持语言列表:
- -------------------------
-
- 全部可用语言列表:
-
- gettor+ar(a)torproject.org: Arabic
- gettor+de(a)torproject.org: German
- gettor+en(a)torproject.org: English
- gettor+es(a)torproject.org: Spanish
- gettor+fa(a)torproject.org: Farsi (Iran)
- gettor+fr(a)torproject.org: French
- gettor+it(a)torproject.org: Italian
- gettor+nl(a)torproject.org: Dutch
- gettor+pl(a)torproject.org: Polish
- gettor+ru(a)torproject.org: Russian
- gettor+zh(a)torproject.org: 中文
-
- 如果您未指定语言代码,您将收到英文版。
-
- 支持
- =======
-
- 如果您遇到困难或服务出现问题,请联系我们的
- 技术支持邮箱: tor-assistants(a)torproject.org
-
- --
- """
-
-# Short string to build mails follow
-hello_gettor = _("""
- Hello, This is the "GetTor" robot.
-
- Thank you for your request.
-
- """)
-help_dkim_1 = _("""
- Unfortunately, we won't answer you at this address. You should make
- an account with GMAIL.COM or YAHOO.CN and send the mail from
- one of those.
-
- """)
-help_dkim_2 = _("""
- We only process requests from email services that support "DKIM",
- which is an email feature that lets us verify that the address in the
- "From" line is actually the one who sent the mail.
-
- """)
-help_dkim_3 = _("""
- (We apologize if you didn't ask for this mail. Since your email is from
- a service that doesn't use DKIM, we're sending a short explanation,
- and then we'll ignore this email address for the next day or so.)
-
- """)
-help_dkim_4 = _("""
- Please note that currently, we can't process HTML emails or base 64
- mails. You will need to send plain text.
-
- """)
-
-help_dkim_5 = _("""
- If you have any questions or it doesn't work, you can contact a
- human at this support email address: tor-assistants(a)torproject.org
-
- """)
-choose_package_1 = _("""
- I will mail you a Tor package, if you tell me which one you want.
- Please select one of the following package names:
-
- """)
-avail_packs = """
- tor-browser-bundle
- macosx-i386-bundle
- macosx-ppc-bundle
- linux-browser-bundle-i386
- linux-browser-bundle-x86_64
- source-bundle
-
- """
-choose_package_2 = _("""
- Please reply to this mail (to gettor(a)torproject.org) and tell me
- a single package name anywhere in the body of your email.
-
- """)
-obtain_localized_head = _("""
- OBTAINING LOCALIZED VERSIONS OF TOR
- """)
-obtain_localized_underline = """
- ===================================
-
- """
-obtain_localized_1 = _("""
- To get a version of Tor translated into your language, specify the
- language you want in the address you send the mail to:
-
- """)
-obtain_localized_2 = """
- gettor+zh(a)torproject.org
-
- """
-obtain_localized_3 = _("""
- This example will give you the requested package in a localized
- version for Chinese. Check below for a list of supported language
- codes.
-
- """)
-list_of_langs_head = _("""
- List of supported locales:
- """)
-list_of_langs_underline = """
- -------------------------
-
- """
-list_of_langs_1 = _("""
- Here is a list of all available languages:
-
- """)
-list_of_langs_2 = _("""
- gettor+ar(a)torproject.org: Arabic
- gettor+de(a)torproject.org: German
- gettor+en(a)torproject.org: English
- gettor+es(a)torproject.org: Spanish
- gettor+fa(a)torproject.org: Farsi (Iran)
- gettor+fr(a)torproject.org: French
- gettor+it(a)torproject.org: Italian
- gettor+nl(a)torproject.org: Dutch
- gettor+pl(a)torproject.org: Polish
- gettor+ru(a)torproject.org: Russian
- gettor+zh(a)torproject.org: Chinese
-
- """)
-list_of_langs_3 = _("""
- If you select no language, you will receive the English version.
-
- """)
-
-split_help_head = _("""
- SMALLER SIZED PACKAGES
- """)
-split_help_underline = """
- ======================
- """
-split_help_1 = _("""
- If your bandwith is low or your provider doesn't allow you to
- receive large attachments in your email, there is a feature of
- GetTor you can use to make it send you a number of small packages
- instead of one big one.
-
- """)
-split_help_2 = _("""
- Simply include the keyword 'split' somewhere in your email like so:
- """)
-split_help_3 = """
-
- tor-browser-bundle
- split
-
- """
-split_help_4 = _("""
- Sending this text in an email to GetTor will cause it to send you
- the Tor Browser Bundle in a number of 1,4MB attachments.
-
- """)
-split_help_5 = _("""
- After having received all parts, you need to re-assemble them to
- one package again. This is done as follows:
-
- """)
-split_help_6 = _("""
- 1.) Save all received attachments into one folder on your disk.
-
- """)
-split_help_7 = _("""
- 2.) Unzip all files ending in ".z". If you saved all attachments to
- a fresh folder before, simply unzip all files in that folder.
-
- """)
-split_help_8 = _("""
- 3.) Rename the file ending in ".ex_RENAME" to end in ".exe" and
- also rename the file ending in ".ex_RENAME.asc" to end in
- ".exe.asc"
-
- """)
-split_help_9 = _("""
- 4.) Verify all files as described in the mail you received with
- each package. (gpg --verify)
-
- """)
-split_help_10 = _("""
- 5.) Now use a program that can unrar multivolume RAR archives. On
- Windows, this usually is WinRAR. If you don't have that
- installed on you computer yet, get it here:
-
- """)
-split_help_11 = """
- http://www.win-rar.com/download.html
-
- """
-split_help_12 = _("""
- To unpack your Tor package, simply doubleclick the ".exe" file.
-
- """)
-split_help_13 = _("""
- 6.) After unpacking is finished, you should find a newly created
- ".exe" file in your destination folder. Simply doubleclick
- that and Tor Browser Bundle should start within a few seconds.
-
- """)
-split_help_14 = _("""
- 7.) That's it. You're done. Thanks for using Tor and have fun!
-
- """)
-support = _("""
- SUPPORT
- """)
-support_underline = """
- =======
- """
-support_email = _("""
- If you have any questions or it doesn't work, you can contact a
- human at this support email address: tor-assistants(a)torproject.org
-
- """)
-package_mail_1 = _("""
- Here's your requested software as a zip file. Please unzip the
- package and verify the signature.
-
- """)
-package_mail_2 = _("""
- Hint: If your computer has GnuPG installed, use the gpg
- commandline tool as follows after unpacking the zip file:
-
- """)
-package_mail_3 = _("""
- gpg --verify <packagename>.asc <packagename>
-
- """)
-package_mail_4 = _("""
- The output should look somewhat like this:
-
- """)
-package_mail_5 = """
- gpg: Good signature from "Roger Dingledine <arma(a)mit.edu>"
-
- """
-package_mail_6 = _("""
- If you're not familiar with commandline tools, try looking for
- a graphical user interface for GnuPG on this website:
-
- """)
-package_mail_7 = """
- http://www.gnupg.org/related_software/frontends.html
-
- """
-package_mail_8 = _("""
- If your Internet connection blocks access to the Tor network, you
- may need a bridge relay. Bridge relays (or "bridges" for short)
- are Tor relays that aren't listed in the main directory. Since there
- is no complete public list of them, even if your ISP is filtering
- connections to all the known Tor relays, they probably won't be able
- to block all the bridges.
-
- """)
-package_mail_9 = _("""
- You can acquire a bridge by sending an email that contains "get bridges"
- in the body of the email to the following email address:
- bridges(a)torproject.org
-
- """)
-package_mail_10 = _("""
- It is also possible to fetch bridges with a web browser at the following
- url: https://bridges.torproject.org/
-
- """)
-split_package_1 = _("""
- IMPORTANT NOTE:
- Since this is part of a split-file request, you need to wait for
- all split files to be received by you before you can save them all
- into the same directory and unpack them by double-clicking the
- first file.
-
- """)
-split_package_2 = _("""
- Packages might come out of order! Please make sure you received
- all packages before you attempt to unpack them!
-
- """)
-delay_alert_1 = _("""
- Thank you for your request. It was successfully understood. Your request is
- currently being processed. Your package should arrive within the next ten
- minutes.
-
- """)
-delay_alert_2 = _("""
- If it doesn't arrive, the package might be too big for your mail provider.
- Try resending the mail from a gmail.com or yahoo.cn account. Also,
- try asking for tor-browser-bundle rather than tor-im-browser-bundle,
- since it's smaller.
-
- """)
-error_mail = _("""
- Unfortunately we are currently experiencing problems and we can't fulfill
- your request right now. Please be patient as we try to resolve this issue.
-
- """)
-
-# Build the actual mail texts
-packagehelpmsg = hello_gettor + choose_package_1 + avail_packs + choose_package_2 + \
- obtain_localized_head + obtain_localized_underline + \
- obtain_localized_1 + obtain_localized_2 + obtain_localized_3 + \
- list_of_langs_head + list_of_langs_underline + \
- list_of_langs_1 + list_of_langs_2 + list_of_langs_3 + \
- split_help_head + split_help_underline + \
- split_help_1 + split_help_2 + split_help_3 + split_help_4 + \
- split_help_5 + split_help_6 + split_help_7 + split_help_8 + \
- split_help_9 + split_help_10 + split_help_11 + split_help_12 + \
- split_help_13 + split_help_14 + \
- support + support_underline + support_email
-
-helpmsg = hello_gettor + \
- help_dkim_1 + help_dkim_2 + help_dkim_3 + help_dkim_4 + help_dkim_5 + \
- support_email
-
-
-packagemsg = hello_gettor + \
- package_mail_1 + package_mail_2 + package_mail_3 + package_mail_4 + \
- package_mail_5 + package_mail_6 + package_mail_7 + package_mail_8 + \
- package_mail_9 + package_mail_10 + \
- support_email
-
-
-splitpackagemsg = hello_gettor + \
- split_package_1 + split_package_2 + \
- package_mail_1 + package_mail_2 + package_mail_3 + package_mail_4 + \
- package_mail_5 + package_mail_6 + package_mail_7 + package_mail_8 + \
- package_mail_9 + package_mail_10 + \
- support_email
-
-
-delayalertmsg = hello_gettor + \
- delay_alert_1 + delay_alert_2 + \
- support_email
-
-mailfailmsg = hello_gettor + \
- support_email
-
-
diff --git a/lib/gettor/i18n.py b/lib/gettor/i18n.py
new file mode 100644
index 0000000..92a2165
--- /dev/null
+++ b/lib/gettor/i18n.py
@@ -0,0 +1,546 @@
+# Copyright (c) 2008 - 2011, Jacob Appelbaum <jacob(a)appelbaum.net>,
+# Christian Fromme <kaner(a)strace.org>
+# This is Free Software. See LICENSE for license information.
+
+import os
+import gettext
+
+def getLang(lang, localedir=os.path.expanduser("~") + "/gettor/i18n"):
+ """Return the Translation instance for a given language. If no Translation
+ instance is found, return the one for 'en'
+ """
+ return gettext.translation("gettor", localedir=localedir,
+ languages=[lang], fallback="en")
+
+def _(text):
+ """This is necessary because strings are translated when they're imported.
+ Otherwise this would make it impossible to switch languages more than
+ once
+ """
+ return text
+
+# Giant multi language help message. Add more translations as they become ready
+MULTILANGHELP = """
+ Hello, This is the "GetTor" robot.
+
+ I will mail you a Tor package, if you tell me which one you want.
+ Please select one of the following package names:
+
+ tor-browser-bundle
+ macosx-i386-bundle
+ macosx-ppc-bundle
+ linux-browser-bundle-i386
+ linux-browser-bundle-x86_64
+ source-bundle
+
+ Please reply to this mail (to gettor), and tell me
+ a single package name anywhere in the body of your email.
+
+ OBTAINING LOCALIZED VERSIONS OF TOR
+ ===================================
+
+ To get a version of Tor translated into your language, specify the
+ language you want in the address you send the mail to:
+
+ gettor+zh
+
+ This example will give you the requested package in a localized
+ version for Chinese. Check below for a list of supported language
+ codes.
+
+ List of supported locales:
+ -------------------------
+
+ Here is a list of all available languages:
+
+ gettor+ar: Arabic
+ gettor+de: German
+ gettor+en: English
+ gettor+es: Spanish
+ gettor+fa: Farsi (Iran)
+ gettor+fr: French
+ gettor+it: Italian
+ gettor+nl: Dutch
+ gettor+pl: Polish
+ gettor+ru: Russian
+ gettor+zh: Chinese
+
+ If you select no language, you will receive the English version.
+
+ SUPPORT
+ =======
+
+ If you have any questions or it doesn't work, you can contact a
+ human at this support email address: tor-assistants
+
+ --
+
+ مرحبا، أنا روبوت \"احصل على تور\".
+
+ سأرسل لك حزمة برامج تور، إذا أخبرتني أيها تريد.
+ رجاء اختر إحدى أسماء الحزم التالية:
+
+ tor-browser-bundle
+ macosx-i386-bundle
+ macosx-ppc-bundle
+ linux-browser-bundle-i386
+ linux-browser-bundle-x86_64
+ source-bundle
+
+ يرجى أن ترد على هذه الرسالة (إلى gettor(a)torproject.xn--org)-81f وتخبرني
+ باسم حزمة واحدة فقط في أي مكان ضمن رسالة الرد.
+
+ الحصول على إصدارات مترجمة من تور
+ ========================
+
+ لتحصل على إصدار تور مترجم إلى لغتك، يرجى أن تحدد
+ اللغة التي تريد ضمن العنوان الذي سترسل الرسالة الإلكترونية إليه:
+
+ gettor+zh(a)torproject.org
+
+ هذا المثال يعطيك الحزمة المطلوبة مترجمة
+ للغة الصينية. تحقق من القائمة أدناه لتجد رموز اللغات
+ المدعومة.
+
+ قائمة اللغات المدعومة:
+ -------------------
+
+ ها هي قائمة اللغات المتوفرة:
+
+ gettor+ar(a)torproject.org: العربية
+ gettor+de(a)torproject.org: الألمانية
+ gettor+en(a)torproject.org: الإنكليزية
+ gettor+es(a)torproject.org: الإسبانية
+ gettor+fa(a)torproject.org: الفارسية
+ gettor+fr(a)torproject.org: الفرنسية
+ gettor+it(a)torproject.org: الإيطالية
+ gettor+nl(a)torproject.org: الهولندية
+ gettor+pl(a)torproject.org: البولندية
+ gettor+ru(a)torproject.org: الروسية
+ gettor+zh(a)torproject.org: الصينية
+
+ إن لم تقم باختيار لغة فستحصل على الإصدارة الإنكليزية.
+
+ الدعم الفني
+ =======
+
+ إن كانت لديك أية أسئلة أو إذا لم يعمل هذا الحل يمكنك الاتصال بكائن
+ بشري على عنوان الدعم الفني التالي: tor-assistants(a)torproject.org
+
+ --
+
+ سلام! روبات "GetTor" در خدمت شماست.
+
+ چنانچه به من بگویید که به کدامیک از بسته های Tor نیاز دارید، آن را برای شما
+ ارسال خواهم کرد.
+ لطفا یکی از بسته های را زیر با ذکر نام انتخاب کنید:
+
+ tor-browser-bundle
+ macosx-i386-bundle
+ macosx-ppc-bundle
+ linux-browser-bundle-i386
+ linux-browser-bundle-x86_64
+ source-bundle
+
+ لطفا به این نامه پاسخ داده ( به آدرس gettor(a)torproject.org ) و در قسمتی از
+ متن ایمیل خود نام یکی از بسته های فوق را ذکر کنید.
+
+ تهیه نسخه ترجمه شده TOR
+ ===================================
+
+ برای دریافت نسخه ای از TOR ترجمه شده به زبان محلی شما، می بایستی زبان مورد
+ نظر خود را در آدرس گیرنده ایمیل ذکر کنید. بعنوان مثال:
+
+ gettor+zh(a)torproject.org
+
+ در این مثال، فرستنده خواهان نسخه ترجمه شده به زبان چینی می باشد. برای آگاهی
+ از کدهای مربوط به زبانهای قابل پشتیبانی توسط Tor ، فهرست زیر را مطالعه کنید:
+ فهرست زبانهای پشتیانی شده
+ -------------------------
+
+ gettor+ar(a)torproject.org: Arabic
+ gettor+de(a)torproject.org: German
+ gettor+en(a)torproject.org: English
+ gettor+es(a)torproject.org: Spanish
+ gettor+fa(a)torproject.org: Farsi (Iran)
+ gettor+fr(a)torproject.org: French
+ gettor+it(a)torproject.org: Italian
+ gettor+nl(a)torproject.org: Dutch
+ gettor+pl(a)torproject.org: Polish
+ gettor+ru(a)torproject.org: Russian
+ gettor+zh(a)torproject.org: Chinese
+
+ چنانچه هیچیک از زبانهای فوق را انتخاب نکنید، نسخه انگلیسی برای شما ارسال
+ خواهد شد.
+
+ پشتیبانی
+ =======
+
+ چنانچه سوالی دارید یا برنامه دچار اشکال بوده و کار نمی کند ، با قسمت
+ پشتیبانی با آدرس زیر تماس بگیرید تا یک انسان به سوال شما پاسخ دهد: tor-assistants(a)torproject.org
+
+ --
+
+ Hei, dette er "GetTor"-roboten
+
+ Jeg kommer til å sende deg en Tor-pakke, hvis du forteller meg hvilken du
+ vil ha.
+ Vennligst velg en av følgende pakkenavn:
+
+ tor-browser-bundle
+ macosx-i386-bundle
+ macosx-ppc-bundle
+ linux-browser-bundle-i386
+ linux-browser-bundle-x86_64
+ source-bundle
+
+ Vennligst svar til denne eposten (til gettor(a)torproject.org) og nevn
+ kun et enkelt pakkenavn i tekstområdet til eposten din.
+
+ SKAFFE LOKALISERTE VERSJONER AV TOR
+ ===================================
+
+ For å skaffe en versjon av Tor som har blitt oversatt til ditt språk,
+ spesifiser språket du vil i epostadressen du sender eposten til:
+
+ gettor+zh(a)torproject.org
+
+ Dette eksempelet vil gi deg en forespurt pakke som er en oversatt
+ versjon for kinesisk. Se listen nedenfor for hvilke språk det er støtte for.
+
+ Liste av støttede språk:
+ -------------------------
+
+ Her er en liste av språkene som er tilgjengelig:
+
+ gettor+ar(a)torproject.org: Arabisk
+ gettor+de(a)torproject.org: Tysk
+ gettor+en(a)torproject.org: Engelsk
+ gettor+es(a)torproject.org: Spansk
+ gettor+fa(a)torproject.org: Farsi (Iran)
+ gettor+fr(a)torproject.org: Fransk
+ gettor+it(a)torproject.org: Italiensk
+ gettor+nl(a)torproject.org: Nederlandsk
+ gettor+pl(a)torproject.org: Polsk
+ gettor+ru(a)torproject.org: Russisk
+ gettor+zh(a)torproject.org: Kinesisk
+
+ Hvis du ikke spesifiserer noen språk vil du motta standard Engelsk
+ versjon
+
+ STØTTE
+ =======
+
+ Hvis du har noen spørsmål eller det ikke virker, kan du kontakte et
+ menneske på denne support-eposten: tor-assistants(a)torproject.org
+
+ --
+
+ Olá! Este é o robot "GetTor".
+
+ Eu envio-lhe um pacote Tor, bastando para isso dizer qual o que quer.
+ Escolha um dos seguintes pacotes:
+
+ tor-browser-bundle
+ macosx-i386-bundle
+ macosx-ppc-bundle
+ linux-browser-bundle-i386
+ linux-browser-bundle-x86_64
+ source-bundle
+
+ Por favor responda a esta email (para gettor(a)torproject.org) e diga qual o
+ pacote que deseja, colocando o seu nome no corpo do seu email.
+
+ OBTER VERSÕES TRADUZIDAS DO TOR
+ ===================================
+
+ Para lhe ser enviado uma versão traduzida do Tor, especifique a língua no
+ destinatário do seu email:
+
+ gettor+zh(a)torproject.org
+
+ Este exemplo vai enviar o pacote traduzido para Chinês Simplificado. Veja a
+ lista de endereços de email existentes que pode utilizar:
+
+ Lista de endereços de email suportados:
+ -------------------------
+
+ gettor+pt(a)torproject.org: Português
+ gettor+ar(a)torproject.org: Arábico
+ gettor+de(a)torproject.org: Alemão
+ gettor+en(a)torproject.org: Inglês
+ gettor+es(a)torproject.org: Espanhol
+ gettor+fa(a)torproject.org: Farsi (Irão)
+ gettor+fr(a)torproject.org: Francês
+ gettor+it(a)torproject.org: Italiano
+ gettor+nl(a)torproject.org: Holandês
+ gettor+pl(a)torproject.org: Polaco
+ gettor+ru(a)torproject.org: Russo
+ gettor+zh(a)torproject.org: Chinês
+
+ Se não escolher nenhuma língua, receberá o Tor em Inglês.
+
+ SUPORTE
+ =======
+
+ Se tiver alguma dúvida, pode contactar um humano através do seguinte
+ endereço: tor-assistants(a)torproject.org
+
+ --
+
+ Здравствуйте! Это "робот GetTor".
+
+ Я отошлю вам пакет Tor если вы укажете который вы хотите.
+ Пожалуйста выберите один из пакетов:
+
+ tor-browser-bundle
+ macosx-i386-bundle
+ macosx-ppc-bundle
+ linux-browser-bundle-i386
+ linux-browser-bundle-x86_64
+ source-bundle
+
+ Пожалуйста свяжитесь с нами по этой элктронной почте
+ (gettor(a)torproject.org) и укажите
+ название одного из пакетов в любом месте в "теле" вашего письма.
+
+ ПОЛУЧЕНИЕ ЛОКАЛИЗИРОВАННЫХ ВЕРСИЙ TOR
+ ===================================
+
+ Чтобы получить версию Tor переведенную на ваш язык,укажите
+ предпочитаемый язык в адресной строке куда вы отослали электронную почту:
+
+ gettor+zh(a)torproject.org
+
+ Вышеуказанный пример даст вам запрошенный пакет в локализированной
+ версии китайского языка. Проверьте ниже список кодов поддерживаемых
+ языков.
+
+ Список поддерживаемых регионов
+ -------------------------
+
+ Ниже указан список всех доступных языков:
+
+ gettor+ar(a)torproject.org: арабский
+ gettor+de(a)torproject.org: немецкий
+ gettor+en(a)torproject.org: английский
+ gettor+es(a)torproject.org: испанский
+ gettor+fa(a)torproject.org: фарси (Иран)
+ gettor+fr(a)torproject.org: французский
+ gettor+it(a)torproject.org: итальянский
+ gettor+nl(a)torproject.org: голландский
+ gettor+pl(a)torproject.org: польский
+ gettor+ru(a)torproject.org: русский
+ gettor+zh(a)torproject.org: китайский
+
+ Если вы не выберите язык, вы получите версию на английском языке.
+
+ ПОДДЕРЖКА
+ =======
+
+ Если у вас вопросы или что то не сработало, вы можете связаться
+ с живым представителем по этому электронному адресу:tor-assistants@torproject.org
+
+ --
+
+ 你好, 这里是"GetTor"自动回复。
+
+ 您从这里可以得到Tor套件, 请告诉我您需要的套件种类.
+ 请选择套件名称:
+
+ tor-browser-bundle
+ (Tor+Firefox浏览器)
+ macosx-i386-bundle
+ (Tor for MacOS)
+ macosx-ppc-bundle
+ (Tor for MacOS on PowerPC )
+ linux-browser-bundle-i386
+ linux-browser-bundle-x86_64
+ (Tor for Linux)
+ source-bundle
+ (源码包)
+
+ 请直接回复本邮件(gettor(a)torproject.org),
+ 并在信的正文中写好您所需要的套件名称(不包括括号内的中文)。
+
+ 获取其他语言的Tor套件
+ ===================================
+
+ 在收件人地址中指定语言代码可以获得本对应语言的版本,例如:
+
+ gettor+zh(a)torproject.org
+
+ 本例中,您将得到中文版的Tor套件,下面是目前支持的语种代码:
+
+ 支持语言列表:
+ -------------------------
+
+ 全部可用语言列表:
+
+ gettor+ar(a)torproject.org: Arabic
+ gettor+de(a)torproject.org: German
+ gettor+en(a)torproject.org: English
+ gettor+es(a)torproject.org: Spanish
+ gettor+fa(a)torproject.org: Farsi (Iran)
+ gettor+fr(a)torproject.org: French
+ gettor+it(a)torproject.org: Italian
+ gettor+nl(a)torproject.org: Dutch
+ gettor+pl(a)torproject.org: Polish
+ gettor+ru(a)torproject.org: Russian
+ gettor+zh(a)torproject.org: 中文
+
+ 如果您未指定语言代码,您将收到英文版。
+
+ 支持
+ =======
+
+ 如果您遇到困难或服务出现问题,请联系我们的
+ 技术支持邮箱: tor-assistants(a)torproject.org
+
+ --
+ """
+
+GETTOR_TEXT = [
+ # GETTOR_TEXT[0]
+_("""Hello, This is the "GetTor" robot.
+
+Thank you for your request."""),
+ # GETTOR_TEXT[1]
+_(""" Unfortunately, we won't answer you at this address. You should make
+an account with GMAIL.COM or YAHOO.CN and send the mail from
+one of those."""),
+ # GETTOR_TEXT[2]
+_("""We only process requests from email services that support "DKIM",
+which is an email feature that lets us verify that the address in the
+"From" line is actually the one who sent the mail."""),
+ # GETTOR_TEXT[3]
+_("""(We apologize if you didn't ask for this mail. Since your email is from
+a service that doesn't use DKIM, we're sending a short explanation,
+and then we'll ignore this email address for the next day or so.)"""),
+ # GETTOR_TEXT[4]
+_("""Please note that currently, we can't process HTML emails or base 64
+mails. You will need to send plain text."""),
+ # GETTOR_TEXT[5]
+_("""If you have any questions or it doesn't work, you can contact a
+human at this support email address: tor-assistants(a)torproject.org"""),
+ # GETTOR_TEXT[6]
+_("""I will mail you a Tor package, if you tell me which one you want.
+Please select one of the following package names:"""),
+ # GETTOR_TEXT[7]
+_("""Please reply to this mail (to gettor(a)torproject.org) and tell me
+a single package name anywhere in the body of your email."""),
+ # GETTOR_TEXT[8]
+_(""" OBTAINING LOCALIZED VERSIONS OF TOR
+==================================="""),
+ # GETTOR_TEXT[9]
+_("""To get a version of Tor translated into your language, specify the
+language you want in the address you send the mail to:"""),
+ # GETTOR_TEXT[10]
+_("""This example will give you the requested package in a localized
+version for Chinese. Check below for a list of supported language
+codes. """),
+ # GETTOR_TEXT[11]
+_(""" List of supported locales:
+-------------------------"""),
+ # GETTOR_TEXT[12]
+_("""Here is a list of all available languages:"""),
+ # GETTOR_TEXT[13]
+_(""" gettor+ar(a)torproject.org: Arabic
+ gettor+de(a)torproject.org: German
+ gettor+en(a)torproject.org: English
+ gettor+es(a)torproject.org: Spanish
+ gettor+fa(a)torproject.org: Farsi (Iran)
+ gettor+fr(a)torproject.org: French
+ gettor+it(a)torproject.org: Italian
+ gettor+nl(a)torproject.org: Dutch
+ gettor+pl(a)torproject.org: Polish
+ gettor+ru(a)torproject.org: Russian
+ gettor+zh(a)torproject.org: Chinese"""),
+ # GETTOR_TEXT[14]
+_("""If you select no language, you will receive the English version."""),
+ # GETTOR_TEXT[15]
+_("""SMALLER SIZED PACKAGES
+======================"""),
+ # GETTOR_TEXT[16]
+_("""If your bandwith is low or your provider doesn't allow you to
+receive large attachments in your email, there is a feature of
+GetTor you can use to make it send you a number of small packages
+instead of one big one."""),
+ # GETTOR_TEXT[17]
+_("""Simply include the keyword 'split' somewhere in your email like so:"""),
+ # GETTOR_TEXT[18]
+_("""Sending this text in an email to GetTor will cause it to send you
+the Tor Browser Bundle in a number of 1,4MB attachments."""),
+ # GETTOR_TEXT[19]
+_("""After having received all parts, you need to re-assemble them to
+one package again. This is done as follows:"""),
+ # GETTOR_TEXT[20]
+_("""1.) Save all received attachments into one folder on your disk."""),
+ # GETTOR_TEXT[21]
+_("""2.) Unzip all files ending in ".z". If you saved all attachments to
+a fresh folder before, simply unzip all files in that folder."""),
+ # GETTOR_TEXT[22]
+_("""3.) Verify all files as described in the mail you received with
+each package. (gpg --verify)"""),
+ # GETTOR_TEXT[23]
+_("""4.) Now use a program that can unrar multivolume RAR archives. On
+Windows, this usually is WinRAR. If you don't have that
+installed on you computer yet, get it here:"""),
+ # GETTOR_TEXT[24]
+_("""To unpack your Tor package, simply doubleclick the ".exe" file."""),
+ # GETTOR_TEXT[25]
+_("""5.) After unpacking is finished, you should find a newly created
+".exe" file in your destination folder. Simply doubleclick
+that and Tor Browser Bundle should start within a few seconds."""),
+ # GETTOR_TEXT[26]
+_("""6.) That's it. You're done. Thanks for using Tor and have fun!"""),
+ # GETTOR_TEXT[27]
+_("""SUPPORT
+======="""),
+ # GETTOR_TEXT[28]
+_("""If you have any questions or it doesn't work, you can contact a
+human at this support email address: tor-assistants(a)torproject.org"""),
+ # GETTOR_TEXT[29]
+_(""" Here's your requested software as a zip file. Please unzip the
+package and verify the signature."""),
+ # GETTOR_TEXT[30]
+_("""Hint: If your computer has GnuPG installed, use the gpg
+commandline tool as follows after unpacking the zip file:"""),
+ # GETTOR_TEXT[31]
+_("""The output should look somewhat like this:"""),
+ # GETTOR_TEXT[32]
+_("""If you're not familiar with commandline tools, try looking for
+a graphical user interface for GnuPG on this website:"""),
+ # GETTOR_TEXT[33]
+_("""If your Internet connection blocks access to the Tor network, you
+may need a bridge relay. Bridge relays (or "bridges" for short)
+are Tor relays that aren't listed in the main directory. Since there
+is no complete public list of them, even if your ISP is filtering
+connections to all the known Tor relays, they probably won't be able
+to block all the bridges."""),
+ # GETTOR_TEXT[34]
+_("""You can acquire a bridge by sending an email that contains "get bridges"
+in the body of the email to the following email address:"""),
+ # GETTOR_TEXT[35]
+_("""It is also possible to fetch bridges with a web browser at the following
+url: https://bridges.torproject.org/"""),
+ # GETTOR_TEXT[36]
+_("""IMPORTANT NOTE:
+Since this is part of a split-file request, you need to wait for
+all split files to be received by you before you can save them all
+into the same directory and unpack them by double-clicking the
+first file."""),
+ # GETTOR_TEXT[37]
+_("""Packages mighit come out of order! Please make sure you received
+all packages before you attempt to unpack them!"""),
+ # GETTOR_TEXT[38]
+_("""Thank you for your request.
+It was successfully understood. Your request is currently being processed.
+Your package should arrive within the next ten minutes."""),
+ # GETTOR_TEXT[39]
+_("""If it doesn't arrive, the package might be too big for your mail provider.
+Try resending the mail from a GMAIL.COM or YAHOO.COM account."""),
+ # GETTOR_TEXT[40]
+_("""Unfortunately we are currently experiencing problems and we can't fulfill
+your request right now. Please be patient as we try to resolve this issue.""")
+]
diff --git a/lib/gettor/requests.py b/lib/gettor/requests.py
index bcf461f..a61ac14 100644
--- a/lib/gettor/requests.py
+++ b/lib/gettor/requests.py
@@ -23,7 +23,6 @@ class requestMail:
self.request['user'] = self.parsedMessage["Return-Path"]
self.request['ouraddr'] = self.getRealTo(self.parsedMessage["to"])
self.request['locale'] = self.getLocaleInTo(self.request['ouraddr'])
- self.request['plus'] = False # Was this a gettor+lang@ request?
self.request['package'] = None
self.request['split'] = False
self.request['forward'] = None
@@ -52,7 +51,7 @@ class requestMail:
if match:
locale = match.group(3)
logging.debug("User requested language %s" % locale)
- return locale
+ return self.checkAndGetLocale(locale)
else:
logging.debug("Not a 'plus' address")
return self.config.DEFAULT_LOCALE
@@ -147,7 +146,6 @@ class requestMail:
"""
for (lang, aliases) in self.config.SUPP_LANGS.items():
if lang == locale:
- logging.debug("User requested lang %s" % lang)
return locale
if aliases is not None:
if locale in aliases:
diff --git a/lib/gettor/responses.py b/lib/gettor/responses.py
index f0f11b7..248c0ac 100644
--- a/lib/gettor/responses.py
+++ b/lib/gettor/responses.py
@@ -15,8 +15,88 @@ from email.mime.base import MIMEBase
from email.mime.text import MIMEText
import gettor.blacklist
+import gettor.i18n as i18n
-trans = None
+def getPackageHelpMsg(t):
+ return t.gettext(i18n.GETTOR_TEXT[0]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[6]) + "\n\n" \
+ + """ tor-browser-bundle
+ macosx-i386-bundle
+ macosx-ppc-bundle
+ linux-browser-bundle-i386
+ linux-browser-bundle-x86_64
+ source-bundle""" + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[7]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[8]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[9]) + "\n\n" \
+ + " gettor+zh_CN(a)torproject.org" + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[10]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[11]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[12]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[13]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[14]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[15]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[16]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[17]) + "\n\n" \
+ + " tor-browser-bundle" + "\n" \
+ + " split" + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[18]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[19]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[20]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[21]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[22]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[23]) + "\n\n" \
+ + " http://www.win-rar.com/download.html" + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[23]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[24]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[25]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[26]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[27]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[28]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[33]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[34]) + "\n\n" \
+ + " bridges(a)torproject.org" + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[34]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[35]) + "\n"
+
+def getPackageMsg(t):
+ return t.gettext(i18n.GETTOR_TEXT[0]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[29]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[30]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[31]) + "\n\n" \
+ + " gpg: Good signature from 'Roger Dingledine <arma(a)mit.edu>'" \
+ + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[32]) + "\n\n" \
+ + " http://www.gnupg.org/related_software/frontends.html" \
+ + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[33]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[34]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[35]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[27]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[28]) + "\n"
+
+def getSplitPackageMsg(t):
+ return t.gettext(i18n.GETTOR_TEXT[0]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[36]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[37]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[19]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[20]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[21]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[22]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[23]) + "\n\n" \
+ + " http://www.win-rar.com/download.html" + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[24]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[25]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[26]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[27]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[28]) + "\n"
+
+def getDelayAlertMsg(t):
+ return t.gettext(i18n.GETTOR_TEXT[0]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[38]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[39]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[27]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[28]) + "\n"
class Response:
def __init__(self, config, reqInfo):
@@ -29,28 +109,15 @@ class Response:
# Dump info
logging.info(str(self.reqInfo))
- # Initialize the reply language usage
- try:
- localeDir = os.path.join(self.config.BASEDIR, "i18n")
- t = gettext.translation("gettor", localeDir, [reqInfo['locale']])
- t.install()
- # OMG TEH HACK!! Constants need to be imported *after* we've
- # initialized the locale/gettext subsystem
- import gettor.constants
- except IOError:
- logging.error("Translation fail. Trying running with -r.")
- raise
+ # Initialize locale subsystem
+ gettext.install("gettor", unicode=True)
+ self.t = i18n.getLang(self.reqInfo['locale'])
# Init black & whitelists
wlStateDir = os.path.join(self.config.BASEDIR, "wl")
blStateDir = os.path.join(self.config.BASEDIR, "bl")
self.wList = gettor.blacklist.BWList(wlStateDir)
self.bList = gettor.blacklist.BWList(blStateDir)
- # Check blacklist section 'general' list & Drop if necessary
- # XXX: This should learn wildcards
- bListed = self.bList.lookupListEntry(self.reqInfo['user'], "general")
- assert bListed is not True, \
- "Mail from blacklisted user %s" % self.reqInfo['user']
def sendReply(self):
"""All routing decisions take place here. Sending of mails takes place
@@ -89,6 +156,10 @@ class Response:
if self.wList.lookupListEntry(self.reqInfo['user'], "general"):
logging.info("Whitelisted user " + self.reqInfo['user'])
return False
+ # Now check general and specific blacklists, in that order
+ if self.bList.lookupListEntry(self.reqInfo['user'], "general"):
+ logging.info("Blacklisted user " + self.reqInfo['user'])
+ return True
# Create a unique dir name for the requested routine
self.bList.createSublist(fname)
if self.bList.lookupListEntry(self.reqInfo['user'], fname):
@@ -110,7 +181,7 @@ class Response:
return False
logging.info("Sending out %s to %s." % (pack, to))
f = os.path.join(self.config.BASEDIR, "packages", pack + ".z")
- txt = gettor.constants.packagemsg
+ txt = getPackageMsg(self.t)
msg = self.makeMsg(txt, to, fileName=f)
try:
status = self.sendEmail(to, msg)
@@ -130,7 +201,7 @@ class Response:
to = self.reqInfo['user']
logging.info("Sending out %s to %s." % (pack, fwd))
f = os.path.join(self.config.BASEDIR, "packages", pack + ".z")
- text = gettor.constants.packagemsg
+ text = getPackageMsg(self.t)
msg = self.makeMsg(text, fwd, fileName=f)
try:
status = self.sendEmail(fwd, msg)
@@ -172,7 +243,7 @@ class Response:
path = os.path.join(splitDir, filename)
num = num + 1
sub = "[GetTor] Split package [%02d / %02d] " % (num, nFiles)
- txt = gettor.constants.splitpackagemsg
+ txt = getSplitPackageMsg(self.t)
msg = self.makeMsg(txt, sub, self.reqInfo['user'], fileName=path)
try:
status = self.sendEmail(self.reqInfo['user'], msg)
@@ -193,7 +264,7 @@ class Response:
# Don't send anything
return False
logging.info("Sending delay alert to %s" % self.reqInfo['user'])
- return self.sendTextEmail(gettor.constants.delayalertmsg)
+ return self.sendTextEmail(getDelayAlertMsg(self.t))
def sendHelp(self):
"""Send a help mail. This happens when a user sent us a request we
@@ -203,7 +274,7 @@ class Response:
# Don't send anything
return False
logging.info("Sending out help message to %s" % self.reqInfo['user'])
- return self.sendTextEmail(gettor.constants.helpmsg)
+ return self.sendTextEmail(getPackageHelpMsg(self.t))
def sendPackageHelp(self):
"""Send a helpful message to the user interacting with us about
@@ -213,7 +284,7 @@ class Response:
# Don't send anything
return False
logging.info("Sending package help to %s" % self.reqInfo['user'])
- return self.sendTextEmail(gettor.constants.multilangpackagehelpmsg)
+ return self.sendTextEmail(i18n.MULTILANGHELP)
def sendTextEmail(self, text):
"""Generic text message sending routine.
1
0

[gettor/master] Move logfiles to their own subdir again, make the i18n use the actual config values as a fallback. Remove an over-verbose debug output
by kaner@torproject.org 24 Feb '11
by kaner@torproject.org 24 Feb '11
24 Feb '11
commit ce7a0674339fa7f3a1fec99a8706524c7c4255f8
Author: Christian Fromme <kaner(a)strace.org>
Date: Thu Feb 24 12:07:06 2011 +0100
Move logfiles to their own subdir again, make the i18n use the actual config values as a fallback. Remove an over-verbose debug output
---
lib/GetTor.py | 6 +++++-
lib/gettor/i18n.py | 8 +++++---
lib/gettor/responses.py | 2 +-
lib/gettor/utils.py | 1 -
4 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/lib/GetTor.py b/lib/GetTor.py
index 4c050b6..d7bda02 100644
--- a/lib/GetTor.py
+++ b/lib/GetTor.py
@@ -29,7 +29,11 @@ def initializeLogging(cfg):
level = getattr(logging, level)
extra = {}
logfileName = cfg.LOGFILE + "-" + strftime("%Y-%m-%d") + ".log"
- extra['filename'] = os.path.join(cfg.BASEDIR, logfileName)
+ logDir = os.path.join(cfg.BASEDIR, "log")
+ if not gettor.utils.createDir(logDir):
+ # Fall back to /tmp in case of an error
+ logDir="/tmp"
+ extra['filename'] = os.path.join(logDir, logfileName)
print "Logfile is %s" % extra['filename']
diff --git a/lib/gettor/i18n.py b/lib/gettor/i18n.py
index 9cb1239..7e5769f 100644
--- a/lib/gettor/i18n.py
+++ b/lib/gettor/i18n.py
@@ -6,12 +6,14 @@
import os
import gettext
-def getLang(lang, localedir=os.path.expanduser("~") + "/gettor/i18n"):
+def getLang(lang, config):
"""Return the Translation instance for a given language. If no Translation
instance is found, return the one for 'en'
"""
- return gettext.translation("gettor", localedir=localedir,
- languages=[lang], fallback="en")
+ localeDir = os.path.join(config.BASEDIR, "i18n")
+ fallback = config.DEFAULT_LOCALE
+ return gettext.translation("gettor", localedir=localeDir,
+ languages=[lang], fallback=fallback)
def _(text):
"""This is necessary because strings are translated when they're imported.
diff --git a/lib/gettor/responses.py b/lib/gettor/responses.py
index c9dba54..86e43f2 100644
--- a/lib/gettor/responses.py
+++ b/lib/gettor/responses.py
@@ -110,7 +110,7 @@ class Response:
logging.info(str(self.reqInfo))
# Initialize locale subsystem
- self.t = i18n.getLang(self.reqInfo['locale'])
+ self.t = i18n.getLang(self.reqInfo['locale'], config)
# Init black & whitelists
wlStateDir = os.path.join(self.config.BASEDIR, "wl")
diff --git a/lib/gettor/utils.py b/lib/gettor/utils.py
index 958bfdb..0a51760 100644
--- a/lib/gettor/utils.py
+++ b/lib/gettor/utils.py
@@ -22,7 +22,6 @@ def createDir(path):
already exists.
"""
try:
- logging.debug("Creating directory %s if it doesn't exist.." % path)
os.makedirs(path)
except OSError as e:
if e.errno != errno.EEXIST:
1
0