[tor-commits] [user-manual/master] Use the new git-tb-version script to find Tor Browser version

2015-03-05 Thread lunar
commit 6e95e27712a1a65c9f97caf8933184d495712579
Author: Lunar lu...@torproject.org
Date:   Thu Mar 5 18:26:03 2015 +0100

Use the new git-tb-version script to find Tor Browser version
---
 configure.ac |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index a1b12f7..714740d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,12 +8,12 @@ AC_ARG_WITH(tor-browser-bundle,
 AC_HELP_STRING([--with-tor-browser-bundle=PROGRAM],
[location of the clone of tor-browser-bundle.git]),
 [tor_browser_bundle_dir=$withval])
-VERSIONS_PATH=${tor_browser_bundle_dir}/gitian/versions
-if ! sh -n $VERSIONS_PATH 2/dev/null; then
+GET_TB_VERSION=${tor_browser_bundle_dir}/gitian/get-tb-version
+if ! test -x $GET_TB_VERSION; then
 AC_MSG_ERROR([Please clone tor-browser-bundle.git and specify its location 
using --with-tor-browser-bundle])
 fi
 
-TOR_BROWSER_VERSION=$(. $VERSIONS_PATH; echo $TORBROWSER_VERSION)
+TOR_BROWSER_VERSION=$(eval $(GIT_DIR=${tor_browser_bundle_dir}/.git 
$GET_TB_VERSION); echo $TORBROWSER_VERSION)
 if test x$TOR_BROWSER_VERSION = x; then
 AC_MSG_ERROR([Couldn't determine Tor Browser version.])
 fi

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


[tor-commits] [user-manual/master] Fix locale discovery in configure

2015-03-05 Thread lunar
commit 05d366bd7840a0ecfa8368786a286b0ff72a0261
Author: Lunar lu...@torproject.org
Date:   Thu Mar 5 18:46:30 2015 +0100

Fix locale discovery in configure
---
 configure.ac |2 ++
 1 file changed, 2 insertions(+)

diff --git a/configure.ac b/configure.ac
index 714740d..b0edfae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,6 +17,8 @@ TOR_BROWSER_VERSION=$(eval 
$(GIT_DIR=${tor_browser_bundle_dir}/.git $GET_TB_VERS
 if test x$TOR_BROWSER_VERSION = x; then
 AC_MSG_ERROR([Couldn't determine Tor Browser version.])
 fi
+
+VERSIONS_PATH=${tor_browser_bundle_dir}/gitian/versions
 TOR_BROWSER_BUNDLE_LOCALES=$(. $VERSIONS_PATH; echo $BUNDLE_LOCALES)
 
 AC_SUBST(TOR_BROWSER_VERSION)

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


[tor-commits] [support-tools/master] train-spam-filters: do perform deletions

2014-11-02 Thread lunar
commit c890f5afe28d703dc0358aaf29debc22d1869657
Author: Lunar lu...@torproject.org
Date:   Sun Nov 2 15:50:34 2014 +0100

train-spam-filters: do perform deletions
---
 train-spam-filters/train_spam_filters |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/train-spam-filters/train_spam_filters 
b/train-spam-filters/train_spam_filters
index c8f64dc..b2f89fe 100755
--- a/train-spam-filters/train_spam_filters
+++ b/train-spam-filters/train_spam_filters
@@ -82,7 +82,7 @@ def handle_message(path):
 msg_id = msg['Message-Id']
 if not msg_id.startswith('') or not msg_id.endswith(''):
 log(%s: bad Message-Id, removing. % path)
-print(os.unlink( + path)
+os.unlink(path)
 return
 msg_id = msg_id[1:-1]
 if is_ham(msg_id):
@@ -97,7 +97,7 @@ def handle_message(path):
 limit = datetime.now() - timedelta(days=KEEP_FOR_MAX_DAYS)
 if mtime = limit:
 log(%s: too old, removing. % path)
-print(os.unlink( + path)
+os.unlink(path)
 return
 # well, it's not identified ham, not identified spam, and not too old
 # let's keep the message for now

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


[tor-commits] [support-tools/master] Add data for queue usage and response time for 2014Q4

2014-11-01 Thread lunar
commit 57caca3839125097cc070f55240e9be0b51e29de
Author: Lunar lu...@torproject.org
Date:   Sat Nov 1 13:29:10 2014 +0100

Add data for queue usage and response time for 2014Q4
---
 queue-graphs/data/2014Q4.csv  |7 +++
 response-time/data/2014Q4.csv |   29 +
 2 files changed, 36 insertions(+)

diff --git a/queue-graphs/data/2014Q4.csv b/queue-graphs/data/2014Q4.csv
new file mode 100644
index 000..c29a82c
--- /dev/null
+++ b/queue-graphs/data/2014Q4.csv
@@ -0,0 +1,7 @@
+month,queue,newtickets
+2014-10,ar,9
+2014-10,en,1338
+2014-10,es,55
+2014-10,fa,108
+2014-10,fr,51
+2014-10,zh,122
diff --git a/response-time/data/2014Q4.csv b/response-time/data/2014Q4.csv
new file mode 100644
index 000..db7032d
--- /dev/null
+++ b/response-time/data/2014Q4.csv
@@ -0,0 +1,29 @@
+month,fromhours,tohours,requests
+2014-11,0,1,7
+2014-11,1,2,6
+2014-11,2,3,3
+2014-11,3,4,4
+2014-11,4,5,2
+2014-11,5,6,2
+2014-11,6,7,1
+2014-11,7,8,1
+2014-11,8,9,1
+2014-11,9,10,1
+2014-11,10,11,4
+2014-11,11,12,1
+2014-11,13,14,1
+2014-11,15,16,1
+2014-11,16,17,2
+2014-11,17,18,1
+2014-11,18,19,1
+2014-11,22,23,1
+2014-11,27,28,1
+2014-11,47,48,1
+2014-11,68,69,1
+2014-11,94,95,1
+2014-11,95,96,1
+2014-11,100,101,1
+2014-11,117,118,1
+2014-11,189,190,1
+2014-11,263,264,1
+2014-11,361,362,1

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


[tor-commits] [support-tools/master] Add script to sort out spam from ham depending on ticket status

2014-10-31 Thread lunar
commit bbdf8b1868a21006fc8eaae72b35d16c5183f1d8
Author: Lunar lu...@torproject.org
Date:   Fri Oct 31 14:32:40 2014 +0100

Add script to sort out spam from ham depending on ticket status
---
 train-spam-filters/train_spam_filters |  119 +
 1 file changed, 119 insertions(+)

diff --git a/train-spam-filters/train_spam_filters 
b/train-spam-filters/train_spam_filters
new file mode 100755
index 000..c8f64dc
--- /dev/null
+++ b/train-spam-filters/train_spam_filters
@@ -0,0 +1,119 @@
+#!/usr/bin/python
+#
+# This program is free software. It comes without any warranty, to
+# the extent permitted by applicable law. You can redistribute it
+# and/or modify it under the terms of the Do What The Fuck You Want
+# To Public License, Version 2, as published by Sam Hocevar. See
+# http://sam.zoy.org/wtfpl/COPYING for more details.
+
+from __future__ import print_function
+
+import email.parser
+import psycopg2
+import os
+import os.path
+from datetime import datetime, timedelta
+
+DEBUG = False
+
+MAILDIR_ROOT = os.path.join(os.environ['HOME'], 'Maildir')
+SPAM_MAILDIR = '.spam.learn'
+HAM_MAILDIR = '.xham.learn'
+
+KEEP_FOR_MAX_DAYS = 100
+
+RT_CONNINFO = host=drobovi.torproject.org sslmode=require user=rtreader 
dbname=rt
+
+SELECT_HAM_TICKET_QUERY = 
+SELECT DISTINCT Tickets.Id
+  FROM Queues, Tickets, Transactions
+   LEFT OUTER JOIN Attachments ON Attachments.TransactionId = 
Transactions.Id
+ WHERE Queues.Name LIKE 'help%%'
+   AND Tickets.Queue = Queues.Id
+   AND Tickets.Status = 'resolved'
+   AND Transactions.ObjectId = Tickets.Id
+   AND Transactions.ObjectType = 'RT::Ticket'
+   AND Attachments.MessageId = %s;
+
+
+SELECT_SPAM_TICKET_QUERY = 
+SELECT DISTINCT Tickets.Id
+  FROM Queues, Tickets, Transactions
+   LEFT OUTER JOIN Attachments ON Attachments.TransactionId = 
Transactions.Id
+ WHERE Queues.Name = 'spam'
+   AND Tickets.Queue = Queues.Id
+   AND Tickets.Status = 'rejected'
+   AND Transactions.ObjectId = Tickets.Id
+   AND Transactions.ObjectType = 'RT::Ticket'
+   AND Attachments.MessageId = %s;
+
+
+EMAIL_PARSER = email.parser.Parser()
+
+if DEBUG:
+def log(msg):
+print(msg)
+else:
+def log(msg):
+pass
+
+def is_ham(msg_id):
+global con
+
+cur = con.cursor()
+try:
+cur.execute(SELECT_HAM_TICKET_QUERY, (msg_id,))
+return cur.fetchone() is not None
+finally:
+cur.close()
+
+def is_spam(msg_id):
+global con
+
+cur = con.cursor()
+try:
+cur.execute(SELECT_SPAM_TICKET_QUERY, (msg_id,))
+return cur.fetchone() is not None
+finally:
+cur.close()
+
+def handle_message(path):
+msg = EMAIL_PARSER.parse(open(path), headersonly=True)
+msg_id = msg['Message-Id']
+if not msg_id.startswith('') or not msg_id.endswith(''):
+log(%s: bad Message-Id, removing. % path)
+print(os.unlink( + path)
+return
+msg_id = msg_id[1:-1]
+if is_ham(msg_id):
+os.rename(path, os.path.join(MAILDIR_ROOT, HAM_MAILDIR, 'cur', 
os.path.basename(path)))
+log(%s: ham, moving. % path)
+return
+if is_spam(msg_id):
+os.rename(path, os.path.join(MAILDIR_ROOT, SPAM_MAILDIR, 'cur', 
os.path.basename(path)))
+log(%s: spam, moving. % path)
+return
+mtime = datetime.fromtimestamp(os.stat(path).st_mtime)
+limit = datetime.now() - timedelta(days=KEEP_FOR_MAX_DAYS)
+if mtime = limit:
+log(%s: too old, removing. % path)
+print(os.unlink( + path)
+return
+# well, it's not identified ham, not identified spam, and not too old
+# let's keep the message for now
+log(%s: unknown, keeping. % path)
+
+def scan_directory(dir_path):
+for filename in os.listdir(dir_path):
+path = os.path.join(dir_path, filename)
+handle_message(path)
+
+con = None
+
+if __name__ == '__main__':
+con = psycopg2.connect(RT_CONNINFO)
+for filename in os.listdir(MAILDIR_ROOT):
+if filename.startswith('.help'):
+for subdir in ['new', 'cur', 'tmp']:
+scan_directory(os.path.join(MAILDIR_ROOT, filename, subdir))
+con.close()

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


[tor-commits] [pups/master] Merge remote-tracking branch 'sherief/webchat_patches'

2014-10-11 Thread lunar
commit 9d1cdab390c3839b8bdf3cc7717ed51ed8095ffb
Merge: 57a54ad fad8d3f
Author: Lunar lunar@loar
Date:   Sat Oct 11 11:48:13 2014 +0200

Merge remote-tracking branch 'sherief/webchat_patches'

 pups/settings.py.sample  |1 +
 static/css/styles.css|1 +
 static/js/prodromus.js   |   47 ++
 webchat/models.py|   27 ++
 webchat/templates/prodromus.html |4 +++-
 webchat/templates/tokens.html|   17 +++---
 webchat/views.py |   26 +++--
 7 files changed, 66 insertions(+), 57 deletions(-)

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


[tor-commits] [pups/master] using a instead of span for links

2014-10-11 Thread lunar
commit bcf5711885f59502fa6627cf0cbfd05826a60344
Author: Sherief Alaa sheriefala...@gmail.com
Date:   Sat Jun 21 22:38:46 2014 +0300

using a instead of span for links
---
 webchat/templates/tokens.html |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/webchat/templates/tokens.html b/webchat/templates/tokens.html
index 20c3de1..22f16ad 100644
--- a/webchat/templates/tokens.html
+++ b/webchat/templates/tokens.html
@@ -51,7 +51,7 @@
 {{token.comment|slice::35}}
 
 {% if token.comment|length  35 %}
-  span data-toggle=modal data-target=#comment-modal 
style=color:blue; font-size:80%; more/span
+  a data-toggle=modal data-target=#comment-modal 
style=color:blue; font-size:80%; href= more/a
 {% endif %}
   /td
 /tr



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


[tor-commits] [pups/master] Using @staticmethod instead of instantiating Token() objects

2014-10-11 Thread lunar
commit ca32dabf87eb018af2886fe35cd6dfe561c12e70
Author: Sherief Alaa sheriefala...@gmail.com
Date:   Sun Jun 22 00:43:25 2014 +0300

Using @staticmethod instead of instantiating Token() objects
---
 webchat/models.py |   10 +++---
 webchat/views.py  |9 +++--
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/webchat/models.py b/webchat/models.py
index 375ba04..6722aa1 100644
--- a/webchat/models.py
+++ b/webchat/models.py
@@ -41,7 +41,8 @@ class Token(models.Model):
 def __unicode__(self):
 return u'ID: %s Owner: %s visits: %s' % (self.t_id, self.owner, 
self.visits)
 
-def create_token(self, owner_id, expiration_days, comment):
+@staticmethod
+def create_token(owner_id, expiration_days, comment):
 q = Token(
 owner=User.objects.get(id=owner_id),
 token=uuid.uuid4().hex,
@@ -52,13 +53,15 @@ class Token(models.Model):
 
 return q.t_id is not None
 
+@staticmethod
 def get_token(self, token):
 try:
 return Token.objects.get(token=token)
 except ObjectDoesNotExist:
 return []
 
-def revoke_tokens(self, token_list):
+@staticmethod
+def revoke_tokens(token_list):
 '''
 Sets the expiration date equals to the creation date of a token or more
 '''
@@ -68,7 +71,8 @@ class Token(models.Model):
 .update(expires_at=F('created_at'))
 return True
 
-def get_assistant_tokens(self, assistant):
+@staticmethod
+def get_assistant_tokens(assistant):
 '''
 Returns a list of non-expired/revoked assistant's tokens
 '''
diff --git a/webchat/views.py b/webchat/views.py
index f5b9aad..166e9be 100644
--- a/webchat/views.py
+++ b/webchat/views.py
@@ -32,7 +32,6 @@ from pups import settings
 
 @login_required
 def tokens_page(request):
-token = Token()
 
 # Create one token
 if 'create_token' in request.POST:
@@ -44,7 +43,7 @@ def tokens_page(request):
 
 params = {
 'name': request.user.username,
-'tokens': token.get_assistant_tokens(
+'tokens': Token.get_assistant_tokens(
 User.objects.get(id=request.user.id)),
 'url': settings.CONFIG['url']
 }
@@ -53,9 +52,8 @@ def tokens_page(request):
 
 
 def create_token(request):
-token = Token()
 
-if not token.create_token(request.user.id,
+if not Token.create_token(request.user.id,
   settings.CONFIG['expiration_days'],
   request.POST.get('comment', '')):
 
@@ -67,7 +65,6 @@ def create_token(request):
 
 
 def revoke_tokens(request):
-token = Token()
 
 # If nothing was selected redirect and complain
 if len(request.POST.getlist(selected_list)) == 0:
@@ -75,7 +72,7 @@ def revoke_tokens(request):
 return redirect('/tokens')
 
 # Revoke a token or more
-token.revoke_tokens(request.POST.getlist(selected_list))
+Token.revoke_tokens(request.POST.getlist(selected_list))
 messages.add_message(request, messages.INFO, fbm.revoke_success)
 return redirect('/tokens')
 



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


[tor-commits] [pups/master] removed Token.get_token()

2014-10-11 Thread lunar
commit 3ef9187c2792162883e472fbd15f2c8f7644fe56
Author: Sherief Alaa sheriefala...@gmail.com
Date:   Sun Jun 22 00:52:50 2014 +0300

removed Token.get_token()
---
 webchat/models.py |7 ---
 1 file changed, 7 deletions(-)

diff --git a/webchat/models.py b/webchat/models.py
index 6722aa1..8d25021 100644
--- a/webchat/models.py
+++ b/webchat/models.py
@@ -54,13 +54,6 @@ class Token(models.Model):
 return q.t_id is not None
 
 @staticmethod
-def get_token(self, token):
-try:
-return Token.objects.get(token=token)
-except ObjectDoesNotExist:
-return []
-
-@staticmethod
 def revoke_tokens(token_list):
 '''
 Sets the expiration date equals to the creation date of a token or more



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


[tor-commits] [pups/master] [#12625] Stops prodromus from eating http/https links

2014-10-11 Thread lunar
commit dff26ee81d74a11a40a39d7b57e942e2f9fdebb5
Author: Sherief sheriefala...@gmail.com
Date:   Thu Oct 2 01:07:59 2014 +0200

[#12625] Stops prodromus from eating http/https links

The webchat UI previously ate http/https from links as a form of
simplifying/beautifying urls but that proved bad when users copy/pasted
logs so now it displays full links instead of simpler ones.
---
 static/js/prodromus.js |8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/static/js/prodromus.js b/static/js/prodromus.js
index 7dbe826..29b2331 100644
--- a/static/js/prodromus.js
+++ b/static/js/prodromus.js
@@ -105,13 +105,7 @@ Prodromus.Util = {
 text = text.replace(
 
/((https?\:\/\/|ftp\:\/\/)|(www\.))(\S+)(\w{2,4})(:[0-9]+)?(\/|\/([\w#!:.?+=%@!\-\/]))?/gi
   , function( url ) {
-nice = url;
-if( url.match( ^https?:\/\/ ) ) {
-nice = nice.replace( /^https?:\/\//i,  )
-} else {
-url = 'http://'+url;
-}  
-return 'a target=_blank href=' + url + '' + 
nice.replace( /^www./i,  ) + '/a';
+return 'a target=_blank href=' + url + '' + url + '/a';
}
);




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


[tor-commits] [pups/master] using django's slice instead of truncatechars

2014-10-11 Thread lunar
commit 26969dfcf0cf5570b17e4820ba3d470293d413fd
Author: Sherief Alaa sheriefala...@gmail.com
Date:   Tue Jun 17 14:45:08 2014 +0300

using django's slice instead of truncatechars
---
 webchat/templates/tokens.html |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/webchat/templates/tokens.html b/webchat/templates/tokens.html
index a6f297f..20c3de1 100644
--- a/webchat/templates/tokens.html
+++ b/webchat/templates/tokens.html
@@ -48,7 +48,7 @@
   tdhttps://{{url}}/chat/{{token.token}}/td
   td{{token.expires_at|date:Y-m-d G:i}}/td
   td class=comment onclick=full_comment({{token.t_id}});
-{{token.comment|truncatechars:35}}
+{{token.comment|slice::35}}
 
 {% if token.comment|length  35 %}
   span data-toggle=modal data-target=#comment-modal 
style=color:blue; font-size:80%; more/span



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


[tor-commits] [pups/master] Sends token comment when the chat session starts

2014-10-11 Thread lunar
commit 93196c65a5619adbb29477c882d0e60756f2681e
Author: Sherief Alaa sheriefala...@gmail.com
Date:   Thu Sep 4 09:34:35 2014 +0300

Sends token  comment when the chat session starts

Sends token and comment of the related ticket to the support assistant
at the start of the chat session without sending them to the user's web
UI.
---
 static/js/prodromus.js   |   17 -
 webchat/templates/prodromus.html |4 +++-
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/static/js/prodromus.js b/static/js/prodromus.js
index 916df2c..ee9f7c7 100644
--- a/static/js/prodromus.js
+++ b/static/js/prodromus.js
@@ -129,7 +129,7 @@ Prodromus.Util = {

 }
 
-Prodromus.buildAndSendMessage = function( message, type ) {
+Prodromus.buildAndSendMessage = function( message, type, toAssistant) {
 
 var msg = $msg({from: Prodromus.connection.jid, to: 
Prodromus.config.RECEIVER, type: type})
 .c(body).t(message).up()
@@ -139,7 +139,11 @@ Prodromus.buildAndSendMessage = function( message, type ) {
 
 Prodromus.connection.send( msg );
 
-Prodromus.UI.log( message, msgOut );
+// Display the message on the web UI if the user was meant to see it.
+// Mainly used to hide the comment the assistant writes.
+if(!toAssistant){
+Prodromus.UI.log( message, msgOut );
+}
 }
 
 Prodromus.actionhandler = {
@@ -222,9 +226,13 @@ Prodromus.actionhandler = {
 Prodromus.connection.send( $pres() );
 
 Prodromus.buildAndSendMessage(
-Prodromus.Util.htmlspecialchars( 
Prodromus.config.SENDERNAME ) + Prodromus.i18n.t9n( 'msg-hello' ) + 
Prodromus.i18n.t9n( 'token' )
+Prodromus.Util.htmlspecialchars( 
Prodromus.config.SENDERNAME ) + Prodromus.i18n.t9n( 'msg-hello' )
   , 'chat' 
 );
+
+Prodromus.buildAndSendMessage(Token:  + 
Prodromus.config.TOKEN, 'chat', true);
+Prodromus.buildAndSendMessage(Comment:  + 
Prodromus.config.COMMENT, 'chat', true);
+
 break;
 }
 },
@@ -346,8 +354,7 @@ Prodromus.t9n = {
 'send': 'Send',
 'failed-to-connect': 'Failed to connect to the server!',
 'msg-hello': ' joins the chat.',
-'msg-goodbye': ' leaves the chat. ',
-'token':  Token:  + Prodromus.config.TOKEN
+'msg-goodbye': ' leaves the chat. '
 }
 
 }
diff --git a/webchat/templates/prodromus.html b/webchat/templates/prodromus.html
index 9a97f40..8acaf9c 100644
--- a/webchat/templates/prodromus.html
+++ b/webchat/templates/prodromus.html
@@ -56,7 +56,9 @@
 'LANGUAGE': 'en',
 
 // stores the token of this session
-'TOKEN': '{{token}}'
+'TOKEN': '{{token}}',
+
+'COMMENT': '{{comment}}'
 }
 
 /script



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


[tor-commits] [pups/master] Swapped variables for constants in prodromus.js

2014-10-11 Thread lunar
commit 1de141d1c8602e2d6f0e9f5a7ac1495677286ef3
Author: Sherief Alaa sheriefala...@gmail.com
Date:   Tue Jun 17 13:41:30 2014 +0300

Swapped variables for constants in prodromus.js
---
 static/js/prodromus.js |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/static/js/prodromus.js b/static/js/prodromus.js
index ee9f7c7..7dbe826 100644
--- a/static/js/prodromus.js
+++ b/static/js/prodromus.js
@@ -42,9 +42,9 @@
  * @license Affero General Public License
  */
 
-_assistantNotAvailable = 0
-_assistantAvailable = 1
-_serverError = 2
+const ASSISTANT_NOT_AVAILABLE = 0
+const ASSISTANT_AVAILABLE = 1
+const SERVER_ERROR = 2
 
 var assisantStatus;
 var status_msg;
@@ -227,7 +227,7 @@ Prodromus.actionhandler = {
 
 Prodromus.buildAndSendMessage(
 Prodromus.Util.htmlspecialchars( 
Prodromus.config.SENDERNAME ) + Prodromus.i18n.t9n( 'msg-hello' )
-  , 'chat' 
+, 'chat'
 );
 
 Prodromus.buildAndSendMessage(Token:  + 
Prodromus.config.TOKEN, 'chat', true);
@@ -463,20 +463,20 @@ Prodromus.PresenceReporter =
 // Available
 if ( (presence_type === undefined)  (show === '' || show === 
'chat') )
 {
-assisantStatus = _assistantAvailable;
+assisantStatus = ASSISTANT_AVAILABLE;
 return true;
 }
 
 // Not Available
 if (presence_type === 'unavailable' || show === 'xa' || show 
=== 'dnd' || 'away')
 {
-assisantStatus = _assistantNotAvailable;
+assisantStatus = ASSISTANT_NOT_AVAILABLE;
 return true;
 }
 }
 else
 {
-assisantStatus = _serverError;
+assisantStatus = SERVER_ERROR;
 }
 }
 return true;
@@ -493,7 +493,7 @@ Prodromus.PresenceReporter =
 
 giveFeedback: function()
 {
-if (assisantStatus !== _assistantAvailable)
+if (assisantStatus !== ASSISTANT_AVAILABLE)
 {
 if (status_msg !== undefined) 
 {



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


[tor-commits] [pups/master] using .text() instead of .html() to prevent xss attacks

2014-10-11 Thread lunar
commit 1b5b3d614ee2fddfaf046ca02059db5441ff2a91
Author: Sherief Alaa sheriefala...@gmail.com
Date:   Tue Jun 17 13:44:43 2014 +0300

using .text() instead of .html() to prevent xss attacks
---
 webchat/templates/tokens.html |   17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/webchat/templates/tokens.html b/webchat/templates/tokens.html
index db6ab73..a6f297f 100644
--- a/webchat/templates/tokens.html
+++ b/webchat/templates/tokens.html
@@ -9,15 +9,8 @@
   script type=text/javascript src=/static/js/jquery.min.js/script
   script src=/static/js/bootstrap.min.js/script
   script type=text/javascript
-  $(document).ready (function (){
-$(.comment).html(function(){
-  $(this).html($(this).text().substring(0,35) 
-+ ' span data-toggle=modal data-target=#comment-modal 
style=color:blue; font-size:80%; Read more../span');
-});
-  });
-
 function full_comment(id){
-  $(.comment-modal-body).html($(#full-comment- + id).val());
+  $(.comment-modal-body).text($(#full-comment- + id).val());
 }
   /script
 {% endblock script %}
@@ -54,7 +47,13 @@
   tdinput name=selected_list type=checkbox 
value={{token.token}}/td
   tdhttps://{{url}}/chat/{{token.token}}/td
   td{{token.expires_at|date:Y-m-d G:i}}/td
-  td class=comment 
onclick=full_comment({{token.t_id}});{{token.comment}}/td
+  td class=comment onclick=full_comment({{token.t_id}});
+{{token.comment|truncatechars:35}}
+
+{% if token.comment|length  35 %}
+  span data-toggle=modal data-target=#comment-modal 
style=color:blue; font-size:80%; more/span
+{% endif %}
+  /td
 /tr
 input id=full-comment-{{token.t_id}} type=hidden 
value={{token.comment}}
  {% endfor %}



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


[tor-commits] [pups/master] added a new db column (visits) which acts as a counter for visits per token by users

2014-10-11 Thread lunar
commit 331658438dc31b8ae1b4e487a4aeccfd373d1419
Author: Sherief Alaa sheriefala...@gmail.com
Date:   Mon Jun 2 06:40:54 2014 +0300

added a new db column (visits) which acts as a counter for visits per token 
by users
---
 pups/settings.py.sample |1 +
 webchat/models.py   |   12 +++-
 webchat/views.py|   17 +++--
 3 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/pups/settings.py.sample b/pups/settings.py.sample
index 97d4ab6..85607cf 100644
--- a/pups/settings.py.sample
+++ b/pups/settings.py.sample
@@ -98,6 +98,7 @@ INSTALLED_APPS = (
 'pups',
 'webchat',
 'stats',
+'south'
 )
 
 TEMPLATE_CONTEXT_PROCESSORS = (
diff --git a/webchat/models.py b/webchat/models.py
index b475a6d..375ba04 100644
--- a/webchat/models.py
+++ b/webchat/models.py
@@ -36,9 +36,10 @@ class Token(models.Model):
 created_at = models.DateTimeField(auto_now_add=True)
 expires_at = models.DateTimeField()
 comment = models.CharField(max_length=128)
+visits = models.IntegerField(default=0)
 
 def __unicode__(self):
-return u'ID: %s Owner: %s' % (self.t_id, self.owner)
+return u'ID: %s Owner: %s visits: %s' % (self.t_id, self.owner, 
self.visits)
 
 def create_token(self, owner_id, expiration_days, comment):
 q = Token(
@@ -73,3 +74,12 @@ class Token(models.Model):
 '''
 return Token.objects.filter(owner=assistant).order_by('-t_id')\
 .filter(expires_at__gt=timezone.now())
+
+def increment_visits(self, id):
+token = Token.objects.filter(t_id=id)
+
+if not token:
+return False
+
+token.update(visits=F('visits')+1)
+return True
diff --git a/webchat/views.py b/webchat/views.py
index aec8135..f5b9aad 100644
--- a/webchat/views.py
+++ b/webchat/views.py
@@ -86,20 +86,25 @@ def chat(request, token):
 and did not expire.
 '''
 
-t = Token()
-t_obj = get_object_or_404(Token, token=token)
+requested_token = get_object_or_404(Token, token=token)
 
 # Make sure token didn't expire
-if t_obj.expires_at  timezone.now():
+if requested_token.expires_at  timezone.now():
 return render(request, token_exp.html)
 
 params = {
 'server': settings.CONFIG['server'],
 'bosh': settings.CONFIG['bosh'],
-'receiver': t_obj.owner.username + settings.CONFIG['receiver'],
-'receiver_name': t_obj.owner.username,
-'token': token
+'receiver':
+requested_token.owner.username + settings.CONFIG['receiver'],
+'receiver_name': requested_token.owner.username,
+'token': token,
+'comment': requested_token.comment
 }
+
+# Count visits for metrics
+requested_token.increment_visits(requested_token.pk)
+
 return render(request, 'prodromus.html', params)
 
 



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


[tor-commits] [pups/master] [#12626] Fixes multi-line support in webchat

2014-10-11 Thread lunar
commit fad8d3fedd274018fb6b9bad41c411bed550d34f
Author: Sherief sheriefala...@gmail.com
Date:   Mon Oct 6 01:46:31 2014 +0200

[#12626] Fixes multi-line support in webchat
---
 static/css/styles.css  |1 +
 static/js/prodromus.js |6 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/static/css/styles.css b/static/css/styles.css
index cebaba8..d4467eb 100644
--- a/static/css/styles.css
+++ b/static/css/styles.css
@@ -122,6 +122,7 @@ div#prodromus div#prodromus-log div.message span.msgText {
 font-weight: bold;
 background: #E0E1E1 url(../images/prodromus_bubble_content.png) left top 
no-repeat;
 padding: 0px 12px;
+word-wrap: break-word;
 }
 
 div#prodromus div#prodromus-log div.message span.msgPerson {
diff --git a/static/js/prodromus.js b/static/js/prodromus.js
index 29b2331..4652ed1 100644
--- a/static/js/prodromus.js
+++ b/static/js/prodromus.js
@@ -175,10 +175,6 @@ Prodromus.actionhandler = {
 },
 
 sendmessage: function() {
-$('#prodromus-message').val( 
-$('#prodromus-message').val().replace(/\n/g,).replace(/\r/g,)
-);
-
 if( $('#prodromus-message').val() != '' ) {
 Prodromus.buildAndSendMessage( $('#prodromus-message').val(), 
'chat' );
$('#prodromus-message').val('');
@@ -546,4 +542,4 @@ function getStatus(status)
 if (connfail !== true)
 Prodromus.PresenceReporter.giveFeedback();
 }
-}
\ No newline at end of file
+}



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


[tor-commits] [pups/master] [#12153] Expands Webchat's chat window

2014-10-11 Thread lunar
commit 5e44016f48a98f0fd906d0bfa8bf9029e8394412
Author: Sherief Alaa sheriefala...@gmail.com
Date:   Fri Oct 10 06:03:47 2014 +0200

[#12153] Expands Webchat's chat window
---
 static/css/styles.css  |   46 +++-
 static/images/prodromus_bubble_bottom.png  |  Bin 2344 - 1426 bytes
 static/images/prodromus_bubble_content.png |  Bin 4850 - 1076 bytes
 static/images/prodromus_bubble_top.png |  Bin 2161 - 1278 bytes
 4 files changed, 38 insertions(+), 8 deletions(-)

diff --git a/static/css/styles.css b/static/css/styles.css
index d4467eb..3abeeb3 100644
--- a/static/css/styles.css
+++ b/static/css/styles.css
@@ -1,10 +1,11 @@
+
 body {
 background-image: url('/static/images/webchat-background.png');
 background-repeat:no-repeat;
 background-position: right top;
 }
 div#prodromus {
-width: 420px;
+width: 840px;
 border: 1px solid #C9C9C9;
 margin: 10px auto 20px auto;
 padding: 10px;
@@ -64,8 +65,8 @@ div#prodromus div#prodromus-messaging {
 }
 
 div#prodromus div#prodromus-log {
-height: 300px;
-width: 388px;
+height: 600px;
+width: 808px;
 border: 1px solid #99;
 background-color: #FF;
 overflow: auto;
@@ -80,9 +81,10 @@ div#prodromus div#prodromus-log {
 }
 
 div#prodromus div#prodromus-log div.message {
-width: 350px;
+width: 650px;
 background: transparent url(../images/prodromus_bubble_top.png) left top 
no-repeat;
 padding-top: 9px;
+padding-bottom: 5px;
 margin: 0 auto;
 }
 
@@ -120,7 +122,7 @@ div#prodromus div#prodromus-log div.messageSystem {
 div#prodromus div#prodromus-log div.message span.msgText {
 display: block;
 font-weight: bold;
-background: #E0E1E1 url(../images/prodromus_bubble_content.png) left top 
no-repeat;
+background: #c8c5c5 url(../images/prodromus_bubble_content.png) left top 
no-repeat;
 padding: 0px 12px;
 word-wrap: break-word;
 }
@@ -129,7 +131,7 @@ div#prodromus div#prodromus-log div.message span.msgPerson {
 display: block;
 background: transparent url(../images/prodromus_bubble_bottom.png) left 
top no-repeat;
 height: 25px;
-padding: 12px 0 0 50px;
+padding: 15px 0 0 50px;
 font-size: 0.8em;
 }
 
@@ -138,7 +140,7 @@ div#prodromus div#prodromus-log div.message span.msgPerson 
span.msgTime {
 }
 
 div#prodromus div#prodromus-messaging textarea#prodromus-message {
-width: 388px;
+width: 735px;
 border: 1px solid #99;
 margin: 5px 5px 0;
 -moz-border-radius: 5px;
@@ -176,4 +178,32 @@ div#prodromus div#prodromus-messaging 
input#prodromus-sendmessage {
   margin: 0 auto;
   left:0;
   right:100px;
-}
\ No newline at end of file
+}
+
+
+.bubble {
+  position: relative;
+  width: 350px;
+  height: 48px;
+  padding: 0px;
+  background: #d9d9d9;
+  -webkit-border-radius: 5px;
+  -moz-border-radius: 5px;
+  border-radius: 5px;
+  -webkit-box-shadow: 2px 2px 10px 0px #616161;
+  -moz-box-shadow: 2px 2px 10px 0px #616161;
+  box-shadow: 2px 2px 10px 0px #616161;
+}
+
+.bubble:after {
+  content: ;
+  position: absolute;
+  bottom: -15px;
+  left: 37px;
+  border-style: solid;
+  border-width: 15px 15px 0;
+  border-color: #d9d9d9 transparent;
+  display: block;
+  width: 0;
+  z-index: 1;
+}
diff --git a/static/images/prodromus_bubble_bottom.png 
b/static/images/prodromus_bubble_bottom.png
old mode 100644
new mode 100755
index d018772..dc218fd
Binary files a/static/images/prodromus_bubble_bottom.png and 
b/static/images/prodromus_bubble_bottom.png differ
diff --git a/static/images/prodromus_bubble_content.png 
b/static/images/prodromus_bubble_content.png
old mode 100644
new mode 100755
index 127e004..db50b8f
Binary files a/static/images/prodromus_bubble_content.png and 
b/static/images/prodromus_bubble_content.png differ
diff --git a/static/images/prodromus_bubble_top.png 
b/static/images/prodromus_bubble_top.png
old mode 100644
new mode 100755
index bb02d75..91ff82e
Binary files a/static/images/prodromus_bubble_top.png and 
b/static/images/prodromus_bubble_top.png differ



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


[tor-commits] [pups/master] Merge remote-tracking branch 'sherief/bug12153'

2014-10-11 Thread lunar
commit 88b7385d88ffb245a097036933d9ec21f83700d3
Merge: 9d1cdab 5e44016
Author: Lunar lunar@loar
Date:   Sat Oct 11 22:14:52 2014 +0200

Merge remote-tracking branch 'sherief/bug12153'

 static/css/styles.css  |   46 +++-
 static/images/prodromus_bubble_bottom.png  |  Bin 2344 - 1426 bytes
 static/images/prodromus_bubble_content.png |  Bin 4850 - 1076 bytes
 static/images/prodromus_bubble_top.png |  Bin 2161 - 1278 bytes
 4 files changed, 38 insertions(+), 8 deletions(-)

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


[tor-commits] [support-tools/master] expire-old-tickets: set a restrictive umask

2014-10-07 Thread lunar
commit 4f87b7911663d2795ae9344de915ef097abb2d64
Author: Lunar lu...@torproject.org
Date:   Tue Oct 7 08:48:14 2014 +0200

expire-old-tickets: set a restrictive umask
---
 expire-old-tickets/expire-old-tickets |2 ++
 1 file changed, 2 insertions(+)

diff --git a/expire-old-tickets/expire-old-tickets 
b/expire-old-tickets/expire-old-tickets
index 3cc82e0..99079e4 100755
--- a/expire-old-tickets/expire-old-tickets
+++ b/expire-old-tickets/expire-old-tickets
@@ -11,6 +11,8 @@
 
 set -e
 
+umask 007
+
 # GnuPG keys used to encrypt the sql dumps
 KEYS=$(grep -v '^[^[:space:]]*#' END_OF_KEYS)
 # andrew

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


[tor-commits] [support-tools/master] Add queue graphs data for September 2014

2014-10-01 Thread lunar
commit 25e96a02b533355fc41cfc0478cf4b6213b56502
Author: Lunar lu...@torproject.org
Date:   Wed Oct 1 10:29:18 2014 +0200

Add queue graphs data for September 2014
---
 queue-graphs/data/2014Q3.csv |6 ++
 1 file changed, 6 insertions(+)

diff --git a/queue-graphs/data/2014Q3.csv b/queue-graphs/data/2014Q3.csv
index 4208896..2d491bc 100644
--- a/queue-graphs/data/2014Q3.csv
+++ b/queue-graphs/data/2014Q3.csv
@@ -11,3 +11,9 @@ month,queue,newtickets
 2014-08,fa,241
 2014-08,fr,33
 2014-08,zh,76
+2014-09,ar,6
+2014-09,en,1210
+2014-09,es,60
+2014-09,fa,127
+2014-09,fr,36
+2014-09,zh,94



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


[tor-commits] [support-tools/master] Add response time data for September 2014

2014-10-01 Thread lunar
commit 30522fa24cd80e5c8c54b9d70b9ee74f1a2ce5c8
Author: Lunar lu...@torproject.org
Date:   Wed Oct 1 10:30:19 2014 +0200

Add response time data for September 2014
---
 response-time/data/2014Q3.csv |  234 +
 1 file changed, 234 insertions(+)

diff --git a/response-time/data/2014Q3.csv b/response-time/data/2014Q3.csv
index fd4b41c..7cc7750 100644
--- a/response-time/data/2014Q3.csv
+++ b/response-time/data/2014Q3.csv
@@ -364,3 +364,237 @@ month,fromhours,tohours,requests
 2014-08,1398,1399,1
 2014-08,2312,2313,1
 2014-08,2975,2976,1
+2014-09,0,1,446
+2014-09,1,2,228
+2014-09,2,3,148
+2014-09,3,4,135
+2014-09,4,5,91
+2014-09,5,6,116
+2014-09,6,7,66
+2014-09,7,8,55
+2014-09,8,9,67
+2014-09,9,10,53
+2014-09,10,11,46
+2014-09,11,12,50
+2014-09,12,13,42
+2014-09,13,14,49
+2014-09,14,15,34
+2014-09,15,16,29
+2014-09,16,17,21
+2014-09,17,18,36
+2014-09,18,19,37
+2014-09,19,20,32
+2014-09,20,21,18
+2014-09,21,22,25
+2014-09,22,23,26
+2014-09,23,24,21
+2014-09,24,25,19
+2014-09,25,26,14
+2014-09,26,27,28
+2014-09,27,28,26
+2014-09,28,29,21
+2014-09,29,30,22
+2014-09,30,31,11
+2014-09,31,32,24
+2014-09,32,33,13
+2014-09,33,34,18
+2014-09,34,35,23
+2014-09,35,36,14
+2014-09,36,37,16
+2014-09,37,38,12
+2014-09,38,39,12
+2014-09,39,40,6
+2014-09,40,41,13
+2014-09,41,42,12
+2014-09,42,43,4
+2014-09,43,44,8
+2014-09,44,45,7
+2014-09,45,46,9
+2014-09,46,47,7
+2014-09,47,48,4
+2014-09,48,49,4
+2014-09,49,50,6
+2014-09,50,51,11
+2014-09,51,52,6
+2014-09,52,53,4
+2014-09,53,54,9
+2014-09,54,55,3
+2014-09,55,56,7
+2014-09,56,57,2
+2014-09,57,58,4
+2014-09,58,59,6
+2014-09,59,60,5
+2014-09,60,61,3
+2014-09,61,62,6
+2014-09,62,63,3
+2014-09,63,64,7
+2014-09,64,65,5
+2014-09,65,66,2
+2014-09,66,67,2
+2014-09,67,68,3
+2014-09,68,69,6
+2014-09,69,70,4
+2014-09,70,71,8
+2014-09,71,72,2
+2014-09,72,73,5
+2014-09,73,74,3
+2014-09,74,75,2
+2014-09,75,76,2
+2014-09,76,77,5
+2014-09,77,78,3
+2014-09,78,79,4
+2014-09,79,80,4
+2014-09,80,81,4
+2014-09,82,83,2
+2014-09,83,84,2
+2014-09,85,86,1
+2014-09,87,88,5
+2014-09,88,89,3
+2014-09,89,90,1
+2014-09,90,91,2
+2014-09,91,92,3
+2014-09,92,93,4
+2014-09,93,94,2
+2014-09,94,95,2
+2014-09,95,96,4
+2014-09,96,97,5
+2014-09,97,98,1
+2014-09,98,99,5
+2014-09,99,100,1
+2014-09,100,101,1
+2014-09,101,102,2
+2014-09,102,103,2
+2014-09,103,104,3
+2014-09,106,107,1
+2014-09,107,108,4
+2014-09,110,111,1
+2014-09,111,112,2
+2014-09,112,113,1
+2014-09,113,114,1
+2014-09,114,115,4
+2014-09,115,116,5
+2014-09,116,117,1
+2014-09,118,119,5
+2014-09,119,120,2
+2014-09,120,121,2
+2014-09,121,122,2
+2014-09,122,123,2
+2014-09,123,124,2
+2014-09,124,125,2
+2014-09,125,126,1
+2014-09,127,128,1
+2014-09,128,129,1
+2014-09,130,131,2
+2014-09,133,134,3
+2014-09,135,136,4
+2014-09,136,137,3
+2014-09,137,138,3
+2014-09,138,139,2
+2014-09,139,140,1
+2014-09,140,141,3
+2014-09,142,143,1
+2014-09,143,144,3
+2014-09,145,146,1
+2014-09,147,148,3
+2014-09,148,149,1
+2014-09,149,150,2
+2014-09,150,151,1
+2014-09,154,155,1
+2014-09,155,156,1
+2014-09,160,161,1
+2014-09,162,163,1
+2014-09,163,164,2
+2014-09,166,167,1
+2014-09,167,168,1
+2014-09,170,171,2
+2014-09,171,172,1
+2014-09,172,173,1
+2014-09,174,175,1
+2014-09,175,176,1
+2014-09,177,178,1
+2014-09,180,181,1
+2014-09,183,184,3
+2014-09,184,185,1
+2014-09,187,188,1
+2014-09,189,190,1
+2014-09,197,198,1
+2014-09,200,201,1
+2014-09,202,203,1
+2014-09,206,207,1
+2014-09,209,210,2
+2014-09,210,211,2
+2014-09,211,212,1
+2014-09,214,215,1
+2014-09,225,226,1
+2014-09,234,235,2
+2014-09,235,236,1
+2014-09,237,238,1
+2014-09,242,243,1
+2014-09,243,244,1
+2014-09,247,248,1
+2014-09,255,256,1
+2014-09,257,258,1
+2014-09,258,259,1
+2014-09,266,267,1
+2014-09,274,275,1
+2014-09,275,276,1
+2014-09,276,277,1
+2014-09,279,280,1
+2014-09,297,298,1
+2014-09,300,301,1
+2014-09,311,312,2
+2014-09,314,315,1
+2014-09,321,322,2
+2014-09,322,323,1
+2014-09,327,328,1
+2014-09,352,353,1
+2014-09,353,354,1
+2014-09,377,378,1
+2014-09,391,392,1
+2014-09,436,437,1
+2014-09,478,479,1
+2014-09,550,551,1
+2014-09,768,769,1
+2014-09,858,859,1
+2014-09,1129,1130,1
+2014-09,1132,1133,1
+2014-09,2055,2056,1
+2014-09,2403,2404,1
+2014-09,2537,2538,1
+2014-09,4921,4922,1
+2014-09,5057,5058,1
+2014-09,5374,5375,1
+2014-09,5393,5394,1
+2014-09,5534,5535,1
+2014-09,5712,5713,1
+2014-09,5814,5815,1
+2014-09,6000,6001,1
+2014-09,6050,6051,1
+2014-09,6118,6119,1
+2014-09,6216,6217,1
+2014-09,6274,6275,1
+2014-09,6280,6281,1
+2014-09,6397,6398,1
+2014-09,6463,6464,1
+2014-09,6467,6468,1
+2014-09,6469,6470,1
+2014-09,7018,7019,1
+2014-09,7196,7197,1
+2014-09,7575,7576,1
+2014-09,8684,8685,1
+2014-09,9882,9883,1
+2014-09,9883,9884,1
+2014-09,10154,10155,1
+2014-09,10624,10625,1
+2014-09,10841,10842,1
+2014-09,11277,11278,1
+2014-09,11289,11290,1
+2014-09,11580,11581,1
+2014-09,11600,11601,1
+2014-09,11658,11659,1
+2014-09,11699,11700,1
+2014-09,11775,11776,1
+2014-09,11860,11861,1
+2014-09,12280,12281,1
+2014-09,12328,12329,1
+2014-09,12412,12413,1

[tor-commits] [support-tools/master] expire-old-tickets: add new script to remove old information from RT database

2014-09-26 Thread lunar
commit b86a05ebfc3c5145191a17079a6601c4300dd749
Author: Lunar lu...@torproject.org
Date:   Fri Sep 26 15:10:45 2014 +0200

expire-old-tickets: add new script to remove old information from RT 
database
---
 expire-old-tickets/expire-old-tickets |  123 +
 1 file changed, 123 insertions(+)

diff --git a/expire-old-tickets/expire-old-tickets 
b/expire-old-tickets/expire-old-tickets
new file mode 100755
index 000..3cc82e0
--- /dev/null
+++ b/expire-old-tickets/expire-old-tickets
@@ -0,0 +1,123 @@
+#!/bin/sh
+#
+# This program is free software. It comes without any warranty, to
+# the extent permitted by applicable law. You can redistribute it
+# and/or modify it under the terms of the Do What The Fuck You Want
+# To Public License, Version 2, as published by Sam Hocevar. See
+# http://sam.zoy.org/wtfpl/COPYING for more details.
+#
+# This script will use rt-shredder to remove old tickets and users from the RT
+# database, and then encrypt the saved sqldump.
+
+set -e
+
+# GnuPG keys used to encrypt the sql dumps
+KEYS=$(grep -v '^[^[:space:]]*#' END_OF_KEYS)
+# andrew
+0291ECCBE42B22068E685545627DEE286B4D6475
+# roger
+F65CE37F04BA5B360AE6EE17C218525819F78451
+# nick
+B35BF85BF19489D04E28C33C21194EBB165733EA
+# mikeperry
+C963C21D63564E2B10BB335B29846B3C683686CC
+# lunar
+0603CCFD91865C17E88D4C798382C95C29023DF9
+END_OF_KEYS
+
+# How long must we keep old tickets
+EXPIRE_AFTER=100 # days
+
+# Where to write the SQL dumps
+DUMP_DIR=/srv/rtstuff/shredded
+
+# Free space requirement in $DUMP_DIR
+MIN_STORAGE_SPACE=50 # MB
+
+warn_about_upcoming_expirations() {
+   local key
+   local info
+   local main_uid
+   local expiration_date
+   local in_ten_days_epoch
+   local expiration_epoch
+
+   for key in $KEYS; do
+   info=$(gpg --batch --quiet --list-keys --with-colons $key)
+   main_uid=$(echo $info | awk -F: '$1 ~ /^pub$/ { print $10 
}')
+   for expiration_date in $(echo $info | awk -F: '$2 ~ /^[^e]$/ 
{ if (($1 == pub) || ($1 == sub  $12 == e)) { print $7 } }'); do
+   in_ten_days_epoch=$(date --date='+10 days' +%s)
+   expiration_epoch=$(date --date=$expiration_date +%s)
+   if [ $in_ten_days_epoch -gt $expiration_epoch ]; 
then
+   echo Warning! $main_uid expires on 
$expiration_date.
+   fi
+   done
+   done
+}
+
+encrypt() {
+   local key
+   local recipients
+
+   for key in $KEYS; do
+   recipients=${recipients:+$recipients }--recipient $key
+   done
+   gpg --batch --always-trust $recipients --encrypt
+}
+
+is_encryption_working() {
+   echo 'test' | encrypt  /dev/null
+
+}
+
+is_there_enough_free_space() {
+   local free_space
+   local min_space_in_kbytes
+
+   free_space=$(df -P -k $DUMP_DIR | awk '/^\// { print $4 }')
+   min_space_in_kbytes=$(expr $MIN_STORAGE_SPACE '*' 1024 '*' 1024)
+   test $free_space -le $min_space_in_kbytes
+}
+
+fill_rt_config() {
+   local file=$1
+
+   cat /etc/request-tracker4/RT_SiteConfig.d/[0-9][0-9]*  $file
+   echo 1;  $file
+}
+
+if ! [ -d $DUMP_DIR ]; then
+   echo $DUMP_DIR does not exist. Exiting. 2
+   exit 1
+fi
+
+if ! is_there_enough_free_space; then
+   echo $DUMP_DIR has less than $MIN_STORAGE_SPACE MB of available disk 
space. Exiting. 2
+   exit 1
+fi
+
+warn_about_upcoming_expirations
+
+if ! is_encryption_working; then
+   echo Encryption is not working as it should. Exiting. 2
+   exit 1
+fi
+
+# Re-create RT_SiteConfig.pm from .d directory as we don't have the rights to
+# read /etc/request-tracker4/RT_SiteConfig.pm
+TMP_SITE_CONFIG=$(mktemp)
+trap rm -f '$TMP_SITE_CONFIG' EXIT
+
+fill_rt_config $TMP_SITE_CONFIG
+
+DATE=$(date --date=-$EXPIRE_AFTER days +%Y-%m-%d)
+TICKETS_SQL=$DUMP_DIR/tickets-shredded-$DATE.sql
+USERS_SQL=$DUMP_DIR/users-shredded-$DATE.sql
+
+RT_SITE_CONFIG=$TMP_SITE_CONFIG /usr/sbin/rt-shredder --force --sqldump 
$TICKETS_SQL --plugin Tickets=query,(Status = 'resolved' OR Status = 
'rejected' OR Status = 'deleted') AND LastUpdated  '$DATE';limit,9
+xz --stdout --compress $TICKETS_SQL | encrypt  $TICKETS_SQL.xz.gpg
+shred -u -n 1 $TICKETS_SQL
+
+RT_SITE_CONFIG=$TMP_SITE_CONFIG /usr/sbin/rt-shredder --force --sqldump 
$USERS_SQL --plugin 
Users=status,any;member_of,Unprivileged;no_tickets,1;replace_relations,Nobody;limit,9
+xz --stdout --compress $USERS_SQL | encrypt  $USERS_SQL.xz.gpg
+shred -u -n 1 $USERS_SQL

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


[tor-commits] [support-tools/master] Add queue graphs data for August 2014

2014-09-01 Thread lunar
commit d7779f9a0a065b3d9142b94de297183faaa7
Author: Lunar lu...@torproject.org
Date:   Tue Sep 2 01:01:00 2014 +

Add queue graphs data for August 2014
---
 queue-graphs/data/2014Q3.csv |6 ++
 1 file changed, 6 insertions(+)

diff --git a/queue-graphs/data/2014Q3.csv b/queue-graphs/data/2014Q3.csv
index 4ce9d25..4208896 100644
--- a/queue-graphs/data/2014Q3.csv
+++ b/queue-graphs/data/2014Q3.csv
@@ -5,3 +5,9 @@ month,queue,newtickets
 2014-07,fa,156
 2014-07,fr,37
 2014-07,zh,73
+2014-08,ar,8
+2014-08,en,1098
+2014-08,es,61
+2014-08,fa,241
+2014-08,fr,33
+2014-08,zh,76



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


[tor-commits] [support-tools/master] Add response time data for August 2014

2014-09-01 Thread lunar
commit 3998c080d4300e6ed215668f08808ac1b99ab1a4
Author: Lunar lu...@torproject.org
Date:   Tue Sep 2 01:02:23 2014 +

Add response time data for August 2014
---
 response-time/data/2014Q3.csv |  189 +
 1 file changed, 189 insertions(+)

diff --git a/response-time/data/2014Q3.csv b/response-time/data/2014Q3.csv
index 1dab19e..fd4b41c 100644
--- a/response-time/data/2014Q3.csv
+++ b/response-time/data/2014Q3.csv
@@ -175,3 +175,192 @@ month,fromhours,tohours,requests
 2014-07,4850,4851,1
 2014-07,5740,5741,1
 2014-07,7271,7272,1
+2014-08,0,1,331
+2014-08,1,2,153
+2014-08,2,3,114
+2014-08,3,4,92
+2014-08,4,5,82
+2014-08,5,6,82
+2014-08,6,7,60
+2014-08,7,8,69
+2014-08,8,9,70
+2014-08,9,10,41
+2014-08,10,11,57
+2014-08,11,12,52
+2014-08,12,13,48
+2014-08,13,14,40
+2014-08,14,15,39
+2014-08,15,16,47
+2014-08,16,17,47
+2014-08,17,18,39
+2014-08,18,19,35
+2014-08,19,20,39
+2014-08,20,21,45
+2014-08,21,22,34
+2014-08,22,23,39
+2014-08,23,24,37
+2014-08,24,25,34
+2014-08,25,26,30
+2014-08,26,27,29
+2014-08,27,28,26
+2014-08,28,29,16
+2014-08,29,30,17
+2014-08,30,31,24
+2014-08,31,32,11
+2014-08,32,33,21
+2014-08,33,34,20
+2014-08,34,35,13
+2014-08,35,36,19
+2014-08,36,37,8
+2014-08,37,38,14
+2014-08,38,39,9
+2014-08,39,40,19
+2014-08,40,41,12
+2014-08,41,42,13
+2014-08,42,43,9
+2014-08,43,44,13
+2014-08,44,45,13
+2014-08,45,46,12
+2014-08,46,47,11
+2014-08,47,48,21
+2014-08,48,49,13
+2014-08,49,50,9
+2014-08,50,51,14
+2014-08,51,52,6
+2014-08,52,53,12
+2014-08,53,54,10
+2014-08,54,55,13
+2014-08,55,56,7
+2014-08,56,57,10
+2014-08,57,58,9
+2014-08,58,59,4
+2014-08,59,60,7
+2014-08,60,61,3
+2014-08,61,62,7
+2014-08,62,63,4
+2014-08,63,64,3
+2014-08,64,65,5
+2014-08,65,66,4
+2014-08,66,67,6
+2014-08,67,68,6
+2014-08,68,69,6
+2014-08,69,70,5
+2014-08,70,71,6
+2014-08,71,72,12
+2014-08,72,73,6
+2014-08,73,74,7
+2014-08,74,75,3
+2014-08,75,76,7
+2014-08,76,77,5
+2014-08,77,78,4
+2014-08,78,79,3
+2014-08,79,80,4
+2014-08,80,81,3
+2014-08,81,82,3
+2014-08,82,83,4
+2014-08,83,84,6
+2014-08,84,85,3
+2014-08,85,86,1
+2014-08,86,87,5
+2014-08,87,88,4
+2014-08,88,89,3
+2014-08,89,90,4
+2014-08,90,91,5
+2014-08,91,92,7
+2014-08,92,93,4
+2014-08,93,94,5
+2014-08,94,95,5
+2014-08,95,96,5
+2014-08,96,97,9
+2014-08,97,98,3
+2014-08,98,99,2
+2014-08,99,100,3
+2014-08,100,101,6
+2014-08,101,102,4
+2014-08,102,103,4
+2014-08,103,104,1
+2014-08,105,106,1
+2014-08,106,107,3
+2014-08,107,108,1
+2014-08,108,109,1
+2014-08,110,111,1
+2014-08,111,112,4
+2014-08,112,113,3
+2014-08,113,114,3
+2014-08,114,115,3
+2014-08,115,116,1
+2014-08,116,117,5
+2014-08,117,118,3
+2014-08,118,119,1
+2014-08,119,120,2
+2014-08,120,121,3
+2014-08,121,122,1
+2014-08,125,126,1
+2014-08,126,127,1
+2014-08,127,128,2
+2014-08,129,130,1
+2014-08,130,131,1
+2014-08,131,132,1
+2014-08,132,133,1
+2014-08,133,134,2
+2014-08,134,135,1
+2014-08,135,136,1
+2014-08,136,137,2
+2014-08,137,138,2
+2014-08,139,140,3
+2014-08,140,141,2
+2014-08,141,142,1
+2014-08,142,143,2
+2014-08,143,144,3
+2014-08,144,145,2
+2014-08,145,146,1
+2014-08,146,147,2
+2014-08,148,149,1
+2014-08,149,150,2
+2014-08,150,151,1
+2014-08,151,152,1
+2014-08,158,159,1
+2014-08,159,160,1
+2014-08,162,163,1
+2014-08,163,164,1
+2014-08,165,166,1
+2014-08,170,171,1
+2014-08,171,172,2
+2014-08,173,174,2
+2014-08,177,178,1
+2014-08,179,180,1
+2014-08,180,181,2
+2014-08,183,184,2
+2014-08,184,185,1
+2014-08,186,187,2
+2014-08,187,188,1
+2014-08,189,190,2
+2014-08,190,191,1
+2014-08,195,196,2
+2014-08,200,201,1
+2014-08,204,205,1
+2014-08,205,206,2
+2014-08,206,207,1
+2014-08,214,215,1
+2014-08,220,221,1
+2014-08,234,235,1
+2014-08,238,239,1
+2014-08,247,248,1
+2014-08,266,267,1
+2014-08,289,290,1
+2014-08,293,294,1
+2014-08,311,312,2
+2014-08,352,353,1
+2014-08,377,378,1
+2014-08,436,437,2
+2014-08,466,467,1
+2014-08,540,541,1
+2014-08,551,552,1
+2014-08,557,558,1
+2014-08,860,861,1
+2014-08,943,944,1
+2014-08,1187,1188,1
+2014-08,1223,1224,1
+2014-08,1398,1399,1
+2014-08,2312,2313,1
+2014-08,2975,2976,1

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


[tor-commits] r26914: {website} Remove obsolete statement about working on Chrome APIs in th (website/trunk/docs/en)

2014-08-12 Thread Lunar
Author: lunar
Date: 2014-08-12 11:16:13 + (Tue, 12 Aug 2014)
New Revision: 26914

Modified:
   website/trunk/docs/en/faq.wml
Log:
Remove obsolete statement about working on Chrome APIs in the FAQ

The answer is still probably not optimal, but previously it was misleading.
Wording courtesy of Sebastian.


Modified: website/trunk/docs/en/faq.wml
===
--- website/trunk/docs/en/faq.wml   2014-08-07 18:15:54 UTC (rev 26913)
+++ website/trunk/docs/en/faq.wml   2014-08-12 11:16:13 UTC (rev 26914)
@@ -1277,15 +1277,16 @@
 Chrome/IE/Opera/etc with Tor./a/h3
 
 p
-In short, using any browser besides Tor Browser Bundle with Tor is a
+In short, using any browser besides Tor Browser with Tor is a
 really bad idea.
 /p
 
 p
-We're working with the Chrome team to a
-href=https://blog.torproject.org/blog/google-chrome-incognito-mode-tor-and-fingerprinting;fix
 some bugs and missing APIs in Chrome/a so it
-will be possible to write a Torbutton for Chrome. No support for any
-other browser is on the horizon.
+Our efforts to work with the Chrome team to a
+href=https://blog.torproject.org/blog/google-chrome-incognito-mode-tor-and-fingerprinting;add
+missing APIs/a were unsuccessful, unfortunately. Currently, it is impossible
+to use other browsers and get the same level of protections as when using the
+Tor Browser.
 /p
 
 hr

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


[tor-commits] [support-tools/master] Add queue graphs data for July 2014

2014-08-01 Thread lunar
commit 692cf5256bdbf7957b1e1f07697a495833600c9d
Author: Lunar lu...@torproject.org
Date:   Fri Aug 1 13:14:04 2014 +0200

Add queue graphs data for July 2014
---
 queue-graphs/data/2014Q3.csv |7 +++
 1 file changed, 7 insertions(+)

diff --git a/queue-graphs/data/2014Q3.csv b/queue-graphs/data/2014Q3.csv
new file mode 100644
index 000..4ce9d25
--- /dev/null
+++ b/queue-graphs/data/2014Q3.csv
@@ -0,0 +1,7 @@
+month,queue,newtickets
+2014-07,ar,7
+2014-07,en,1147
+2014-07,es,52
+2014-07,fa,156
+2014-07,fr,37
+2014-07,zh,73

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


[tor-commits] [support-tools/master] Add response time data for July 2014

2014-08-01 Thread lunar
commit 5a638b89e914bd96759998532a300c6e36a90cf5
Author: Lunar lu...@torproject.org
Date:   Fri Aug 1 13:15:07 2014 +0200

Add response time data for July 2014
---
 response-time/data/2014Q3.csv |  177 +
 1 file changed, 177 insertions(+)

diff --git a/response-time/data/2014Q3.csv b/response-time/data/2014Q3.csv
new file mode 100644
index 000..1dab19e
--- /dev/null
+++ b/response-time/data/2014Q3.csv
@@ -0,0 +1,177 @@
+month,fromhours,tohours,requests
+2014-07,0,1,383
+2014-07,1,2,164
+2014-07,2,3,115
+2014-07,3,4,103
+2014-07,4,5,74
+2014-07,5,6,88
+2014-07,6,7,68
+2014-07,7,8,68
+2014-07,8,9,59
+2014-07,9,10,46
+2014-07,10,11,48
+2014-07,11,12,34
+2014-07,12,13,45
+2014-07,13,14,48
+2014-07,14,15,47
+2014-07,15,16,44
+2014-07,16,17,48
+2014-07,17,18,41
+2014-07,18,19,31
+2014-07,19,20,32
+2014-07,20,21,29
+2014-07,21,22,31
+2014-07,22,23,37
+2014-07,23,24,26
+2014-07,24,25,19
+2014-07,25,26,22
+2014-07,26,27,20
+2014-07,27,28,26
+2014-07,28,29,19
+2014-07,29,30,15
+2014-07,30,31,23
+2014-07,31,32,15
+2014-07,32,33,13
+2014-07,33,34,13
+2014-07,34,35,11
+2014-07,35,36,11
+2014-07,36,37,11
+2014-07,37,38,2
+2014-07,38,39,13
+2014-07,39,40,6
+2014-07,40,41,15
+2014-07,41,42,8
+2014-07,42,43,10
+2014-07,43,44,14
+2014-07,44,45,9
+2014-07,45,46,8
+2014-07,46,47,8
+2014-07,47,48,6
+2014-07,48,49,9
+2014-07,49,50,14
+2014-07,50,51,11
+2014-07,51,52,9
+2014-07,52,53,8
+2014-07,53,54,7
+2014-07,54,55,5
+2014-07,55,56,7
+2014-07,56,57,11
+2014-07,57,58,7
+2014-07,58,59,5
+2014-07,59,60,4
+2014-07,60,61,2
+2014-07,61,62,7
+2014-07,62,63,4
+2014-07,63,64,3
+2014-07,64,65,9
+2014-07,65,66,4
+2014-07,66,67,4
+2014-07,67,68,3
+2014-07,68,69,2
+2014-07,69,70,4
+2014-07,70,71,2
+2014-07,71,72,4
+2014-07,72,73,7
+2014-07,73,74,6
+2014-07,74,75,9
+2014-07,75,76,6
+2014-07,76,77,3
+2014-07,77,78,7
+2014-07,78,79,1
+2014-07,79,80,7
+2014-07,80,81,7
+2014-07,81,82,4
+2014-07,82,83,1
+2014-07,83,84,7
+2014-07,84,85,6
+2014-07,85,86,5
+2014-07,86,87,4
+2014-07,87,88,4
+2014-07,88,89,3
+2014-07,89,90,3
+2014-07,90,91,2
+2014-07,91,92,4
+2014-07,92,93,2
+2014-07,93,94,5
+2014-07,94,95,6
+2014-07,95,96,1
+2014-07,96,97,1
+2014-07,97,98,1
+2014-07,99,100,1
+2014-07,100,101,4
+2014-07,102,103,2
+2014-07,103,104,1
+2014-07,105,106,3
+2014-07,106,107,2
+2014-07,108,109,1
+2014-07,110,111,1
+2014-07,111,112,1
+2014-07,117,118,1
+2014-07,118,119,1
+2014-07,122,123,2
+2014-07,123,124,2
+2014-07,124,125,1
+2014-07,125,126,2
+2014-07,126,127,1
+2014-07,128,129,1
+2014-07,129,130,1
+2014-07,130,131,1
+2014-07,132,133,1
+2014-07,138,139,2
+2014-07,142,143,1
+2014-07,144,145,1
+2014-07,145,146,1
+2014-07,146,147,1
+2014-07,148,149,1
+2014-07,149,150,1
+2014-07,152,153,1
+2014-07,155,156,2
+2014-07,158,159,1
+2014-07,160,161,1
+2014-07,165,166,1
+2014-07,168,169,1
+2014-07,171,172,3
+2014-07,172,173,1
+2014-07,173,174,3
+2014-07,174,175,1
+2014-07,177,178,1
+2014-07,178,179,1
+2014-07,179,180,1
+2014-07,180,181,1
+2014-07,182,183,1
+2014-07,186,187,1
+2014-07,196,197,1
+2014-07,203,204,1
+2014-07,217,218,1
+2014-07,223,224,1
+2014-07,229,230,2
+2014-07,243,244,1
+2014-07,249,250,1
+2014-07,253,254,2
+2014-07,265,266,1
+2014-07,272,273,1
+2014-07,277,278,1
+2014-07,293,294,1
+2014-07,298,299,1
+2014-07,299,300,1
+2014-07,302,303,1
+2014-07,333,334,1
+2014-07,344,345,1
+2014-07,421,422,1
+2014-07,434,435,1
+2014-07,436,437,1
+2014-07,505,506,1
+2014-07,507,508,1
+2014-07,527,528,1
+2014-07,696,697,1
+2014-07,938,939,1
+2014-07,1046,1047,1
+2014-07,1171,1172,1
+2014-07,1218,1219,1
+2014-07,3073,3074,1
+2014-07,3655,3656,1
+2014-07,3803,3804,1
+2014-07,4305,4306,1
+2014-07,4850,4851,1
+2014-07,5740,5741,1
+2014-07,7271,7272,1

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


[tor-commits] r26882: {website} Add a FAQ entry about outgoing filters for Tor relays (website/trunk/docs/en)

2014-07-22 Thread Lunar
Author: lunar
Date: 2014-07-22 09:26:34 + (Tue, 22 Jul 2014)
New Revision: 26882

Modified:
   website/trunk/docs/en/faq.wml
Log:
Add a FAQ entry about outgoing filters for Tor relays


Modified: website/trunk/docs/en/faq.wml
===
--- website/trunk/docs/en/faq.wml   2014-07-22 06:35:49 UTC (rev 26881)
+++ website/trunk/docs/en/faq.wml   2014-07-22 09:26:34 UTC (rev 26882)
@@ -198,6 +198,7 @@
 account?/a/li
 lia href=#WrongIPMy relay is picking the wrong IP address./a/li
 lia href=#BehindANATI'm behind a NAT/Firewall/a/li
+lia href=#OutgoingFirewallHow should I configure my outgoing 
filters?/a/li
 lia href=#RelayMemoryWhy is my Tor relay using so much memory?
 /a/li
 lia href=#BetterAnonymityDo I get better anonymity if I run a relay?
@@ -2332,6 +2333,28 @@
 
 hr
 
+a id=OutgoingFirewall/a
+h3a class=anchor href=#BandwidthShapingHow should I configure
+my outgoing filters?/a/h3
+
+p
+Tor design assumes that any relay can reach every other relays. So
+all emoutgoing/em connections must be allowed.
+/p
+p
+Tor is promoting free network access without interference.
+Exit nodes must not attempt to filter any traffic coming from the
+Tor network. Selecting outgoing traffic is likely to forfeit the
+protections usually given to emcommon carriers/em in many
+jurisdictions.
+/p
+p
+Exit nodes which filter traffic will get the a
+href=#WhatIsTheBadExitFlagBadExit/a flag once detected.
+/p
+
+hr
+
 a id=BandwidthShaping/a
 h3a class=anchor href=#BandwidthShapingWhat bandwidth shaping
 options are available to Tor relays?/a/h3

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


[tor-commits] r26884: {website} Remove duplication about outgoing firewalls by splitting use (website/trunk/docs/en)

2014-07-22 Thread Lunar
Author: lunar
Date: 2014-07-22 16:24:08 + (Tue, 22 Jul 2014)
New Revision: 26884

Modified:
   website/trunk/docs/en/faq.wml
Log:
Remove duplication about outgoing firewalls by splitting uses cases between 
client and relay


Modified: website/trunk/docs/en/faq.wml
===
--- website/trunk/docs/en/faq.wml   2014-07-22 13:46:17 UTC (rev 26883)
+++ website/trunk/docs/en/faq.wml   2014-07-22 16:24:08 UTC (rev 26884)
@@ -48,8 +48,8 @@
 lia href=#IsItWorkingHow can I tell if Tor is working, and that my
 connections really are anonymized?/a/li
 lia href=#MobileCan I use Tor on my phone or mobile device?/a/li
-lia href=#OutboundPortsDo I have to open all these outbound ports
-on my firewall?/a/li
+lia href=#OutboundPortsWhich outbound ports must be open when
+using Tor as a client?/a/li
 lia href=#FTPHow do I use my browser for ftp with Tor?/a/li
 lia href=#NoDataScrubbingDoes Tor remove personal information
 from the data my application sends?/a/li
@@ -882,10 +882,9 @@
 
 hr
 
- a id=OutboundPorts/a
-h3a class=anchor href=#OutboundPortsDo I have to open all these
-outbound ports on my firewall?/a/h3
-
+a id=OutboundPorts/a
+h3a class=anchor href=#OutboundPortsWhich outbound ports must be 
open when
+using Tor as a client?/a/h3
 p
 Tor may attempt to connect to any port that is advertised in the
 directory as an ORPort (for making Tor connections) or a DirPort (for
@@ -894,7 +893,7 @@
 ports too.
 /p
 p
-As a client: you could probably get away with opening only those four
+When using Tor as a client, you could probably get away with opening only 
those four
 ports. Since Tor does all its connections in the background, it will retry
 ones that fail, and hopefully you'll never have to know that it failed, as
 long as it finds a working one often enough. However, to get the most
@@ -905,14 +904,6 @@
 you want to explicitly tell your Tor client which ports are reachable
 for you.
 /p
-p
-As a relay: you must allow outgoing connections to every other relay
-and to anywhere your exit policy advertises that you allow. The
-cleanest way to do that is simply to allow all outgoing connections
-at your firewall. If you don't, clients will ask you to extend to
-those relays, and those connections will fail, leading to complex
-anonymity implications for the clients which we'd like to avoid.
-/p
 
 hr
 
@@ -2334,7 +2325,7 @@
 hr
 
 a id=OutgoingFirewall/a
-h3a class=anchor href=#BandwidthShapingHow should I configure
+h3a class=anchor href=#OutgoingFirewallHow should I configure
 my outgoing filters?/a/h3
 
 p

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


[tor-commits] [support-tools/master] Add scripts to monitor changes to RT articles

2014-07-18 Thread lunar
commit 26e45154a20650fa8d2ae2c2891f7aa864d7d750
Author: Lunar lu...@torproject.org
Date:   Fri Jul 18 15:54:13 2014 +0200

Add scripts to monitor changes to RT articles
---
 rt-articles/README  |   69 +++
 rt-articles/dump_rt_articles|   69 +++
 rt-articles/push_rt_articles|   11 +++
 rt-articles/receive_rt_articles |   19 +++
 4 files changed, 168 insertions(+)

diff --git a/rt-articles/README b/rt-articles/README
new file mode 100644
index 000..7fb39c2
--- /dev/null
+++ b/rt-articles/README
@@ -0,0 +1,69 @@
+This is a set of script to extract RT articles from the database and
+track when they change.
+
+Setup notes
+===
+
+Two systems are involved. rude.torproject.org which hosts RT and
+perdulce.torproject.org which hosts people.torproject.org. We are going
+to allow a very restricted push of data from the formor to the latter.
+
+On rude.torproject.org
+--
+
+Create SSH key:
+
+ssh-keygen -t rsa -b 4096 -N '' -f .ssh/id_rsa_rt_articles
+
+Configure SSH (through `~/.ssh/config`):
+
+Host perdulce.torproject.org
+BatchMode yes
+IdentityFile ~/.ssh/id_rsa_rt_articles
+
+Add cron job:
+
+17,47 * * * * /srv/rtstuff/support-tools/rt-articles/push_rt_articles
+
+On perdulce.torproject.org
+--
+
+Install the public key from rude. To do that, use email interface of
+ud-ldap: https://db.debian.org/doc-mail.html. *But replace
+`debian.org` with `torproject.org`!*
+
+ssh-rsa …== usual key
+allowed_hosts=perdulce.debian.org 
from=rude.torproject.org,command=~/bin/receive_rt_articles,no-pty,no-port-forwarding
 ssh-rsa …== key from rude
+
+Create the Git repository:
+
+cd public_html
+mkdir rt-articles.git  cd rt-articles.git
+git init --bare
+vi description
+mv hooks/post-update.sample hooks/post-update
+chmod +x hooks/post-update
+
+Configure the email notification:
+
+echo 'sh /usr/share/git-core/contrib/hooks/post-receive-email'  
hooks/post-receive
+chmod +x hooks/post-receive
+git config hooks.mailinglist lu...@torproject.org
+git config hooks.envelopesender lunar+rt-artic...@torproject.org
+git config hooks.emailprefix '[RT Articles] '
+git config hooks.diffopts '--stat --summary --find-copies-harder -p'
+
+Do the initial clone:
+
+cd $HOME
+git clone public_html/rt-articles.git
+
+Also clone the script repository:
+
+cd $HOME
+git clone https://git.torproject.org/support-tools.git
+
+And add the symlink:
+
+mkdir -p bin
+ln -s ../support-tools/receive_rt_articles bin
diff --git a/rt-articles/dump_rt_articles b/rt-articles/dump_rt_articles
new file mode 100755
index 000..b47bf2f
--- /dev/null
+++ b/rt-articles/dump_rt_articles
@@ -0,0 +1,69 @@
+#!/usr/bin/python
+#
+# This program is free software. It comes without any warranty, to
+# the extent permitted by applicable law. You can redistribute it
+# and/or modify it under the terms of the Do What The Fuck You Want
+# To Public License, Version 2, as published by Sam Hocevar. See
+# http://sam.zoy.org/wtfpl/COPYING for more details.
+#
+# This script will dump all RT articles to a given directory.
+# Ideally, the directory should be empty.
+
+import psycopg2
+import re
+import sys
+import os
+import os.path
+
+RT_CONNINFO = host=drobovi.torproject.org sslmode=require user=rtreader 
dbname=rt
+
+SELECT_TRANSACTIONS_QUERY = 
+SELECT classes.name AS class,
+   articles.name AS title,
+   CASE WHEN objectcustomfieldvalues.content != '' THEN 
objectcustomfieldvalues.content
+ELSE objectcustomfieldvalues.largecontent
+   END AS content,
+   objectcustomfieldvalues.lastupdated,
+   articles.id
+  FROM classes, articles, objectcustomfieldvalues
+ WHERE articles.class = classes.id
+   AND objectcustomfieldvalues.objecttype = 'RT::Article'
+   AND objectcustomfieldvalues.objectid = articles.id
+   AND objectcustomfieldvalues.id = (
+   SELECT objectcustomfieldvalues.id
+ FROM objectcustomfieldvalues
+WHERE objectcustomfieldvalues.objectid = articles.id
+  AND objectcustomfieldvalues.disabled = 0
+ORDER BY objectcustomfieldvalues.lastupdated DESC
+LIMIT 1)
+ ORDER BY classes.id, articles.id
+
+
+def slugify(title):
+return re.sub(r'\W+', '-', title)
+
+def dump_rt_articles(con, path):
+cur = con.cursor()
+cur.execute(SELECT_TRANSACTIONS_QUERY)
+for article_class, title, content, last_updated, article_id in cur:
+class_slug = slugify(article_class)
+class_dir = os.path.join(path, class_slug)
+if not os.path.isdir(class_dir):
+os.mkdir(class_dir)
+filename = os.path.join(class_dir, %03d_%s % (article_id, 
slugify(title)))
+with open(filename, 'w') as f:
+f.write('Title: %s\n' % title)
+f.write

[tor-commits] [support-tools/master] rt-articles: fix path in README

2014-07-18 Thread lunar
commit b2fb521087af61de2b2a770d6b5bd53607373d70
Author: Lunar lu...@torproject.org
Date:   Fri Jul 18 15:56:56 2014 +0200

rt-articles: fix path in README
---
 rt-articles/README |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rt-articles/README b/rt-articles/README
index 7fb39c2..d89e94e 100644
--- a/rt-articles/README
+++ b/rt-articles/README
@@ -66,4 +66,4 @@ Also clone the script repository:
 And add the symlink:
 
 mkdir -p bin
-ln -s ../support-tools/receive_rt_articles bin
+ln -s ../support-tools/rt-articles/receive_rt_articles bin

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


[tor-commits] [support-tools/master] Add response time data for 2014Q2

2014-06-30 Thread lunar
commit 4595261e794161d9ba10da92fe7e146e183bf7e8
Author: Lunar lu...@torproject.org
Date:   Tue Jul 1 06:20:37 2014 +0200

Add response time data for 2014Q2
---
 response-time/data/2014Q2.csv |  646 +
 1 file changed, 646 insertions(+)

diff --git a/response-time/data/2014Q2.csv b/response-time/data/2014Q2.csv
new file mode 100644
index 000..b074628
--- /dev/null
+++ b/response-time/data/2014Q2.csv
@@ -0,0 +1,646 @@
+month,fromhours,tohours,requests
+2014-04,0,1,258
+2014-04,1,2,129
+2014-04,2,3,89
+2014-04,3,4,85
+2014-04,4,5,77
+2014-04,5,6,67
+2014-04,6,7,71
+2014-04,7,8,54
+2014-04,8,9,59
+2014-04,9,10,62
+2014-04,10,11,58
+2014-04,11,12,52
+2014-04,12,13,62
+2014-04,13,14,65
+2014-04,14,15,41
+2014-04,15,16,44
+2014-04,16,17,42
+2014-04,17,18,51
+2014-04,18,19,36
+2014-04,19,20,36
+2014-04,20,21,34
+2014-04,21,22,43
+2014-04,22,23,24
+2014-04,23,24,25
+2014-04,24,25,19
+2014-04,25,26,21
+2014-04,26,27,25
+2014-04,27,28,14
+2014-04,28,29,17
+2014-04,29,30,16
+2014-04,30,31,25
+2014-04,31,32,16
+2014-04,32,33,16
+2014-04,33,34,26
+2014-04,34,35,13
+2014-04,35,36,10
+2014-04,36,37,19
+2014-04,37,38,15
+2014-04,38,39,13
+2014-04,39,40,15
+2014-04,40,41,15
+2014-04,41,42,9
+2014-04,42,43,18
+2014-04,43,44,14
+2014-04,44,45,12
+2014-04,45,46,11
+2014-04,46,47,9
+2014-04,47,48,9
+2014-04,48,49,13
+2014-04,49,50,6
+2014-04,50,51,14
+2014-04,51,52,7
+2014-04,52,53,9
+2014-04,53,54,13
+2014-04,54,55,5
+2014-04,55,56,9
+2014-04,56,57,9
+2014-04,57,58,10
+2014-04,58,59,8
+2014-04,59,60,3
+2014-04,60,61,2
+2014-04,61,62,8
+2014-04,62,63,8
+2014-04,63,64,10
+2014-04,64,65,3
+2014-04,65,66,4
+2014-04,66,67,9
+2014-04,67,68,10
+2014-04,68,69,4
+2014-04,69,70,4
+2014-04,70,71,8
+2014-04,71,72,8
+2014-04,72,73,7
+2014-04,73,74,6
+2014-04,74,75,2
+2014-04,75,76,5
+2014-04,76,77,3
+2014-04,77,78,2
+2014-04,78,79,2
+2014-04,79,80,8
+2014-04,80,81,1
+2014-04,81,82,3
+2014-04,82,83,4
+2014-04,83,84,3
+2014-04,84,85,2
+2014-04,85,86,2
+2014-04,86,87,2
+2014-04,87,88,2
+2014-04,88,89,3
+2014-04,89,90,4
+2014-04,90,91,2
+2014-04,91,92,2
+2014-04,92,93,1
+2014-04,93,94,3
+2014-04,94,95,2
+2014-04,95,96,4
+2014-04,96,97,2
+2014-04,97,98,3
+2014-04,98,99,2
+2014-04,99,100,2
+2014-04,100,101,1
+2014-04,101,102,1
+2014-04,102,103,3
+2014-04,103,104,2
+2014-04,104,105,2
+2014-04,105,106,1
+2014-04,106,107,2
+2014-04,107,108,1
+2014-04,108,109,2
+2014-04,111,112,3
+2014-04,112,113,1
+2014-04,113,114,6
+2014-04,114,115,4
+2014-04,115,116,3
+2014-04,116,117,3
+2014-04,117,118,1
+2014-04,118,119,7
+2014-04,119,120,3
+2014-04,122,123,2
+2014-04,125,126,2
+2014-04,128,129,1
+2014-04,129,130,5
+2014-04,131,132,2
+2014-04,133,134,1
+2014-04,134,135,1
+2014-04,137,138,1
+2014-04,138,139,3
+2014-04,139,140,1
+2014-04,140,141,1
+2014-04,142,143,1
+2014-04,143,144,2
+2014-04,144,145,2
+2014-04,145,146,1
+2014-04,146,147,2
+2014-04,147,148,1
+2014-04,150,151,2
+2014-04,151,152,1
+2014-04,152,153,2
+2014-04,155,156,1
+2014-04,157,158,1
+2014-04,159,160,1
+2014-04,162,163,1
+2014-04,163,164,1
+2014-04,164,165,1
+2014-04,165,166,1
+2014-04,168,169,1
+2014-04,175,176,1
+2014-04,179,180,1
+2014-04,184,185,1
+2014-04,185,186,1
+2014-04,187,188,1
+2014-04,188,189,1
+2014-04,191,192,2
+2014-04,200,201,2
+2014-04,201,202,1
+2014-04,220,221,1
+2014-04,240,241,1
+2014-04,246,247,1
+2014-04,270,271,1
+2014-04,275,276,1
+2014-04,310,311,1
+2014-04,338,339,1
+2014-04,345,346,1
+2014-04,348,349,1
+2014-04,354,355,1
+2014-04,368,369,1
+2014-04,370,371,1
+2014-04,371,372,1
+2014-04,372,373,1
+2014-04,373,374,1
+2014-04,374,375,2
+2014-04,383,384,1
+2014-04,386,387,1
+2014-04,393,394,1
+2014-04,395,396,1
+2014-04,396,397,1
+2014-04,407,408,3
+2014-04,408,409,1
+2014-04,411,412,1
+2014-04,412,413,1
+2014-04,414,415,1
+2014-04,419,420,1
+2014-04,428,429,1
+2014-04,437,438,1
+2014-04,443,444,1
+2014-04,444,445,1
+2014-04,447,448,1
+2014-04,453,454,1
+2014-04,459,460,1
+2014-04,474,475,2
+2014-04,481,482,1
+2014-04,487,488,1
+2014-04,490,491,1
+2014-04,494,495,1
+2014-04,495,496,1
+2014-04,497,498,1
+2014-04,499,500,2
+2014-04,503,504,1
+2014-04,507,508,1
+2014-04,523,524,1
+2014-04,526,527,1
+2014-04,528,529,2
+2014-04,529,530,1
+2014-04,535,536,1
+2014-04,537,538,1
+2014-04,547,548,1
+2014-04,553,554,1
+2014-04,563,564,1
+2014-04,564,565,1
+2014-04,565,566,1
+2014-04,574,575,1
+2014-04,580,581,2
+2014-04,598,599,1
+2014-04,616,617,1
+2014-04,625,626,1
+2014-04,654,655,2
+2014-04,760,761,1
+2014-04,792,793,1
+2014-04,850,851,1
+2014-04,898,899,1
+2014-04,919,920,1
+2014-04,1099,1100,1
+2014-04,1677,1678,1
+2014-04,2050,2051,1
+2014-04,2312,2313,1
+2014-04,5579,5580,1
+2014-05,0,1,361
+2014-05,1,2,136
+2014-05,2,3,122
+2014-05,3,4,92
+2014-05,4,5,108
+2014-05,5,6,79
+2014-05,6,7,71
+2014-05,7,8,56
+2014-05,8,9,54
+2014-05,9,10,53
+2014-05,10,11,62
+2014-05,11,12,41
+2014-05,12,13,59
+2014-05,13,14,46
+2014-05,14,15,47
+2014-05,15,16,55
+2014-05,16,17,45
+2014-05,17,18,46
+2014-05,18,19,36
+2014-05,19,20,29
+2014

[tor-commits] [support-tools/master] Add queue graph data for 2014Q2

2014-06-30 Thread lunar
commit e55aa13d60cf624bcc09e246dd11df3baccb53ff
Author: Lunar lu...@torproject.org
Date:   Tue Jul 1 06:21:13 2014 +0200

Add queue graph data for 2014Q2
---
 queue-graphs/data/2014Q2.csv |   18 ++
 1 file changed, 18 insertions(+)

diff --git a/queue-graphs/data/2014Q2.csv b/queue-graphs/data/2014Q2.csv
new file mode 100644
index 000..eb82efc
--- /dev/null
+++ b/queue-graphs/data/2014Q2.csv
@@ -0,0 +1,18 @@
+month,queue,newtickets
+2014-04,ar,12
+2014-04,en,1162
+2014-04,es,63
+2014-04,fa,90
+2014-04,fr,34
+2014-04,zh,50
+2014-05,ar,6
+2014-05,en,1063
+2014-05,es,58
+2014-05,fa,145
+2014-05,fr,41
+2014-06,ar,14
+2014-06,en,998
+2014-06,es,45
+2014-06,fa,87
+2014-06,fr,19
+2014-06,zh,100

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


[tor-commits] r26834: {website} Use canonical spelling for OS X on Tor Browser page (website/trunk/projects/en)

2014-06-14 Thread Lunar
Author: lunar
Date: 2014-06-14 07:11:55 + (Sat, 14 Jun 2014)
New Revision: 26834

Modified:
   website/trunk/projects/en/torbrowser.wml
Log:
Use canonical spelling for OS X on Tor Browser page

Modified: website/trunk/projects/en/torbrowser.wml
===
--- website/trunk/projects/en/torbrowser.wml2014-06-14 07:06:27 UTC (rev 
26833)
+++ website/trunk/projects/en/torbrowser.wml2014-06-14 07:11:55 UTC (rev 
26834)
@@ -37,7 +37,7 @@
 span class=normalTor Browser Bundle/span
   /a
   pInstallation Instructions
-  bra href=#windowsWindows/a bull; a href=#macosxOSX/a 
bull; a href=#linuxLinux/a/p
+  bra href=#windowsWindows/a bull; a href=#macosxOS X/a 
bull; a href=#linuxLinux/a/p
 /div
 div class=pjvids
   h3Quick Videos on how to use the Tor Browser Bundle/h3
@@ -50,7 +50,7 @@
 tda 
href=https://media.torproject.org/video/TBBTraining/TBBTraining-DownloadAndVerify-Windows.mp4;
 Windows/a/td
 tda 
href=https://media.torproject.org/video/TBBTraining/TBBTraining-DownloadAndVerify-MacOS.mp4;
-Apple OSX/a/td
+Apple OS X/a/td
 tda 
href=https://media.torproject.org/video/TBBTraining/TBBTraining-DownloadAndVerify-Linux.mp4;
 Linux/a/td
   /tr
@@ -65,7 +65,7 @@
 tda 
href=https://media.torproject.org/video/torbrowser-docs/How-to-verify-signatures-in-Windows.mp4;
 Windows/a/td
 tda 
href=https://media.torproject.org/video/torbrowser-docs/How-to-verify-signatures-in-OSX.mp4;
-Apple OSX/a/td
+Apple OS X/a/td
 tda 
href=https://media.torproject.org/video/torbrowser-docs/How-to-verify-signatures-in-Linux.mp4;
 Linux/a/td
   /tr --
@@ -74,7 +74,7 @@
 tda 
href=https://media.torproject.org/video/torbrowser-docs/How-to-find-and-use-bridges-in-TBB.mp4;
 Windows/a/td
 tda 
href=https://media.torproject.org/video/torbrowser-docs/How-to-find-and-use-bridges-in-TBB.mp4;
-Apple OSX/a/td
+Apple OS X/a/td
 tda 
href=https://media.torproject.org/video/torbrowser-docs/How-to-find-and-use-bridges-in-TBB.mp4;
 Linux/a/td
   /tr--
@@ -95,7 +95,7 @@
 tr
   thbrLanguage/th
   thMicrosoft Windowsbrem(version-torbrowserbundle)/em/th
-  thMac OSXbrem(version-torbrowserbundleosx32)/em/th
+  thMac OS Xbrem(version-torbrowserbundleosx32)/em/th
   thLinuxbrem(version-torbrowserbundlelinux32)/em/th
 /tr
   /thead
@@ -309,7 +309,7 @@
 
   div id=macosx class=anchor/div
   div class=macosx box
-div class=pjtitleh2Mac OSX Instructions/h2/div
+div class=pjtitleh2Mac OS X Instructions/h2/div
 div class=pjtext
   pDownload the file above, save it somewhere, then click on it.
   Mac OS X will automatically unarchive it and you will have a TorBrowser 
application

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


[tor-commits] [user-manual/master] Enable out-of-source-tree builds

2014-05-28 Thread lunar
commit 44a3777eb38d94319871ba97b25af8b8aa60e50e
Author: Lunar lu...@torproject.org
Date:   Wed May 28 09:22:25 2014 +0200

Enable out-of-source-tree builds

One can now do:

mkdir build-tree  cd build-tree
../user-manual/configure --with-tor-browser-bundle=../tor-browser-bundle
make html

Easy part was sprinkling Makefile.am with appropriate $(srcdir). Symlinks
to the media needs to be done to localized version or to C version as a
fallback.

Less funny was how to deal with xi:include / for the version number.
We use the `-p` option of yelp-build to specify a search path. Works great.
But there's no such option to `itstool` and it errors out if it's unable
to find `type=text` includes (to get include them in translation strings, 
I
presume). So we now include the Tor Browser version in an XML file instead.

Gotcha: yelp rules uses the presence of the C directory to detect if it's
an out-of-tree build. So we must not create a C directory when building.

Let's also re-add a missing variable substitution in configure.ac.
---
 C/index.page   |6 +-
 Makefile.am|   17 +++--
 configure.ac   |3 ++-
 include/tor-browser-version.xml.in |2 ++
 tor-browser-version.txt.in |1 -
 5 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/C/index.page b/C/index.page
index 764fcde..191839f 100644
--- a/C/index.page
+++ b/C/index.page
@@ -6,6 +6,10 @@
   titleTor Browser User Manual/title
   p its:locNote=lt;span/gt; will be replaced by current Tor Browser 
version
 Version:
-span its:translate=noxi:include href=../tor-browser-version.txt 
parse=text//span
+span its:translate=no
+ xi:include href=tor-browser-version.xml parse=xml 
xpointer=xpointer(//text()))
+xi:fallbackUNKNOWN/xi:fallback
+  /xi:include
+/span
   /p
 /page
diff --git a/Makefile.am b/Makefile.am
index a0dfb8d..672ae9e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,8 +6,8 @@ MAL2LATEX = ../mal2latex
 TOR_AND_HTTPS = ../tor-and-https
 
 HELP_ID = tor-browser-user-manual
-HELP_FILES = $(shell cd C  git ls-files '*.page')
-HELP_MEDIA = $(shell cd C  git ls-files 'media')
+HELP_FILES = $(shell cd $(srcdir)/C  git ls-files '*.page')
+HELP_MEDIA = $(shell cd $(srcdir)/C  git ls-files 'media')
 HELP_PLATFORMS = windows macosx linux
 HELP_LINGUAS = @TOR_BROWSER_BUNDLE_LOCALES@
 
@@ -17,7 +17,8 @@ html: all media-symlinks.stamp
for lc in C $(HELP_LINGUAS); do \
for platform in $(HELP_PLATFORMS); do \
mkdir -p html/$$platform/$$lc; \
-   yelp-build html -x platform-$$platform.xslt \
+   yelp-build html -p include \
+   -x 
$(srcdir)/platform-$$platform.xslt \
-o html/$$platform/$$lc $$lc; \
done; \
done
@@ -38,13 +39,17 @@ pdf: all media-symlinks.stamp
done; \
done;
 
-media-symlinks.stamp: all
+media-symlinks.stamp:
set -e  \
-   for lc in C $(HELP_LINGUAS); do \
+   for lc in $(HELP_LINGUAS); do \
for media in $(HELP_MEDIA); do \
if ! [ -f $$lc/$$media ]; then \
mkdir -p $$(dirname $$lc/$$media); \
-   ln -nsf ../../C/$$media $$lc/$$media; \
+   if [ -f $(srcdir)/$$lc/$$media ]; then \
+   ln -nsf 
$(abs_srcdir)/$$lc/$$media $$lc/$$media; \
+   else \
+   ln -nsf $(abs_srcdir)/C/$$media 
$$lc/$$media; \
+   fi; \
fi; \
done; \
done
diff --git a/configure.ac b/configure.ac
index ed8bbcf..a1b12f7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,11 +19,12 @@ if test x$TOR_BROWSER_VERSION = x; then
 fi
 TOR_BROWSER_BUNDLE_LOCALES=$(. $VERSIONS_PATH; echo $BUNDLE_LOCALES)
 
+AC_SUBST(TOR_BROWSER_VERSION)
 AC_SUBST(TOR_BROWSER_BUNDLE_LOCALES)
 
 YELP_HELP_INIT
 
 AC_CONFIG_FILES([Makefile
- tor-browser-version.txt])
+ include/tor-browser-version.xml])
 
 AC_OUTPUT
diff --git a/include/tor-browser-version.xml.in 
b/include/tor-browser-version.xml.in
new file mode 100644
index 000..8cf6628
--- /dev/null
+++ b/include/tor-browser-version.xml.in
@@ -0,0 +1,2 @@
+?xml version=1.0 encoding=UTF-8?
+sys@TOR_BROWSER_VERSION@/sys
diff --git a/tor-browser-version.txt.in b/tor-browser-version.txt.in
deleted file mode 100644
index c675947..000
--- a/tor-browser-version.txt.in
+++ /dev

[tor-commits] [user-manual/master] Add missing build dependency to README

2014-05-28 Thread lunar
commit dc9826402be19fd8822932e79851364911555ef5
Author: Lunar lu...@torproject.org
Date:   Wed May 28 10:08:07 2014 +0200

Add missing build dependency to README
---
 README |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README b/README
index debf14e..17202cf 100644
--- a/README
+++ b/README
@@ -10,7 +10,7 @@ Building the HTML version
 
 Required dependencies on Debian:
 
-autoconf yelp-tools yelp-xsl intltool
+git autoconf yelp-tools yelp-xsl intltool
 
 Bootstrap:
 

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


[tor-commits] [user-manual/master] Restore compatibility with yelp-tools 3.4

2014-05-28 Thread lunar
commit 298acf26d0fdb323caf44355b332e1c2144f60ac
Author: Lunar lu...@torproject.org
Date:   Wed May 28 14:44:00 2014 +0200

Restore compatibility with yelp-tools 3.4

Unfortunately, this requires us to add a en-US lingua (because
we can't create a C directory without breaking out-of-tree builds).
---
 Makefile.am|   14 +-
 en-US/en-US.po |  451 
 2 files changed, 460 insertions(+), 5 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 9f11906..a45aac7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,16 +9,20 @@ HELP_ID = tor-browser-user-manual
 HELP_FILES = $(shell cd $(srcdir)/C  git ls-files '*.page')
 HELP_MEDIA = $(shell cd $(srcdir)/C  git ls-files 'media')
 HELP_PLATFORMS = windows macosx linux
-HELP_LINGUAS = @TOR_BROWSER_BUNDLE_LOCALES@
+HELP_LINGUAS = en-US @TOR_BROWSER_BUNDLE_LOCALES@
 
 .PHONY: html
 html: all media-symlinks.stamp
set -e  \
-   for lc in C $(HELP_LINGUAS); do \
+   for lc in $(HELP_LINGUAS); do \
+   includes=$$(find include -maxdepth 1 -type f) ; \
+   for file in $$includes; do \
+   mkdir -p $$(dirname $$file); \
+   ln -nsf ../$$file $$lc/$$(basename $$file); \
+   done; \
for platform in $(HELP_PLATFORMS); do \
mkdir -p html/$$platform/$$lc; \
-   yelp-build html -p include \
-   -x 
$(srcdir)/platform-$$platform.xslt \
+   yelp-build html -x 
$(srcdir)/platform-$$platform.xslt \
-o html/$$platform/$$lc $$lc; \
for ttf in $$lc/media/*.ttf; do \
cp --preserve=timestamps $$ttf 
html/$$platform/$$lc/media; \
@@ -29,7 +33,7 @@ html: all media-symlinks.stamp
 .PHONY: pdf
 pdf: all media-symlinks.stamp
set -e  \
-   for lc in C $(HELP_LINGUAS); do \
+   for lc in $(HELP_LINGUAS); do \
for platform in $(HELP_PLATFORMS); do \
PDF_DIR=pdf/$$platform/$$lc; \
LATEX_FILE=$(HELP_ID)-$$lc.latex; \
diff --git a/en-US/en-US.po b/en-US/en-US.po
new file mode 100644
index 000..12ef3eb
--- /dev/null
+++ b/en-US/en-US.po
@@ -0,0 +1,451 @@
+msgid 
+msgstr 
+Project-Id-Version: PACKAGE VERSION\n
+POT-Creation-Date: 2014-05-27 18:03+0200\n
+PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n
+Last-Translator: FULL NAME EMAIL@ADDRESS\n
+Language-Team: LANGUAGE l...@li.org\n
+MIME-Version: 1.0\n
+Content-Type: text/plain; charset=UTF-8\n
+Content-Transfer-Encoding: 8bit\n
+
+#. Put one translator per line, in the form NAME EMAIL, YEAR1, YEAR2
+msgctxt _
+msgid translator-credits
+msgstr 
+
+#. This is a reference to an external file such as an image or video. When
+#. the file changes, the md5 hash will change to let you know you need to
+#. update your localized copy. The msgstr is not used at all. Set it to
+#. whatever you like once you have updated your copy of the file.
+#: C/bridges.page:143(media)
+msgctxt _
+msgid external ref='media/tor-launcher-custom-bridges_en-US.png' 
md5='93365c2aa3fb4d627497e83f28a39b7e'
+msgstr 
+
+#: C/bridges.page:7(info/desc)
+msgid What bridges are and how to use them.
+msgstr 
+
+#: C/bridges.page:11(page/title)
+msgid Bridges
+msgstr 
+
+#: C/bridges.page:13(page/p)
+msgid Bridges are quiet gateways into the Tor Network. Like Tor relays, they 
are run by volunteers. Unlike relays, they are not listed publicly. Using 
bridges disguise the fact that one is using Tor.
+msgstr 
+
+#: C/bridges.page:19(page/p)
+msgid Currently there are five bridge types, or transports, available. More 
are being developed.
+msgstr 
+
+#: C/bridges.page:26(td/p)
+msgid ORPort
+msgstr 
+
+#: C/bridges.page:31(td/p)
+msgid Requesting 'bridges' without specifying the bridge type, will return 
ORPort bridges, also called Vanilla bridges. ORPort bridges are NOT reliable 
for circumventing censorship or national firewalls. ORPort bridges can be 
useful as trusted entry points into the Tor network.
+msgstr 
+
+#: C/bridges.page:41(td/p)
+msgid obfs2
+msgstr 
+
+#: C/bridges.page:46(td/p)
+msgid Censors have learned how to identify obfs2 bridges. This transport is 
being deprecated.
+msgstr 
+
+#: C/bridges.page:54(td/p)
+msgid obfs3
+msgstr 
+
+#: C/bridges.page:59(td/p)
+msgid Obfsproxy disguises Tor traffic as random noise. obfs3 bridges work 
almost everywhere. A few obfs3 bridges have been blocked.
+msgstr 
+
+#: C/bridges.page:67(td/p)
+msgid Scramblesuit
+msgstr 
+
+#: C/bridges.page:72(td/p)
+msgid Scramblesuit is an additional tool for the obfsproxy transport. 
Scramblesuit bridges are designed to be hard to identify and hard to block.
+msgstr 
+
+#: C/bridges.page:81(td

[tor-commits] [user-manual/master] Stop abusing sort title and use groups instead

2014-05-27 Thread lunar
commit 4da906a523e95d45aeb6efdf9d8f04f6d169c622
Author: Lunar lu...@torproject.org
Date:   Tue May 27 11:07:34 2014 +0200

Stop abusing sort title and use groups instead

According to Mallard's specification:

Sort titles allow you to specify alternate text to be used when sorting 
the
page or section. Certain automatic link sections will sort the nodes 
they
link to. When this happens, providing a sort title allows you to control
how the node is collated. This is useful for excluding leading articles
such as “an” and “the”.

The order of topic pages on the main index is better controlled by using
grouping capabilities of automatic links.
---
 C/bridges.page |1 -
 C/circumvention.page   |1 -
 C/how-tor-works.page   |3 +--
 C/known-issues.page|3 +--
 C/troubleshooting.page |3 +--
 C/uninstalling.page|1 -
 6 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/C/bridges.page b/C/bridges.page
index 9964928..6c4cc57 100644
--- a/C/bridges.page
+++ b/C/bridges.page
@@ -5,7 +5,6 @@
 
 info
   descWhat bridges are and how to use them./desc
-  title type='sort'05 Bridges/title
   link type=guide xref=index /
 /info
 
diff --git a/C/circumvention.page b/C/circumvention.page
index b228699..5fc1f03 100644
--- a/C/circumvention.page
+++ b/C/circumvention.page
@@ -4,7 +4,6 @@
   id=circumvention
 
 info
-  title type='sort'04 Circumvention/title
   descWhat to do if the Tor network is blocked./desc
   link type=guide xref=index /
 /info
diff --git a/C/how-tor-works.page b/C/how-tor-works.page
index ecbacfa..930a237 100644
--- a/C/how-tor-works.page
+++ b/C/how-tor-works.page
@@ -3,9 +3,8 @@
   id=how-tor-works
 
   info
-title type='sort'01 Tor/title
 descHow Tor works./desc
-link type=guide xref=index/
+link type=guide xref=index group=#first/
   /info
 
   titleTor/title
diff --git a/C/known-issues.page b/C/known-issues.page
index 33e0c7e..327b8be 100644
--- a/C/known-issues.page
+++ b/C/known-issues.page
@@ -5,8 +5,7 @@
 
 info
   descA list of known issues./desc
-  title type='sort'03 Known Issues/title
-  link type=guide xref=index/
+  link type=guide xref=index group=#last /
 /info
 
 titleKnown Issues/title
diff --git a/C/troubleshooting.page b/C/troubleshooting.page
index ca9c480..d1cda52 100644
--- a/C/troubleshooting.page
+++ b/C/troubleshooting.page
@@ -4,9 +4,8 @@
   id=troubleshooting
 
 info
-  title type=sort02 Troubleshooting/title
   descWhat to do if Tor Browser doesn't work./desc
-  link type=guide xref=index/
+  link type=guide xref=index group=#last /
 /info
 
 titleTroubleshooting/title
diff --git a/C/uninstalling.page b/C/uninstalling.page
index 14e875d..5c8ca62 100644
--- a/C/uninstalling.page
+++ b/C/uninstalling.page
@@ -5,7 +5,6 @@
 
 info
   descHow to remove Tor Browser from your system./desc
-  title type='sort'06 Uninstalling/title
   link type=guide xref=index/
 /info
 



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


[tor-commits] [user-manual/master] Rework page about Tor to include warnings and the Tor and HTTPS visual

2014-05-27 Thread lunar
commit d97c9d6f1702e66dc719d697214cfcdf65cb5c2c
Author: Lunar lu...@torproject.org
Date:   Tue May 27 18:04:48 2014 +0200

Rework page about Tor to include warnings and the Tor and HTTPS visual
---
 C/how-tor-works.page |   37 
 C/tor.page   |  228 ++
 Makefile.am  |   12 +++
 3 files changed, 240 insertions(+), 37 deletions(-)

diff --git a/C/how-tor-works.page b/C/how-tor-works.page
deleted file mode 100644
index 930a237..000
--- a/C/how-tor-works.page
+++ /dev/null
@@ -1,37 +0,0 @@
-page xmlns=http://projectmallard.org/1.0/;
-  type=topic
-  id=how-tor-works
-
-  info
-descHow Tor works./desc
-link type=guide xref=index group=#first/
-  /info
-
-  titleTor/title
-  p
-Tor is a network of virtual tunnels that allows you to improve your
-privacy and security on the Internet. Tor works by sending your
-traffic through three random servers (also known as emrelays/em)
-in the Tor network, before the traffic is sent out onto the public
-Internet
-  /p
-  media type=image src=media/how-tor-works.png /
-  p
-The image above illustrates a user browsing to different websites
-over Tor. The green monitors represent relays in the Tor network,
-while the three keys represent the layers of encryption between the
-user and each relay.
-  /p
-  p
-Tor will anonymize the origin of your traffic, and it will encrypt
-everything between you and the Tor network. Tor will also encrypt
-your traffic inside the Tor network, but it cannot encrypt your
-traffic between the Tor network and its final destination.
-  /p
-  p
-If you are communicating sensitive information, for example when
-logging on to a website with a username and password, make sure that
-you are using HTTPS (e.g.  inputemhttps/em://torproject.org//input,
-not inputemhttp/em://torproject.org//input).
-  /p
-/page
diff --git a/C/tor.page b/C/tor.page
new file mode 100644
index 000..2e86158
--- /dev/null
+++ b/C/tor.page
@@ -0,0 +1,228 @@
+page xmlns=http://projectmallard.org/1.0/;
+  xmlns:its=http://www.w3.org/2005/11/its;
+  xmlns:xi=http://www.w3.org/2001/XInclude;
+  type=topic
+  id=tor
+
+  info
+link type=guide xref=index group=#first/
+descLearn what Tor can do to protect your privacy and anonymity./desc
+  /info
+
+  titleTor/title
+
+  section id=what-tor-will-do
+titleWhat Tor will do/title
+
+p
+  The app its:translate=noTor Browser/app uses the app
+  its:translate=noTor/app network to protect your privacy
+  and anonymity. Using the app its:translate=noTor/app network has 
two
+  main properties:
+/p
+
+list
+  item
+p
+  The Internet access provider will not be able to learn the sites
+  being visited and will not be able to monitor the content of
+  the communication.
+/p
+  /item
+  item
+p
+  The sites will see a connection coming from the app
+  its:translate=noTor/app network and will not learn
+  the actual Internet connection used to visit them.
+/p
+  /item
+/list
+
+p
+  On top of that, the app its:translate=noTor Browser/app is designed
+  to minimize the ability of websites to fingerprint the browser.
+/p
+p
+  The Tor Browser does not keep any browsing history. emCookies/em
+  are only valid for a single session: until the app 
its:translate=noTor
+  Browser/app is exited or a !-- XXX: add link --guiNew 
Identity/gui
+  is requested.
+/p
+
+!-- XXX: add Tor Browser team/mikeperry about things that are worth
+adding here. --
+  /section
+
+  section id=what-tor-will-not-do
+titleWhat Tor will emnot/em do/title
+
+p
+  app its:translate=noTor/app and the app its:translate=noTor
+  Browser/app will protect your privacy and anonymity only if used
+  appropriately.
+/p
+
+list
+  item
+p
+  app its:translate=noTor/app will not encrypt the whole
+  communication. What is sent to the app its:translate=noTor/app
+  network is what leaves the app its:translate=noTor/app network.
+  For web browsing, this means that any confidential information
+  should be sent using the HTTPS protocol.
+  !-- XXX: add a link to another topic page / document HTTPS 
Everywhere
+  --
+  !-- XXX: mention hidden services? --
+/p
+  /item
+  item
+p
+  If you give a website identifying information (e.g. a name, a
+  emlogin/em), you will no longer be an anonymous visitor of this
+  website.
+/p
+  /item
+  item
+p
+  If you transfer files, they can contain identifying information in 
their
+  metadata, like the camera serial number.
+/p
+  /item
+  item
+p
+  Only connections made

[tor-commits] [user-manual/master] Change main title to the name of the document

2014-05-27 Thread lunar
commit 089985a34ebce448bdd8192a124b5c149eb885a1
Author: Lunar lu...@torproject.org
Date:   Tue May 27 10:53:38 2014 +0200

Change main title to the name of the document
---
 C/index.page |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/C/index.page b/C/index.page
index 84ef2f5..1df3448 100644
--- a/C/index.page
+++ b/C/index.page
@@ -3,7 +3,7 @@
   xmlns:its=http://www.w3.org/2005/11/its;
   type=guide
   id=index
-  titleTor Browser Help/title
+  titleTor Browser User Manual/title
   p its:locNote=lt;span/gt; will be replaced by current Tor Browser 
version
 Version:
 span its:translate=noxi:include href=../tor-browser-version.txt 
parse=text//span



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


[tor-commits] [user-manual/master] whitespace

2014-05-27 Thread lunar
commit 54a268114098cd111acb188a7c91be329cc173a0
Author: Lunar lu...@torproject.org
Date:   Tue May 27 22:46:11 2014 +0200

whitespace
---
 C/index.page |1 -
 1 file changed, 1 deletion(-)

diff --git a/C/index.page b/C/index.page
index 1df3448..764fcde 100644
--- a/C/index.page
+++ b/C/index.page
@@ -9,4 +9,3 @@
 span its:translate=noxi:include href=../tor-browser-version.txt 
parse=text//span
   /p
 /page
-

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


[tor-commits] [user-manual/master] Add half-working PDF build using mal2latex

2014-05-15 Thread lunar
commit bd0410a31c6e6a57643c5f088a737d6228164257
Author: Lunar lu...@torproject.org
Date:   Thu May 15 23:47:12 2014 +0200

Add half-working PDF build using mal2latex
---
 .gitignore  |2 ++
 Makefile.am |   39 ---
 2 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/.gitignore b/.gitignore
index 385f555..ba2dcf1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@
 #*
 
 /html
+/pdf
 /tor-browser-version.txt
 
 /tor-browser-user-manual.pot
@@ -12,6 +13,7 @@
 /[a-z][a-z]_[A-Z][A-Z]/*.mo
 /[a-z][a-z]_[A-Z][A-Z]/*.stamp
 /[a-z][a-z]_[A-Z][A-Z]/*.page
+/media-symlinks.stamp
 
 /Makefile
 /Makefile.in
diff --git a/Makefile.am b/Makefile.am
index 5f02d4e..6980dba 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,7 @@
 @YELP_HELP_RULES@
 
+# XXX: turn into ./configure option
+MAL2LATEX = ../mal2latex
 HELP_ID = tor-browser-user-manual
 HELP_FILES = $(shell cd C  git ls-files '*.page')
 HELP_MEDIA = $(shell cd C  git ls-files 'media')
@@ -7,22 +9,44 @@ HELP_PLATFORMS = windows macosx linux
 HELP_LINGUAS = ar de es fa fr it ko nl pl pt_PT ru tr vi zh_CN
 
 .PHONY: html
-html: all
+html: all media-symlinks.stamp
set -e  \
for lc in C $(HELP_LINGUAS); do \
-   for media in $(HELP_MEDIA); do \
-   if ! [ -f $$lc/$$media ]; then \
-   mkdir -p $$(dirname $$lc/$$media); \
-   ln -nsf ../../C/$$media $$lc/$$media; \
-   fi; \
-   done; \
for platform in $(HELP_PLATFORMS); do \
mkdir -p html/$$platform/$$lc; \
yelp-build html -x platform-$$platform.xslt \
-o html/$$platform/$$lc $$lc; \
done; \
+   done
+
+.PHONY: pdf
+pdf: all media-symlinks.stamp
+   set -e  \
+   for lc in C $(HELP_LINGUAS); do \
+   for platform in $(HELP_PLATFORMS); do \
+   PDF_DIR=pdf/$$platform/$$lc; \
+   LATEX_FILE=$(HELP_ID)-$$lc.latex; \
+   mkdir -p $$PDF_DIR; \
+   yelp-build cache -o $$PDF_DIR/index.cache $$lc; 
\
+   xsltproc --xinclude \
+   $(MAL2LATEX)/mal2latex.xsl 
$$PDF_DIR/index.cache \
+$$PDF_DIR/$$LATEX_FILE; \
+   (cd $$PDF_DIR  lualatex $$LATEX_FILE); \
+   done; \
done;
 
+media-symlinks.stamp: all
+   set -e  \
+   for lc in C $(HELP_LINGUAS); do \
+   for media in $(HELP_MEDIA); do \
+   if ! [ -f $$lc/$$media ]; then \
+   mkdir -p $$(dirname $$lc/$$media); \
+   ln -nsf ../../C/$$media $$lc/$$media; \
+   fi; \
+   done; \
+   done
+   touch media-symlinks.stamp
+
 clean:
set -e  \
for lc in C $(HELP_LINGUAS); do \
@@ -36,3 +60,4 @@ clean:
 
 distclean-local:
rm -rf html
+   rm -rf pdf

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


[tor-commits] [support-tools/master] response_time: Remove useless import

2014-05-13 Thread lunar
commit 6bec76c35ab3d66a1f4fef92444af8c4aaafd84b
Author: Lunar lu...@torproject.org
Date:   Tue May 13 14:04:35 2014 +0200

response_time: Remove useless import
---
 response-time/response_time.py |1 -
 1 file changed, 1 deletion(-)

diff --git a/response-time/response_time.py b/response-time/response_time.py
index e2cae2e..40d8ad9 100755
--- a/response-time/response_time.py
+++ b/response-time/response_time.py
@@ -12,7 +12,6 @@ import psycopg2
 import re
 import subprocess
 import sys
-import yaml
 
 RT_CONNINFO = host=drobovi.torproject.org sslmode=require user=rtreader 
dbname=rt
 



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


[tor-commits] [support-tools/master] response_time: Fix typo

2014-05-13 Thread lunar
commit f17c3d7b7a0d98b6a9f7a2780f75ba45046cf94a
Author: Lunar lu...@torproject.org
Date:   Tue May 13 14:04:43 2014 +0200

response_time: Fix typo
---
 response-time/response_time.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/response-time/response_time.py b/response-time/response_time.py
index 40d8ad9..38981e5 100755
--- a/response-time/response_time.py
+++ b/response-time/response_time.py
@@ -48,7 +48,7 @@ def account_tickets(con, year, month):
 response_time = last_update - open_tickets[ticket_id]
 bucket = int(response_time.total_seconds() / (BUCKET_SIZE * 60 
* 60))
 response_times[bucket] = 1 + response_times.get(bucket, 0)
-print %d anwsered in %s % (ticket_id, response_time)
+print %d answered in %s % (ticket_id, response_time)
 del open_tickets[ticket_id]
 else:
 print Don't know when %d was opened. % (ticket_id)

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


[tor-commits] [support-tools/master] Add queue graphs data for March 2014

2014-04-01 Thread lunar
commit 3eb13fac22732eaa67e34186200575debb95fe5a
Author: Lunar lu...@torproject.org
Date:   Tue Apr 1 11:11:57 2014 +0200

Add queue graphs data for March 2014
---
 queue-graphs/data/2014Q1.csv |6 ++
 1 file changed, 6 insertions(+)

diff --git a/queue-graphs/data/2014Q1.csv b/queue-graphs/data/2014Q1.csv
index 3e945b4..8be8a5a 100644
--- a/queue-graphs/data/2014Q1.csv
+++ b/queue-graphs/data/2014Q1.csv
@@ -11,3 +11,9 @@ month,queue,newtickets
 2014-02,fa,57
 2014-02,fr,39
 2014-02,zh,76
+2014-03,ar,14
+2014-03,en,1387
+2014-03,es,65
+2014-03,fa,54
+2014-03,fr,37
+2014-03,zh,80



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


[tor-commits] [support-tools/master] Add response time graphs data for 2014Q1

2014-04-01 Thread lunar
commit 780139a57259fb0dbad798dda66530d41de9d9e6
Author: Lunar lu...@torproject.org
Date:   Tue Apr 1 11:28:06 2014 +0200

Add response time graphs data for 2014Q1
---
 response-time/data/2014Q1.csv |  688 +
 1 file changed, 688 insertions(+)

diff --git a/response-time/data/2014Q1.csv b/response-time/data/2014Q1.csv
new file mode 100644
index 000..acb7d2a
--- /dev/null
+++ b/response-time/data/2014Q1.csv
@@ -0,0 +1,688 @@
+month,fromhours,tohours,requests
+2014-01,0,1,634
+2014-01,1,2,247
+2014-01,2,3,170
+2014-01,3,4,134
+2014-01,4,5,131
+2014-01,5,6,62
+2014-01,6,7,85
+2014-01,7,8,81
+2014-01,8,9,68
+2014-01,9,10,60
+2014-01,10,11,72
+2014-01,11,12,64
+2014-01,12,13,55
+2014-01,13,14,45
+2014-01,14,15,34
+2014-01,15,16,36
+2014-01,16,17,32
+2014-01,17,18,34
+2014-01,18,19,33
+2014-01,19,20,48
+2014-01,20,21,36
+2014-01,21,22,31
+2014-01,22,23,23
+2014-01,23,24,29
+2014-01,24,25,13
+2014-01,25,26,23
+2014-01,26,27,18
+2014-01,27,28,15
+2014-01,28,29,22
+2014-01,29,30,17
+2014-01,30,31,17
+2014-01,31,32,10
+2014-01,32,33,8
+2014-01,33,34,14
+2014-01,34,35,11
+2014-01,35,36,4
+2014-01,36,37,10
+2014-01,37,38,10
+2014-01,38,39,11
+2014-01,39,40,4
+2014-01,40,41,9
+2014-01,41,42,8
+2014-01,42,43,11
+2014-01,43,44,9
+2014-01,44,45,12
+2014-01,45,46,8
+2014-01,46,47,15
+2014-01,47,48,17
+2014-01,48,49,5
+2014-01,49,50,9
+2014-01,50,51,7
+2014-01,51,52,10
+2014-01,52,53,5
+2014-01,53,54,1
+2014-01,54,55,6
+2014-01,55,56,9
+2014-01,56,57,8
+2014-01,57,58,1
+2014-01,58,59,4
+2014-01,59,60,7
+2014-01,60,61,3
+2014-01,61,62,3
+2014-01,62,63,5
+2014-01,63,64,2
+2014-01,64,65,5
+2014-01,65,66,3
+2014-01,66,67,4
+2014-01,67,68,6
+2014-01,68,69,10
+2014-01,69,70,7
+2014-01,70,71,6
+2014-01,71,72,4
+2014-01,72,73,5
+2014-01,73,74,5
+2014-01,74,75,4
+2014-01,75,76,5
+2014-01,76,77,4
+2014-01,78,79,2
+2014-01,79,80,7
+2014-01,80,81,2
+2014-01,81,82,2
+2014-01,82,83,4
+2014-01,83,84,1
+2014-01,84,85,3
+2014-01,85,86,8
+2014-01,86,87,4
+2014-01,87,88,1
+2014-01,89,90,3
+2014-01,90,91,4
+2014-01,91,92,2
+2014-01,92,93,2
+2014-01,93,94,3
+2014-01,94,95,2
+2014-01,95,96,3
+2014-01,97,98,1
+2014-01,98,99,2
+2014-01,99,100,2
+2014-01,100,101,2
+2014-01,103,104,1
+2014-01,104,105,1
+2014-01,105,106,3
+2014-01,107,108,1
+2014-01,108,109,1
+2014-01,111,112,2
+2014-01,112,113,1
+2014-01,115,116,1
+2014-01,116,117,2
+2014-01,117,118,3
+2014-01,118,119,2
+2014-01,119,120,1
+2014-01,120,121,3
+2014-01,121,122,2
+2014-01,124,125,1
+2014-01,125,126,1
+2014-01,126,127,1
+2014-01,127,128,1
+2014-01,128,129,3
+2014-01,129,130,1
+2014-01,132,133,1
+2014-01,133,134,1
+2014-01,134,135,1
+2014-01,135,136,1
+2014-01,138,139,1
+2014-01,142,143,1
+2014-01,146,147,4
+2014-01,147,148,1
+2014-01,149,150,1
+2014-01,150,151,1
+2014-01,152,153,1
+2014-01,153,154,2
+2014-01,154,155,1
+2014-01,155,156,1
+2014-01,160,161,3
+2014-01,162,163,1
+2014-01,165,166,3
+2014-01,167,168,1
+2014-01,168,169,1
+2014-01,170,171,1
+2014-01,171,172,1
+2014-01,172,173,2
+2014-01,173,174,2
+2014-01,175,176,1
+2014-01,176,177,1
+2014-01,177,178,2
+2014-01,182,183,3
+2014-01,183,184,3
+2014-01,190,191,1
+2014-01,193,194,1
+2014-01,196,197,2
+2014-01,198,199,2
+2014-01,200,201,1
+2014-01,209,210,1
+2014-01,212,213,1
+2014-01,213,214,1
+2014-01,214,215,1
+2014-01,215,216,2
+2014-01,223,224,1
+2014-01,229,230,1
+2014-01,230,231,2
+2014-01,231,232,2
+2014-01,232,233,1
+2014-01,234,235,2
+2014-01,239,240,1
+2014-01,243,244,1
+2014-01,246,247,1
+2014-01,247,248,1
+2014-01,248,249,1
+2014-01,252,253,1
+2014-01,253,254,1
+2014-01,254,255,1
+2014-01,260,261,1
+2014-01,270,271,1
+2014-01,272,273,1
+2014-01,275,276,1
+2014-01,283,284,1
+2014-01,286,287,1
+2014-01,289,290,1
+2014-01,290,291,2
+2014-01,298,299,2
+2014-01,311,312,1
+2014-01,314,315,1
+2014-01,319,320,1
+2014-01,335,336,2
+2014-01,336,337,1
+2014-01,337,338,1
+2014-01,341,342,1
+2014-01,345,346,1
+2014-01,349,350,1
+2014-01,358,359,2
+2014-01,359,360,2
+2014-01,381,382,1
+2014-01,388,389,1
+2014-01,405,406,1
+2014-01,422,423,1
+2014-01,428,429,1
+2014-01,430,431,2
+2014-01,437,438,3
+2014-01,444,445,1
+2014-01,462,463,1
+2014-01,486,487,1
+2014-01,505,506,1
+2014-01,506,507,1
+2014-01,529,530,1
+2014-01,533,534,1
+2014-01,543,544,1
+2014-01,544,545,1
+2014-01,562,563,1
+2014-01,566,567,1
+2014-01,567,568,1
+2014-01,593,594,1
+2014-01,606,607,1
+2014-01,639,640,1
+2014-01,650,651,1
+2014-01,656,657,1
+2014-01,674,675,1
+2014-01,689,690,1
+2014-01,690,691,1
+2014-01,758,759,1
+2014-01,760,761,2
+2014-01,767,768,1
+2014-01,771,772,1
+2014-01,782,783,1
+2014-01,786,787,1
+2014-01,794,795,1
+2014-01,803,804,1
+2014-01,805,806,1
+2014-01,810,811,1
+2014-01,816,817,1
+2014-01,820,821,1
+2014-01,828,829,1
+2014-01,830,831,1
+2014-01,835,836,2
+2014-01,836,837,1
+2014-01,837,838,1
+2014-01,838,839,1
+2014-01,841,842,1
+2014-01,844,845,1
+2014-01,847,848,1
+2014-01,851,852,2
+2014-01,852,853,1
+2014-01,853,854,1
+2014-01,855,856,1
+2014-01,856,857,1
+2014-01,857,858,1
+2014-01,858,859,2

[tor-commits] [support-tools/master] Import Karsten's response time graph script from #11177

2014-03-27 Thread lunar
commit af83756289928095e8a2c8856f92e8f28198f9c3
Author: Lunar lu...@torproject.org
Date:   Thu Mar 27 16:08:29 2014 +0100

Import Karsten's response time graph script from #11177
---
 response-time/README.txt   |8 +
 response-time/data/2013Q3.csv  |  654 
 response-time/data/2013Q4.csv  |  601 
 response-time/response_time.py |5 +-
 response-time/time-to-reply.R  |   43 +++
 5 files changed, 1309 insertions(+), 2 deletions(-)

diff --git a/response-time/README.txt b/response-time/README.txt
new file mode 100644
index 000..1784c64
--- /dev/null
+++ b/response-time/README.txt
@@ -0,0 +1,8 @@
+# Install required packages
+R
+install.packages(ggplot2)
+quit()
+
+# Run graphing script
+R --slave -f time-to-reply.R --args data/2013Q4.csv 2013Q4.pdf
+
diff --git a/response-time/data/2013Q3.csv b/response-time/data/2013Q3.csv
new file mode 100644
index 000..8281c8a
--- /dev/null
+++ b/response-time/data/2013Q3.csv
@@ -0,0 +1,654 @@
+month,fromhours,tohours,requests
+2013-07,0,1,621
+2013-07,1,2,200
+2013-07,2,3,156
+2013-07,3,4,119
+2013-07,4,5,85
+2013-07,5,6,57
+2013-07,6,7,42
+2013-07,7,8,25
+2013-07,8,9,40
+2013-07,9,10,31
+2013-07,10,11,29
+2013-07,11,12,21
+2013-07,12,13,21
+2013-07,13,14,12
+2013-07,14,15,22
+2013-07,15,16,4
+2013-07,16,17,10
+2013-07,17,18,13
+2013-07,18,19,15
+2013-07,19,20,6
+2013-07,20,21,7
+2013-07,21,22,5
+2013-07,22,23,9
+2013-07,23,24,7
+2013-07,24,25,7
+2013-07,25,26,3
+2013-07,26,27,6
+2013-07,27,28,4
+2013-07,28,29,7
+2013-07,29,30,2
+2013-07,30,31,5
+2013-07,31,32,3
+2013-07,32,33,3
+2013-07,33,34,2
+2013-07,34,35,3
+2013-07,36,37,1
+2013-07,37,38,1
+2013-07,38,39,1
+2013-07,39,40,2
+2013-07,40,41,6
+2013-07,41,42,3
+2013-07,42,43,5
+2013-07,43,44,3
+2013-07,45,46,3
+2013-07,47,48,1
+2013-07,48,49,1
+2013-07,49,50,3
+2013-07,51,52,1
+2013-07,52,53,4
+2013-07,54,55,5
+2013-07,56,57,3
+2013-07,61,62,1
+2013-07,62,63,2
+2013-07,63,64,1
+2013-07,64,65,1
+2013-07,66,67,3
+2013-07,67,68,1
+2013-07,69,70,2
+2013-07,70,71,2
+2013-07,76,77,2
+2013-07,80,81,3
+2013-07,81,82,1
+2013-07,84,85,1
+2013-07,85,86,2
+2013-07,86,87,1
+2013-07,87,88,2
+2013-07,92,93,1
+2013-07,93,94,1
+2013-07,94,95,2
+2013-07,97,98,3
+2013-07,99,100,1
+2013-07,100,101,1
+2013-07,101,102,1
+2013-07,109,110,1
+2013-07,113,114,2
+2013-07,115,116,1
+2013-07,122,123,1
+2013-07,123,124,1
+2013-07,127,128,1
+2013-07,130,131,1
+2013-07,131,132,1
+2013-07,144,145,1
+2013-07,154,155,1
+2013-07,156,157,1
+2013-07,158,159,1
+2013-07,159,160,1
+2013-07,167,168,1
+2013-07,169,170,1
+2013-07,183,184,1
+2013-07,211,212,1
+2013-07,212,213,1
+2013-07,222,223,1
+2013-07,231,232,1
+2013-07,232,233,1
+2013-07,233,234,1
+2013-07,236,237,1
+2013-07,242,243,1
+2013-07,251,252,1
+2013-07,258,259,1
+2013-07,264,265,1
+2013-07,267,268,1
+2013-07,275,276,1
+2013-07,283,284,1
+2013-07,291,292,1
+2013-07,296,297,2
+2013-07,298,299,1
+2013-07,320,321,1
+2013-07,344,345,1
+2013-07,349,350,1
+2013-07,376,377,1
+2013-07,383,384,1
+2013-07,389,390,1
+2013-07,399,400,1
+2013-07,406,407,1
+2013-07,430,431,1
+2013-07,457,458,1
+2013-07,488,489,1
+2013-07,504,505,1
+2013-07,516,517,1
+2013-07,526,527,1
+2013-07,533,534,1
+2013-07,548,549,1
+2013-07,549,550,1
+2013-07,551,552,1
+2013-07,567,568,1
+2013-07,579,580,1
+2013-07,582,583,1
+2013-07,651,652,2
+2013-07,682,683,1
+2013-07,715,716,1
+2013-07,720,721,1
+2013-07,723,724,1
+2013-07,757,758,1
+2013-07,762,763,1
+2013-07,766,767,1
+2013-07,768,769,1
+2013-07,772,773,1
+2013-07,777,778,1
+2013-07,796,797,1
+2013-07,820,821,1
+2013-07,836,837,1
+2013-07,860,861,1
+2013-07,903,904,1
+2013-07,938,939,1
+2013-07,983,984,1
+2013-07,1005,1006,1
+2013-07,1047,1048,1
+2013-07,1128,1129,1
+2013-07,1142,1143,1
+2013-07,1155,1156,1
+2013-07,1192,1193,1
+2013-07,1219,1220,1
+2013-07,1222,1223,1
+2013-07,1236,1237,1
+2013-07,1237,1238,1
+2013-07,1242,1243,1
+2013-07,1268,1269,1
+2013-07,1287,1288,1
+2013-07,1292,1293,1
+2013-07,1306,1307,1
+2013-07,1309,1310,1
+2013-07,1314,1315,1
+2013-07,1320,1321,1
+2013-07,1329,1330,1
+2013-07,1333,1334,1
+2013-07,1337,1338,1
+2013-07,1411,1412,1
+2013-07,1417,1418,1
+2013-07,1445,1446,1
+2013-07,1456,1457,1
+2013-07,1465,1466,1
+2013-07,1483,1484,1
+2013-07,1512,1513,1
+2013-07,1528,1529,1
+2013-07,1529,1530,1
+2013-07,1540,1541,1
+2013-07,1541,1542,1
+2013-07,1545,1546,2
+2013-07,1552,1553,2
+2013-07,1567,1568,1
+2013-07,1573,1574,1
+2013-07,1582,1583,1
+2013-07,1585,1586,1
+2013-07,1589,1590,1
+2013-07,1595,1596,1
+2013-07,1598,1599,1
+2013-07,1613,1614,1
+2013-07,1615,1616,1
+2013-07,1628,1629,1
+2013-07,1641,1642,1
+2013-07,1661,1662,1
+2013-07,1674,1675,1
+2013-07,1727,1728,1
+2013-07,1742,1743,1
+2013-07,1743,1744,2
+2013-07,1765,1766,1
+2013-07,1771,1772,1
+2013-07,1772,1773,1
+2013-07,1775,1776,1
+2013-07,1785,1786,1
+2013-07,1788,1789,1
+2013-07,1792,1793,2
+2013-07,1796,1797,1
+2013-07,1799,1800,1
+2013-07,1806,1807,1
+2013-07,1817,1818,1
+2013-07,1833,1834,1
+2013

[tor-commits] [support-tools/master] Pie charts are better for response time graphs

2014-03-27 Thread lunar
commit ce2a876bc0dfc4ff5cc600ab74a1a52e57a41543
Author: Lunar lu...@torproject.org
Date:   Thu Mar 27 21:25:28 2014 +0100

Pie charts are better for response time graphs
---
 response-time/time-to-reply.R |   15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/response-time/time-to-reply.R b/response-time/time-to-reply.R
index dcbf000..bb41cbd 100644
--- a/response-time/time-to-reply.R
+++ b/response-time/time-to-reply.R
@@ -27,11 +27,15 @@ data - aggregate(list(requests = data$requests),
 
 # Plot the data
 ggplot(data,
-  aes(x = month,  # Month on the x axis
+  aes(x = factor(1),  # Single value on x axis
   y = requests,   # Number of requests on y axis
   fill = interval)) + # Different colours for response time
-# Make a dodged bar chart
-geom_bar(stat = identity, position = dodge) +
+geom_bar( # Start with a bar plot
+  stat = identity,  # Make y represent values in the data
+  position = fill,  # Make all bars the same length
+  width = 1) +# Make all pies the same size
+facet_grid(. ~ month) +   # Make 1 chart per month
+coord_polar(theta = y) +# Change y coordinates for pie chart
 scale_x_discrete() +# No x axis label
 scale_y_continuous() +  # No y axis label
 # No legend title
@@ -39,5 +43,8 @@ scale_y_continuous() +  # No y axis label
 # http://vis.supstat.com/2013/04/plotting-symbols-and-color-palettes/
 scale_fill_brewer(, palette = Set2) +
 ggtitle(Time to respond to support requests per month\n) +
-theme_bw()
+theme_bw() +
+theme(axis.text = element_blank(),# No tick labels
+  axis.ticks = element_blank(),   # No ticks
+  panel.grid.major = element_blank()) # No axis lines
 ggsave(args[2], width = 8, height = 4, dpi = 100)

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


[tor-commits] [support-tools/master] Add script used to produce monthly reports

2014-03-25 Thread lunar
commit 3403859aee7fe8df73fd9c10f4a44216296d9861
Author: Lunar lu...@torproject.org
Date:   Tue Mar 25 16:17:36 2014 +0100

Add script used to produce monthly reports
---
 monthly-report/README.txt   |   13 +++
 monthly-report/monthly_stats.py |  187 +++
 2 files changed, 200 insertions(+)

diff --git a/monthly-report/README.txt b/monthly-report/README.txt
new file mode 100644
index 000..d5549d3
--- /dev/null
+++ b/monthly-report/README.txt
@@ -0,0 +1,13 @@
+Monthly reporting scripts
+=
+
+`monthly_stats.py` is meant to be run on rude.torproject.org and will
+produce most statistics for a monthly help desk report.
+
+Usage: monthly_stats.py [YEAR MONTH]
+
+By default the report will be for the current month.
+
+`~/.pgpass` should be properly filled, e.g.:
+
+drobovi.torproject.org:5432:rt:rtreader:A_SECRET_PASSWORD
diff --git a/monthly-report/monthly_stats.py b/monthly-report/monthly_stats.py
new file mode 100755
index 000..81625f8
--- /dev/null
+++ b/monthly-report/monthly_stats.py
@@ -0,0 +1,187 @@
+#!/usr/bin/python
+#
+# This program is free software. It comes without any warranty, to
+# the extent permitted by applicable law. You can redistribute it
+# and/or modify it under the terms of the Do What The Fuck You Want
+# To Public License, Version 2, as published by Sam Hocevar. See
+# http://sam.zoy.org/wtfpl/COPYING for more details.
+
+import calendar
+import datetime
+import psycopg2
+import re
+import subprocess
+import sys
+import yaml
+
+RT_CONNINFO = host=drobovi.torproject.org sslmode=require user=rtreader 
dbname=rt
+
+SELECT_TRANSACTIONS_QUERY = 
+SELECT tickets.id, tickets.lastupdatedby, queues.name, 
transactions.created, transactions.field, transactions.newvalue
+  FROM tickets
+  JOIN queues ON (queues.id = tickets.queue)
+  JOIN transactions ON (transactions.objectid = tickets.id
+AND transactions.objecttype = 'RT::Ticket')
+ WHERE tickets.lastupdated = %s
+   AND tickets.created  %s + INTERVAL '1 MONTH'
+   AND transactions.created  %s + INTERVAL '1 MONTH'
+ ORDER BY tickets.id, transactions.id;
+
+
+SELECT_QUEUE_NAME_QUERY = 
+SELECT queues.name
+  FROM queues
+ WHERE queues.id = %s
+
+
+SELECT_USER_NAME_QUERY = 
+SELECT users.name
+  FROM users
+ WHERE users.id = %s
+
+
+def get_queue_name(queue_id):
+global con
+
+cur = con.cursor()
+try:
+cur.execute(SELECT_QUEUE_NAME_QUERY, (queue_id,))
+return cur.fetchone()[0]
+finally:
+cur.close()
+
+def get_user_name(user_id):
+global con
+
+cur = con.cursor()
+try:
+cur.execute(SELECT_USER_NAME_QUERY, (user_id,))
+return cur.fetchone()[0]
+finally:
+cur.close()
+
+def account_ticket(fields):
+global resolved, rejected, open_tickets, ticket_count
+
+ticket_count += 1
+
+queue = fields.get('Queue')
+if queue and queue.isdigit():
+queue = get_queue_name(queue)
+
+owner = fields.get('Owner')
+if owner and owner.isdigit():
+owner = get_user_name(owner)
+
+status = fields['Status']
+
+if status == 'resolved':
+if queue != 'spam' and owner:
+if not owner in resolved:
+resolved[owner] = {}
+if not queue in resolved[owner]:
+resolved[owner][queue] = 0
+resolved[owner][queue] += 1
+elif status == 'rejected':
+user = get_user_name(fields['LastUpdatedBy'])
+if user not in rejected:
+rejected[user] = 0
+rejected[user] += 1
+else:
+if queue != 'spam' and 'MergedInto' not in fields:
+if queue not in open_tickets:
+open_tickets[queue] = 0
+open_tickets[queue] += 1
+
+def account_tickets(year, month):
+global con
+
+cur = con.cursor()
+first_of_month = datetime.datetime(year, month, 1).date()
+print cur.mogrify(SELECT_TRANSACTIONS_QUERY, (first_of_month, 
first_of_month, first_of_month))
+cur.execute(SELECT_TRANSACTIONS_QUERY, (first_of_month, first_of_month, 
first_of_month))
+
+fields = {}
+for ticket_id, last_updated_by, current_queue, transaction_created, 
transaction_field, transaction_new_value in cur:
+if ticket_id != fields.get('TicketId'):
+if 'TicketId' in fields:
+account_ticket(fields)
+fields = { 'TicketId': ticket_id, 'LastUpdatedBy': 
last_updated_by, 'Status': 'new', 'Owner': None, 'Queue': current_queue }
+if transaction_field:
+fields[transaction_field] = transaction_new_value
+if 'TicketId' in fields:
+account_ticket(fields)
+cur.close()
+
+print Ticket count: %d % ticket_count
+print Stats:
+print_stats()
+
+def get_queues(resolved):
+queues = set()
+for user in resolved:
+queues.update(resolved[user])
+return queues
+
+def short_queue_name(queue

[tor-commits] [support-tools/master] Add first version of a script to extract response time

2014-03-25 Thread lunar
commit f6053d050e466d39c61383960edd8ab0cb27f372
Author: Lunar lu...@torproject.org
Date:   Tue Mar 25 17:21:48 2014 +0100

Add first version of a script to extract response time
---
 response-time/response_time.py |   77 
 1 file changed, 77 insertions(+)

diff --git a/response-time/response_time.py b/response-time/response_time.py
new file mode 100755
index 000..0b7d1b9
--- /dev/null
+++ b/response-time/response_time.py
@@ -0,0 +1,77 @@
+#!/usr/bin/python
+#
+# This program is free software. It comes without any warranty, to
+# the extent permitted by applicable law. You can redistribute it
+# and/or modify it under the terms of the Do What The Fuck You Want
+# To Public License, Version 2, as published by Sam Hocevar. See
+# http://sam.zoy.org/wtfpl/COPYING for more details.
+
+import calendar
+from datetime import datetime, timedelta
+import psycopg2
+import re
+import subprocess
+import sys
+import yaml
+
+RT_CONNINFO = host=drobovi.torproject.org sslmode=require user=rtreader 
dbname=rt
+
+SELECT_TRANSACTIONS_QUERY = 
+SELECT tickets.id, transactions.created, transactions.type, 
transactions.newvalue
+  FROM tickets
+  JOIN queues ON (queues.id = tickets.queue)
+  JOIN transactions ON (transactions.objectid = tickets.id
+AND transactions.objecttype = 'RT::Ticket')
+ WHERE tickets.lastupdated = %s
+   AND tickets.created  %s + INTERVAL '1 MONTH'
+ ORDER BY tickets.id, transactions.id;
+
+
+BUCKET_SIZE = 4 # hours
+
+def account_tickets(con, year, month):
+cur = con.cursor()
+first_of_month = datetime(year, month, 1).date()
+print cur.mogrify(SELECT_TRANSACTIONS_QUERY, (first_of_month, 
first_of_month))
+cur.execute(SELECT_TRANSACTIONS_QUERY, (first_of_month, first_of_month))
+
+open_tickets = {} # ticket_id - time
+response_times = {}
+fields = {}
+for ticket_id, transaction_created, transaction_type, 
transaction_new_value in cur:
+if transaction_type not in ('Create', 'Status'):
+continue
+status = transaction_new_value
+last_update = transaction_created
+print %d %s %s % (ticket_id, status, last_update)
+if status == 'resolved' or status == 'rejected':
+if ticket_id in open_tickets:
+response_time = last_update - open_tickets[ticket_id]
+bucket = int(response_time.total_seconds() / (BUCKET_SIZE * 60 
* 60))
+response_times[bucket] = 1 + response_times.get(bucket, 0)
+print %d anwsered in %s % (ticket_id, response_time)
+del open_tickets[ticket_id]
+else:
+print Don't know when %d was opened. % (ticket_id)
+else:
+if ticket_id not in open_tickets:
+open_tickets[ticket_id] = last_update
+cur.close()
+print ''
+buckets = response_times.keys()
+buckets.sort()
+for bucket in buckets:
+print %3d hours - %3d hours: %d % (bucket * BUCKET_SIZE, (bucket + 
1) * BUCKET_SIZE, response_times[bucket])
+
+if __name__ == '__main__':
+if len(sys.argv) == 1:
+now = datetime.now()
+year, month = now.year, now.month
+elif len(sys.argv) == 3:
+year, month = int(sys.argv[1]), int(sys.argv[2])
+else:
+print sys.stderr, Usage: %s [YEAR MONTH] % (sys.argv[0])
+sys.exit(1)
+con = psycopg2.connect(RT_CONNINFO)
+account_tickets(con, year, month)
+con.close()

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