[tor-commits] [nyx/master] Move tor event configuration to util

2015-05-04 Thread atagar
commit 895c6a5d13e09c235d7446307f01d8771d11ff1d
Author: Damian Johnson 
Date:   Sat May 2 13:48:39 2015 -0700

Move tor event configuration to util

Move listen_for_events() to util, and drop another largely unused helper.
---
 nyx/log_panel.py |  100 +++---
 nyx/util/log.py  |   36 
 2 files changed, 56 insertions(+), 80 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index 2840c86..fe3e39e 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -18,7 +18,7 @@ import nyx.arguments
 import nyx.popups
 
 from nyx.util import join, panel, tor_controller, ui_tools
-from nyx.util.log import TOR_RUNLEVELS, LogFileOutput, LogGroup, LogEntry, 
LogFilters, read_tor_log, condense_runlevels, days_since, log_file_path
+from nyx.util.log import LogFileOutput, LogGroup, LogEntry, LogFilters, 
read_tor_log, condense_runlevels, listen_for_events, days_since, log_file_path
 
 ENTRY_INDENT = 2  # spaces an entry's message is indented after the first line
 
@@ -74,22 +74,16 @@ class LogPanel(panel.Panel, threading.Thread):
 threading.Thread.__init__(self)
 self.setDaemon(True)
 
+self._logged_event_types = listen_for_events(self._register_tor_event, 
logged_events)
+self._logged_events = LogGroup(CONFIG['cache.log_panel.size'], 
group_by_day = CONFIG['features.log.showDateDividers'])
+self._log_file = LogFileOutput(CONFIG['features.log_file'])
 self._filter = LogFilters(initial_filters = CONFIG['features.log.regex'])
 
-self.logged_events = []  # needs to be set before we receive any events
-
-# restricts the input to the set of events we can listen to, and
-# configures the controller to liten to them
-
-self.logged_events = self.set_event_listening(logged_events)
+self.set_pause_attr('_logged_events')
 
 self.last_content_height = 0 # height of the rendered content when 
last drawn
-self._log_file = LogFileOutput(CONFIG['features.log_file'])
 self.scroll = 0
 
-self.set_pause_attr('_msg_log')
-self._msg_log = LogGroup(CONFIG['cache.log_panel.size'], group_by_day = 
CONFIG['features.log.showDateDividers'])
-
 self._last_update = -1   # time the content was last revised
 self._halt = False   # terminates thread if true
 self._cond = threading.Condition()   # used for pausing/resuming the thread
@@ -108,8 +102,8 @@ class LogPanel(panel.Panel, threading.Thread):
   if log_location:
 try:
   for entry in reversed(list(read_tor_log(log_location, 
CONFIG['features.log.prepopulateReadLimit']))):
-if entry.type in self.logged_events:
-  self._msg_log.add(entry)
+if entry.type in self._logged_event_types:
+  self._logged_events.add(entry)
 except IOError as exc:
   log.info('Unable to read log located at %s: %s' % (log_location, 
exc))
 except ValueError as exc:
@@ -124,7 +118,7 @@ class LogPanel(panel.Panel, threading.Thread):
 
 # leaving last_content_height as being too low causes initialization 
problems
 
-self.last_content_height = len(self._msg_log)
+self.last_content_height = len(self._logged_events)
 
   def set_duplicate_visability(self, is_visible):
 """
@@ -138,25 +132,6 @@ class LogPanel(panel.Panel, threading.Thread):
 nyx_config = conf.get_config('nyx')
 nyx_config.set('features.log.showDuplicateEntries', str(is_visible))
 
-  def set_logged_events(self, event_types):
-"""
-Sets the event types recognized by the panel.
-
-Arguments:
-  event_types - event types to be logged
-"""
-
-if event_types == self.logged_events:
-  return
-
-with self.vals_lock:
-  # configures the controller to listen for these tor events, and provides
-  # back a subset without anything we're failing to listen to
-
-  set_types = self.set_event_listening(event_types)
-  self.logged_events = set_types
-  self.redraw(True)
-
   def get_filter(self):
 """
 Provides our currently selected regex filter.
@@ -200,9 +175,13 @@ class LogPanel(panel.Panel, threading.Thread):
 
 if user_input:
   user_input = user_input.replace(' ', '')  # strips spaces
+  event_types = nyx.arguments.expand_events(user_input)
 
   try:
-self.set_logged_events(nyx.arguments.expand_events(user_input))
+if event_types != self._logged_event_types:
+  with self.vals_lock:
+self._logged_event_types = 
listen_for_events(self._register_tor_event, event_types)
+self.redraw(True)
   except ValueError as exc:
 nyx.popups.show_msg('Invalid flags: %s' % str(exc), 2)
   finally:
@@ -228,7 +207,7 @@ class LogPanel(panel.Panel, threading.Thread):
 """
 
 with self.vals_lock:
-  self._msg_log = LogGroup(CONFIG['cache.log_panel.size'], group_by_day = 
CONFIG['features.log.showD

[tor-commits] [nyx/master] Revise days_since() to behave more intuitively

2015-05-04 Thread atagar
commit 6a582784233e4db9e6b5a5035f3b5eebbdf908ce
Author: Damian Johnson 
Date:   Mon May 4 20:39:16 2015 -0700

Revise days_since() to behave more intuitively

We only used days_since() to figure out if one day was the same as another, 
so
didn't really care what the value actually was. Changing it to be in 
reference
to today at midnight so zero means today, one means yesterday, etc.
---
 nyx/util/log.py |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/nyx/util/log.py b/nyx/util/log.py
index 1371bb8..f224789 100644
--- a/nyx/util/log.py
+++ b/nyx/util/log.py
@@ -24,20 +24,25 @@ except ImportError:
   from stem.util.lru_cache import lru_cache
 
 TOR_RUNLEVELS = ['DEBUG', 'INFO', 'NOTICE', 'WARN', 'ERR']
-TIMEZONE_OFFSET = time.altzone if time.localtime()[8] else time.timezone
 CONFIG = stem.util.conf.config_dict('nyx', {'tor.chroot': ''})
 
 
 def days_since(timestamp):
   """
   Provides the number of days since a given unix timestamp, by local time.
+  Daybreaks are rolled over at midnight. For instance, 5pm today would report
+  zero, and 5pm yesterday would report one.
 
   :param int timestamp: unix timestamp to provide time since
 
   :reutrns: **int** with the number of days since this event
   """
 
-  return int((timestamp - TIMEZONE_OFFSET) / 86400)
+  # unix timestamp for today at midnight
+
+  midnight = time.mktime(datetime.datetime.today().date().timetuple())
+
+  return int((midnight - timestamp) / 86400)
 
 
 def log_file_path(controller):



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


[tor-commits] [nyx/master] Revise log panel's filter handling

2015-05-04 Thread atagar
commit c8341ae3fee5330e3fd013aaa054ef3a59736a92
Author: Damian Johnson 
Date:   Fri May 1 09:14:31 2015 -0700

Revise log panel's filter handling

Adding a small LogFilters class which allows us to drop quite a bit.
---
 nyx/log_panel.py|  110 ---
 nyx/menu/actions.py |6 ++-
 nyx/util/log.py |   49 +++
 3 files changed, 69 insertions(+), 96 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index 4a7e6de..2840c86 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -4,7 +4,6 @@ for. This provides prepopulation from the log file and supports 
filtering by
 regular expressions.
 """
 
-import re
 import os
 import time
 import curses
@@ -19,7 +18,7 @@ import nyx.arguments
 import nyx.popups
 
 from nyx.util import join, panel, tor_controller, ui_tools
-from nyx.util.log import TOR_RUNLEVELS, LogFileOutput, LogGroup, LogEntry, 
read_tor_log, condense_runlevels, days_since, log_file_path
+from nyx.util.log import TOR_RUNLEVELS, LogFileOutput, LogGroup, LogEntry, 
LogFilters, read_tor_log, condense_runlevels, days_since, log_file_path
 
 ENTRY_INDENT = 2  # spaces an entry's message is indented after the first line
 
@@ -56,10 +55,6 @@ CONFIG = conf.config_dict('nyx', {
 
 CONTENT_HEIGHT_REDRAW_THRESHOLD = 3
 
-# maximum number of regex filters we'll remember
-
-MAX_REGEX_FILTERS = 5
-
 # Log buffer so we start collecting stem/nyx events when imported. This is used
 # to make our LogPanel when curses initializes.
 
@@ -79,21 +74,7 @@ class LogPanel(panel.Panel, threading.Thread):
 threading.Thread.__init__(self)
 self.setDaemon(True)
 
-# regex filters the user has defined
-
-self.filter_options = []
-
-for filter in CONFIG['features.log.regex']:
-  # checks if we can't have more filters
-
-  if len(self.filter_options) >= MAX_REGEX_FILTERS:
-break
-
-  try:
-re.compile(filter)
-self.filter_options.append(filter)
-  except re.error as exc:
-log.notice('Invalid regular expression pattern (%s): %s' % (exc, 
filter))
+self._filter = LogFilters(initial_filters = CONFIG['features.log.regex'])
 
 self.logged_events = []  # needs to be set before we receive any events
 
@@ -102,7 +83,6 @@ class LogPanel(panel.Panel, threading.Thread):
 
 self.logged_events = self.set_event_listening(logged_events)
 
-self.regex_filter = None # filter for presented log events (no 
filtering if None)
 self.last_content_height = 0 # height of the rendered content when 
last drawn
 self._log_file = LogFileOutput(CONFIG['features.log_file'])
 self.scroll = 0
@@ -113,11 +93,6 @@ class LogPanel(panel.Panel, threading.Thread):
 self._last_update = -1   # time the content was last revised
 self._halt = False   # terminates thread if true
 self._cond = threading.Condition()   # used for pausing/resuming the thread
-
-# restricts concurrent write access to attributes used to draw the display
-# and pausing:
-# msg_log, logged_events, regex_filter, scroll
-
 self.vals_lock = threading.RLock()
 
 # cached parameters (invalidated if arguments for them change)
@@ -187,49 +162,7 @@ class LogPanel(panel.Panel, threading.Thread):
 Provides our currently selected regex filter.
 """
 
-return self.filter_options[0] if self.regex_filter else None
-
-  def set_filter(self, log_filter):
-"""
-Filters log entries according to the given regular expression.
-
-Arguments:
-  log_filter - regular expression used to determine which messages are
-  shown, None if no filter should be applied
-"""
-
-if log_filter == self.regex_filter:
-  return
-
-with self.vals_lock:
-  self.regex_filter = log_filter
-  self.redraw(True)
-
-  def make_filter_selection(self, selected_option):
-"""
-Makes the given filter selection, applying it to the log and reorganizing
-our filter selection.
-
-Arguments:
-  selected_option - regex filter we've already added, None if no filter
-   should be applied
-"""
-
-if selected_option:
-  try:
-self.set_filter(re.compile(selected_option))
-
-# move selection to top
-
-self.filter_options.remove(selected_option)
-self.filter_options.insert(0, selected_option)
-  except re.error as exc:
-# shouldn't happen since we've already checked validity
-
-log.warn("Invalid regular expression ('%s': %s) - removing from 
listing" % (selected_option, exc))
-self.filter_options.remove(selected_option)
-else:
-  self.set_filter(None)
+return self._filter
 
   def show_filter_prompt(self):
 """
@@ -239,15 +172,7 @@ class LogPanel(panel.Panel, threading.Thread):
 regex_input = nyx.popups.input_prompt('Regular expression: ')
 
 if regex_input:
-  try:
-self.set_filter(r

[tor-commits] [nyx/master] Overhaul daybreak handling

2015-05-04 Thread atagar
commit 85f98793c90f13b5bdc9a8922ae40380614373f4
Author: Damian Johnson 
Date:   Sun Apr 26 11:38:36 2015 -0700

Overhaul daybreak handling

I never liked our old approach for grouping entries by day. Oh, and it was
inefficient as hell.

Replacing it with simpler and more performant grouping.
---
 nyx/log_panel.py  |  159 +
 nyx/util/log.py   |   33 +-
 test/util/log/data/daybreak_deduplication |   37 +++
 test/util/log/log_group.py|   61 ++-
 4 files changed, 176 insertions(+), 114 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index f61d9c6..2038a69 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -22,10 +22,7 @@ import nyx.popups
 
 from nyx import __version__
 from nyx.util import panel, tor_controller, ui_tools
-from nyx.util.log import LogGroup, LogEntry, read_tor_log
-
-DAYBREAK_EVENT = 'DAYBREAK'  # special event for marking when the date changes
-TIMEZONE_OFFSET = time.altzone if time.localtime()[8] else time.timezone
+from nyx.util.log import LogGroup, LogEntry, read_tor_log, days_since
 
 ENTRY_INDENT = 2  # spaces an entry's message is indented after the first line
 
@@ -65,32 +62,11 @@ DUPLICATE_MSG = ' [%i duplicate%s hidden]'
 
 CONTENT_HEIGHT_REDRAW_THRESHOLD = 3
 
-# cached values and the arguments that generated it for the get_daybreaks and
-# get_duplicates functions
-
-CACHED_DAYBREAKS_ARGUMENTS = (None, None)  # events, current day
-CACHED_DAYBREAKS_RESULT = None
-
 # maximum number of regex filters we'll remember
 
 MAX_REGEX_FILTERS = 5
 
 
-def days_since(timestamp = None):
-  """
-  Provides the number of days since the epoch converted to local time (rounded
-  down).
-
-  Arguments:
-timestamp - unix timestamp to convert, current time if undefined
-  """
-
-  if timestamp is None:
-timestamp = time.time()
-
-  return int((timestamp - TIMEZONE_OFFSET) / 86400)
-
-
 def log_file_path():
   for log_entry in tor_controller().get_conf('Log', [], True):
 entry_comp = log_entry.split()  # looking for an entry like: notice file 
/var/log/tor/notices.log
@@ -99,48 +75,6 @@ def log_file_path():
   return CONFIG['tor.chroot'] + entry_comp[2]
 
 
-def get_daybreaks(events, ignore_time_for_cache = False):
-  """
-  Provides the input events back with special 'DAYBREAK_EVENT' markers inserted
-  whenever the date changed between log entries (or since the most recent
-  event). The timestamp matches the beginning of the day for the following
-  entry.
-
-  Arguments:
-events - chronologically ordered listing of events
-ignore_time_for_cache - skips taking the day into consideration for 
providing
- cached results if true
-  """
-
-  global CACHED_DAYBREAKS_ARGUMENTS, CACHED_DAYBREAKS_RESULT
-
-  if not events:
-return []
-
-  new_listing = []
-  current_day = days_since()
-  last_day = current_day
-
-  if CACHED_DAYBREAKS_ARGUMENTS[0] == events and \
-(ignore_time_for_cache or CACHED_DAYBREAKS_ARGUMENTS[1] == current_day):
-return list(CACHED_DAYBREAKS_RESULT)
-
-  for entry in events:
-event_day = days_since(entry.timestamp)
-
-if event_day != last_day:
-  marker_timestamp = (event_day * 86400) + TIMEZONE_OFFSET
-  new_listing.append(LogEntry(marker_timestamp, DAYBREAK_EVENT, ''))
-
-new_listing.append(entry)
-last_day = event_day
-
-  CACHED_DAYBREAKS_ARGUMENTS = (list(events), current_day)
-  CACHED_DAYBREAKS_RESULT = list(new_listing)
-
-  return new_listing
-
-
 class LogPanel(panel.Panel, threading.Thread, logging.Handler):
   """
   Listens for and displays tor, nyx, and stem events. This can prepopulate
@@ -188,7 +122,7 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 self.scroll = 0
 
 self.set_pause_attr('_msg_log')
-self._msg_log = LogGroup(CONFIG['cache.log_panel.size'])
+self._msg_log = LogGroup(CONFIG['cache.log_panel.size'], group_by_day = 
CONFIG['features.log.showDateDividers'])
 
 self._last_update = -1   # time the content was last revised
 self._halt = False   # terminates thread if true
@@ -260,7 +194,7 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 with self.vals_lock:
   # clears the event log
 
-  self._msg_log = LogGroup(CONFIG['cache.log_panel.size'])
+  self._msg_log = LogGroup(CONFIG['cache.log_panel.size'], group_by_day = 
CONFIG['features.log.showDateDividers'])
 
   # fetches past tor events from log file, if available
 
@@ -477,7 +411,7 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 """
 
 with self.vals_lock:
-  self._msg_log = LogGroup(CONFIG['cache.log_panel.size'])
+  self._msg_log = LogGroup(CONFIG['cache.log_panel.size'], group_by_day = 
CONFIG['features.log.showDateDividers'])
   self.redraw(True)
 
   def save_snapshot(self, path):
@@ -635,6 +569,7 @@ class 

[tor-commits] [nyx/master] Have LogGroup's add() accept LogEntries

2015-05-04 Thread atagar
commit a1f6177e8c08e203bac584ad3dd0f2f1cf9500de
Author: Damian Johnson 
Date:   Mon Apr 27 09:17:32 2015 -0700

Have LogGroup's add() accept LogEntries

On reflection we always have a log entry on hand so lets just have the add
method take that. The only thing that used the prior add() method was the
tests.
---
 nyx/log_panel.py   |4 ++--
 nyx/util/log.py|5 +
 test/util/log/log_group.py |   42 +-
 3 files changed, 24 insertions(+), 27 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index 3bfa739..5016e09 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -148,7 +148,7 @@ class LogPanel(panel.Panel, threading.Thread):
 try:
   for entry in reversed(list(read_tor_log(logging_location, 
read_limit))):
 if entry.type in set_runlevels:
-  self._msg_log.add(entry.timestamp, entry.type, entry.message)
+  self._msg_log.add(entry)
 except IOError as exc:
   log.info('Unable to read log located at %s: %s' % (logging_location, 
exc))
 except ValueError as exc:
@@ -756,7 +756,7 @@ class LogPanel(panel.Panel, threading.Thread):
 self.log_file = None
 
 with self.vals_lock:
-  self._msg_log.add(event.timestamp, event.type, event.message)
+  self._msg_log.add(event)
 
   # notifies the display that it has new content
 
diff --git a/nyx/util/log.py b/nyx/util/log.py
index 279a390..9a40411 100644
--- a/nyx/util/log.py
+++ b/nyx/util/log.py
@@ -135,10 +135,7 @@ class LogGroup(object):
 self._entries = []
 self._lock = threading.RLock()
 
-  def add(self, timestamp, type, message):
-self.add_entry(LogEntry(timestamp, type, message))
-
-  def add_entry(self, entry):
+  def add(self, entry):
 with self._lock:
   duplicate = None
   our_day = entry.days_since()
diff --git a/test/util/log/log_group.py b/test/util/log/log_group.py
index d1f1f46..f4716ca 100644
--- a/test/util/log/log_group.py
+++ b/test/util/log/log_group.py
@@ -9,41 +9,41 @@ class TestLogGroup(unittest.TestCase):
 group = LogGroup(5)
 self.assertEqual(0, len(group))
 
-group.add(1333738410, 'INFO', 'tor_lockfile_lock(): Locking 
"/home/atagar/.tor/lock"')
+group.add(LogEntry(1333738410, 'INFO', 'tor_lockfile_lock(): Locking 
"/home/atagar/.tor/lock"'))
 self.assertEqual([LogEntry(1333738410, 'INFO', 'tor_lockfile_lock(): 
Locking "/home/atagar/.tor/lock"')], list(group))
 self.assertEqual(1, len(group))
 
-group.add(1333738420, 'NYX_DEBUG', 'GETCONF MyFamily (runtime: 0.0007)')
-group.add(1333738430, 'NOTICE', 'Bootstrapped 72%: Loading relay 
descriptors.')
-group.add(1333738440, 'NOTICE', 'Bootstrapped 75%: Loading relay 
descriptors.')
-group.add(1333738450, 'NOTICE', 'Bootstrapped 78%: Loading relay 
descriptors.')
+group.add(LogEntry(1333738420, 'NYX_DEBUG', 'GETCONF MyFamily (runtime: 
0.0007)'))
+group.add(LogEntry(1333738430, 'NOTICE', 'Bootstrapped 72%: Loading relay 
descriptors.'))
+group.add(LogEntry(1333738440, 'NOTICE', 'Bootstrapped 75%: Loading relay 
descriptors.'))
+group.add(LogEntry(1333738450, 'NOTICE', 'Bootstrapped 78%: Loading relay 
descriptors.'))
 self.assertEqual(5, len(group))
 
 # group should now be full, adding more entries pops others off
 
-group.add(1333738460, 'NOTICE', 'Bootstrapped 80%: Loading relay 
descriptors.')
+group.add(LogEntry(1333738460, 'NOTICE', 'Bootstrapped 80%: Loading relay 
descriptors.'))
 self.assertFalse(LogEntry(1333738410, 'INFO', 'tor_lockfile_lock(): 
Locking "/home/atagar/.tor/lock"') in list(group))
 self.assertEqual(5, len(group))
 
 # try adding a bunch that will be deduplicated, and make sure we still 
maintain the size
 
-group.add(1333738510, 'NOTICE', 'Bootstrapped 80%: Loading relay 
descriptors.')
-group.add(1333738520, 'NOTICE', 'Bootstrapped 80%: Loading relay 
descriptors.')
-group.add(1333738530, 'NOTICE', 'Bootstrapped 80%: Loading relay 
descriptors.')
-group.add(1333738540, 'NOTICE', 'Bootstrapped 80%: Loading relay 
descriptors.')
-group.add(1333738550, 'NOTICE', 'Bootstrapped 80%: Loading relay 
descriptors.')
-group.add(1333738560, 'NOTICE', 'Bootstrapped 80%: Loading relay 
descriptors.')
-group.add(1333738570, 'NOTICE', 'Bootstrapped 80%: Loading relay 
descriptors.')
+group.add(LogEntry(1333738510, 'NOTICE', 'Bootstrapped 80%: Loading relay 
descriptors.'))
+group.add(LogEntry(1333738520, 'NOTICE', 'Bootstrapped 80%: Loading relay 
descriptors.'))
+group.add(LogEntry(1333738530, 'NOTICE', 'Bootstrapped 80%: Loading relay 
descriptors.'))
+group.add(LogEntry(1333738540, 'NOTICE', 'Bootstrapped 80%: Loading relay 
descriptors.'))
+group.add(LogEntry(1333738550, 'NOTICE', 'Bootstrapped 80%: Loading relay 
descriptors.'))
+group.add(LogEntry(1333738560, 'NOTICE', 'Bootstrapped 80%: Loading relay 
descriptors.'))
+

[tor-commits] [nyx/master] Finish making log panel attributes private

2015-05-04 Thread atagar
commit e1795b755bbd3630f624c4c2448d7d78703ea61b
Author: Damian Johnson 
Date:   Sun May 3 10:34:42 2015 -0700

Finish making log panel attributes private

Been swapping them over as we rewrite sections, but now just renaming the 
rest.
---
 nyx/log_panel.py |   62 --
 1 file changed, 27 insertions(+), 35 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index 03f4478..0a8e250 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -79,18 +79,13 @@ class LogPanel(panel.Panel, threading.Thread):
 
 self.set_pause_attr('_logged_events')
 
-self.last_content_height = 0 # height of the rendered content when 
last drawn
-self.scroll = 0
+self._last_content_height = 0  # height of the rendered content when last 
drawn
+self._scroll = 0
 
-self._last_update = -1   # time the content was last revised
-self._halt = False   # terminates thread if true
+self._halt = False  # terminates thread if true
 self._pause_condition = threading.Condition()
 self._lock = threading.RLock()
-
-# cached parameters (invalidated if arguments for them change)
-# last set of events we've drawn with
-
-self._last_logged_events = []
+self._has_new_event = False
 
 # fetches past tor events from log file, if available
 
@@ -116,7 +111,7 @@ class LogPanel(panel.Panel, threading.Thread):
 
 # leaving last_content_height as being too low causes initialization 
problems
 
-self.last_content_height = len(self._logged_events)
+self._last_content_height = len(self._logged_events)
 
   def set_duplicate_visability(self, is_visible):
 """
@@ -244,11 +239,11 @@ class LogPanel(panel.Panel, threading.Thread):
   def handle_key(self, key):
 if key.is_scroll():
   page_height = self.get_preferred_size()[0] - 1
-  new_scroll = ui_tools.get_scroll_position(key, self.scroll, page_height, 
self.last_content_height)
+  new_scroll = ui_tools.get_scroll_position(key, self._scroll, 
page_height, self._last_content_height)
 
-  if self.scroll != new_scroll:
+  if self._scroll != new_scroll:
 with self._lock:
-  self.scroll = new_scroll
+  self._scroll = new_scroll
   self.redraw(True)
 elif key.match('u'):
   with self._lock:
@@ -303,11 +298,8 @@ class LogPanel(panel.Panel, threading.Thread):
 ]
 
   def draw(self, width, height):
-event_log = self.get_attr('_logged_events')
-
 with self._lock:
-  self._last_logged_events, self._last_update = event_log, time.time()
-  event_log = list(event_log)
+  event_log = list(self.get_attr('_logged_events'))
 
   # draws the top label
 
@@ -324,20 +316,20 @@ class LogPanel(panel.Panel, threading.Thread):
 
   # restricts scroll location to valid bounds
 
-  self.scroll = max(0, min(self.scroll, self.last_content_height - height 
+ 1))
+  self._scroll = max(0, min(self._scroll, self._last_content_height - 
height + 1))
 
   # draws left-hand scroll bar if content's longer than the height
 
   msg_indent, divider_indent = 1, 0  # offsets for scroll bar
-  is_scroll_bar_visible = self.last_content_height > height - 1
+  is_scroll_bar_visible = self._last_content_height > height - 1
 
   if is_scroll_bar_visible:
 msg_indent, divider_indent = 3, 2
-self.add_scroll_bar(self.scroll, self.scroll + height - 1, 
self.last_content_height, 1)
+self.add_scroll_bar(self._scroll, self._scroll + height - 1, 
self._last_content_height, 1)
 
   # draws log entries
 
-  line_count = 1 - self.scroll
+  line_count = 1 - self._scroll
   seen_first_date_divider = False
   divider_attr, duplicate_attr = (curses.A_BOLD, 'yellow'), 
(curses.A_BOLD, 'green')
 
@@ -459,13 +451,13 @@ class LogPanel(panel.Panel, threading.Thread):
   # - last_content_height was off by too much
   # - we're off the bottom of the page
 
-  new_content_height = line_count + self.scroll - 1
-  content_height_delta = abs(self.last_content_height - new_content_height)
+  new_content_height = line_count + self._scroll - 1
+  content_height_delta = abs(self._last_content_height - 
new_content_height)
   force_redraw, force_redraw_reason = True, ''
 
   if content_height_delta >= CONTENT_HEIGHT_REDRAW_THRESHOLD:
 force_redraw_reason = 'estimate was off by %i' % content_height_delta
-  elif new_content_height > height and self.scroll + height - 1 > 
new_content_height:
+  elif new_content_height > height and self._scroll + height - 1 > 
new_content_height:
 force_redraw_reason = 'scrolled off the bottom of the page'
   elif not is_scroll_bar_visible and new_content_height > height - 1:
 force_redraw_reason = "scroll bar wasn't previously visible"
@@ -474,7 +466,8 @@ class LogPanel(panel.Panel, threading.Thread):
   else:
 force_redraw = False
 
-  

[tor-commits] [nyx/master] Drop deduplicated_log attribute

2015-05-04 Thread atagar
commit 008ab93d05eb005988066aea4381c27e817814ea
Author: Damian Johnson 
Date:   Sun May 3 08:46:59 2015 -0700

Drop deduplicated_log attribute

Easy bit of our draw() funtion to simplify.
---
 nyx/log_panel.py |   90 +++---
 1 file changed, 39 insertions(+), 51 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index 590df6e..03f4478 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -84,8 +84,8 @@ class LogPanel(panel.Panel, threading.Thread):
 
 self._last_update = -1   # time the content was last revised
 self._halt = False   # terminates thread if true
-self._cond = threading.Condition()   # used for pausing/resuming the thread
-self.vals_lock = threading.RLock()
+self._pause_condition = threading.Condition()
+self._lock = threading.RLock()
 
 # cached parameters (invalidated if arguments for them change)
 # last set of events we've drawn with
@@ -177,7 +177,7 @@ class LogPanel(panel.Panel, threading.Thread):
 
   try:
 if event_types != self._logged_event_types:
-  with self.vals_lock:
+  with self._lock:
 self._logged_event_types = 
nyx.util.log.listen_for_events(self._register_tor_event, event_types)
 self.redraw(True)
   except ValueError as exc:
@@ -204,7 +204,7 @@ class LogPanel(panel.Panel, threading.Thread):
 Clears the contents of the event log.
 """
 
-with self.vals_lock:
+with self._lock:
   self._logged_events = 
nyx.util.log.LogGroup(CONFIG['cache.log_panel.size'], group_by_day = 
CONFIG['features.log.showDateDividers'])
   self.redraw(True)
 
@@ -230,17 +230,16 @@ class LogPanel(panel.Panel, threading.Thread):
 except OSError as exc:
   raise IOError("unable to make directory '%s'" % base_dir)
 
-snapshot_file = open(path, 'w')
-
-with self.vals_lock:
-  try:
-for entry in reversed(self._logged_events):
-  is_visible = self._filter.match(entry.display_message)
+with self._lock:
+  with open(path, 'w') as snapshot_file:
+try:
+  for entry in reversed(self._logged_events):
+is_visible = self._filter.match(entry.display_message)
 
-  if is_visible:
-snapshot_file.write(entry.display_message + '\n')
-  except Exception as exc:
-raise exc
+if is_visible:
+  snapshot_file.write(entry.display_message + '\n')
+except Exception as exc:
+  raise IOError("unable to write to '%s': %s" % (path, exc))
 
   def handle_key(self, key):
 if key.is_scroll():
@@ -248,11 +247,11 @@ class LogPanel(panel.Panel, threading.Thread):
   new_scroll = ui_tools.get_scroll_position(key, self.scroll, page_height, 
self.last_content_height)
 
   if self.scroll != new_scroll:
-with self.vals_lock:
+with self._lock:
   self.scroll = new_scroll
   self.redraw(True)
 elif key.match('u'):
-  with self.vals_lock:
+  with self._lock:
 self.set_duplicate_visability(not 
CONFIG['features.log.showDuplicateEntries'])
 self.redraw(True)
 elif key.match('c'):
@@ -304,27 +303,22 @@ class LogPanel(panel.Panel, threading.Thread):
 ]
 
   def draw(self, width, height):
-"""
-Redraws message log. Entries stretch to use available space and may
-contain up to two lines. Starts with newest entries.
-"""
-
 event_log = self.get_attr('_logged_events')
 
-with self.vals_lock:
+with self._lock:
   self._last_logged_events, self._last_update = event_log, time.time()
   event_log = list(event_log)
 
   # draws the top label
 
   if self.is_title_visible():
-comp = list(nyx.util.log.condense_runlevels(*self._logged_event_types))
+title_comp = 
list(nyx.util.log.condense_runlevels(*self._logged_event_types))
 
 if self._filter.selection():
-  comp.append('filter: %s' % self._filter.selection())
+  title_comp.append('filter: %s' % self._filter.selection())
 
-comp_str = join(comp, ', ', width - 10)
-title = 'Events (%s):' % comp_str if comp_str else 'Events:'
+title_comp_str = join(title_comp, ', ', width - 10)
+title = 'Events (%s):' % title_comp_str if title_comp_str else 
'Events:'
 
 self.addstr(0, 0, title, curses.A_STANDOUT)
 
@@ -347,27 +341,21 @@ class LogPanel(panel.Panel, threading.Thread):
   seen_first_date_divider = False
   divider_attr, duplicate_attr = (curses.A_BOLD, 'yellow'), 
(curses.A_BOLD, 'green')
 
-  # TODO: fix daybreak handling
-  # is_dates_shown = self.regex_filter is None and 
CONFIG['features.log.showDateDividers']
-  # event_log = get_daybreaks(current_log, self.is_paused()) if 
is_dates_shown else current_log
-
-  if not CONFIG['features.log.showDuplicateEntries']:
-deduplicated_log = []
-
-for e

[tor-commits] [nyx/master] Rewrite log panel

2015-05-04 Thread atagar
commit 1ef21851fabb44d4df83cde2df64e490f31848f7
Merge: 4517746 454803d
Author: Damian Johnson 
Date:   Mon May 4 22:36:43 2015 -0700

Rewrite log panel

Overhaul our log panel. Cleaner code, decent test coverage, but probably
neatest for users is that our deduplication logic is no longer painfully
inefficient. Previously it was a O(n^2) operation essentially every time we
logged an event (so pretty much O(n^3). This was so bad the panel turned off
deduplication when it became too slow.

New version is O(n^2) over the lifetime of our process, and we can make it
linear with just a bit more work.

 nyx/config/attributes.cfg |   18 +
 nyx/config/dedup.cfg  |   68 +-
 nyx/config/strings.cfg|1 +
 nyx/controller.py |   10 +-
 nyx/graph_panel.py|3 +-
 nyx/header_panel.py   |5 +-
 nyx/log_panel.py  | 1309 +
 nyx/menu/actions.py   |6 +-
 nyx/util/__init__.py  |9 +-
 nyx/util/log.py   |  452 ++
 nyx/util/panel.py |   36 +-
 nyx/util/ui_tools.py  |   27 +-
 nyxrc.sample  |7 -
 run_tests.py  |   10 +-
 test/util/__init__.py |2 +-
 test/util/log/__init__.py |8 +
 test/util/log/condense_runlevels.py   |   13 +
 test/util/log/data/daybreak_deduplication |   37 +
 test/util/log/data/malformed_date |   21 +
 test/util/log/data/malformed_line |   21 +
 test/util/log/data/malformed_runlevel |   21 +
 test/util/log/data/multiple_tor_instances |   33 +
 test/util/log/data/tor_log|   21 +
 test/util/log/log_entry.py|   27 +
 test/util/log/log_group.py|  146 
 test/util/log/read_tor_log.py |   59 ++
 26 files changed, 1202 insertions(+), 1168 deletions(-)

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


[tor-commits] [nyx/master] Function for drawing a log message

2015-05-04 Thread atagar
commit eb090a9c2a9d985df4477136e682e89bc5905d04
Author: Damian Johnson 
Date:   Mon May 4 13:28:58 2015 -0700

Function for drawing a log message

Ick this draw function is a tricky, tangled mess! To be fair what it's 
trying
to do isn't easy.

Big chunk of this is rendering the content of a log message with line 
wrapping
and deduplication. Rewritting this bit first in its own function.
---
 nyx/log_panel.py |  114 --
 1 file changed, 51 insertions(+), 63 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index 0a8e250..4211e09 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -331,7 +331,7 @@ class LogPanel(panel.Panel, threading.Thread):
 
   line_count = 1 - self._scroll
   seen_first_date_divider = False
-  divider_attr, duplicate_attr = (curses.A_BOLD, 'yellow'), 
(curses.A_BOLD, 'green')
+  divider_attr = (curses.A_BOLD, 'yellow')
 
   # determines if we have the minimum width to show date dividers
 
@@ -342,15 +342,10 @@ class LogPanel(panel.Panel, threading.Thread):
 entry = event_log[i]
 is_last = i == len(event_log) - 1
 
-if CONFIG['features.log.showDuplicateEntries']:
-  duplicate_count = 0
-elif entry.is_duplicate:
-  continue
-else:
-  duplicate_count = len(entry.duplicates) if entry.duplicates else 0
-
-if not self._filter.match(entry.display_message):
-  continue  # filter doesn't match log message - skip
+if entry.is_duplicate and not 
CONFIG['features.log.showDuplicateEntries']:
+  continue  # deduplicated message
+elif not self._filter.match(entry.display_message):
+  continue  # filter doesn't match log message
 
 # checks if we should be showing a divider with the date
 
@@ -380,60 +375,13 @@ class LogPanel(panel.Panel, threading.Thread):
   seen_first_date_divider = True
   line_count += 1
 
-# entry contents to be displayed, tuples of the form:
-# (msg, formatting, includeLinebreak)
-
-display_queue = []
-
-msg_comp = entry.display_message.split('\n')
-
-for i in range(len(msg_comp)):
-  font = curses.A_BOLD if 'ERR' in entry.type else curses.A_NORMAL  # 
emphasizes ERR messages
-  display_queue.append((msg_comp[i].strip(), (font, 
CONFIG['attr.log_color'].get(entry.type, 'white')), i != len(msg_comp) - 1))
-
-if duplicate_count:
-  plural_label = 's' if duplicate_count > 1 else ''
-  duplicate_msg = ' [%i duplicate%s hidden]' % (duplicate_count, 
plural_label)
-  display_queue.append((duplicate_msg, duplicate_attr, False))
-
-# TODO: a fix made line_offset unused, and probably broke 
max_entries_per_line... not sure if we care
-
-cursor_location, line_offset = msg_indent, 0
-max_entries_per_line = CONFIG['features.log.max_lines_per_entry']
-
-while display_queue:
-  msg, format, include_break = display_queue.pop(0)
-  draw_line = line_count + line_offset
-
-  if line_offset == max_entries_per_line:
-break
-
-  max_msg_size = width - cursor_location - 1
-
-  if len(msg) > max_msg_size:
-# message is too long - break it up
-if line_offset == max_entries_per_line - 1:
-  msg = str_tools.crop(msg, max_msg_size)
-else:
-  msg, remainder = str_tools.crop(msg, max_msg_size, 4, 4, 
str_tools.Ending.HYPHEN, True)
-  display_queue.insert(0, (remainder.strip(), format, 
include_break))
-
-include_break = True
-
-  if draw_line < height and draw_line >= 1:
-if seen_first_date_divider and width - divider_indent >= 3 and 
show_daybreaks:
-  self.addch(draw_line, divider_indent, curses.ACS_VLINE, 
*divider_attr)
-  self.addch(draw_line, width - 1, curses.ACS_VLINE, *divider_attr)
-
-self.addstr(draw_line, cursor_location, msg, *format)
-
-  cursor_location += len(msg)
+line_count_start = line_count
+line_count = self._draw_entry(msg_indent, line_count, width, entry, 
height)
 
-  if include_break or not display_queue:
-line_count += 1
-cursor_location = msg_indent + 2  # indent following lines
-
-  line_count += line_offset
+for y in range(line_count_start, line_count):
+  if seen_first_date_divider and width - divider_indent >= 3 and 
show_daybreaks:
+self.addch(y, divider_indent, curses.ACS_VLINE, *divider_attr)
+self.addch(y, width - 1, curses.ACS_VLINE, *divider_attr)
 
 # if this is the last line and there's room, then draw the bottom of 
the divider
 
@@ -473,6 +421,46 @@ class LogPanel(panel.Panel, threading.Thread):
 log.debug('redrawing the log panel with the corrected content height 
(%s)' % force_redraw_reason)
 

[tor-commits] [nyx/master] Register stem/nyx events from before curses starts

2015-05-04 Thread atagar
commit 59b6dabb2ce64684069a1a9fa796a586302acb23
Author: Damian Johnson 
Date:   Mon Apr 27 09:07:42 2015 -0700

Register stem/nyx events from before curses starts

Recording events from when the log panel is imported, rather than after 
curses
starts (which misses a lot of potentially interesting events).
---
 nyx/log_panel.py |  121 +-
 nyx/util/log.py  |2 +-
 2 files changed, 57 insertions(+), 66 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index fe75e18..3bfa739 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -8,7 +8,6 @@ import re
 import os
 import time
 import curses
-import logging
 import threading
 
 import stem
@@ -64,6 +63,13 @@ CONTENT_HEIGHT_REDRAW_THRESHOLD = 3
 
 MAX_REGEX_FILTERS = 5
 
+# Log buffer so we start collecting stem/nyx events when imported. This is used
+# to make our LogPanel when curses initializes.
+
+stem_logger = stem.util.log.get_logger()
+NYX_LOGGER = log.LogBuffer(log.Runlevel.DEBUG, yield_records = True)
+stem_logger.addHandler(NYX_LOGGER)
+
 
 def log_file_path():
   for log_entry in tor_controller().get_conf('Log', [], True):
@@ -73,7 +79,7 @@ def log_file_path():
   return CONFIG['tor.chroot'] + entry_comp[2]
 
 
-class LogPanel(panel.Panel, threading.Thread, logging.Handler):
+class LogPanel(panel.Panel, threading.Thread):
   """
   Listens for and displays tor, nyx, and stem events. This can prepopulate
   from tor's log file if it exists.
@@ -81,13 +87,6 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 
   def __init__(self, stdscr, logged_events):
 panel.Panel.__init__(self, stdscr, 'log', 0)
-logging.Handler.__init__(self, level = log.logging_level(log.DEBUG))
-
-self.setFormatter(logging.Formatter(
-  fmt = '%(asctime)s [%(levelname)s] %(message)s',
-  datefmt = '%m/%d/%Y %H:%M:%S'),
-)
-
 threading.Thread.__init__(self)
 self.setDaemon(True)
 
@@ -155,6 +154,13 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 except ValueError as exc:
   log.info(str(exc))
 
+# stop logging to NYX_LOGGER, adding its event backlog and future ones
+
+for event in NYX_LOGGER:
+  self._register_nyx_event(event)
+
+NYX_LOGGER.emit = self._register_nyx_event
+
 # leaving last_content_height as being too low causes initialization 
problems
 
 self.last_content_height = len(self._msg_log)
@@ -191,15 +197,6 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 log.error('Unable to write to log file: %s' % exc)
 self.log_file = None
 
-stem_logger = log.get_logger()
-stem_logger.addHandler(self)
-
-  def emit(self, record):
-if record.levelname == 'WARNING':
-  record.levelname = 'WARN'
-
-self.register_event(LogEntry(int(record.created), 'NYX_%s' % 
record.levelname, record.msg))
-
   def set_duplicate_visability(self, is_visible):
 """
 Sets if duplicate log entries are collaped or expanded.
@@ -212,51 +209,6 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 nyx_config = conf.get_config('nyx')
 nyx_config.set('features.log.showDuplicateEntries', str(is_visible))
 
-  def register_tor_event(self, event):
-"""
-Translates a stem.response.event.Event instance into a LogEvent, and calls
-register_event().
-"""
-
-msg = ' '.join(str(event).split(' ')[1:])
-
-if isinstance(event, stem.response.events.BandwidthEvent):
-  msg = 'READ: %i, WRITTEN: %i' % (event.read, event.written)
-elif isinstance(event, stem.response.events.LogEvent):
-  msg = event.message
-
-self.register_event(LogEntry(event.arrived_at, event.type, msg))
-
-  def register_event(self, event):
-"""
-Notes event and redraws log. If paused it's held in a temporary buffer.
-
-Arguments:
-  event - LogEntry for the event that occurred
-"""
-
-if event.type not in self.logged_events:
-  return
-
-# note event in the log file if we're saving them
-
-if self.log_file:
-  try:
-self.log_file.write(event.display_message + '\n')
-self.log_file.flush()
-  except IOError as exc:
-log.error('Unable to write to log file: %s' % exc.strerror)
-self.log_file = None
-
-with self.vals_lock:
-  self._msg_log.add(event.timestamp, event.type, event.message)
-
-  # notifies the display that it has new content
-
-  if not self.regex_filter or 
self.regex_filter.search(event.display_message):
-with self._cond:
-  self._cond.notifyAll()
-
   def set_logged_events(self, event_types):
 """
 Sets the event types recognized by the panel.
@@ -761,14 +713,53 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
   tor_events.update(set(nyx.arguments.missing_event_types()))
 
 controller = tor_controller()
-controller.remove_event_listener(self.register_tor_event)
+controller.rem

[tor-commits] [nyx/master] Finish rewriting the log panel

2015-05-04 Thread atagar
commit 454803d2516cf53c91a9f0068003761168fcbcf7
Author: Damian Johnson 
Date:   Mon May 4 22:35:38 2015 -0700

Finish rewriting the log panel

Not completely perfect, but damn close. Happy enough with it to finally 
merge. :P
---
 nyx/graph_panel.py  |3 +--
 nyx/header_panel.py |5 ++--
 nyx/log_panel.py|   74 ---
 3 files changed, 32 insertions(+), 50 deletions(-)

diff --git a/nyx/graph_panel.py b/nyx/graph_panel.py
index 3cc60bd..cf43492 100644
--- a/nyx/graph_panel.py
+++ b/nyx/graph_panel.py
@@ -20,10 +20,9 @@ import nyx.controller
 import nyx.popups
 import nyx.util.tracker
 
-from nyx.util import join, msg, panel, tor_controller
-
 from stem.control import EventType, Listener
 from stem.util import conf, enum, log, str_tools, system
+from nyx.util import join, msg, panel, tor_controller
 
 GraphStat = enum.Enum(('BANDWIDTH', 'bandwidth'), ('CONNECTIONS', 
'connections'), ('SYSTEM_RESOURCES', 'resources'))
 Interval = enum.Enum(('EACH_SECOND', 'each second'), ('FIVE_SECONDS', '5 
seconds'), ('THIRTY_SECONDS', '30 seconds'), ('MINUTELY', 'minutely'), 
('FIFTEEN_MINUTE', '15 minute'), ('THIRTY_MINUTE', '30 minute'), ('HOURLY', 
'hourly'), ('DAILY', 'daily'))
diff --git a/nyx/header_panel.py b/nyx/header_panel.py
index df63174..4eb0a84 100644
--- a/nyx/header_panel.py
+++ b/nyx/header_panel.py
@@ -10,14 +10,13 @@ import time
 import curses
 import threading
 
+import stem
+
 import nyx.controller
 import nyx.popups
 
-import stem
-
 from stem.control import Listener
 from stem.util import conf, log, proc, str_tools, system
-
 from nyx.util import msg, tor_controller, panel, tracker
 
 MIN_DUAL_COL_WIDTH = 141  # minimum width where we'll show two columns
diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index 300af83..626a42f 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -9,15 +9,13 @@ import time
 import curses
 import threading
 
-import stem
 import stem.response.events
 
-from stem.util import conf, log, str_tools
-
 import nyx.arguments
 import nyx.popups
 import nyx.util.log
 
+from stem.util import conf, log, str_tools
 from nyx.util import join, panel, tor_controller, ui_tools
 
 
@@ -45,6 +43,8 @@ CONFIG = conf.config_dict('nyx', {
   'attr.log_color': {},
 }, conf_handler)
 
+TIMEZONE_OFFSET = time.altzone if time.localtime()[8] else time.timezone
+
 # The height of the drawn content is estimated based on the last time we redrew
 # the panel. It's chiefly used for scrolling and the bar indicating its
 # position. Letting the estimate be too inaccurate results in a display bug, so
@@ -55,14 +55,14 @@ CONTENT_HEIGHT_REDRAW_THRESHOLD = 3
 # Log buffer so we start collecting stem/nyx events when imported. This is used
 # to make our LogPanel when curses initializes.
 
-stem_logger = stem.util.log.get_logger()
+stem_logger = log.get_logger()
 NYX_LOGGER = log.LogBuffer(log.Runlevel.DEBUG, yield_records = True)
 stem_logger.addHandler(NYX_LOGGER)
 
 
 class LogPanel(panel.Panel, threading.Thread):
   """
-  Listens for and displays tor, nyx, and stem events. This can prepopulate
+  Listens for and displays tor, nyx, and stem events. This prepopulates
   from tor's log file if it exists.
   """
 
@@ -71,19 +71,16 @@ class LogPanel(panel.Panel, threading.Thread):
 threading.Thread.__init__(self)
 self.setDaemon(True)
 
+self._logged_events = 
nyx.util.log.LogGroup(CONFIG['cache.log_panel.size'], group_by_day = True)
 self._logged_event_types = 
nyx.util.log.listen_for_events(self._register_tor_event, logged_events)
-self._logged_events = nyx.util.log.LogGroup(CONFIG['cache.log_panel.size'])
 self._log_file = nyx.util.log.LogFileOutput(CONFIG['features.logFile'])
 self._filter = nyx.util.log.LogFilters(initial_filters = 
CONFIG['features.log.regex'])
 
 self.set_pause_attr('_logged_events')
 
-self._last_content_height = 0  # height of the rendered content when last 
drawn
-self._scroll = 0
-
 self._halt = False  # terminates thread if true
-self._pause_condition = threading.Condition()
 self._lock = threading.RLock()
+self._pause_condition = threading.Condition()
 self._has_new_event = False
 
 # fetches past tor events from log file, if available
@@ -101,24 +98,22 @@ class LogPanel(panel.Panel, threading.Thread):
 except ValueError as exc:
   log.info(str(exc))
 
-# stop logging to NYX_LOGGER, adding its event backlog and future ones
+self._last_content_height = len(self._logged_events)  # height of the 
rendered content when last drawn
+self._scroll = 0
+
+# merge NYX_LOGGER into us, and listen for its future events
 
 for event in NYX_LOGGER:
   self._register_nyx_event(event)
 
 NYX_LOGGER.emit = self._register_nyx_event
 
-# leaving last_content_height as being too low causes initialization 
problems
-
-self._last_content_height = len(self._logged_events)
-
   def set_duplicate_visability(self, is_visibl

[tor-commits] [nyx/master] Use absolute names for nyx.util.log functions

2015-05-04 Thread atagar
commit 2ebaf9cbf00b23d9d5646504bb19dc0e0405a4b2
Author: Damian Johnson 
Date:   Sat May 2 13:56:44 2015 -0700

Use absolute names for nyx.util.log functions

Now that so many are over there importing the names is a pretty big import
line. Lets just use the absolute names instead.
---
 nyx/log_panel.py |   32 +++-
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index fe3e39e..590df6e 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -16,11 +16,9 @@ from stem.util import conf, log, str_tools
 
 import nyx.arguments
 import nyx.popups
+import nyx.util.log
 
 from nyx.util import join, panel, tor_controller, ui_tools
-from nyx.util.log import LogFileOutput, LogGroup, LogEntry, LogFilters, 
read_tor_log, condense_runlevels, listen_for_events, days_since, log_file_path
-
-ENTRY_INDENT = 2  # spaces an entry's message is indented after the first line
 
 
 def conf_handler(key, value):
@@ -74,10 +72,10 @@ class LogPanel(panel.Panel, threading.Thread):
 threading.Thread.__init__(self)
 self.setDaemon(True)
 
-self._logged_event_types = listen_for_events(self._register_tor_event, 
logged_events)
-self._logged_events = LogGroup(CONFIG['cache.log_panel.size'], 
group_by_day = CONFIG['features.log.showDateDividers'])
-self._log_file = LogFileOutput(CONFIG['features.log_file'])
-self._filter = LogFilters(initial_filters = CONFIG['features.log.regex'])
+self._logged_event_types = 
nyx.util.log.listen_for_events(self._register_tor_event, logged_events)
+self._logged_events = 
nyx.util.log.LogGroup(CONFIG['cache.log_panel.size'], group_by_day = 
CONFIG['features.log.showDateDividers'])
+self._log_file = nyx.util.log.LogFileOutput(CONFIG['features.log_file'])
+self._filter = nyx.util.log.LogFilters(initial_filters = 
CONFIG['features.log.regex'])
 
 self.set_pause_attr('_logged_events')
 
@@ -97,11 +95,11 @@ class LogPanel(panel.Panel, threading.Thread):
 # fetches past tor events from log file, if available
 
 if CONFIG['features.log.prepopulate']:
-  log_location = log_file_path(tor_controller())
+  log_location = nyx.util.log.log_file_path(tor_controller())
 
   if log_location:
 try:
-  for entry in reversed(list(read_tor_log(log_location, 
CONFIG['features.log.prepopulateReadLimit']))):
+  for entry in reversed(list(nyx.util.log.read_tor_log(log_location, 
CONFIG['features.log.prepopulateReadLimit']))):
 if entry.type in self._logged_event_types:
   self._logged_events.add(entry)
 except IOError as exc:
@@ -180,7 +178,7 @@ class LogPanel(panel.Panel, threading.Thread):
   try:
 if event_types != self._logged_event_types:
   with self.vals_lock:
-self._logged_event_types = 
listen_for_events(self._register_tor_event, event_types)
+self._logged_event_types = 
nyx.util.log.listen_for_events(self._register_tor_event, event_types)
 self.redraw(True)
   except ValueError as exc:
 nyx.popups.show_msg('Invalid flags: %s' % str(exc), 2)
@@ -207,7 +205,7 @@ class LogPanel(panel.Panel, threading.Thread):
 """
 
 with self.vals_lock:
-  self._logged_events = LogGroup(CONFIG['cache.log_panel.size'], 
group_by_day = CONFIG['features.log.showDateDividers'])
+  self._logged_events = 
nyx.util.log.LogGroup(CONFIG['cache.log_panel.size'], group_by_day = 
CONFIG['features.log.showDateDividers'])
   self.redraw(True)
 
   def save_snapshot(self, path):
@@ -320,7 +318,7 @@ class LogPanel(panel.Panel, threading.Thread):
   # draws the top label
 
   if self.is_title_visible():
-comp = list(condense_runlevels(*self._logged_event_types))
+comp = list(nyx.util.log.condense_runlevels(*self._logged_event_types))
 
 if self._filter.selection():
   comp.append('filter: %s' % self._filter.selection())
@@ -453,7 +451,7 @@ class LogPanel(panel.Panel, threading.Thread):
 
   if include_break or not display_queue:
 line_count += 1
-cursor_location = msg_indent + ENTRY_INDENT
+cursor_location = msg_indent + 2  # indent following lines
 
   line_count += line_offset
 
@@ -501,10 +499,10 @@ class LogPanel(panel.Panel, threading.Thread):
 responsive if additions are less frequent.
 """
 
-last_day = days_since(time.time())  # used to determine if the date has 
changed
+last_day = nyx.util.log.days_since(time.time())  # used to determine if 
the date has changed
 
 while not self._halt:
-  current_day = days_since(time.time())
+  current_day = nyx.util.log.days_since(time.time())
   time_since_reset = time.time() - self._last_update
   max_log_update_rate = CONFIG['features.log.maxRefreshRate'] / 1000.0
 
@@ -545,13 +543,13 @@ class LogPanel(panel.Panel, threading.Thread):
 elif isinstance(e

[tor-commits] [nyx/master] Don't clear log when re-attaching to tor

2015-05-04 Thread atagar
commit faa6dd144d254e201b547e86341be7dbc44d1d34
Author: Damian Johnson 
Date:   Sun Apr 26 22:21:15 2015 -0700

Don't clear log when re-attaching to tor

Idea was to ensure logs concerned the tor instance we're attached to, but 
not
sure this is actually desirable. When attaching to a restarted tor instance 
no
reason to clear the nyx log panel.
---
 nyx/log_panel.py |   63 --
 1 file changed, 23 insertions(+), 40 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index 3e83de5..fe75e18 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -137,7 +137,23 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 
 self._last_logged_events = []
 
-self.reprepopulate_events()
+# fetches past tor events from log file, if available
+
+if CONFIG['features.log.prepopulate']:
+  set_runlevels = list(set.intersection(set(self.logged_events), 
set(list(log.Runlevel
+  read_limit = CONFIG['features.log.prepopulateReadLimit']
+
+  logging_location = log_file_path()
+
+  if logging_location:
+try:
+  for entry in reversed(list(read_tor_log(logging_location, 
read_limit))):
+if entry.type in set_runlevels:
+  self._msg_log.add(entry.timestamp, entry.type, entry.message)
+except IOError as exc:
+  log.info('Unable to read log located at %s: %s' % (logging_location, 
exc))
+except ValueError as exc:
+  log.info(str(exc))
 
 # leaving last_content_height as being too low causes initialization 
problems
 
@@ -146,7 +162,12 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 # adds listeners for tor and stem events
 
 controller = tor_controller()
-controller.add_status_listener(self._reset_listener)
+
+def reset_listener(controller, event_type, _):
+  if event_type == State.CLOSED:
+log.notice('Tor control port closed')
+
+controller.add_status_listener(reset_listener)
 
 # opens log file if we'll be saving entries
 
@@ -179,34 +200,6 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 
 self.register_event(LogEntry(int(record.created), 'NYX_%s' % 
record.levelname, record.msg))
 
-  def reprepopulate_events(self):
-"""
-Clears the event log and repopulates it from the nyx and tor backlogs.
-"""
-
-with self.vals_lock:
-  # clears the event log
-
-  self._msg_log = LogGroup(CONFIG['cache.log_panel.size'], group_by_day = 
CONFIG['features.log.showDateDividers'])
-
-  # fetches past tor events from log file, if available
-
-  if CONFIG['features.log.prepopulate']:
-set_runlevels = list(set.intersection(set(self.logged_events), 
set(list(log.Runlevel
-read_limit = CONFIG['features.log.prepopulateReadLimit']
-
-logging_location = log_file_path()
-
-if logging_location:
-  try:
-for entry in reversed(list(read_tor_log(logging_location, 
read_limit))):
-  if entry.type in set_runlevels:
-self._msg_log.add(entry.timestamp, entry.type, entry.message)
-  except IOError as exc:
-log.info('Unable to read log located at %s: %s' % 
(logging_location, exc))
-  except ValueError as exc:
-log.info(str(exc))
-
   def set_duplicate_visability(self, is_visible):
 """
 Sets if duplicate log entries are collaped or expanded.
@@ -779,13 +772,3 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 # provides back the input set minus events we failed to set
 
 return sorted(tor_events.union(nyx_events))
-
-  def _reset_listener(self, controller, event_type, _):
-# if we're attaching to a new tor instance then clears the log and
-# prepopulates it with the content belonging to this instance
-
-if event_type == State.INIT:
-  self.reprepopulate_events()
-  self.redraw(True)
-elif event_type == State.CLOSED:
-  log.notice('Tor control port closed')



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


[tor-commits] [nyx/master] Rewrite log panel title handling

2015-05-04 Thread atagar
commit a909b71b1d8c870d88914b049b87fec2bb7608b2
Author: Damian Johnson 
Date:   Sun Apr 26 22:01:41 2015 -0700

Rewrite log panel title handling

Moved the tricky bit to a helper, now with tests.
---
 nyx/log_panel.py|  152 +++
 nyx/util/log.py |   69 
 test/util/log/condense_runlevels.py |   13 +++
 3 files changed, 95 insertions(+), 139 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index 2038a69..3e83de5 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -21,8 +21,8 @@ import nyx.arguments
 import nyx.popups
 
 from nyx import __version__
-from nyx.util import panel, tor_controller, ui_tools
-from nyx.util.log import LogGroup, LogEntry, read_tor_log, days_since
+from nyx.util import join, panel, tor_controller, ui_tools
+from nyx.util.log import TOR_RUNLEVELS, LogGroup, LogEntry, read_tor_log, 
condense_runlevels, days_since
 
 ENTRY_INDENT = 2  # spaces an entry's message is indented after the first line
 
@@ -53,8 +53,6 @@ CONFIG = conf.config_dict('nyx', {
   'attr.log_color': {},
 }, conf_handler)
 
-DUPLICATE_MSG = ' [%i duplicate%s hidden]'
-
 # The height of the drawn content is estimated based on the last time we redrew
 # the panel. It's chiefly used for scrolling and the bar indicating its
 # position. Letting the estimate be too inaccurate results in a display bug, so
@@ -139,11 +137,6 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 
 self._last_logged_events = []
 
-# _get_title (args: logged_events, regex_filter pattern, width)
-
-self._title_cache = None
-self._title_args = (None, None, None)
-
 self.reprepopulate_events()
 
 # leaving last_content_height as being too low causes initialization 
problems
@@ -531,7 +524,15 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
   # draws the top label
 
   if self.is_title_visible():
-self.addstr(0, 0, self._get_title(width), curses.A_STANDOUT)
+comp = condense_runlevels(*self.logged_events)
+
+if self.regex_filter:
+  comp.append('filter: %s' % self.regex_filter)
+
+comp_str = join(comp, ', ', width - 10)
+title = 'Events (%s):' % comp_str if comp_str else 'Events:'
+
+self.addstr(0, 0, title, curses.A_STANDOUT)
 
   # restricts scroll location to valid bounds
 
@@ -618,7 +619,7 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 
 if duplicate_count:
   plural_label = 's' if duplicate_count > 1 else ''
-  duplicate_msg = DUPLICATE_MSG % (duplicate_count, plural_label)
+  duplicate_msg = ' [%i duplicate%s hidden]' % (duplicate_count, 
plural_label)
   display_queue.append((duplicate_msg, duplicate_attr, False))
 
 # TODO: a fix made line_offset unused, and probably broke 
max_entries_per_line... not sure if we care
@@ -758,16 +759,8 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 
 # accounts for runlevel naming difference
 
-if 'ERROR' in events:
-  events.add('ERR')
-  events.remove('ERROR')
-
-if 'WARNING' in events:
-  events.add('WARN')
-  events.remove('WARNING')
-
 tor_events = 
events.intersection(set(nyx.arguments.TOR_EVENT_TYPES.values()))
-nyx_events = events.intersection(set(['NYX_%s' % runlevel for runlevel in 
log.Runlevel.keys()]))
+nyx_events = events.intersection(set(['NYX_%s' % runlevel for runlevel in 
TOR_RUNLEVELS]))
 
 # adds events unrecognized by nyx if we're listening to the 'UNKNOWN' type
 
@@ -796,122 +789,3 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
   self.redraw(True)
 elif event_type == State.CLOSED:
   log.notice('Tor control port closed')
-
-  def _get_title(self, width):
-"""
-Provides the label used for the panel, looking like:
-  Events (NYX NOTICE - ERR, BW - filter: prepopulate):
-
-This truncates the attributes (with an ellipse) if too long, and condenses
-runlevel ranges if there's three or more in a row (for instance NYX_INFO,
-NYX_NOTICE, and NYX_WARN becomes 'NYX_INFO - WARN').
-
-Arguments:
-  width - width constraint the label needs to fix in
-"""
-
-# usually the attributes used to make the label are decently static, so
-# provide cached results if they're unchanged
-
-with self.vals_lock:
-  current_pattern = self.regex_filter.pattern if self.regex_filter else 
None
-  is_unchanged = self._title_args[0] == self.logged_events
-  is_unchanged &= self._title_args[1] == current_pattern
-  is_unchanged &= self._title_args[2] == width
-
-  if is_unchanged:
-return self._title_cache
-
-  events_list = list(self.logged_events)
-
-  if not events_list:
-if not current_pattern:
-  panel_label = 'Events:'
-else:
-  label_pattern = str_tools.crop(current_pattern, width - 18)
-  

[tor-commits] [nyx/master] Revise outputing logs to a file

2015-05-04 Thread atagar
commit 179a7dcd216661fa32a3ea300b9b1a7dd2c19cc7
Author: Damian Johnson 
Date:   Tue Apr 28 09:49:51 2015 -0700

Revise outputing logs to a file

Moving this to its own simple class. Much nicer.
---
 nyx/log_panel.py |   38 +++---
 nyx/util/log.py  |   35 +++
 2 files changed, 38 insertions(+), 35 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index f250084..44a2b2a 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -19,9 +19,8 @@ from stem.util import conf, log, str_tools
 import nyx.arguments
 import nyx.popups
 
-from nyx import __version__
 from nyx.util import join, panel, tor_controller, ui_tools
-from nyx.util.log import TOR_RUNLEVELS, LogGroup, LogEntry, read_tor_log, 
condense_runlevels, days_since, log_file_path
+from nyx.util.log import TOR_RUNLEVELS, LogFileOutput, LogGroup, LogEntry, 
read_tor_log, condense_runlevels, days_since, log_file_path
 
 ENTRY_INDENT = 2  # spaces an entry's message is indented after the first line
 
@@ -106,7 +105,7 @@ class LogPanel(panel.Panel, threading.Thread):
 
 self.regex_filter = None # filter for presented log events (no 
filtering if None)
 self.last_content_height = 0 # height of the rendered content when 
last drawn
-self._log_file = None# file log messages are saved to 
(skipped if None)
+self._log_file = LogFileOutput(CONFIG['features.log_file'])
 self.scroll = 0
 
 self.set_pause_attr('_msg_log')
@@ -166,28 +165,6 @@ class LogPanel(panel.Panel, threading.Thread):
 
 controller.add_status_listener(reset_listener)
 
-# opens log file if we'll be saving entries
-
-if CONFIG['features.log_file']:
-  log_path = CONFIG['features.log_file']
-
-  try:
-# make dir if the path doesn't already exist
-
-base_dir = os.path.dirname(log_path)
-
-if not os.path.exists(base_dir):
-  os.makedirs(base_dir)
-
-self._log_file = open(log_path, 'a')
-log.notice('nyx %s opening log file (%s)' % (__version__, log_path))
-  except IOError as exc:
-log.error('Unable to write to log file: %s' % exc.strerror)
-self._log_file = None
-  except OSError as exc:
-log.error('Unable to write to log file: %s' % exc)
-self._log_file = None
-
   def set_duplicate_visability(self, is_visible):
 """
 Sets if duplicate log entries are collaped or expanded.
@@ -736,18 +713,9 @@ class LogPanel(panel.Panel, threading.Thread):
 if event.type not in self.logged_events:
   return
 
-# note event in the log file if we're saving them
-
-if self._log_file:
-  try:
-self._log_file.write(event.display_message + '\n')
-self._log_file.flush()
-  except IOError as exc:
-log.error('Unable to write to log file: %s' % exc.strerror)
-self._log_file = None
-
 with self.vals_lock:
   self._msg_log.add(event)
+  self._log_file.write(event.display_message)
 
   # notifies the display that it has new content
 
diff --git a/nyx/util/log.py b/nyx/util/log.py
index 4df50c0..a2e3820 100644
--- a/nyx/util/log.py
+++ b/nyx/util/log.py
@@ -3,6 +3,7 @@ Logging utilities, primiarily short aliases for logging a 
message at various
 runlevels.
 """
 
+import os
 import time
 import threading
 
@@ -10,6 +11,7 @@ import stem.util.conf
 import stem.util.log
 import stem.util.system
 
+import nyx
 import nyx.util
 
 try:
@@ -271,6 +273,39 @@ class LogEntry(object):
 return hash(self.display_message)
 
 
+class LogFileOutput(object):
+  """
+  File where log messages we receive are written. If unable to do so then a
+  notification is logged and further write attempts are skipped.
+  """
+
+  def __init__(self, path):
+self._file = None
+
+if path:
+  try:
+path_dir = os.path.dirname(path)
+
+if not os.path.exists(path_dir):
+  os.makedirs(path_dir)
+
+self._file = open(path, 'a')
+notice('nyx %s opening log file (%s)' % (nyx.__version__, path))
+  except IOError as exc:
+error('Unable to write to log file: %s' % exc.strerror)
+  except OSError as exc:
+error('Unable to write to log file: %s' % exc)
+
+  def write(self, msg):
+if self._file:
+  try:
+self._file.write(msg + '\n')
+self._file.flush()
+  except IOError as exc:
+error('Unable to write to log file: %s' % exc.strerror)
+self._file = None
+
+
 def trace(msg, **attr):
   _log(stem.util.log.TRACE, msg, **attr)
 



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


[tor-commits] [nyx/master] Move log_file_path() to util

2015-05-04 Thread atagar
commit 095dc9cceb57c5c7649b594023fdad6505a17ac0
Author: Damian Johnson 
Date:   Mon Apr 27 09:29:36 2015 -0700

Move log_file_path() to util

Small function that's been just begging to go into the util for a while now.
---
 nyx/log_panel.py |   29 ++---
 nyx/util/log.py  |   18 ++
 2 files changed, 28 insertions(+), 19 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index 5016e09..f250084 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -21,7 +21,7 @@ import nyx.popups
 
 from nyx import __version__
 from nyx.util import join, panel, tor_controller, ui_tools
-from nyx.util.log import TOR_RUNLEVELS, LogGroup, LogEntry, read_tor_log, 
condense_runlevels, days_since
+from nyx.util.log import TOR_RUNLEVELS, LogGroup, LogEntry, read_tor_log, 
condense_runlevels, days_since, log_file_path
 
 ENTRY_INDENT = 2  # spaces an entry's message is indented after the first line
 
@@ -48,7 +48,6 @@ CONFIG = conf.config_dict('nyx', {
   'features.log.regex': [],
   'cache.log_panel.size': 1000,
   'msg.misc.event_types': '',
-  'tor.chroot': '',
   'attr.log_color': {},
 }, conf_handler)
 
@@ -71,14 +70,6 @@ NYX_LOGGER = log.LogBuffer(log.Runlevel.DEBUG, yield_records 
= True)
 stem_logger.addHandler(NYX_LOGGER)
 
 
-def log_file_path():
-  for log_entry in tor_controller().get_conf('Log', [], True):
-entry_comp = log_entry.split()  # looking for an entry like: notice file 
/var/log/tor/notices.log
-
-if entry_comp[1] == 'file':
-  return CONFIG['tor.chroot'] + entry_comp[2]
-
-
 class LogPanel(panel.Panel, threading.Thread):
   """
   Listens for and displays tor, nyx, and stem events. This can prepopulate
@@ -115,7 +106,7 @@ class LogPanel(panel.Panel, threading.Thread):
 
 self.regex_filter = None # filter for presented log events (no 
filtering if None)
 self.last_content_height = 0 # height of the rendered content when 
last drawn
-self.log_file = None # file log messages are saved to 
(skipped if None)
+self._log_file = None# file log messages are saved to 
(skipped if None)
 self.scroll = 0
 
 self.set_pause_attr('_msg_log')
@@ -142,7 +133,7 @@ class LogPanel(panel.Panel, threading.Thread):
   set_runlevels = list(set.intersection(set(self.logged_events), 
set(list(log.Runlevel
   read_limit = CONFIG['features.log.prepopulateReadLimit']
 
-  logging_location = log_file_path()
+  logging_location = log_file_path(tor_controller())
 
   if logging_location:
 try:
@@ -188,14 +179,14 @@ class LogPanel(panel.Panel, threading.Thread):
 if not os.path.exists(base_dir):
   os.makedirs(base_dir)
 
-self.log_file = open(log_path, 'a')
+self._log_file = open(log_path, 'a')
 log.notice('nyx %s opening log file (%s)' % (__version__, log_path))
   except IOError as exc:
 log.error('Unable to write to log file: %s' % exc.strerror)
-self.log_file = None
+self._log_file = None
   except OSError as exc:
 log.error('Unable to write to log file: %s' % exc)
-self.log_file = None
+self._log_file = None
 
   def set_duplicate_visability(self, is_visible):
 """
@@ -747,13 +738,13 @@ class LogPanel(panel.Panel, threading.Thread):
 
 # note event in the log file if we're saving them
 
-if self.log_file:
+if self._log_file:
   try:
-self.log_file.write(event.display_message + '\n')
-self.log_file.flush()
+self._log_file.write(event.display_message + '\n')
+self._log_file.flush()
   except IOError as exc:
 log.error('Unable to write to log file: %s' % exc.strerror)
-self.log_file = None
+self._log_file = None
 
 with self.vals_lock:
   self._msg_log.add(event)
diff --git a/nyx/util/log.py b/nyx/util/log.py
index 9a40411..4df50c0 100644
--- a/nyx/util/log.py
+++ b/nyx/util/log.py
@@ -20,6 +20,7 @@ except ImportError:
 
 TOR_RUNLEVELS = ['DEBUG', 'INFO', 'NOTICE', 'WARN', 'ERR']
 TIMEZONE_OFFSET = time.altzone if time.localtime()[8] else time.timezone
+CONFIG = stem.util.conf.config_dict('nyx', {'tor.chroot': ''})
 
 
 def days_since(timestamp):
@@ -34,6 +35,23 @@ def days_since(timestamp):
   return int((timestamp - TIMEZONE_OFFSET) / 86400)
 
 
+def log_file_path(controller):
+  """
+  Provides the path where tor's log file resides, if one exists.
+
+  :params stem.control.Controller controller: tor controller connection
+
+  :returns: **str** with the absolute path of our log file, or **None** if one
+doesn't exist
+  """
+
+  for log_entry in controller.get_conf('Log', [], True):
+entry_comp = log_entry.split()  # looking for an entry like: notice file 
/var/log/tor/notices.log
+
+if entry_comp[1] == 'file':
+  return CONFIG['tor.chroot'] + entry_comp[2]
+
+
 @lru_cache()
 def condense_runlevels(*events):
   """



_

[tor-commits] [nyx/master] Rewrite log panel's draw function

2015-05-04 Thread atagar
commit 9f4329ea439b815e8b220e1e851699f0b53fcbbe
Author: Damian Johnson 
Date:   Mon May 4 21:31:59 2015 -0700

Rewrite log panel's draw function
---
 nyx/log_panel.py |  117 +-
 nyx/util/ui_tools.py |   25 +++
 2 files changed, 57 insertions(+), 85 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index 4211e09..9685c77 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -300,106 +300,53 @@ class LogPanel(panel.Panel, threading.Thread):
   def draw(self, width, height):
 with self._lock:
   event_log = list(self.get_attr('_logged_events'))
-
-  # draws the top label
-
-  if self.is_title_visible():
-title_comp = 
list(nyx.util.log.condense_runlevels(*self._logged_event_types))
-
-if self._filter.selection():
-  title_comp.append('filter: %s' % self._filter.selection())
-
-title_comp_str = join(title_comp, ', ', width - 10)
-title = 'Events (%s):' % title_comp_str if title_comp_str else 
'Events:'
-
-self.addstr(0, 0, title, curses.A_STANDOUT)
-
-  # restricts scroll location to valid bounds
-
   self._scroll = max(0, min(self._scroll, self._last_content_height - 
height + 1))
 
-  # draws left-hand scroll bar if content's longer than the height
-
-  msg_indent, divider_indent = 1, 0  # offsets for scroll bar
   is_scroll_bar_visible = self._last_content_height > height - 1
 
   if is_scroll_bar_visible:
-msg_indent, divider_indent = 3, 2
 self.add_scroll_bar(self._scroll, self._scroll + height - 1, 
self._last_content_height, 1)
 
-  # draws log entries
-
-  line_count = 1 - self._scroll
-  seen_first_date_divider = False
-  divider_attr = (curses.A_BOLD, 'yellow')
+  x, y = 3 if is_scroll_bar_visible else 1, 1 - self._scroll
 
-  # determines if we have the minimum width to show date dividers
+  # group entries by date, filtering out those that aren't visible
 
-  show_daybreaks = width - divider_indent >= 3
-  last_day = event_log[0].days_since() if event_log else 0
-
-  for i in range(len(event_log)):
-entry = event_log[i]
-is_last = i == len(event_log) - 1
+  days_ago_to_entries = {}
 
+  for entry in event_log:
 if entry.is_duplicate and not 
CONFIG['features.log.showDuplicateEntries']:
   continue  # deduplicated message
 elif not self._filter.match(entry.display_message):
   continue  # filter doesn't match log message
 
-# checks if we should be showing a divider with the date
-
-if last_day != entry.days_since():
-  # bottom of the divider
-
-  if seen_first_date_divider:
-if line_count >= 1 and line_count < height and show_daybreaks:
-  self.addch(line_count, divider_indent, curses.ACS_LLCORNER, 
*divider_attr)
-  self.hline(line_count, divider_indent + 1, width - 
divider_indent - 2, *divider_attr)
-  self.addch(line_count, width - 1, curses.ACS_LRCORNER, 
*divider_attr)
+days_ago_to_entries.setdefault(entry.days_since(), []).append(entry)
 
-line_count += 1
+  for days_ago in sorted(days_ago_to_entries.keys()):
+if days_ago == 0:
+  for entry in days_ago_to_entries[days_ago]:
+y = self._draw_entry(x, y, width, entry)
+else:
+  original_y, y = y, y + 1
 
-  # top of the divider
+  for entry in days_ago_to_entries[days_ago]:
+y = self._draw_entry(x, y, width, entry)
 
-  if line_count >= 1 and line_count < height and show_daybreaks:
-time_label = time.strftime(' %B %d, %Y ', 
time.localtime(entry.timestamp))
-self.addch(line_count, divider_indent, curses.ACS_ULCORNER, 
*divider_attr)
-self.addch(line_count, divider_indent + 1, curses.ACS_HLINE, 
*divider_attr)
-self.addstr(line_count, divider_indent + 2, time_label, 
curses.A_BOLD, *divider_attr)
+  ui_tools.draw_box(self, original_y, x - 1, width - x + 1, y - 
original_y + 1, curses.A_BOLD, 'yellow')
+  time_label = time.strftime(' %B %d, %Y ', 
time.localtime(days_ago_to_entries[days_ago][0].timestamp))
+  self.addstr(original_y, x + 1, time_label, curses.A_BOLD, 
curses.A_BOLD, 'yellow')
 
-line_length = width - divider_indent - len(time_label) - 3
-self.hline(line_count, divider_indent + len(time_label) + 2, 
line_length, *divider_attr)
-self.addch(line_count, divider_indent + len(time_label) + 2 + 
line_length, curses.ACS_URCORNER, *divider_attr)
+  y += 1
 
-  seen_first_date_divider = True
-  line_count += 1
+  # drawing the title after the content, so we'll clear content from the 
top line
 
-line_count_start = line_count
-line_count = self._draw_entry(msg_indent, line_count, width, entry, 
height)
-
-for y in range(line_coun

[tor-commits] [nyx/master] Drop features.log.showDateDividers

2015-05-04 Thread atagar
commit de740bae89566eb4d436d2d8f902bed0ccafcd0e
Author: Damian Johnson 
Date:   Mon May 4 21:35:01 2015 -0700

Drop features.log.showDateDividers

Drop the ability to opt out of grouping by days. Never known this to be 
useful,
and probably not worth accounting this in our new draw() function.

Also fixing features.log.maxLinesPerEntry and features.logFile. They were
documented as being camel case in our nyxrc.sample (like all options), but 
in
the code it wasn't.
---
 nyx/log_panel.py |   15 +++
 nyxrc.sample |3 ---
 2 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index 9685c77..300af83 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -22,7 +22,7 @@ from nyx.util import join, panel, tor_controller, ui_tools
 
 
 def conf_handler(key, value):
-  if key == 'features.log.max_lines_per_entry':
+  if key == 'features.log.maxLinesPerEntry':
 return max(1, value)
   elif key == 'features.log.prepopulateReadLimit':
 return max(0, value)
@@ -33,10 +33,9 @@ def conf_handler(key, value):
 
 
 CONFIG = conf.config_dict('nyx', {
-  'features.log_file': '',
-  'features.log.showDateDividers': True,
+  'features.logFile': '',
   'features.log.showDuplicateEntries': False,
-  'features.log.max_lines_per_entry': 6,
+  'features.log.maxLinesPerEntry': 6,
   'features.log.prepopulate': True,
   'features.log.prepopulateReadLimit': 5000,
   'features.log.maxRefreshRate': 300,
@@ -73,8 +72,8 @@ class LogPanel(panel.Panel, threading.Thread):
 self.setDaemon(True)
 
 self._logged_event_types = 
nyx.util.log.listen_for_events(self._register_tor_event, logged_events)
-self._logged_events = 
nyx.util.log.LogGroup(CONFIG['cache.log_panel.size'], group_by_day = 
CONFIG['features.log.showDateDividers'])
-self._log_file = nyx.util.log.LogFileOutput(CONFIG['features.log_file'])
+self._logged_events = nyx.util.log.LogGroup(CONFIG['cache.log_panel.size'])
+self._log_file = nyx.util.log.LogFileOutput(CONFIG['features.logFile'])
 self._filter = nyx.util.log.LogFilters(initial_filters = 
CONFIG['features.log.regex'])
 
 self.set_pause_attr('_logged_events')
@@ -200,7 +199,7 @@ class LogPanel(panel.Panel, threading.Thread):
 """
 
 with self._lock:
-  self._logged_events = 
nyx.util.log.LogGroup(CONFIG['cache.log_panel.size'], group_by_day = 
CONFIG['features.log.showDateDividers'])
+  self._logged_events = 
nyx.util.log.LogGroup(CONFIG['cache.log_panel.size'])
   self.redraw(True)
 
   def save_snapshot(self, path):
@@ -401,7 +400,7 @@ class LogPanel(panel.Panel, threading.Thread):
   while msg:
 x, msg = draw_line(x, y, width, msg, *attr)
 
-if (y - orig_y + 1) >= CONFIG['features.log.max_lines_per_entry']:
+if (y - orig_y + 1) >= CONFIG['features.log.maxLinesPerEntry']:
   break  # filled up the maximum number of lines we're allowing for
 
 if msg:
diff --git a/nyxrc.sample b/nyxrc.sample
index fadc5df..44b0228 100644
--- a/nyxrc.sample
+++ b/nyxrc.sample
@@ -59,8 +59,6 @@ features.confirmQuit true
 
 # Paremters for the log panel
 # ---
-# showDateDividers
-#   show borders with dates for entries from previous days
 # showDuplicateEntries
 #   shows all log entries if true, otherwise collapses similar entries with an
 #   indicator for how much is being hidden
@@ -77,7 +75,6 @@ features.confirmQuit true
 # regex
 #   preconfigured regular expression pattern, up to five will be loaded
 
-features.log.showDateDividers true
 features.log.showDuplicateEntries false
 features.log.maxLinesPerEntry 6
 features.log.prepopulate true



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


[tor-commits] [nyx/master] Fix menu's 'exit' option

2015-05-04 Thread atagar
commit 594e96c389d05a81f658f766fe2c88bab1e763f8
Author: Damian Johnson 
Date:   Thu Apr 30 08:29:04 2015 -0700

Fix menu's 'exit' option

Earlier change that dropped the quit method broke our menu, causing nyx to
crash with the following when you bring it up...

  Traceback (most recent call last):
File "./run_nyx", line 60, in 
  main()
File "./run_nyx", line 17, in main
  nyx.starter.main()
File "/home/atagar/Desktop/nyx/stem/util/conf.py", line 288, in wrapped
  return func(*args, config = config, **kwargs)
File "/home/atagar/Desktop/nyx/nyx/starter.py", line 91, in main
  curses.wrapper(nyx.controller.start_nyx)
File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
  return func(stdscr, *args, **kwds)
File "/home/atagar/Desktop/nyx/nyx/controller.py", line 590, in 
start_nyx
  nyx.menu.menu.show_menu()
File "/home/atagar/Desktop/nyx/nyx/menu/menu.py", line 90, in show_menu
  menu = nyx.menu.actions.make_menu()
File "/home/atagar/Desktop/nyx/nyx/menu/actions.py", line 31, in 
make_menu
  base_menu.add(make_actions_menu())
File "/home/atagar/Desktop/nyx/nyx/menu/actions.py", line 81, in 
make_actions_menu
  actions_menu.add(nyx.menu.item.MenuItem('Exit', control.quit))
  AttributeError: Controller instance has no attribute 'quit'
---
 nyx/controller.py |6 +-
 nyx/log_panel.py  |6 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/nyx/controller.py b/nyx/controller.py
index 6225038..77b2037 100644
--- a/nyx/controller.py
+++ b/nyx/controller.py
@@ -208,6 +208,7 @@ class Controller:
   page_panels   - list of pages, each being a list of the panels on it
 """
 
+self.quit_signal = False
 self._screen = stdscr
 self._sticky_panels = sticky_panels
 self._page_panels = page_panels
@@ -465,6 +466,9 @@ class Controller:
 
 return data_dir
 
+  def quit(self):
+self.quit_signal = True
+
 
 def heartbeat_check(is_unresponsive):
   """
@@ -558,7 +562,7 @@ def start_nyx(stdscr):
   override_key = None  # uses this rather than waiting on user input
   is_unresponsive = False  # flag for heartbeat responsiveness check
 
-  while True:
+  while not control.quit_signal:
 display_panels = control.get_display_panels()
 is_unresponsive = heartbeat_check(is_unresponsive)
 
diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index e1465ab..4a7e6de 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -369,9 +369,7 @@ class LogPanel(panel.Panel, threading.Thread):
   # does all activity under a curses lock to prevent redraws when adding
   # new filters
 
-  panel.CURSES_LOCK.acquire()
-
-  try:
+  with CURSES_LOCK:
 selection = nyx.popups.show_menu('Log Filter:', options, old_selection)
 
 # applies new setting
@@ -383,8 +381,6 @@ class LogPanel(panel.Panel, threading.Thread):
   self.show_filter_prompt()
 elif selection != -1:
   self.make_filter_selection(self.filter_options[selection - 1])
-  finally:
-panel.CURSES_LOCK.release()
 
   if len(self.filter_options) > MAX_REGEX_FILTERS:
 del self.filter_options[MAX_REGEX_FILTERS:]



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


[tor-commits] [nyx/master] Move log colors to config

2015-05-04 Thread atagar
commit 552bdf3756af1e3bc254bc5c0e7c7f3019d7cd69
Author: Damian Johnson 
Date:   Sat Apr 11 16:23:16 2015 -0700

Move log colors to config

This is a simple 'event type => color' mapping so no need for it to be 
littered
throughout our code.
---
 nyx/config/attributes.cfg |   18 ++
 nyx/log_panel.py  |   38 +-
 2 files changed, 27 insertions(+), 29 deletions(-)

diff --git a/nyx/config/attributes.cfg b/nyx/config/attributes.cfg
index 30bfafb..fe24120 100644
--- a/nyx/config/attributes.cfg
+++ b/nyx/config/attributes.cfg
@@ -39,3 +39,21 @@ attr.graph.header.secondary bandwidth => Upload
 attr.graph.header.secondary connections => Outbound
 attr.graph.header.secondary resources => Memory
 
+attr.log_color DEBUG => magenta
+attr.log_color INFO => blue
+attr.log_color NOTICE => green
+attr.log_color WARN => yellow
+attr.log_color ERR => red
+
+attr.log_color NYX_DEBUG => magenta
+attr.log_color NYX_INFO => blue
+attr.log_color NYX_NOTICE => green
+attr.log_color NYX_WARN => yellow
+attr.log_color NYX_ERR => red
+
+attr.log_color CIRC => yellow
+attr.log_color BW => cyan
+attr.log_color NS => blue
+attr.log_color NEWCONSENSUS => blue
+attr.log_color GUARD => yellow
+
diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index 33af9dd..ddf2c6e 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -28,14 +28,6 @@ try:
 except ImportError:
   from stem.util.lru_cache import lru_cache
 
-RUNLEVEL_EVENT_COLOR = {
-  log.DEBUG: 'magenta',
-  log.INFO: 'blue',
-  log.NOTICE: 'green',
-  log.WARN: 'yellow',
-  log.ERR: 'red',
-}
-
 DAYBREAK_EVENT = 'DAYBREAK'  # special event for marking when the date changes
 TIMEZONE_OFFSET = time.altzone if time.localtime()[8] else time.timezone
 
@@ -66,6 +58,7 @@ CONFIG = conf.config_dict('nyx', {
   'cache.log_panel.size': 1000,
   'msg.misc.event_types': '',
   'tor.chroot': '',
+  'attr.log_color': {},
 }, conf_handler)
 
 DUPLICATE_MSG = ' [%i duplicate%s hidden]'
@@ -283,11 +276,11 @@ class LogEntry():
 color - color of the log entry
   """
 
-  def __init__(self, timestamp, event_type, msg, color):
+  def __init__(self, timestamp, event_type, msg):
 self.timestamp = timestamp
 self.type = event_type
 self.msg = msg
-self.color = color
+self.color = CONFIG['attr.log_color'].get(event_type, 'white')
 
   @lru_cache()
   def get_display_message(self, include_date = False):
@@ -415,8 +408,7 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 if record.levelname == 'WARNING':
   record.levelname = 'WARN'
 
-event_color = RUNLEVEL_EVENT_COLOR[record.levelname]
-self.register_event(LogEntry(int(record.created), 'NYX_%s' % 
record.levelname, record.msg, event_color))
+self.register_event(LogEntry(int(record.created), 'NYX_%s' % 
record.levelname, record.msg))
 
   def reprepopulate_events(self):
 """
@@ -441,7 +433,7 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 try:
   for entry in read_tor_log(logging_location, read_limit):
 if entry.runlevel in set_runlevels:
-  self.msg_log.append(LogEntry(entry.timestamp, entry.runlevel, 
entry.message, RUNLEVEL_EVENT_COLOR[entry.runlevel]))
+  self.msg_log.append(LogEntry(entry.timestamp, entry.runlevel, 
entry.message))
 except IOError as exc:
   log.info('Unable to read log located at %s: %s' % (logging_location, 
exc))
 except ValueError as exc:
@@ -471,26 +463,14 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 register_event().
 """
 
-msg, color = ' '.join(str(event).split(' ')[1:]), 'white'
+msg = ' '.join(str(event).split(' ')[1:])
 
-if isinstance(event, events.CircuitEvent):
-  color = 'yellow'
-elif isinstance(event, events.BandwidthEvent):
-  color = 'cyan'
+if isinstance(event, events.BandwidthEvent):
   msg = 'READ: %i, WRITTEN: %i' % (event.read, event.written)
 elif isinstance(event, events.LogEvent):
-  color = RUNLEVEL_EVENT_COLOR[event.runlevel]
   msg = event.message
-elif isinstance(event, events.NetworkStatusEvent):
-  color = 'blue'
-elif isinstance(event, events.NewConsensusEvent):
-  color = 'magenta'
-elif isinstance(event, events.GuardEvent):
-  color = 'yellow'
-elif event.type not in nyx.arguments.TOR_EVENT_TYPES.values():
-  color = 'red'  # unknown event type
-
-self.register_event(LogEntry(event.arrived_at, event.type, msg, color))
+
+self.register_event(LogEntry(event.arrived_at, event.type, msg))
 
   def register_event(self, event):
 """



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


[tor-commits] [nyx/master] Drop log panel's is_duplicate() helper

2015-05-04 Thread atagar
commit 871912cb14edf81a5695bd54b0356331eed2e702
Author: Damian Johnson 
Date:   Sun Apr 12 15:29:14 2015 -0700

Drop log panel's is_duplicate() helper

It no longer really does much. Despite its name is wasn't being used check 
for
a boolean condition, but rather get the indices of duplicates. Merging it 
with
its sole caller.
---
 nyx/log_panel.py |   50 +++---
 1 file changed, 11 insertions(+), 39 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index cdb2346..dc63af8 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -169,8 +169,17 @@ def get_duplicates(events):
   return_events = []
 
   while events_remaining:
-entry = events_remaining.pop(0)
-duplicate_indices = is_duplicate(entry, events_remaining, True)
+entry, duplicate_indices = events_remaining.pop(0), []
+
+for i, earlier_entry in enumerate(events_remaining):
+  # if showing dates then do duplicate detection for each day, rather
+  # than globally
+
+  if earlier_entry.type == DAYBREAK_EVENT:
+break
+
+  if entry.is_duplicate(earlier_entry):
+duplicate_indices.append(i)
 
 # checks if the call timeout has been reached
 
@@ -192,43 +201,6 @@ def get_duplicates(events):
   return return_events
 
 
-def is_duplicate(event, event_set, get_duplicates = False):
-  """
-  True if the event is a duplicate for something in the event_set, false
-  otherwise. If the get_duplicates flag is set this provides the indices of
-  the duplicates instead.
-
-  Arguments:
-event - event to search for duplicates of
-event_set  - set to look for the event in
-get_duplicates - instead of providing back a boolean this gives a list of
-the duplicate indices in the event_set
-  """
-
-  duplicate_indices = []
-
-  for i in range(len(event_set)):
-forward_entry = event_set[i]
-
-# if showing dates then do duplicate detection for each day, rather
-# than globally
-
-if forward_entry.type == DAYBREAK_EVENT:
-  break
-
-if event.type == forward_entry.type:
-  if event.is_duplicate(forward_entry):
-if get_duplicates:
-  duplicate_indices.append(i)
-else:
-  return True
-
-  if get_duplicates:
-return duplicate_indices
-  else:
-return False
-
-
 class LogPanel(panel.Panel, threading.Thread, logging.Handler):
   """
   Listens for and displays tor, nyx, and stem events. This can prepopulate



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


[tor-commits] [nyx/master] Drop log panel's state listener

2015-05-04 Thread atagar
commit b6df5ccc52286d197423506cd8be0155ecfeaa89
Author: Damian Johnson 
Date:   Wed Apr 29 08:54:29 2015 -0700

Drop log panel's state listener

All it did now was log a message saying we're disconnected from tor. We have
lots of other state listeners laying around and can just as well be part of 
one
of those.
---
 nyx/controller.py |4 +++-
 nyx/log_panel.py  |   11 ---
 2 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/nyx/controller.py b/nyx/controller.py
index f94bf11..6225038 100644
--- a/nyx/controller.py
+++ b/nyx/controller.py
@@ -500,7 +500,9 @@ def conn_reset_listener(controller, event_type, _):
   if resolver.is_alive():
 resolver.set_paused(event_type == State.CLOSED)
 
-if event_type in (State.INIT, State.RESET):
+if event_type == State.CLOSED:
+  log.notice('Tor control port closed')
+elif event_type in (State.INIT, State.RESET):
   # Reload the torrc contents. If the torrc panel is present then it will
   # do this instead since it wants to do validation and redraw _after_ the
   # new contents are loaded.
diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index 44a2b2a..a592e56 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -13,7 +13,6 @@ import threading
 import stem
 import stem.response.events
 
-from stem.control import State
 from stem.util import conf, log, str_tools
 
 import nyx.arguments
@@ -155,16 +154,6 @@ class LogPanel(panel.Panel, threading.Thread):
 
 self.last_content_height = len(self._msg_log)
 
-# adds listeners for tor and stem events
-
-controller = tor_controller()
-
-def reset_listener(controller, event_type, _):
-  if event_type == State.CLOSED:
-log.notice('Tor control port closed')
-
-controller.add_status_listener(reset_listener)
-
   def set_duplicate_visability(self, is_visible):
 """
 Sets if duplicate log entries are collaped or expanded.



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


[tor-commits] [nyx/master] Dropping features.log.entryDuration

2015-05-04 Thread atagar
commit 09bed012b7373146b1faf2321622e95670b54828
Author: Damian Johnson 
Date:   Thu Apr 16 08:16:47 2015 -0700

Dropping features.log.entryDuration

This is a config option that let the user set a TTL for how long we keep log
entries. This is in addition to a 'maximum number of entries' limitation.

Did anyone use this? Did anyone even know it existed? Probably not - just
pointless complexity.
---
 nyx/log_panel.py |   43 +--
 nyxrc.sample |4 
 2 files changed, 5 insertions(+), 42 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index e691b29..ff64c78 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -45,7 +45,6 @@ CONFIG = conf.config_dict('nyx', {
   'features.log_file': '',
   'features.log.showDateDividers': True,
   'features.log.showDuplicateEntries': False,
-  'features.log.entryDuration': 7,
   'features.log.max_lines_per_entry': 6,
   'features.log.prepopulate': True,
   'features.log.prepopulateReadLimit': 5000,
@@ -341,7 +340,8 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 
   # crops events that are either too old, or more numerous than the 
caching size
 
-  self._trim_events(self.msg_log)
+  if len(self.msg_log) > CONFIG['cache.log_panel.size']:
+del self.msg_log[CONFIG['cache.log_panel.size']:]
 
   def set_duplicate_visability(self, is_visible):
 """
@@ -393,7 +393,9 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 
 with self.vals_lock:
   self.msg_log.insert(0, event)
-  self._trim_events(self.msg_log)
+
+  if len(self.msg_log) > CONFIG['cache.log_panel.size']:
+del self.msg_log[CONFIG['cache.log_panel.size']:]
 
   # notifies the display that it has new content
 
@@ -1043,38 +1045,3 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
   self._title_args = (list(self.logged_events), current_pattern, width)
 
   return panel_label
-
-  def _trim_events(self, event_listing):
-"""
-Crops events that have either:
-- grown beyond the cache limit
-- outlived the configured log duration
-
-Argument:
-  event_listing - listing of log entries
-"""
-
-cache_size = CONFIG['cache.log_panel.size']
-
-if len(event_listing) > cache_size:
-  del event_listing[cache_size:]
-
-log_ttl = CONFIG['features.log.entryDuration']
-
-if log_ttl > 0:
-  current_day = days_since()
-
-  breakpoint = None  # index at which to crop from
-
-  for i in range(len(event_listing) - 1, -1, -1):
-days_since_event = current_day - days_since(event_listing[i].timestamp)
-
-if days_since_event > log_ttl:
-  breakpoint = i  # older than the ttl
-else:
-  break
-
-  # removes entries older than the ttl
-
-  if breakpoint is not None:
-del event_listing[breakpoint:]
diff --git a/nyxrc.sample b/nyxrc.sample
index 1b3cc65..fadc5df 100644
--- a/nyxrc.sample
+++ b/nyxrc.sample
@@ -64,9 +64,6 @@ features.confirmQuit true
 # showDuplicateEntries
 #   shows all log entries if true, otherwise collapses similar entries with an
 #   indicator for how much is being hidden
-# entryDuration
-#   number of days log entries are kept before being dropped (if zero then
-#   they're kept until cropped due to caching limits)
 # maxLinesPerEntry
 #   max number of lines to display for a single log entry
 # prepopulate
@@ -82,7 +79,6 @@ features.confirmQuit true
 
 features.log.showDateDividers true
 features.log.showDuplicateEntries false
-features.log.entryDuration 7
 features.log.maxLinesPerEntry 6
 features.log.prepopulate true
 features.log.prepopulateReadLimit 5000



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


[tor-commits] [nyx/master] Standardize on allowing multiple styling attributes

2015-05-04 Thread atagar
commit 31aa289c444da1f06dcef12ce83cbf5e5d72c9d1
Author: Damian Johnson 
Date:   Sun Apr 19 12:26:28 2015 -0700

Standardize on allowing multiple styling attributes

We changed addstr() to allow multiple styling attributes. Changing our other
draw methods as well since we now expect it from them...

  Traceback (most recent call last):
File "./run_nyx", line 60, in 
  main()
File "./run_nyx", line 17, in main
  nyx.starter.main()
File "/home/atagar/Desktop/nyx/stem/util/conf.py", line 288, in wrapped
  return func(*args, config = config, **kwargs)
File "/home/atagar/Desktop/nyx/nyx/starter.py", line 91, in main
  curses.wrapper(nyx.controller.start_nyx)
File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
  return func(stdscr, *args, **kwds)
File "/home/atagar/Desktop/nyx/nyx/controller.py", line 570, in 
start_nyx
  control.redraw(False)
File "/home/atagar/Desktop/nyx/nyx/controller.py", line 401, in redraw
  panel_impl.redraw(force)
File "/home/atagar/Desktop/nyx/nyx/log_panel.py", line 828, in redraw
  panel.Panel.redraw(self, force_redraw, block)
File "/home/atagar/Desktop/nyx/nyx/util/panel.py", line 433, in redraw
  self.draw(self.max_x, self.max_y)
File "/home/atagar/Desktop/nyx/nyx/log_panel.py", line 727, in draw
  self.addch(line_count, divider_indent, curses.ACS_ULCORNER, 
*divider_attr)
  TypeError: addch() takes at most 5 arguments (6 given)
---
 nyx/util/panel.py |   36 ++--
 1 file changed, 30 insertions(+), 6 deletions(-)

diff --git a/nyx/util/panel.py b/nyx/util/panel.py
index 2841fe3..6dc3d0e 100644
--- a/nyx/util/panel.py
+++ b/nyx/util/panel.py
@@ -435,7 +435,7 @@ class Panel(object):
 finally:
   CURSES_LOCK.release()
 
-  def hline(self, y, x, length, attr=curses.A_NORMAL):
+  def hline(self, y, x, length, *attributes):
 """
 Draws a horizontal line. This should only be called from the context of a
 panel's draw method.
@@ -447,15 +447,23 @@ class Panel(object):
   attr   - text attributes
 """
 
+format_attr = curses.A_NORMAL
+
+for attr in attributes:
+  if isinstance(attr, str):
+format_attr |= ui_tools.get_color(attr)
+  else:
+format_attr |= attr
+
 if self.win and self.max_x > x and self.max_y > y:
   try:
 draw_length = min(length, self.max_x - x)
-self.win.hline(y, x, curses.ACS_HLINE | attr, draw_length)
+self.win.hline(y, x, curses.ACS_HLINE | format_attr, draw_length)
   except:
 # in edge cases drawing could cause a _curses.error
 pass
 
-  def vline(self, y, x, length, attr=curses.A_NORMAL):
+  def vline(self, y, x, length, *attributes):
 """
 Draws a vertical line. This should only be called from the context of a
 panel's draw method.
@@ -467,15 +475,23 @@ class Panel(object):
   attr   - text attributes
 """
 
+format_attr = curses.A_NORMAL
+
+for attr in attributes:
+  if isinstance(attr, str):
+format_attr |= ui_tools.get_color(attr)
+  else:
+format_attr |= attr
+
 if self.win and self.max_x > x and self.max_y > y:
   try:
 draw_length = min(length, self.max_y - y)
-self.win.vline(y, x, curses.ACS_VLINE | attr, draw_length)
+self.win.vline(y, x, curses.ACS_VLINE | format_attr, draw_length)
   except:
 # in edge cases drawing could cause a _curses.error
 pass
 
-  def addch(self, y, x, char, attr=curses.A_NORMAL):
+  def addch(self, y, x, char, *attributes):
 """
 Draws a single character. This should only be called from the context of a
 panel's draw method.
@@ -487,9 +503,17 @@ class Panel(object):
   attr - text attributes
 """
 
+format_attr = curses.A_NORMAL
+
+for attr in attributes:
+  if isinstance(attr, str):
+format_attr |= ui_tools.get_color(attr)
+  else:
+format_attr |= attr
+
 if self.win and self.max_x > x and self.max_y > y:
   try:
-self.win.addch(y, x, char, attr)
+self.win.addch(y, x, char, format_attr)
   except:
 # in edge cases drawing could cause a _curses.error
 pass



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


[tor-commits] [nyx/master] Pretend log file entries are from the currnet year

2015-05-04 Thread atagar
commit 0dd3c643d48fbab03014c2c1d1d5aa201f5be57c
Author: Damian Johnson 
Date:   Wed Apr 29 09:56:14 2015 -0700

Pretend log file entries are from the currnet year

Log files lack the year so we gotta guess (#15607). We hardcoded 2012 so 
this
would still work for leap years but this is a pretty gross hack. Better to
pretend the log entries are recent, and if we hit a leap year edge case then
meh. User just won't get log prepopulation.
---
 nyx/log_panel.py |   13 +
 nyx/util/log.py  |   14 ++
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index a592e56..e1465ab 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -128,18 +128,15 @@ class LogPanel(panel.Panel, threading.Thread):
 # fetches past tor events from log file, if available
 
 if CONFIG['features.log.prepopulate']:
-  set_runlevels = list(set.intersection(set(self.logged_events), 
set(list(log.Runlevel
-  read_limit = CONFIG['features.log.prepopulateReadLimit']
+  log_location = log_file_path(tor_controller())
 
-  logging_location = log_file_path(tor_controller())
-
-  if logging_location:
+  if log_location:
 try:
-  for entry in reversed(list(read_tor_log(logging_location, 
read_limit))):
-if entry.type in set_runlevels:
+  for entry in reversed(list(read_tor_log(log_location, 
CONFIG['features.log.prepopulateReadLimit']))):
+if entry.type in self.logged_events:
   self._msg_log.add(entry)
 except IOError as exc:
-  log.info('Unable to read log located at %s: %s' % (logging_location, 
exc))
+  log.info('Unable to read log located at %s: %s' % (log_location, 
exc))
 except ValueError as exc:
   log.info(str(exc))
 
diff --git a/nyx/util/log.py b/nyx/util/log.py
index a2e3820..e188cb4 100644
--- a/nyx/util/log.py
+++ b/nyx/util/log.py
@@ -3,6 +3,7 @@ Logging utilities, primiarily short aliases for logging a 
message at various
 runlevels.
 """
 
+import datetime
 import os
 import time
 import threading
@@ -376,18 +377,23 @@ def read_tor_log(path, read_limit = None):
 
 runlevel = line_comp[3][1:-1].upper()
 msg = ' '.join(line_comp[4:])
+current_year = str(datetime.datetime.now().year)
 
-# Pretending the year is 2012 because 2012 is a leap year. We don't know
-# the actual year (#15607) so picking something else risks strptime failing
-# when it reads Feb 29th (#5265).
+# Pretending it's the current year. We don't know the actual year (#15607)
+# and this may fail due to leap years when picking Feb 29th (#5265).
 
 try:
-  timestamp_str = '2012 ' + ' '.join(line_comp[:3])
+  timestamp_str = current_year + ' ' + ' '.join(line_comp[:3])
   timestamp_str = timestamp_str.split('.', 1)[0]  # drop fractional seconds
   timestamp_comp = list(time.strptime(timestamp_str, '%Y %b %d %H:%M:%S'))
   timestamp_comp[8] = isdst
 
   timestamp = int(time.mktime(timestamp_comp))  # converts local to unix 
time
+
+  if timestamp > time.time():
+# log entry is from before a year boundary
+timestamp_comp[0] -= 1
+timestamp = int(time.mktime(timestamp_comp))
 except ValueError:
   raise ValueError("Log located at %s has a timestamp we don't recognize: 
%s" % (path, ' '.join(line_comp[:3])))
 



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


[tor-commits] [nyx/master] Move deduplication to log util

2015-05-04 Thread atagar
commit 4135a5498a289a6b75320535ab5ecb20020ac54b
Author: Damian Johnson 
Date:   Sun Apr 12 14:39:49 2015 -0700

Move deduplication to log util

This fits very nicely as a method of the LogEntry. This will also make it 
much
easier to add tests.
---
 nyx/log_panel.py |   42 +-
 nyx/util/log.py  |   53 +
 2 files changed, 54 insertions(+), 41 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index 75fa59d..cdb2346 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -24,12 +24,6 @@ from nyx import __version__
 from nyx.util import panel, tor_controller, ui_tools
 from nyx.util.log import LogEntry, read_tor_log
 
-try:
-  # added in python 3.2
-  from functools import lru_cache
-except ImportError:
-  from stem.util.lru_cache import lru_cache
-
 DAYBREAK_EVENT = 'DAYBREAK'  # special event for marking when the date changes
 TIMEZONE_OFFSET = time.altzone if time.localtime()[8] else time.timezone
 
@@ -104,23 +98,6 @@ def days_since(timestamp = None):
   return int((timestamp - TIMEZONE_OFFSET) / 86400)
 
 
-@lru_cache()
-def common_log_messages():
-  """
-  Fetches a mapping of common log messages to their runlevels from the config.
-  """
-
-  nyx_config = conf.get_config('nyx')
-  messages = {}
-
-  for conf_key in nyx_config.keys():
-if conf_key.startswith('dedup.'):
-  event_type = conf_key[4:].upper()
-  messages[event_type] = nyx_config.get(conf_key, [])
-
-  return messages
-
-
 def log_file_path():
   for log_entry in tor_controller().get_conf('Log', [], True):
 entry_comp = log_entry.split()  # looking for an entry like: notice file 
/var/log/tor/notices.log
@@ -240,24 +217,7 @@ def is_duplicate(event, event_set, get_duplicates = False):
   break
 
 if event.type == forward_entry.type:
-  is_duplicate = False
-
-  if event.msg == forward_entry.msg:
-is_duplicate = True
-  else:
-for common_msg in common_log_messages().get(event.type, []):
-  # if it starts with an asterisk then check the whole message rather
-  # than just the start
-
-  if common_msg[0] == '*':
-is_duplicate = common_msg[1:] in event.msg and common_msg[1:] in 
forward_entry.msg
-  else:
-is_duplicate = event.msg.startswith(common_msg) and 
forward_entry.msg.startswith(common_msg)
-
-  if is_duplicate:
-break
-
-  if is_duplicate:
+  if event.is_duplicate(forward_entry):
 if get_duplicates:
   duplicate_indices.append(i)
 else:
diff --git a/nyx/util/log.py b/nyx/util/log.py
index 2d8f523..a753390 100644
--- a/nyx/util/log.py
+++ b/nyx/util/log.py
@@ -5,14 +5,41 @@ runlevels.
 
 import time
 
+import stem.util.conf
 import stem.util.log
 import stem.util.system
 
 import nyx.util
 
+try:
+  # added in python 3.2
+  from functools import lru_cache
+except ImportError:
+  from stem.util.lru_cache import lru_cache
+
 TOR_RUNLEVELS = ['DEBUG', 'INFO', 'NOTICE', 'WARN', 'ERR']
 
 
+@lru_cache()
+def _common_log_messages():
+  """
+  Provides a mapping of message types to its common log messages. These are
+  message prefixes unless it starts with an asterisk, in which case it can
+  appear anywhere in the message.
+
+  :returns: **dict** of the form {event_type => [msg1, msg2...]}
+  """
+
+  nyx_config, messages = stem.util.conf.get_config('nyx'), {}
+
+  for conf_key in nyx_config.keys():
+if conf_key.startswith('dedup.'):
+  event_type = conf_key[4:]
+  messages[event_type] = nyx_config.get(conf_key, [])
+
+  return messages
+
+
 class LogEntry(object):
   """
   Individual tor or nyx log entry.
@@ -34,6 +61,32 @@ class LogEntry(object):
 entry_time = time.localtime(self.timestamp)
 self.display_message = '%02i:%02i:%02i [%s] %s' % (entry_time[3], 
entry_time[4], entry_time[5], self.type, self.message)
 
+  @lru_cache()
+  def is_duplicate(self, entry):
+"""
+Checks if we are a duplicate of the given message or not.
+
+:returns: **True** if the given log message is a duplicate of us and 
**False** otherwise
+"""
+
+if self.message == entry.message:
+  return True
+elif self.type != entry.type:
+  return False
+
+for common_msg in _common_log_messages().get(self.type, []):
+  # if it starts with an asterisk then check the whole message rather
+  # than just the start
+
+  if common_msg[0] == '*':
+if common_msg[1:] in self.message and common_msg[1:] in entry.message:
+  return True
+  else:
+if self.message.startswith(common_msg) and 
entry.message.startswith(common_msg):
+  return True
+
+return False
+
   def __eq__(self, other):
 if isinstance(other, LogEntry):
   return hash(self) == hash(other)



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

[tor-commits] [nyx/master] Check for quote types in test

2015-05-04 Thread atagar
commit fab856eae980a6adcaa451738b8e79146b8199a3
Author: Damian Johnson 
Date:   Fri Apr 10 09:23:27 2015 -0700

Check for quote types in test

Taking advantage of Stem's new check to keep additions standardized on 
single
quotes.
---
 nyx/log_panel.py  |2 +-
 run_tests.py  |5 +++--
 test/util/read_tor_log.py |2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index 8650996..f58af4c 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -457,7 +457,7 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 if entry.runlevel in set_runlevels:
   self.msg_log.append(LogEntry(entry.timestamp, entry.runlevel, 
entry.message, RUNLEVEL_EVENT_COLOR[entry.runlevel]))
 except IOError as exc:
-  log.info("Unable to read log located at %s: %s" % (logging_location, 
exc))
+  log.info('Unable to read log located at %s: %s' % (logging_location, 
exc))
 except ValueError as exc:
   log.info(str(exc))
 
diff --git a/run_tests.py b/run_tests.py
index 17e879d..6e62169 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -58,6 +58,7 @@ def main():
   check_newlines = True,
   check_trailing_whitespace = True,
   check_exception_keyword = True,
+  prefer_single_quotes = True,
 )
 
 for path, issues in pep8_issues.items():
@@ -70,8 +71,8 @@ def main():
 for file_path in static_check_issues:
   print '* %s' % file_path
 
-  for line_number, msg in static_check_issues[file_path]:
-print '  line %-4s - %s' % (line_number, msg)
+  for issue in static_check_issues[file_path]:
+print '  line %-4s - %-40s %s' % (issue.line_number, issue.message, 
issue.line)
 
   print
 
diff --git a/test/util/read_tor_log.py b/test/util/read_tor_log.py
index 3b2ca01..7f84c41 100644
--- a/test/util/read_tor_log.py
+++ b/test/util/read_tor_log.py
@@ -49,7 +49,7 @@ class TestReadTorLog(unittest.TestCase):
   list(read_tor_log(data_path('malformed_runlevel')))
   self.fail("Malformed content should've raised a ValueError")
 except ValueError as exc:
-  self.assertTrue("has an unrecognized runlevel: [unrecognized]" in 
str(exc))
+  self.assertTrue('has an unrecognized runlevel: [unrecognized]' in 
str(exc))
 
   def test_with_malformed_date(self):
 try:



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


[tor-commits] [nyx/master] Don't provide dates when writing logs to files

2015-05-04 Thread atagar
commit c1c1581b5d9a8435703822b42e806ad4b2693ad2
Author: Damian Johnson 
Date:   Sat Apr 11 16:26:09 2015 -0700

Don't provide dates when writing logs to files

Tor doesn't provide dates (#15607) so we provide made up information for
prepopulated events. Might as well just not provide dates at all until tor
improves this.
---
 nyx/log_panel.py |   15 +--
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index ddf2c6e..cdaca17 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -283,7 +283,7 @@ class LogEntry():
 self.color = CONFIG['attr.log_color'].get(event_type, 'white')
 
   @lru_cache()
-  def get_display_message(self, include_date = False):
+  def get_display_message(self):
 """
 Provides the entry's message for the log.
 
@@ -291,13 +291,8 @@ class LogEntry():
   include_date - appends the event's date to the start of the message
 """
 
-if include_date:
-  entry_time = time.localtime(self.timestamp)
-  time_label = '%i/%i/%i %02i:%02i:%02i' % (entry_time[1], entry_time[2], 
entry_time[0], entry_time[3], entry_time[4], entry_time[5])
-  return '%s [%s] %s' % (time_label, self.type, self.msg)
-else:
-  entry_time = time.localtime(self.timestamp)
-  return '%02i:%02i:%02i [%s] %s' % (entry_time[3], entry_time[4], 
entry_time[5], self.type, self.msg)
+entry_time = time.localtime(self.timestamp)
+return '%02i:%02i:%02i [%s] %s' % (entry_time[3], entry_time[4], 
entry_time[5], self.type, self.msg)
 
 
 class LogPanel(panel.Panel, threading.Thread, logging.Handler):
@@ -491,7 +486,7 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 
 if self.log_file:
   try:
-self.log_file.write(event.get_display_message(True) + '\n')
+self.log_file.write(event.get_display_message() + '\n')
 self.log_file.flush()
   except IOError as exc:
 log.error('Unable to write to log file: %s' % exc.strerror)
@@ -687,7 +682,7 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 is_visible = not self.regex_filter or 
self.regex_filter.search(entry.get_display_message())
 
 if is_visible:
-  snapshot_file.write(entry.get_display_message(True) + '\n')
+  snapshot_file.write(entry.get_display_message() + '\n')
 
   self.vals_lock.release()
 except Exception as exc:



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


[tor-commits] [nyx/master] Rewritten, more performant log deduplication

2015-05-04 Thread atagar
commit f47bcd4289751f349fd047a5e801ad59da394b0c
Author: Damian Johnson 
Date:   Tue Apr 21 09:01:37 2015 -0700

Rewritten, more performant log deduplication

Our log deduplication was pretty grossly inefficient, doing O(n^2) 
operations
every time we redrew the interface. Replacing this with a O(n) operation 
when
we add log messages.

This should both drop arm's cpu usage when reading messages at the DEBUG
runlevel and allow us to always support deduplicaion (previously arm turned 
it
off when it got too slow).

This also moves deduplication to our util and adds tests (yay!). Next bit to
port over is the daybreak handling...
---
 nyx/config/dedup.cfg   |6 +-
 nyx/log_panel.py   |  131 ++--
 nyx/util/log.py|   65 +++-
 test/util/log/deduplication.py |   27 -
 test/util/log/log_entry.py |   27 +
 test/util/log/log_group.py |   87 ++
 6 files changed, 214 insertions(+), 129 deletions(-)

diff --git a/nyx/config/dedup.cfg b/nyx/config/dedup.cfg
index 06c4ff2..954e588 100644
--- a/nyx/config/dedup.cfg
+++ b/nyx/config/dedup.cfg
@@ -37,7 +37,9 @@
 # [NOTICE] I learned some more directory information, but not enough to build a
 #  circuit: We have only 469/2027 usable descriptors.
 # [NOTICE] Attempt by %s to open a stream from unknown relay. Closing.
-# [NOTICE] Bootstrapped 72%: Loading relay descriptors.
+# [NOTICE] Average packaged cell fullness: 70.976%. TLS write overhead: 11%
+# [NOTICE] Heartbeat: Tor's uptime is 8 days 6:00 hours, with 0 circuits open.
+#  I've sent 3.53 MB and received 90.61 MB.
 # [WARN] You specified a server "Amunet8" by name, but this name is not
 #registered
 # [WARN] I have no descriptor for the router named "Amunet8" in my declared
@@ -79,6 +81,8 @@ dedup.NOTICE We stalled too much while trying to write
 dedup.NOTICE I learned some more directory information, but not enough to 
build a circuit
 dedup.NOTICE Attempt by
 dedup.NOTICE *Loading relay descriptors.
+dedup.NOTICE Average packaged cell fullness:
+dedup.NOTICE Heartbeat: Tor's uptime is
 dedup.WARN You specified a server
 dedup.WARN I have no descriptor for the router named
 dedup.WARN Controller gave us config lines that didn't validate
diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index ff64c78..f61d9c6 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -22,7 +22,7 @@ import nyx.popups
 
 from nyx import __version__
 from nyx.util import panel, tor_controller, ui_tools
-from nyx.util.log import LogEntry, read_tor_log
+from nyx.util.log import LogGroup, LogEntry, read_tor_log
 
 DAYBREAK_EVENT = 'DAYBREAK'  # special event for marking when the date changes
 TIMEZONE_OFFSET = time.altzone if time.localtime()[8] else time.timezone
@@ -70,12 +70,6 @@ CONTENT_HEIGHT_REDRAW_THRESHOLD = 3
 
 CACHED_DAYBREAKS_ARGUMENTS = (None, None)  # events, current day
 CACHED_DAYBREAKS_RESULT = None
-CACHED_DUPLICATES_ARGUMENTS = None  # events
-CACHED_DUPLICATES_RESULT = None
-
-# duration we'll wait for the deduplication function before giving up (in ms)
-
-DEDUPLICATION_TIMEOUT = 100
 
 # maximum number of regex filters we'll remember
 
@@ -147,59 +141,6 @@ def get_daybreaks(events, ignore_time_for_cache = False):
   return new_listing
 
 
-def get_duplicates(events):
-  """
-  Deduplicates a list of log entries, providing back a tuple listing with the
-  log entry and count of duplicates following it. Entries in different days are
-  not considered to be duplicates. This times out, returning None if it takes
-  longer than DEDUPLICATION_TIMEOUT.
-
-  Arguments:
-events - chronologically ordered listing of events
-  """
-
-  global CACHED_DUPLICATES_ARGUMENTS, CACHED_DUPLICATES_RESULT
-
-  if CACHED_DUPLICATES_ARGUMENTS == events:
-return list(CACHED_DUPLICATES_RESULT)
-
-  start_time = time.time()
-  events_remaining = list(events)
-  return_events = []
-
-  while events_remaining:
-entry, duplicate_indices = events_remaining.pop(0), []
-
-for i, earlier_entry in enumerate(events_remaining):
-  # if showing dates then do duplicate detection for each day, rather
-  # than globally
-
-  if earlier_entry.type == DAYBREAK_EVENT:
-break
-
-  if entry.is_duplicate(earlier_entry):
-duplicate_indices.append(i)
-
-# checks if the call timeout has been reached
-
-if (time.time() - start_time) > DEDUPLICATION_TIMEOUT / 1000.0:
-  return None
-
-# drops duplicate entries
-
-duplicate_indices.reverse()
-
-for i in duplicate_indices:
-  del events_remaining[i]
-
-return_events.append((entry, len(duplicate_indices)))
-
-  CACHED_DUPLICATES_ARGUMENTS = list(events)
-  CACHED_DUPLICATES_RESULT = list(return_events)
-
-  return return_events
-
-
 class LogPanel(panel.Panel, threading.Thread, logging.Handler):
   """
   Listens for and displays tor, nyx, and 

[tor-commits] [nyx/master] Move LogEntry to log util

2015-05-04 Thread atagar
commit 7889e5e1b0ef095beba0017e92b74971437ea101
Author: Damian Johnson 
Date:   Sun Apr 12 13:49:21 2015 -0700

Move LogEntry to log util

We made a LogEntry namedtuple in the log util for read_tor_log(). This is 
very
similar to the LogEntry class in the panel. Just moving the class - we'll 
want
this to make our other helpers testable too.
---
 nyx/log_panel.py |   62 +-
 nyx/util/log.py  |   45 
 nyx/util/ui_tools.py |2 +-
 3 files changed, 48 insertions(+), 61 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index cdaca17..75fa59d 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -12,15 +12,17 @@ import logging
 import threading
 
 import stem
+import stem.response.events
+
 from stem.control import State
-from stem.response import events
 from stem.util import conf, log, str_tools
 
 import nyx.arguments
 import nyx.popups
+
 from nyx import __version__
 from nyx.util import panel, tor_controller, ui_tools
-from nyx.util.log import read_tor_log
+from nyx.util.log import LogEntry, read_tor_log
 
 try:
   # added in python 3.2
@@ -158,7 +160,7 @@ def get_daybreaks(events, ignore_time_for_cache = False):
 
 if event_day != last_day:
   marker_timestamp = (event_day * 86400) + TIMEZONE_OFFSET
-  new_listing.append(LogEntry(marker_timestamp, DAYBREAK_EVENT, '', 
'white'))
+  new_listing.append(LogEntry(marker_timestamp, DAYBREAK_EVENT, ''))
 
 new_listing.append(entry)
 last_day = event_day
@@ -267,34 +269,6 @@ def is_duplicate(event, event_set, get_duplicates = False):
 return False
 
 
-class LogEntry():
-  """
-  Individual log file entry, having the following attributes:
-timestamp - unix timestamp for when the event occurred
-event_type - event type that occurred ('INFO', 'BW', 'NYX_WARN', etc)
-msg   - message that was logged
-color - color of the log entry
-  """
-
-  def __init__(self, timestamp, event_type, msg):
-self.timestamp = timestamp
-self.type = event_type
-self.msg = msg
-self.color = CONFIG['attr.log_color'].get(event_type, 'white')
-
-  @lru_cache()
-  def get_display_message(self):
-"""
-Provides the entry's message for the log.
-
-Arguments:
-  include_date - appends the event's date to the start of the message
-"""
-
-entry_time = time.localtime(self.timestamp)
-return '%02i:%02i:%02i [%s] %s' % (entry_time[3], entry_time[4], 
entry_time[5], self.type, self.msg)
-
-
 class LogPanel(panel.Panel, threading.Thread, logging.Handler):
   """
   Listens for and displays tor, nyx, and stem events. This can prepopulate
@@ -427,8 +401,8 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
   if logging_location:
 try:
   for entry in read_tor_log(logging_location, read_limit):
-if entry.runlevel in set_runlevels:
-  self.msg_log.append(LogEntry(entry.timestamp, entry.runlevel, 
entry.message))
+if entry.type in set_runlevels:
+  self.msg_log.append(entry)
 except IOError as exc:
   log.info('Unable to read log located at %s: %s' % (logging_location, 
exc))
 except ValueError as exc:
@@ -460,9 +434,9 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 
 msg = ' '.join(str(event).split(' ')[1:])
 
-if isinstance(event, events.BandwidthEvent):
+if isinstance(event, stem.response.events.BandwidthEvent):
   msg = 'READ: %i, WRITTEN: %i' % (event.read, event.written)
-elif isinstance(event, events.LogEvent):
+elif isinstance(event, stem.response.events.LogEvent):
   msg = event.message
 
 self.register_event(LogEntry(event.arrived_at, event.type, msg))
@@ -478,15 +452,11 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 if event.type not in self.logged_events:
   return
 
-# strips control characters to avoid screwing up the terminal
-
-event.msg = ui_tools.get_printable(event.msg)
-
 # note event in the log file if we're saving them
 
 if self.log_file:
   try:
-self.log_file.write(event.get_display_message() + '\n')
+self.log_file.write(event.display_message + '\n')
 self.log_file.flush()
   except IOError as exc:
 log.error('Unable to write to log file: %s' % exc.strerror)
@@ -498,7 +468,7 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 
 # notifies the display that it has new content
 
-if not self.regex_filter or 
self.regex_filter.search(event.get_display_message()):
+if not self.regex_filter or 
self.regex_filter.search(event.display_message):
   self._cond.acquire()
   self._cond.notifyAll()
   self._cond.release()
@@ -679,10 +649,10 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 
 try:
   for entry in self.msg_log:
-is_visible = not self.regex_fi

[tor-commits] [nyx/master] Use @lru_cache for common log messages

2015-05-04 Thread atagar
commit 90522a52bf85bc6eb66671db531e5e988052ed89
Author: Damian Johnson 
Date:   Sat Apr 11 15:59:28 2015 -0700

Use @lru_cache for common log messages

Classic instance for a cache rather than doing it manually.
---
 nyx/log_panel.py |   48 +---
 1 file changed, 17 insertions(+), 31 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index f58af4c..33af9dd 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -22,6 +22,12 @@ from nyx import __version__
 from nyx.util import panel, tor_controller, ui_tools
 from nyx.util.log import read_tor_log
 
+try:
+  # added in python 3.2
+  from functools import lru_cache
+except ImportError:
+  from stem.util.lru_cache import lru_cache
+
 RUNLEVEL_EVENT_COLOR = {
   log.DEBUG: 'magenta',
   log.INFO: 'blue',
@@ -71,11 +77,6 @@ DUPLICATE_MSG = ' [%i duplicate%s hidden]'
 
 CONTENT_HEIGHT_REDRAW_THRESHOLD = 3
 
-# static starting portion of common log entries, fetched from the config when
-# needed if None
-
-COMMON_LOG_MESSAGES = None
-
 # cached values and the arguments that generated it for the get_daybreaks and
 # get_duplicates functions
 
@@ -108,21 +109,21 @@ def days_since(timestamp = None):
   return int((timestamp - TIMEZONE_OFFSET) / 86400)
 
 
-def load_log_messages():
+@lru_cache()
+def common_log_messages():
   """
   Fetches a mapping of common log messages to their runlevels from the config.
   """
 
-  global COMMON_LOG_MESSAGES
   nyx_config = conf.get_config('nyx')
-
-  COMMON_LOG_MESSAGES = {}
+  messages = {}
 
   for conf_key in nyx_config.keys():
 if conf_key.startswith('dedup.'):
   event_type = conf_key[4:].upper()
-  messages = nyx_config.get(conf_key, [])
-  COMMON_LOG_MESSAGES[event_type] = messages
+  messages[event_type] = nyx_config.get(conf_key, [])
+
+  return messages
 
 
 def log_file_path():
@@ -191,11 +192,6 @@ def get_duplicates(events):
   if CACHED_DUPLICATES_ARGUMENTS == events:
 return list(CACHED_DUPLICATES_RESULT)
 
-  # loads common log entries from the config if they haven't been
-
-  if COMMON_LOG_MESSAGES is None:
-load_log_messages()
-
   start_time = time.time()
   events_remaining = list(events)
   return_events = []
@@ -253,8 +249,8 @@ def is_duplicate(event, event_set, get_duplicates = False):
 
   if event.msg == forward_entry.msg:
 is_duplicate = True
-  elif event.type in COMMON_LOG_MESSAGES:
-for common_msg in COMMON_LOG_MESSAGES[event.type]:
+  else:
+for common_msg in common_log_messages().get(event.type, []):
   # if it starts with an asterisk then check the whole message rather
   # than just the start
 
@@ -292,8 +288,8 @@ class LogEntry():
 self.type = event_type
 self.msg = msg
 self.color = color
-self._display_message = None
 
+  @lru_cache()
   def get_display_message(self, include_date = False):
 """
 Provides the entry's message for the log.
@@ -303,16 +299,12 @@ class LogEntry():
 """
 
 if include_date:
-  # not the common case so skip caching
   entry_time = time.localtime(self.timestamp)
   time_label = '%i/%i/%i %02i:%02i:%02i' % (entry_time[1], entry_time[2], 
entry_time[0], entry_time[3], entry_time[4], entry_time[5])
   return '%s [%s] %s' % (time_label, self.type, self.msg)
-
-if not self._display_message:
+else:
   entry_time = time.localtime(self.timestamp)
-  self._display_message = '%02i:%02i:%02i [%s] %s' % (entry_time[3], 
entry_time[4], entry_time[5], self.type, self.msg)
-
-return self._display_message
+  return '%02i:%02i:%02i [%s] %s' % (entry_time[3], entry_time[4], 
entry_time[5], self.type, self.msg)
 
 
 class LogPanel(panel.Panel, threading.Thread, logging.Handler):
@@ -333,12 +325,6 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 threading.Thread.__init__(self)
 self.setDaemon(True)
 
-# Make sure that the msg.* messages are loaded. Lazy loading it later is
-# fine, but this way we're sure it happens before warning about unused
-# config options.
-
-load_log_messages()
-
 # regex filters the user has defined
 
 self.filter_options = []



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


[tor-commits] [nyx/master] Fix nyx log message deduplication

2015-05-04 Thread atagar
commit 95ea86e2e907006bd4b9d8ccd53d8ccfa152fb1f
Author: Damian Johnson 
Date:   Sun Apr 12 14:38:48 2015 -0700

Fix nyx log message deduplication

The name shuffle missed our dedup.cfg, breaking deduplication of this type 
of
message.
---
 nyx/config/dedup.cfg |   62 +-
 1 file changed, 31 insertions(+), 31 deletions(-)

diff --git a/nyx/config/dedup.cfg b/nyx/config/dedup.cfg
index ce8afcb..06c4ff2 100644
--- a/nyx/config/dedup.cfg
+++ b/nyx/config/dedup.cfg
@@ -47,17 +47,17 @@
 # [WARN] Problem bootstrapping. Stuck at 80%: Connecting to the Tor network.
 #(Network is unreachable; NOROUTE; count 47;recommendation warn)
 # [WARN] 4 unknown, 1 missing key, 3 good, 0 bad, 1 no signature, 4 required
-# [ARM_DEBUG] refresh rate: 0.001 seconds
-# [ARM_DEBUG] proc call (process connections): /proc/net/[tcp|udp] (runtime: 
0.0018)
-# [ARM_DEBUG] system call: ps -p 2354 -o %cpu,rss,%mem,etime (runtime: 0.02)
-# [ARM_DEBUG] system call: netstat -npt | grep 2354/tor (runtime: 0.02)
-# [ARM_DEBUG] recreating panel 'graph' with the dimensions of 14/124
-# [ARM_DEBUG] redrawing the log panel with the corrected content height 
(estimat was off by 4)
-# [ARM_DEBUG] GETINFO accounting/bytes-left (runtime: 0.0006)
-# [ARM_DEBUG] GETINFO traffic/read (runtime: 0.0004)
-# [ARM_DEBUG] GETINFO traffic/written (runtime: 0.0002)
-# [ARM_DEBUG] GETCONF MyFamily (runtime: 0.0007)
-# [ARM_DEBUG] Unable to query process resource usage from ps, waiting 6.25 
seconds (unrecognized output from ps: ...)
+# [NYX_DEBUG] refresh rate: 0.001 seconds
+# [NYX_DEBUG] proc call (process connections): /proc/net/[tcp|udp] (runtime: 
0.0018)
+# [NYX_DEBUG] system call: ps -p 2354 -o %cpu,rss,%mem,etime (runtime: 0.02)
+# [NYX_DEBUG] system call: netstat -npt | grep 2354/tor (runtime: 0.02)
+# [NYX_DEBUG] recreating panel 'graph' with the dimensions of 14/124
+# [NYX_DEBUG] redrawing the log panel with the corrected content height 
(estimat was off by 4)
+# [NYX_DEBUG] GETINFO accounting/bytes-left (runtime: 0.0006)
+# [NYX_DEBUG] GETINFO traffic/read (runtime: 0.0004)
+# [NYX_DEBUG] GETINFO traffic/written (runtime: 0.0002)
+# [NYX_DEBUG] GETCONF MyFamily (runtime: 0.0007)
+# [NYX_DEBUG] Unable to query process resource usage from ps, waiting 6.25 
seconds (unrecognized output from ps: ...)
 #
 

 
@@ -84,24 +84,24 @@ dedup.WARN I have no descriptor for the router named
 dedup.WARN Controller gave us config lines that didn't validate
 dedup.WARN Problem bootstrapping. Stuck at
 dedup.WARN *missing key,
-dedup.ARM_DEBUG refresh rate:
-dedup.ARM_DEBUG proc call (cwd):
-dedup.ARM_DEBUG proc call (memory usage):
-dedup.ARM_DEBUG proc call (process command
-dedup.ARM_DEBUG proc call (process utime
-dedup.ARM_DEBUG proc call (process stime
-dedup.ARM_DEBUG proc call (process start time
-dedup.ARM_DEBUG proc call (process connections):
-dedup.ARM_DEBUG system call: ps
-dedup.ARM_DEBUG system call: netstat
-dedup.ARM_DEBUG recreating panel '
-dedup.ARM_DEBUG redrawing the log panel with the corrected content height (
-dedup.ARM_DEBUG GETINFO accounting/bytes
-dedup.ARM_DEBUG GETINFO accounting/bytes-left
-dedup.ARM_DEBUG GETINFO accounting/interval-end
-dedup.ARM_DEBUG GETINFO accounting/hibernating
-dedup.ARM_DEBUG GETINFO traffic/read
-dedup.ARM_DEBUG GETINFO traffic/written
-dedup.ARM_DEBUG GETCONF
-dedup.ARM_DEBUG Unable to query process resource usage from ps
+dedup.NYX_DEBUG refresh rate:
+dedup.NYX_DEBUG proc call (cwd):
+dedup.NYX_DEBUG proc call (memory usage):
+dedup.NYX_DEBUG proc call (process command
+dedup.NYX_DEBUG proc call (process utime
+dedup.NYX_DEBUG proc call (process stime
+dedup.NYX_DEBUG proc call (process start time
+dedup.NYX_DEBUG proc call (process connections):
+dedup.NYX_DEBUG system call: ps
+dedup.NYX_DEBUG system call: netstat
+dedup.NYX_DEBUG recreating panel '
+dedup.NYX_DEBUG redrawing the log panel with the corrected content height (
+dedup.NYX_DEBUG GETINFO accounting/bytes
+dedup.NYX_DEBUG GETINFO accounting/bytes-left
+dedup.NYX_DEBUG GETINFO accounting/interval-end
+dedup.NYX_DEBUG GETINFO accounting/hibernating
+dedup.NYX_DEBUG GETINFO traffic/read
+dedup.NYX_DEBUG GETINFO traffic/written
+dedup.NYX_DEBUG GETCONF
+dedup.NYX_DEBUG Unable to query process resource usage from ps
 



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


[tor-commits] [nyx/master] Move log util tests to their own module

2015-05-04 Thread atagar
commit e3797bd6bcef5347f118e0208d9ed95b08b42fad
Author: Damian Johnson 
Date:   Sun Apr 12 14:37:55 2015 -0700

Move log util tests to their own module

About to add some more so better to group them in a module.
---
 test/util/__init__.py |2 +-
 test/util/data/malformed_date |   21 --
 test/util/data/malformed_line |   21 --
 test/util/data/malformed_runlevel |   21 --
 test/util/data/multiple_tor_instances |   33 
 test/util/data/tor_log|   21 --
 test/util/log/__init__.py |7 
 test/util/log/data/malformed_date |   21 ++
 test/util/log/data/malformed_line |   21 ++
 test/util/log/data/malformed_runlevel |   21 ++
 test/util/log/data/multiple_tor_instances |   33 
 test/util/log/data/tor_log|   21 ++
 test/util/log/read_tor_log.py |   59 +
 test/util/read_tor_log.py |   59 -
 14 files changed, 184 insertions(+), 177 deletions(-)

diff --git a/test/util/__init__.py b/test/util/__init__.py
index cc6042f..a03ad4f 100644
--- a/test/util/__init__.py
+++ b/test/util/__init__.py
@@ -2,4 +2,4 @@
 Unit tests for nyx's utilities.
 """
 
-__all__ = ['bandwidth_from_state']
+__all__ = ['log', 'tracker']
diff --git a/test/util/data/empty_file b/test/util/data/empty_file
deleted file mode 100644
index e69de29..000
diff --git a/test/util/data/malformed_date b/test/util/data/malformed_date
deleted file mode 100644
index 712149d..000
--- a/test/util/data/malformed_date
+++ /dev/null
@@ -1,21 +0,0 @@
-Apr 06 11:03:39.000 [notice] Tor 0.2.7.0-alpha-dev (git-4247ce99e5d9b7b2) 
opening new log file.
-Apr 06 11:03:39.832 [notice] Tor v0.2.7.0-alpha-dev (git-4247ce99e5d9b7b2) 
running on Linux with Libevent 2.0.16-stable, OpenSSL 1.0.1 and Zlib 1.2.3.4.
-Apr 06 11:03:39.832 [notice] Tor can't help you if you use it wrong! Learn how 
to be safe at https://www.torproject.org/download/download#warning
-Apr 06 11:03:39.833 [notice] This version is not a stable Tor release. Expect 
more bugs than usual.
-Apr 06 11:03:39.833 [notice] Read configuration file "/home/atagar/.tor/torrc".
-Apr 06 11:03:39.838 [notice] Opening Socks listener on 127.0.0.1:9050
-Apr 06 11:03:39.838 [notice] Opening Control listener on 127.0.0.1:9051
-Apr 06 11:03:39.000 [notice] Bootstrapped 0%: Starting
-Apr 06 11:03:42.000 [notice] Bootstrapped 45%: Asking for relay descriptors
-Apr 06 11:03:43.000 [notice] Bootstrapped 50%: Loading relay descriptors
-Apr 06 11:03:49.000 [notice] New control connection opened from 127.0.0.1.
-Apr 06 11:03:51.000 [notice] Bootstrapped 55%: Loading relay descriptors
-Apr 06 11:03:51.000 [notice] Bootstrapped 63%: Loading relay descriptors
-Apr 06 11:03:51.000 [notice] Bootstrapped 69%: Loading relay descriptors
-Apr 06 11:03:51.000 [notice] Bootstrapped 74%: Loading relay descriptors
-Apr 06 11:03:52.000 [notice] Bootstrapped 80%: Connecting to the Tor network
-Zed 06 11:03:52.000 [notice] Bootstrapped 90%: Establishing a Tor circuit
-Apr 06 11:03:53.000 [notice] Tor has successfully opened a circuit. Looks like 
client functionality is working.
-Apr 06 11:03:53.000 [notice] Bootstrapped 100%: Done
-Apr 06 11:03:55.000 [notice] New control connection opened from 127.0.0.1.
-Apr 06 11:53:46.000 [notice] Interrupt: exiting cleanly.
diff --git a/test/util/data/malformed_line b/test/util/data/malformed_line
deleted file mode 100644
index ac9a367..000
--- a/test/util/data/malformed_line
+++ /dev/null
@@ -1,21 +0,0 @@
-Apr 06 11:03:39.000 [notice] Tor 0.2.7.0-alpha-dev (git-4247ce99e5d9b7b2) 
opening new log file.
-Apr 06 11:03:39.832 [notice] Tor v0.2.7.0-alpha-dev (git-4247ce99e5d9b7b2) 
running on Linux with Libevent 2.0.16-stable, OpenSSL 1.0.1 and Zlib 1.2.3.4.
-Apr 06 11:03:39.832 [notice] Tor can't help you if you use it wrong! Learn how 
to be safe at https://www.torproject.org/download/download#warning
-Apr 06 11:03:39.833 [notice] This version is not a stable Tor release. Expect 
more bugs than usual.
-Apr 06 11:03:39.833 [notice] Read configuration file "/home/atagar/.tor/torrc".
-Apr 06 11:03:39.838 [notice] Opening Socks listener on 127.0.0.1:9050
-Apr 06 11:03:39.838 [notice] Opening Control listener on 127.0.0.1:9051
-Apr 06 11:03:39.000 [notice] Bootstrapped 0%: Starting
-Apr 06 11:03:42.000 [notice] Bootstrapped 45%: Asking for relay descriptors
-Apr 06 11:03:43.000 [notice] Bootstrapped 50%: Loading relay descriptors
-Apr 06 11:03:49.000 [notice] New control connection opened from 127.0.0.1.
-Apr 06 11:03:51.000 [notice] Bootstrapped 55%: Loading relay descriptors
-Apr 06 11:03:51.000 [notice] Bootstrapped 63%: Loading relay descriptors
-Apr 06 11:03:51.000 [notice] Bootstrapped 69%: Loading relay descriptors
-Apr 06 11:03:51.000 [notice] Bootstrapped 74%: Loading relay descr

[tor-commits] [nyx/master] Basic deduplication unit tests

2015-05-04 Thread atagar
commit ebaf46e6e310301bc31bb4c45a0430fd52a8439f
Author: Damian Johnson 
Date:   Sun Apr 12 15:22:21 2015 -0700

Basic deduplication unit tests

Just some simple unit tests to start with. No suprise, deduplication was
completley borked. :P
---
 nyx/util/log.py|8 
 test/util/log/__init__.py  |1 +
 test/util/log/deduplication.py |   27 +++
 3 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/nyx/util/log.py b/nyx/util/log.py
index a753390..6e28e6c 100644
--- a/nyx/util/log.py
+++ b/nyx/util/log.py
@@ -34,7 +34,7 @@ def _common_log_messages():
 
   for conf_key in nyx_config.keys():
 if conf_key.startswith('dedup.'):
-  event_type = conf_key[4:]
+  event_type = conf_key[6:]
   messages[event_type] = nyx_config.get(conf_key, [])
 
   return messages
@@ -69,10 +69,10 @@ class LogEntry(object):
 :returns: **True** if the given log message is a duplicate of us and 
**False** otherwise
 """
 
-if self.message == entry.message:
-  return True
-elif self.type != entry.type:
+if self.type != entry.type:
   return False
+elif self.message == entry.message:
+  return True
 
 for common_msg in _common_log_messages().get(self.type, []):
   # if it starts with an asterisk then check the whole message rather
diff --git a/test/util/log/__init__.py b/test/util/log/__init__.py
index b2fb6f7..9896955 100644
--- a/test/util/log/__init__.py
+++ b/test/util/log/__init__.py
@@ -3,5 +3,6 @@ Unit tests for nyx's log utilities.
 """
 
 __all__ = [
+  'deduplication',
   'read_tor_log',
 ]
diff --git a/test/util/log/deduplication.py b/test/util/log/deduplication.py
new file mode 100644
index 000..fdd97f2
--- /dev/null
+++ b/test/util/log/deduplication.py
@@ -0,0 +1,27 @@
+import unittest
+
+from nyx.util.log import LogEntry
+
+
+class TestLogDeduplication(unittest.TestCase):
+  def test_matches_identical_messages(self):
+# Simple case is that we match the same message but different timestamp.
+
+entry = LogEntry(1333738434, 'INFO', 'tor_lockfile_lock(): Locking 
"/home/atagar/.tor/lock"')
+self.assertTrue(entry.is_duplicate(LogEntry(1333738457, 'INFO', 
'tor_lockfile_lock(): Locking "/home/atagar/.tor/lock"')))
+
+# ... but we shouldn't match if the runlevel differs.
+
+self.assertFalse(entry.is_duplicate(LogEntry(1333738457, 'DEBUG', 
'tor_lockfile_lock(): Locking "/home/atagar/.tor/lock"')))
+
+  def test_matches_based_on_prefix(self):
+# matches using a prefix specified in dedup.cfg
+
+entry = LogEntry(1333738434, 'NYX_DEBUG', 'GETCONF MyFamily (runtime: 
0.0007)')
+self.assertTrue(entry.is_duplicate(LogEntry(1333738457, 'NYX_DEBUG', 
'GETCONF MyFamily (runtime: 0.0015)')))
+
+  def test_matches_with_wildcard(self):
+# matches using a wildcard specified in dedup.cfg
+
+entry = LogEntry(1333738434, 'NOTICE', 'Bootstrapped 72%: Loading relay 
descriptors.')
+self.assertTrue(entry.is_duplicate(LogEntry(1333738457, 'NOTICE', 
'Bootstrapped 55%: Loading relay descriptors.')))



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


[tor-commits] [nyx/master] Take advantage of stem.util.system.tail()

2015-05-04 Thread atagar
commit ece58f823d9548f04f9a8027c8db17440e33700e
Author: Damian Johnson 
Date:   Mon Apr 6 10:56:08 2015 -0700

Take advantage of stem.util.system.tail()

Using our new util rather than shelling out for this. Cuts down on one more
platform specific dependency.
---
 nyx/log_panel.py |   99 ++
 1 file changed, 40 insertions(+), 59 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index 62d2319..b314eaa 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -190,82 +190,63 @@ def get_log_file_entries(runlevels, read_limit = None, 
add_limit = None):
 if is_file_subset:
   read_limit = add_limit
 
-  # tries opening the log file, cropping results to avoid choking on huge logs
-
-  lines = []
-
-  try:
-if read_limit:
-  lines = system.call('tail -n %i %s' % (read_limit, logging_location))
-
-  if not lines:
-raise IOError()
-else:
-  log_file = open(logging_location, 'r')
-  lines = log_file.readlines()
-  log_file.close()
-  except IOError:
-log.warn("Unable to read tor's log file: %s" % logging_location)
-
-  if not lines:
-return []
-
   logged_events = []
   current_unix_time, current_local_time = time.time(), time.localtime()
 
-  for i in range(len(lines) - 1, -1, -1):
-line = lines[i]
-
-# entries look like:
-# Jul 15 18:29:48.806 [notice] Parsing GEOIP file.
+  try:
+for line in system.tail(logging_location, read_limit):
+  # entries look like:
+  # Jul 15 18:29:48.806 [notice] Parsing GEOIP file.
 
-line_comp = line.split()
+  line_comp = line.split()
 
-# Checks that we have all the components we expect. This could happen if
-# we're either not parsing a tor log or in weird edge cases (like being
-# out of disk space)
+  # Checks that we have all the components we expect. This could happen if
+  # we're either not parsing a tor log or in weird edge cases (like being
+  # out of disk space)
 
-if len(line_comp) < 4:
-  continue
+  if len(line_comp) < 4:
+continue
 
-event_type = line_comp[3][1:-1].upper()
+  event_type = line_comp[3][1:-1].upper()
 
-if event_type in runlevels:
-  # converts timestamp to unix time
+  if event_type in runlevels:
+# converts timestamp to unix time
 
-  timestamp = ' '.join(line_comp[:3])
+timestamp = ' '.join(line_comp[:3])
 
-  # strips the decimal seconds
+# strips the decimal seconds
 
-  if '.' in timestamp:
-timestamp = timestamp[:timestamp.find('.')]
+if '.' in timestamp:
+  timestamp = timestamp[:timestamp.find('.')]
 
-  # Ignoring wday and yday since they aren't used.
-  #
-  # Pretend the year is 2012, because 2012 is a leap year, and parsing a
-  # date with strptime fails if Feb 29th is passed without a year that's
-  # actually a leap year. We can't just use the current year, because we
-  # might be parsing old logs which didn't get rotated.
-  #
-  # https://trac.torproject.org/projects/tor/ticket/5265
+# Ignoring wday and yday since they aren't used.
+#
+# Pretend the year is 2012, because 2012 is a leap year, and parsing a
+# date with strptime fails if Feb 29th is passed without a year that's
+# actually a leap year. We can't just use the current year, because we
+# might be parsing old logs which didn't get rotated.
+#
+# https://trac.torproject.org/projects/tor/ticket/5265
 
-  timestamp = '2012 ' + timestamp
-  event_time_comp = list(time.strptime(timestamp, '%Y %b %d %H:%M:%S'))
-  event_time_comp[8] = current_local_time.tm_isdst
-  event_time = time.mktime(event_time_comp)  # converts local to unix time
+timestamp = '2012 ' + timestamp
+event_time_comp = list(time.strptime(timestamp, '%Y %b %d %H:%M:%S'))
+event_time_comp[8] = current_local_time.tm_isdst
+event_time = time.mktime(event_time_comp)  # converts local to unix 
time
 
-  # The above is gonna be wrong if the logs are for the previous year. If
-  # the event's in the future then correct for this.
+# The above is gonna be wrong if the logs are for the previous year. If
+# the event's in the future then correct for this.
 
-  if event_time > current_unix_time + 60:
-event_time_comp[0] -= 1
-event_time = time.mktime(event_time_comp)
+if event_time > current_unix_time + 60:
+  event_time_comp[0] -= 1
+  event_time = time.mktime(event_time_comp)
 
-  event_msg = ' '.join(line_comp[4:])
-  logged_events.append(LogEntry(event_time, event_type, event_msg, 
RUNLEVEL_EVENT_COLOR[event_type]))
+event_msg = ' '.join(line_comp[4:])
+logged_events.append(LogEntry(event_time, event_type, event_msg, 
RUNLEVEL_EVENT_COLOR[event_type]))
 
-if 'opening log file' in line:
-  break  # 

[tor-commits] [nyx/master] Use 'with' for log panel locking

2015-05-04 Thread atagar
commit 68cef741685f139c852f55b9f25d57cad78aa78f
Author: Damian Johnson 
Date:   Wed Apr 15 10:03:31 2015 -0700

Use 'with' for log panel locking

Safer locking so unexpected exceptions won't cause us to have an unreleased
lock.
---
 nyx/log_panel.py |  520 ++
 1 file changed, 251 insertions(+), 269 deletions(-)

diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index dc63af8..e691b29 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -316,35 +316,32 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 Clears the event log and repopulates it from the nyx and tor backlogs.
 """
 
-self.vals_lock.acquire()
+with self.vals_lock:
+  # clears the event log
 
-# clears the event log
+  self.msg_log = []
 
-self.msg_log = []
+  # fetches past tor events from log file, if available
 
-# fetches past tor events from log file, if available
+  if CONFIG['features.log.prepopulate']:
+set_runlevels = list(set.intersection(set(self.logged_events), 
set(list(log.Runlevel
+read_limit = CONFIG['features.log.prepopulateReadLimit']
 
-if CONFIG['features.log.prepopulate']:
-  set_runlevels = list(set.intersection(set(self.logged_events), 
set(list(log.Runlevel
-  read_limit = CONFIG['features.log.prepopulateReadLimit']
+logging_location = log_file_path()
 
-  logging_location = log_file_path()
-
-  if logging_location:
-try:
-  for entry in read_tor_log(logging_location, read_limit):
-if entry.type in set_runlevels:
-  self.msg_log.append(entry)
-except IOError as exc:
-  log.info('Unable to read log located at %s: %s' % (logging_location, 
exc))
-except ValueError as exc:
-  log.info(str(exc))
-
-# crops events that are either too old, or more numerous than the caching 
size
+if logging_location:
+  try:
+for entry in read_tor_log(logging_location, read_limit):
+  if entry.type in set_runlevels:
+self.msg_log.append(entry)
+  except IOError as exc:
+log.info('Unable to read log located at %s: %s' % 
(logging_location, exc))
+  except ValueError as exc:
+log.info(str(exc))
 
-self._trim_events(self.msg_log)
+  # crops events that are either too old, or more numerous than the 
caching size
 
-self.vals_lock.release()
+  self._trim_events(self.msg_log)
 
   def set_duplicate_visability(self, is_visible):
 """
@@ -394,18 +391,16 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 log.error('Unable to write to log file: %s' % exc.strerror)
 self.log_file = None
 
-self.vals_lock.acquire()
-self.msg_log.insert(0, event)
-self._trim_events(self.msg_log)
-
-# notifies the display that it has new content
+with self.vals_lock:
+  self.msg_log.insert(0, event)
+  self._trim_events(self.msg_log)
 
-if not self.regex_filter or 
self.regex_filter.search(event.display_message):
-  self._cond.acquire()
-  self._cond.notifyAll()
-  self._cond.release()
+  # notifies the display that it has new content
 
-self.vals_lock.release()
+  if not self.regex_filter or 
self.regex_filter.search(event.display_message):
+self._cond.acquire()
+self._cond.notifyAll()
+self._cond.release()
 
   def set_logged_events(self, event_types):
 """
@@ -418,15 +413,13 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 if event_types == self.logged_events:
   return
 
-self.vals_lock.acquire()
-
-# configures the controller to listen for these tor events, and provides
-# back a subset without anything we're failing to listen to
+with self.vals_lock:
+  # configures the controller to listen for these tor events, and provides
+  # back a subset without anything we're failing to listen to
 
-set_types = self.set_event_listening(event_types)
-self.logged_events = set_types
-self.redraw(True)
-self.vals_lock.release()
+  set_types = self.set_event_listening(event_types)
+  self.logged_events = set_types
+  self.redraw(True)
 
   def get_filter(self):
 """
@@ -447,10 +440,9 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 if log_filter == self.regex_filter:
   return
 
-self.vals_lock.acquire()
-self.regex_filter = log_filter
-self.redraw(True)
-self.vals_lock.release()
+with self.vals_lock:
+  self.regex_filter = log_filter
+  self.redraw(True)
 
   def make_filter_selection(self, selected_option):
 """
@@ -549,10 +541,9 @@ class LogPanel(panel.Panel, threading.Thread, 
logging.Handler):
 Clears the contents of the event log.
 """
 
-self.vals_lock.acquire()
-self.msg_log = []
-self.redraw(True)
-self.vals_lock.release()
+  

[tor-commits] [nyx/master] read_tor_log() for reading tor log files

2015-05-04 Thread atagar
commit b20b60df25a5f99f32b0f347173083883e6fb409
Author: Damian Johnson 
Date:   Mon Apr 6 15:41:50 2015 -0700

read_tor_log() for reading tor log files

Replacing get_log_file_entries() with a tested, simpler function. This is 
still
a lot grosser than I'd like, but not much I can do unless something happens
with #15607.
---
 nyx/config/strings.cfg|1 +
 nyx/log_panel.py  |  149 -
 nyx/util/__init__.py  |9 +-
 nyx/util/log.py   |   77 +
 run_tests.py  |5 +-
 test/util/data/malformed_date |   21 +
 test/util/data/malformed_line |   21 +
 test/util/data/malformed_runlevel |   21 +
 test/util/data/multiple_tor_instances |   33 
 test/util/data/tor_log|   21 +
 test/util/read_tor_log.py |   59 +
 11 files changed, 282 insertions(+), 135 deletions(-)

diff --git a/nyx/config/strings.cfg b/nyx/config/strings.cfg
index d1169b9..7660bfb 100644
--- a/nyx/config/strings.cfg
+++ b/nyx/config/strings.cfg
@@ -24,6 +24,7 @@ msg.panel.graphing.prepopulation_successful Bandwidth graph 
has information for
 msg.panel.graphing.bw_event_cache_malformed Tor's 'GETINFO bw-event-cache' 
provided malformed output: {response}
 msg.panel.header.fd_used_at_sixty_percent Tor's file descriptor usage is at 
{percentage}%.
 msg.panel.header.fd_used_at_ninety_percent Tor's file descriptor usage is at 
{percentage}%. If you run out Tor will be unable to continue functioning.
+msg.panel.log.read_from_log_file Read {count} entries from tor's log file: 
{path} (read limit: {read_limit}, runtime: {runtime})
 
 msg.setup.nyx_is_running_as_root Nyx is currently running with root 
permissions. This isn't a good idea, nor should it be necessary. Try starting 
nyx with "sudo -u {tor_user} nyx" instead.
 msg.setup.chroot_doesnt_exist The chroot path set in your config ({path}) 
doesn't exist.
diff --git a/nyx/log_panel.py b/nyx/log_panel.py
index b314eaa..8650996 100644
--- a/nyx/log_panel.py
+++ b/nyx/log_panel.py
@@ -14,12 +14,13 @@ import threading
 import stem
 from stem.control import State
 from stem.response import events
-from stem.util import conf, log, str_tools, system
+from stem.util import conf, log, str_tools
 
 import nyx.arguments
 import nyx.popups
 from nyx import __version__
 from nyx.util import panel, tor_controller, ui_tools
+from nyx.util.log import read_tor_log
 
 RUNLEVEL_EVENT_COLOR = {
   log.DEBUG: 'magenta',
@@ -124,136 +125,12 @@ def load_log_messages():
   COMMON_LOG_MESSAGES[event_type] = messages
 
 
-def get_log_file_entries(runlevels, read_limit = None, add_limit = None):
-  """
-  Parses tor's log file for past events matching the given runlevels, providing
-  a list of log entries (ordered newest to oldest). Limiting the number of read
-  entries is suggested to avoid parsing everything from logs in the GB and TB
-  range.
-
-  Arguments:
-runlevels - event types (DEBUG - ERR) to be returned
-read_limit - max lines of the log file that'll be read (unlimited if None)
-add_limit  - maximum entries to provide back (unlimited if None)
-  """
-
-  start_time = time.time()
-
-  if not runlevels:
-return []
-
-  # checks tor's configuration for the log file's location (if any exists)
-
-  logging_types, logging_location = None, None
-
-  for logging_entry in tor_controller().get_conf('Log', [], True):
-# looks for an entry like: notice file /var/log/tor/notices.log
-
-entry_comp = logging_entry.split()
+def log_file_path():
+  for log_entry in tor_controller().get_conf('Log', [], True):
+entry_comp = log_entry.split()  # looking for an entry like: notice file 
/var/log/tor/notices.log
 
 if entry_comp[1] == 'file':
-  logging_types, logging_location = entry_comp[0], entry_comp[2]
-  break
-
-  if not logging_location:
-return []
-
-  # includes the prefix for tor paths
-
-  logging_location = CONFIG['tor.chroot'] + logging_location
-
-  # if the runlevels argument is a superset of the log file then we can
-  # limit the read contents to the add_limit
-
-  runlevels = list(log.Runlevel)
-  logging_types = logging_types.upper()
-
-  if add_limit and (not read_limit or read_limit > add_limit):
-if '-' in logging_types:
-  div_index = logging_types.find('-')
-  start_index = runlevels.index(logging_types[:div_index])
-  end_index = runlevels.index(logging_types[div_index + 1:])
-  log_file_run_levels = runlevels[start_index:end_index + 1]
-else:
-  start_index = runlevels.index(logging_types)
-  log_file_run_levels = runlevels[start_index:]
-
-# checks if runlevels we're reporting are a superset of the file's contents
-
-is_file_subset = True
-
-for runlevel_type in log_file_run_levels:
-  if runlevel_type not in runlevels:
-is_file_subset = False
-break
-
-

[tor-commits] [tor-browser-spec/master] Describe user behavior as a fingerprinting source.

2015-05-04 Thread mikeperry
commit d8b78e0729a1e5d16244812fbc86b9fa9f29f5b0
Author: Mike Perry 
Date:   Mon May 4 20:14:38 2015 -0700

Describe user behavior as a fingerprinting source.

Also generalize TCP Port to TCP Port and Local Network.
---
 design-doc/design.xml |   38 --
 1 file changed, 28 insertions(+), 10 deletions(-)

diff --git a/design-doc/design.xml b/design-doc/design.xml
index 3d4f18e..fbec073 100644
--- a/design-doc/design.xml
+++ b/design-doc/design.xml
@@ -1464,8 +1464,10 @@ severe, and how to study the efficacy of defenses 
properly.
 Sources of Fingerprinting Issues
 
 
-All fingerprinting issues arise from one of four primary sources. In order
-from most severe to least severe, these sources are:
+All fingerprinting issues arise from one of four primary sources in the
+browser. Additionally, user behavior itself provides one more source of
+potential fingerprinting. Listed in order from most severe to least severe in
+terms of the amount of information they reveal, these sources are:
 
 
 
@@ -1487,13 +1489,15 @@ do so only on a per-site basis via site permissions, to 
avoid linkability.
  Device and Hardware Characteristics
   
 
-Device and hardware characteristics can be determined in three ways: they can 
be
-reported explicitly by the browser, they can be inferred through API behavior,
-or they can be extracted through statistical measurements of system
-performance. We are most concerned with the cases where this information is
-either directly reported or can be determined via a single use of an API or
-feature, and prefer to place such APIs either behind site permissions, or
-disable them entirely.
+Device and hardware characteristics can be determined in three ways: they can
+be reported explicitly by the browser, they can be inferred through browser
+functionality, or they can be extracted through statistical measurements of
+system performance. We are most concerned with the cases where this
+information is either directly reported or can be determined via a single use
+of an API or feature, and prefer to place such APIs either behind site
+permissions, alter their functionality to prevent exposing the most variable
+aspects of these characteristics, or disable them entirely.
+
   
   
 
@@ -1522,6 +1526,20 @@ specific version of a system can be inferred.
 
   
  
+ User Behavior
+  
+
+While somewhat outside the scope of browser fingerprinting, for completeness
+it is important to mention that users themselves theoretically might be
+fingerprinted through their behavior while interacting with a website. This
+behavior includes as keystrokes, mouse movements, click speed, and writing
+style. Basic vectors such as keystroke and mouse usage fingerprinting can be
+mitigated by altering Javascript's notion of time. More advanced issues like
+writing style fingerprinting are the domain of https://github.com/psal/anonymouth";>other tools.
+
+  
+ 
  Browser Vendor and Version Differences
   
 
@@ -1633,7 +1651,7 @@ image data, pure white image data is returned to the 
Javascript APIs.
  
  
 
-Open TCP Port Fingerprinting
+Open TCP Port and Local Network Fingerprinting
  
 
 In Firefox, by using either WebSockets or XHR, it is possible for remote



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


[tor-commits] [tor-browser-spec/master] Address Georg's first round of comments.

2015-05-04 Thread mikeperry
commit 20c36ab5fa6d1cfe2023fbd5d254afa64cf5208f
Author: Mike Perry 
Date:   Mon May 4 19:30:38 2015 -0700

Address Georg's first round of comments.

Primarily removing mention of IP address linkability, and clarifying the
WebWorker blob isolation section areas.
---
 design-doc/design.xml |   21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/design-doc/design.xml b/design-doc/design.xml
index f7ef5dc..3d4f18e 100644
--- a/design-doc/design.xml
+++ b/design-doc/design.xml
@@ -1259,12 +1259,12 @@ False Start via the Firefox Pref
 security.ssl.enable_false_start.
 
 
-IP address, Tor circuit, and HTTP Keep-Alive linkability
+Tor circuit and HTTP connection linkability
  
 
-IP addresses, Tor circuits, and HTTP connections from a third party in one URL
-bar origin MUST NOT be reused for that same third party in another URL bar
-origin.
+Tor circuits and HTTP connections from a third party in one URL bar origin
+MUST NOT be reused for that same third party in another URL bar origin.
+
  
  
 
@@ -1275,11 +1275,10 @@ component that https://gitweb.torproject.org/torbutton.git/tree/src/components/domain-isolator.js";>sets
 the SOCKS username and password for each request. The Tor client has
 logic to prevent connections with different SOCKS usernames and passwords from
-using the same Tor circuit, which provides us with IP address unlinkability.
-Firefox has existing logic to ensure that connections with SOCKS proxies do not
-re-use existing HTTP Keep-Alive connections unless the proxy settings match.
-We extended this logic to cover SOCKS username and password authentication,
-providing us with HTTP Keep-Alive unlinkability.
+using the same Tor circuit. Firefox has existing logic to ensure that 
connections with
+SOCKS proxies do not re-use existing HTTP Keep-Alive connections unless the
+proxy settings match.  We extended this logic to cover SOCKS username and
+password authentication, providing us with HTTP Keep-Alive unlinkability.
 
  
 
@@ -1324,7 +1323,9 @@ URIs created with URL.createObjectURL MUST be limited in 
scope to the first
 party URL bar domain that created them. We provide this isolation in Tor
 Browser via a https://gitweb.torproject.org/tor-browser.git/commit/?h=tor-browser-31.6.0esr-4.5-1&id=0d67ab406bdd3cf095802cb25c081641aa1f0bcc";>direct
-patch to Firefox and disable URL.createObjectURL in a worker context 
as a stopgap.
+patch to Firefox and disable URL.createObjectURL in the WebWorker
+context as a stopgap, due to an edge case with enforcing this isolation in
+WebWorkers.
 
  
 



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


[tor-commits] [tor-browser-spec/master] Clarify the identifier unlinkability section.

2015-05-04 Thread mikeperry
commit 3d07e2d54d2944bd182145908399bc01c7bbe791
Author: Mike Perry 
Date:   Mon May 4 21:14:02 2015 -0700

Clarify the identifier unlinkability section.
---
 design-doc/design.xml |   32 ++--
 1 file changed, 22 insertions(+), 10 deletions(-)

diff --git a/design-doc/design.xml b/design-doc/design.xml
index fbec073..88f6426 100644
--- a/design-doc/design.xml
+++ b/design-doc/design.xml
@@ -1112,16 +1112,14 @@ $HOME environment variable to be the TBB extraction 
directory.
Cross-Origin Identifier Unlinkability

 
-The Tor Browser MUST prevent a user's activity on one site from being linked
-to their activity on another site. When this goal cannot yet be met with an
-existing web technology, that technology or functionality is disabled. Our
-design goal is to ultimately eliminate the need 
to disable arbitrary
-technologies, and instead simply alter them in ways that allows them to
-function in a backwards-compatible way while avoiding linkability. Users
-should be able to use federated login of various kinds to explicitly inform
-sites who they are, but that information should not transparently allow a
-third party to record their activity from site to site without their prior
-consent.
+The Cross-Origin Identifier Unlinkability design requirement is satisfied
+through first party isolation of all browser identifier sources. First party
+isolation means that all identifier sources and browser state are scoped
+(isolated) using the the URL bar domain. This scoping is performed in
+combination with any additional third party scope. When first party isolation
+is used with explicit identifier storage that already has a constrained third
+party scope (such as cookies, DOM storage, and cache), this approach is
+referred to as "double-keying".
 


@@ -1152,6 +1150,19 @@ form history, login values, and so on within a context 
menu for each site.
 
 

+
+ 
+  Identifier Unlinkability Defenses in the Tor Browser
+   
+
+Unfortunately, many aspects of browser state can serve as identifier storage,
+and no other browser vendor or standards body has invested the effort to
+enumerate or otherwise deal with these vectors for third party tracking. As
+such, we have had to enumerate and isolate these identifier sources on a
+piecemeal basis. Here is the list that we have discovered and dealt with to
+date:
+
+   

 Cookies
  Design Goal:
@@ -1430,6 +1441,7 @@ Identity invocations.
 For more details on identifier linkability bugs and enhancements, see the 
https://trac.torproject.org/projects/tor/query?keywords=~tbb-linkability&status=!closed";>tbb-linkability
 tag in our bugtracker
   
+  
   
   
Cross-Origin Fingerprinting Unlinkability

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


[tor-commits] [webwml/master] ugh -- what have i done. maybe this will fix it.

2015-05-04 Thread arma
commit d44d2685480f72baef100e68ba0b08765a167860
Author: Roger Dingledine 
Date:   Mon May 4 23:10:57 2015 -0400

ugh -- what have i done. maybe this will fix it.
---
 press/en/info.wmi |4 
 1 file changed, 4 deletions(-)

diff --git a/press/en/info.wmi b/press/en/info.wmi
index 52968ff..9c9e307 100644
--- a/press/en/info.wmi
+++ b/press/en/info.wmi
@@ -7,12 +7,8 @@
 Press Contact
 
 Tor Press Team
-<<< HEAD
-exec...@torproject.org
-===
 pr...@torproject.org
 +1-617-902-0208
->>> 5628d54898b63540d5df3179261a9cdd591fd970
 
 


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


[tor-commits] [webwml/master] Merge branch 'master' of ssh://git-rw.torproject.org/project/web/webwml

2015-05-04 Thread arma
commit fd56b785c6300a0b675bcd30424c6a3c67472b9f
Merge: fea31a2 5628d54
Author: Roger Dingledine 
Date:   Mon May 4 22:35:33 2015 -0400

Merge branch 'master' of ssh://git-rw.torproject.org/project/web/webwml

Conflicts:
press/en/info.wmi

 Makefile   |4 +-
 about/en/board.wml |  120 +++---
 about/en/contact.wml   |   20 +-
 about/en/corepeople.wml|   28 +-
 about/en/gsoc.wml  |6 +-
 about/en/overview.wml  |   51 +--
 about/en/sponsors.wml  |7 +-
 about/en/torusers.wml  |   76 ++--
 about/en/volunteers.wml|   18 +-
 css/layout.css |   15 +-
 docs/en/bridges.wml|   10 +-
 docs/en/debian.wml |  240 +++-
 docs/en/faq.wml|   22 +-
 docs/en/hidden-services.wml|   40 +-
 docs/en/pluggable-transports.wml   |2 +-
 docs/en/running-a-mirror.wml   |4 +-
 docs/en/signing-keys.wml   |   11 +-
 docs/en/tor-doc-osx.wml|  131 +++
 docs/en/tor-doc-relay.wml  |6 +-
 docs/en/tor-doc-unix.wml   |   22 +-
 docs/en/tor-doc-windows.wml|   51 +--
 docs/en/tor-hidden-service.wml |   18 +-
 docs/en/verifying-signatures.wml   |  132 ---
 docs/torbutton/en/design/design.xml|4 +-
 docs/torbutton/en/design/index.html.en |4 +-
 donate/en/donate.wml   |   12 +-
 download/en/download-easy.wml  |   30 +-
 download/en/download.wml   |   10 +-
 getinvolved/en/relays.wml  |   34 +-
 getinvolved/en/tshirt.wml  |4 +-
 getinvolved/en/volunteer.wml   |  208 --
 images/tbb-macosx-step-1.png   |  Bin 0 -> 21334 bytes
 images/tbb-macosx-step-2.png   |  Bin 0 -> 20451 bytes
 images/tbb-macosx-step-3.png   |  Bin 0 -> 13846 bytes
 include/dlhead.wmi |4 +-
 include/mirrors-table.wmi  |  302 +++
 include/tor-mirrors.csv|  150 
 include/versions.wmi   |   30 +-
 press/en/info.wmi  |5 +
 press/en/press.wml |   60 +++
 projects/en/gettor.wml |   93 +
 projects/en/obfsproxy.wml  |2 +-
 projects/en/torbrowser.wml |   78 ++--
 projects/torbrowser/RecommendedTBBVersions |   20 +-
 projects/torbrowser/design/index.html.en   |  562 +---
 45 files changed, 1419 insertions(+), 1227 deletions(-)

diff --cc press/en/info.wmi
index 5429016,9c9e307..52968ff
--- a/press/en/info.wmi
+++ b/press/en/info.wmi
@@@ -7,7 -7,8 +7,12 @@@
  Press Contact
  
  Tor Press Team
++<<< HEAD
 +exec...@torproject.org
++===
+ pr...@torproject.org
+ +1-617-902-0208
++>>> 5628d54898b63540d5df3179261a9cdd591fd970
  
  
 



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


[tor-commits] [webwml/master] download page listed 0.2.5.12 as the latest stable

2015-05-04 Thread arma
commit 99b7b20fb00b57f5534dfc229f53337b921d4cf2
Author: Roger Dingledine 
Date:   Mon May 4 22:37:08 2015 -0400

download page listed 0.2.5.12 as the latest stable
---
 include/versions.wmi |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/versions.wmi b/include/versions.wmi
index 2c116c7..c83c573 100644
--- a/include/versions.wmi
+++ b/include/versions.wmi
@@ -1,4 +1,4 @@
-0.2.5.12
+0.2.6.7
 0.2.6.7
 
 0.2.6.7

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


[tor-commits] [webwml/master] stop listing a phone number on our press page

2015-05-04 Thread arma
commit fea31a279b48deb698915ae3db29f2d6e4a25dba
Author: Roger Dingledine 
Date:   Tue Apr 14 15:49:51 2015 -0400

stop listing a phone number on our press page
---
 press/en/info.wmi |1 -
 1 file changed, 1 deletion(-)

diff --git a/press/en/info.wmi b/press/en/info.wmi
index 976436b..5429016 100644
--- a/press/en/info.wmi
+++ b/press/en/info.wmi
@@ -8,7 +8,6 @@
 
 Tor Press Team
 exec...@torproject.org
-+1-781-948-1982
 
 




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


[tor-commits] [translation/gettor_completed] Update translations for gettor_completed

2015-05-04 Thread translation
commit 16f2db34301224f686592c086f09648647dee0f0
Author: Translation commit bot 
Date:   Mon May 4 23:15:09 2015 +

Update translations for gettor_completed
---
 ko/gettor.po |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/ko/gettor.po b/ko/gettor.po
index 1b7bb8d..a7e0d72 100644
--- a/ko/gettor.po
+++ b/ko/gettor.po
@@ -14,7 +14,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2013-01-19 13:40+0100\n"
-"PO-Revision-Date: 2015-05-04 22:41+\n"
+"PO-Revision-Date: 2015-05-04 23:01+\n"
 "Last-Translator: 류종헌\n"
 "Language-Team: Korean 
(http://www.transifex.com/projects/p/torproject/language/ko/)\n"
 "MIME-Version: 1.0\n"
@@ -293,7 +293,7 @@ msgstr "패키지가 곧 도착할 것입니다. 모든 
패키지를 압축을 
 msgid ""
 "It was successfully understood. Your request is currently being processed.\n"
 "Your package (%s) should arrive within the next ten minutes."
-msgstr "성공적으로 이해되었습니다. 귀하의 요청은 현재 
진행중이며, 패키지(%s)는 다음 10분 내로 도착해야 합니다."
+msgstr "정상적으로 접수되었습니다.\n귀하의 요청은 현재 
진행중에 있으며, 요청하신 패키지(%s)는 다음 10분 내로 
도착할 것입니다."
 
 #: lib/gettor/i18n.py:191
 msgid ""
@@ -363,7 +363,7 @@ msgid ""
 "macos-i386:\n"
 "The Tor Browser Bundle package for OS X, Intel CPU architecture. In \n"
 "general, newer Mac hardware will require you to use this package."
-msgstr "macos-i386:\nIntel 아키렉처를 사용하고 있는 OS X를 위한 
Tor Browser Bundle입니다. 일반적으로, 최근의 Mac 하드웨어는 이 
패키지가 필요합니다."
+msgstr "macos-i386:\nIntel 아키렉처를 사용하고 있는 OS X를 위한 
Tor Browser Bundle입니다. 2000년 이후로 출시된 대부분의  Mac은 
이 패키지가 필요합니다."
 
 #: lib/gettor/i18n.py:231
 msgid ""
@@ -404,28 +404,28 @@ msgid ""
 "obfs-macos-i386:\n"
 "The Tor Obfsproxy Browser Bundle package for OS X, 32bit Intel CPU \n"
 "architecture."
-msgstr "obfs-macos-i386:\n32비트 인텔 CPU 아키렉쳐를 
사용하는OSX를 위한 Tor Obfsproxy Browser Bundle 패키지"
+msgstr "obfs-macos-i386:\n32비트 인텔 CPU 아키텍쳐를 
사용하는OSX를 위한 Tor Obfsproxy Browser Bundle 패키지"
 
 #: lib/gettor/i18n.py:254
 msgid ""
 "obfs-macos-x86_64:\n"
 "The Tor Obfsproxy Browser Bundle package for OS X, 64bit Intel CPU \n"
 "architecture."
-msgstr "obfs-macos-x86_64:\n64비트 인텔 CPU 아키렉쳐를 
사용하는OSX를 위한 Tor Obfsproxy Browser Bundle 패키지"
+msgstr "obfs-macos-x86_64:\n64비트 인텔 CPU 아키텍쳐를 
사용하는OSX를 위한 Tor Obfsproxy Browser Bundle 패키지"
 
 #: lib/gettor/i18n.py:258
 msgid ""
 "obfs-linux-i386:\n"
 "The Tor Obfsproxy Browser Bundle package for Linux, 32bit Intel CPU \n"
 "architecture."
-msgstr "obfs-linux-i386:\n\n32비트 인텔 CPU 아키렉셔를 사용하는 
리눅스를 위한 Tor Obfsproxy Browser bundle \n패키지"
+msgstr "obfs-linux-i386:\n\n32비트 인텔 CPU 아키텍쳐를 사용하는 
리눅스를 위한 Tor Obfsproxy Browser bundle \n패키지"
 
 #: lib/gettor/i18n.py:262
 msgid ""
 "obfs-linux-x86_64:\n"
 "The Tor Obfsproxy Browser Bundle package for Linux, 64bit Intel CPU \n"
 "architecture."
-msgstr "obfs-linux-x86_64:\n64비트 인텔 CPU 아키렉셔를 사용하는 
리눅스를 위한 Tor Obfsproxy Browser Bundle\n 패키지"
+msgstr "obfs-linux-x86_64:\n64비트 인텔 CPU 아키텍쳐를 사용하는 
리눅스를 위한 Tor Obfsproxy Browser Bundle\n 패키지"
 
 #: lib/gettor/i18n.py:266
 msgid ""
@@ -445,7 +445,7 @@ msgstr "Tor는 무엇입니까?"
 
 #: lib/gettor/i18n.py:274
 msgid "The name \"Tor\" can refer to several different components."
-msgstr "\"토르\"는 여러 가지 서로 다른 구성 요소를 참조할 
수 있습니다."
+msgstr "\"Tor(토르)\"는 여러 가지 서로 다른 구성 요소를 
참조할 수 있습니다."
 
 #: lib/gettor/i18n.py:276
 msgid ""
@@ -481,7 +481,7 @@ msgid ""
 "operating system is Microsoft Windows, you should request \"windows\". Here\n"
 "is a short explanation of all packages to request and what operating \n"
 "systems there are suitable for:"
-msgstr "이것은 사용하는 운영 체제에 따라 다릅니다. 운영 
체제가 Microsoft\nWindows인 경우 예를 들어, \"창\"을 요청해야 
합니다. \n적합한 운영 체제와 모든 패키지에 대한 간단한 
설명 요청하십시오:"
+msgstr "이것은 사용하는 운영 체제에 따라 다릅니다. 운영 
체제가 Microsoft\nWindows인 경우 예를 들어, \"windows\"를 
요청해야 합니다. \n아래의 내용은 요청할 수 있는 운영 ì²´ì 
œ 및 간단한 설명 입니다:"
 
 #: lib/gettor/i18n.py:299
 msgid "How do I extract the file(s) you sent me?"

___
tor-commits mailing

[tor-commits] [translation/gettor] Update translations for gettor

2015-05-04 Thread translation
commit 253bd93e1cb8181217f0602cca0679c3f86c6b6f
Author: Translation commit bot 
Date:   Mon May 4 23:15:05 2015 +

Update translations for gettor
---
 ko/gettor.po |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/ko/gettor.po b/ko/gettor.po
index 1b7bb8d..a7e0d72 100644
--- a/ko/gettor.po
+++ b/ko/gettor.po
@@ -14,7 +14,7 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2013-01-19 13:40+0100\n"
-"PO-Revision-Date: 2015-05-04 22:41+\n"
+"PO-Revision-Date: 2015-05-04 23:01+\n"
 "Last-Translator: 류종헌\n"
 "Language-Team: Korean 
(http://www.transifex.com/projects/p/torproject/language/ko/)\n"
 "MIME-Version: 1.0\n"
@@ -293,7 +293,7 @@ msgstr "패키지가 곧 도착할 것입니다. 모든 
패키지를 압축을 
 msgid ""
 "It was successfully understood. Your request is currently being processed.\n"
 "Your package (%s) should arrive within the next ten minutes."
-msgstr "성공적으로 이해되었습니다. 귀하의 요청은 현재 
진행중이며, 패키지(%s)는 다음 10분 내로 도착해야 합니다."
+msgstr "정상적으로 접수되었습니다.\n귀하의 요청은 현재 
진행중에 있으며, 요청하신 패키지(%s)는 다음 10분 내로 
도착할 것입니다."
 
 #: lib/gettor/i18n.py:191
 msgid ""
@@ -363,7 +363,7 @@ msgid ""
 "macos-i386:\n"
 "The Tor Browser Bundle package for OS X, Intel CPU architecture. In \n"
 "general, newer Mac hardware will require you to use this package."
-msgstr "macos-i386:\nIntel 아키렉처를 사용하고 있는 OS X를 위한 
Tor Browser Bundle입니다. 일반적으로, 최근의 Mac 하드웨어는 이 
패키지가 필요합니다."
+msgstr "macos-i386:\nIntel 아키렉처를 사용하고 있는 OS X를 위한 
Tor Browser Bundle입니다. 2000년 이후로 출시된 대부분의  Mac은 
이 패키지가 필요합니다."
 
 #: lib/gettor/i18n.py:231
 msgid ""
@@ -404,28 +404,28 @@ msgid ""
 "obfs-macos-i386:\n"
 "The Tor Obfsproxy Browser Bundle package for OS X, 32bit Intel CPU \n"
 "architecture."
-msgstr "obfs-macos-i386:\n32비트 인텔 CPU 아키렉쳐를 
사용하는OSX를 위한 Tor Obfsproxy Browser Bundle 패키지"
+msgstr "obfs-macos-i386:\n32비트 인텔 CPU 아키텍쳐를 
사용하는OSX를 위한 Tor Obfsproxy Browser Bundle 패키지"
 
 #: lib/gettor/i18n.py:254
 msgid ""
 "obfs-macos-x86_64:\n"
 "The Tor Obfsproxy Browser Bundle package for OS X, 64bit Intel CPU \n"
 "architecture."
-msgstr "obfs-macos-x86_64:\n64비트 인텔 CPU 아키렉쳐를 
사용하는OSX를 위한 Tor Obfsproxy Browser Bundle 패키지"
+msgstr "obfs-macos-x86_64:\n64비트 인텔 CPU 아키텍쳐를 
사용하는OSX를 위한 Tor Obfsproxy Browser Bundle 패키지"
 
 #: lib/gettor/i18n.py:258
 msgid ""
 "obfs-linux-i386:\n"
 "The Tor Obfsproxy Browser Bundle package for Linux, 32bit Intel CPU \n"
 "architecture."
-msgstr "obfs-linux-i386:\n\n32비트 인텔 CPU 아키렉셔를 사용하는 
리눅스를 위한 Tor Obfsproxy Browser bundle \n패키지"
+msgstr "obfs-linux-i386:\n\n32비트 인텔 CPU 아키텍쳐를 사용하는 
리눅스를 위한 Tor Obfsproxy Browser bundle \n패키지"
 
 #: lib/gettor/i18n.py:262
 msgid ""
 "obfs-linux-x86_64:\n"
 "The Tor Obfsproxy Browser Bundle package for Linux, 64bit Intel CPU \n"
 "architecture."
-msgstr "obfs-linux-x86_64:\n64비트 인텔 CPU 아키렉셔를 사용하는 
리눅스를 위한 Tor Obfsproxy Browser Bundle\n 패키지"
+msgstr "obfs-linux-x86_64:\n64비트 인텔 CPU 아키텍쳐를 사용하는 
리눅스를 위한 Tor Obfsproxy Browser Bundle\n 패키지"
 
 #: lib/gettor/i18n.py:266
 msgid ""
@@ -445,7 +445,7 @@ msgstr "Tor는 무엇입니까?"
 
 #: lib/gettor/i18n.py:274
 msgid "The name \"Tor\" can refer to several different components."
-msgstr "\"토르\"는 여러 가지 서로 다른 구성 요소를 참조할 
수 있습니다."
+msgstr "\"Tor(토르)\"는 여러 가지 서로 다른 구성 요소를 
참조할 수 있습니다."
 
 #: lib/gettor/i18n.py:276
 msgid ""
@@ -481,7 +481,7 @@ msgid ""
 "operating system is Microsoft Windows, you should request \"windows\". Here\n"
 "is a short explanation of all packages to request and what operating \n"
 "systems there are suitable for:"
-msgstr "이것은 사용하는 운영 체제에 따라 다릅니다. 운영 
체제가 Microsoft\nWindows인 경우 예를 들어, \"창\"을 요청해야 
합니다. \n적합한 운영 체제와 모든 패키지에 대한 간단한 
설명 요청하십시오:"
+msgstr "이것은 사용하는 운영 체제에 따라 다릅니다. 운영 
체제가 Microsoft\nWindows인 경우 예를 들어, \"windows\"를 
요청해야 합니다. \n아래의 내용은 요청할 수 있는 운영 ì²´ì 
œ 및 간단한 설명 입니다:"
 
 #: lib/gettor/i18n.py:299
 msgid "How do I extract the file(s) you sent me?"

___
tor-commits mailing list
tor-

[tor-commits] [tor-browser-spec/master] Minor fixes and clarifications

2015-05-04 Thread mikeperry
commit 56581bbb7af9d5d0a180e9ca36cd85855536b769
Author: Georg Koppen 
Date:   Mon May 4 15:35:39 2015 +

Minor fixes and clarifications
---
 design-doc/design.xml |   62 +++--
 1 file changed, 29 insertions(+), 33 deletions(-)

diff --git a/design-doc/design.xml b/design-doc/design.xml
index c0cb1b1..f7ef5dc 100644
--- a/design-doc/design.xml
+++ b/design-doc/design.xml
@@ -1623,11 +1623,10 @@ fingerprinting vectors. If WebGL is normalized through 
software rendering,
 system colors were standardized, and the browser shipped a fixed collection of
 fonts (see later points in this list), it might not be necessary to create a
 canvas permission. However, until then, to reduce the threat from this vector,
-we have patched Firefox to https://gitweb.torproject.org/tor-browser.git/commit/?h=tor-browser-31.6.0esr-4.5-1&id=6a169ef0166b268b1a27546a17b3d7470330917d";>prompt
-before returning valid image data to the Canvas APIs. If the user
-hasn't previously allowed the site in the URL bar to access Canvas image data,
-pure white image data is returned to the Javascript APIs.
+we have patched Firefox to https://gitweb.torproject.org/tor-browser.git/commit/?h=tor-browser-31.6.0esr-4.5-1&id=6a169ef0166b268b1a27546a17b3d7470330917d";>prompt
 before returning valid image data to the Canvas APIs,
+and for https://gitweb.torproject.org/tor-browser.git/commit/?h=tor-browser-31.6.0esr-4.5-1&id=7d51acca6383732480b49ccdb5506ad6fb92e651";>access
 to isPointInPath and related functions.
+If the user hasn't previously allowed the site in the URL bar to access Canvas
+image data, pure white image data is returned to the Javascript APIs.
 
  
  
@@ -1774,27 +1773,25 @@ zoom/viewport-based mechanisms that might allow 
us to always report the
 same desktop resolution regardless of the actual size of the content window,
 and simply scale to make up the difference.  Until then, the user should also
 be informed that maximizing their windows can lead to fingerprintability under
-this scheme. 
+this scheme.
 
  
  Implementation Status:
 
 We automatically resize new browser windows to a 200x100 pixel multiple using
-a window observer to https://gitweb.torproject.org/torbutton.git/tree/src/chrome/content/torbutton.js#n3361";>resize
-new windows based on desktop resolution. To minimize the effect of the
-long tail of large monitor sizes, we also cap the the window size at 1000
-pixels in each direction. Additionally, we patch
-Firefox to use the client content window size https://gitweb.torproject.org/torbutton.git/tree/src/chrome/content/torbutton.js#n3361";>based
+on desktop resolution. To minimize the effect of the long tail of large
+monitor sizes, we also cap the window size at 1000 pixels in each direction.
+Additionally, we patch Firefox to use the client content window size https://gitweb.torproject.org/tor-browser.git/commit/?h=tor-browser-31.6.0esr-4.5-1&id=bd3b1ed32a9c21fdc92fc35f2ec0a41badc378d5";>for
 window.screen, and to https://gitweb.torproject.org/tor-browser.git/commit/?h=tor-browser-31.6.0esr-4.5-1&id=a5648c8d80f396caf294d761cc4a9a76c0b33a9d";>report
 a window.devicePixelRatio of 1.0. Similarly, we https://gitweb.torproject.org/tor-browser.git/commit/?h=tor-browser-31.6.0esr-4.5-1&id=3c02858027634ffcfbd97047dfdf170c19ca29ec";>patch
-DOM events to return content window relative points. We also 
+DOM events to return content window relative points.
 
-We also force
-popups to open in new tabs (via
+We also force popups to open in new tabs (via
 browser.link.open_newwindow.restriction), to avoid
 full-screen popups inferring information about the browser resolution. In
 addition, we prevent auto-maximizing on browser start, and inform users that
@@ -1972,7 +1969,7 @@ large number of people.
  
  Implementation Status:
 
-Currently, the our mitigation against performance fingerprinting is to
+Currently, our mitigation against performance fingerprinting is to
 disable http://www.w3.org/TR/navigation-timing/";>Navigation
 Timing through the Firefox preference
 dom.enable_performance, and to disable the , and the https://wiki.mozilla.org/Sensor_API";>Sensor API. We disable these 
APIs through the Firefox preferences
 dom.battery.enabled,
 dom.network.enabled, and
-device.sensors.enabled. 
+device.sensors.enabled.
 
  
 
@@ -2204,10 +2201,11 @@ video click-to-play via NoScript 
(noscript.forbidMedia).
 
 This security level inherits the preferences from the Medium-Low level, and
 additionally disables the baseline JIT
-(javascript.options.baselinejit.content), disables graphite
-font rendering (gfx.font_rendering.graphite.enabled), and
-only allows Javascript to run if it is loaded over HTTPS and the URL bar is
-HTTPS (by setting noscript.global to false and
+(javascript.options.baselinejit.content), disables Graphite
+(gfx.font_rendering.graphite.enabled) and SVG OpenType font
+rendering (gfx.font_rendering.opentype_svg.enabled) and only
+allo

[tor-commits] [translation/gettor_completed] Update translations for gettor_completed

2015-05-04 Thread translation
commit 176791fa0ea6b008dc837051f20c1dd85508b901
Author: Translation commit bot 
Date:   Mon May 4 22:45:11 2015 +

Update translations for gettor_completed
---
 ko/gettor.po |   41 +
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/ko/gettor.po b/ko/gettor.po
index 4072bd5..1b7bb8d 100644
--- a/ko/gettor.po
+++ b/ko/gettor.po
@@ -7,14 +7,15 @@
 # cwt96 , 2012
 # Jacob Appelbaum , 2009
 # Dr.what , 2014
+# 류종헌, 2015
 # pCsOrI , 2012
 msgid ""
 msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2013-01-19 13:40+0100\n"
-"PO-Revision-Date: 2014-10-15 17:11+\n"
-"Last-Translator: Dr.what \n"
+"PO-Revision-Date: 2015-05-04 22:41+\n"
+"Last-Translator: 류종헌\n"
 "Language-Team: Korean 
(http://www.transifex.com/projects/p/torproject/language/ko/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -24,7 +25,7 @@ msgstr ""
 
 #: lib/gettor/i18n.py:27
 msgid "Hello, This is the \"GetTor\" robot."
-msgstr "안녕하세요, 이것은 \"Gettor\" 로봇입니다."
+msgstr "안녕하세요, \"GetTor\" 로봇에서 답변드립니다."
 
 #: lib/gettor/i18n.py:29
 msgid "Thank you for your request."
@@ -35,14 +36,14 @@ msgid ""
 "Unfortunately, we won't answer you at this address. You should make\n"
 "an account with GMAIL.COM, YAHOO.COM or YAHOO.CN and send the mail from\n"
 "one of those."
-msgstr "불행하게도, 우리는 이 주소로 답변을 보내지 않을 
것입니다. GMAIL.COM, YAHOO.COM, YAHOO.CN 의 메일 주소를 만드시고 
그 메일로 다시 메일을 보내 주십시오."
+msgstr "불행하게도, 우리는 이 주소로 답변을 보내지 않을 
것입니다. GMAIL.COM, YAHOO.COM, YAHOO.CN 에서 메일 주소를 
만드시고 그 메일로 다시 메일을 보내 주십시오."
 
 #: lib/gettor/i18n.py:35
 msgid ""
 "We only process requests from email services that support \"DKIM\",\n"
 "which is an email feature that lets us verify that the address in the\n"
 "\"From\" line is actually the one who sent the mail."
-msgstr "우리는 \"DKIM\"를 지원하는 이메일 서비스에서 
프로세스만 요청합니다.\n이것은 \"보낸 사람\"의 주소가 실ì 
œë¡œ 메일을 보낸 사람인지 확인하실 수 있는 메일 기능입
니다."
+msgstr "저희는 \"From\" 라인에 있는 주소가 실제로 그 메일을 
보낸 사람의 것인지를 확인할 수 있는 이메일 기능인 
\"DKIM\"을 지원하는 이메일 서버스로부터 온 요청만 
처리합니다."
 
 #: lib/gettor/i18n.py:39
 msgid ""
@@ -73,13 +74,13 @@ msgid ""
 "obfs-linux-i386\n"
 "obfs-linux-x86_64\n"
 "source"
-msgstr "원하는 Tor 패키지를 이름을 보낸다면, Tor 패키지를 
보내 드립니다.\n아래와 같은 패키지 이름 중 하나를 선택해 
주십시오.\n\n windows\n macos-i386\n macos-ppc\n linux-i386\n 
linux-x86_64\n obfs-windows\n obfs-macos-i386\n obfs-macos-x86_64\n 
obfs-linux-i386\n obfs-linux-x86_64\n source"
+msgstr "원하시는 Tor 패키지를 이름을 기재하여 보내주시면, 
Tor 패키지를 보내 드립니다.\n아래와 같은 패키지 이름 중 
하나를 선택해 주십시오.\n\n windows\n macos-i386\n macos-ppc\n 
linux-i386\n linux-x86_64\n obfs-windows\n obfs-macos-i386\n 
obfs-macos-x86_64\n obfs-linux-i386\n obfs-linux-x86_64\n source"
 
 #: lib/gettor/i18n.py:61
 msgid ""
 "Please reply to this mail, and tell me a single package name anywhere \n"
 "in the body of your email."
-msgstr "이 메일에 답변해 주십시오. 그리도 하나의 패키지 
이름을 메일 본문 중 어디든지 써서 보내 주십시오."
+msgstr "위의 패키지 중 하나를 메일 본문 중 어디든지 써서  
이 메일에 보내 주십시오."
 
 #: lib/gettor/i18n.py:64
 msgid ""
@@ -104,7 +105,7 @@ msgstr "이 예는 페르시아어 버전을 보내 줄 
것입니다. 지원하
 
 #: lib/gettor/i18n.py:76
 msgid " List of supported locales:"
-msgstr "지원하는 언어 목록"
+msgstr "지원하는 언어 목록:"
 
 #: lib/gettor/i18n.py:78
 msgid "Here is a list of all available languages:"
@@ -127,20 +128,20 @@ msgstr "gettor...@torproject.org: 아랍어\n
gettor...@torproject.or
 
 #: lib/gettor/i18n.py:92
 msgid "If you select no language, you will receive the English version."
-msgstr "언어를 선택하지 않으면, 영어 버전을 보내드립니다."
+msgstr "언어를 선택하지 않으면, 영어 버전을 보내드릴 것입
니다."
 
 #: lib/gettor/i18n.py:94
 msgid ""
 "SMALLER SIZED PACKAGES\n"
 "=="
-msgstr "작은 크기 패키지\n==="
+msgstr "저용량 패키지\n==="
 
 #: lib/gettor/i18n.py:97
 msgid ""
 "If your bandwith is low or your provider doesn't allow you to\n"
 "receive large attachments in your email, GetTor can send you several\n"
 "small packages instead of one big one."
-msgstr "귀하의 대ì—

[tor-commits] [translation/gettor] Update translations for gettor

2015-05-04 Thread translation
commit 016289de652b29b0ebe12d658b5c7ef582e3427a
Author: Translation commit bot 
Date:   Mon May 4 22:45:06 2015 +

Update translations for gettor
---
 ko/gettor.po |   41 +
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/ko/gettor.po b/ko/gettor.po
index 4072bd5..1b7bb8d 100644
--- a/ko/gettor.po
+++ b/ko/gettor.po
@@ -7,14 +7,15 @@
 # cwt96 , 2012
 # Jacob Appelbaum , 2009
 # Dr.what , 2014
+# 류종헌, 2015
 # pCsOrI , 2012
 msgid ""
 msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2013-01-19 13:40+0100\n"
-"PO-Revision-Date: 2014-10-15 17:11+\n"
-"Last-Translator: Dr.what \n"
+"PO-Revision-Date: 2015-05-04 22:41+\n"
+"Last-Translator: 류종헌\n"
 "Language-Team: Korean 
(http://www.transifex.com/projects/p/torproject/language/ko/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -24,7 +25,7 @@ msgstr ""
 
 #: lib/gettor/i18n.py:27
 msgid "Hello, This is the \"GetTor\" robot."
-msgstr "안녕하세요, 이것은 \"Gettor\" 로봇입니다."
+msgstr "안녕하세요, \"GetTor\" 로봇에서 답변드립니다."
 
 #: lib/gettor/i18n.py:29
 msgid "Thank you for your request."
@@ -35,14 +36,14 @@ msgid ""
 "Unfortunately, we won't answer you at this address. You should make\n"
 "an account with GMAIL.COM, YAHOO.COM or YAHOO.CN and send the mail from\n"
 "one of those."
-msgstr "불행하게도, 우리는 이 주소로 답변을 보내지 않을 
것입니다. GMAIL.COM, YAHOO.COM, YAHOO.CN 의 메일 주소를 만드시고 
그 메일로 다시 메일을 보내 주십시오."
+msgstr "불행하게도, 우리는 이 주소로 답변을 보내지 않을 
것입니다. GMAIL.COM, YAHOO.COM, YAHOO.CN 에서 메일 주소를 
만드시고 그 메일로 다시 메일을 보내 주십시오."
 
 #: lib/gettor/i18n.py:35
 msgid ""
 "We only process requests from email services that support \"DKIM\",\n"
 "which is an email feature that lets us verify that the address in the\n"
 "\"From\" line is actually the one who sent the mail."
-msgstr "우리는 \"DKIM\"를 지원하는 이메일 서비스에서 
프로세스만 요청합니다.\n이것은 \"보낸 사람\"의 주소가 실ì 
œë¡œ 메일을 보낸 사람인지 확인하실 수 있는 메일 기능입
니다."
+msgstr "저희는 \"From\" 라인에 있는 주소가 실제로 그 메일을 
보낸 사람의 것인지를 확인할 수 있는 이메일 기능인 
\"DKIM\"을 지원하는 이메일 서버스로부터 온 요청만 
처리합니다."
 
 #: lib/gettor/i18n.py:39
 msgid ""
@@ -73,13 +74,13 @@ msgid ""
 "obfs-linux-i386\n"
 "obfs-linux-x86_64\n"
 "source"
-msgstr "원하는 Tor 패키지를 이름을 보낸다면, Tor 패키지를 
보내 드립니다.\n아래와 같은 패키지 이름 중 하나를 선택해 
주십시오.\n\n windows\n macos-i386\n macos-ppc\n linux-i386\n 
linux-x86_64\n obfs-windows\n obfs-macos-i386\n obfs-macos-x86_64\n 
obfs-linux-i386\n obfs-linux-x86_64\n source"
+msgstr "원하시는 Tor 패키지를 이름을 기재하여 보내주시면, 
Tor 패키지를 보내 드립니다.\n아래와 같은 패키지 이름 중 
하나를 선택해 주십시오.\n\n windows\n macos-i386\n macos-ppc\n 
linux-i386\n linux-x86_64\n obfs-windows\n obfs-macos-i386\n 
obfs-macos-x86_64\n obfs-linux-i386\n obfs-linux-x86_64\n source"
 
 #: lib/gettor/i18n.py:61
 msgid ""
 "Please reply to this mail, and tell me a single package name anywhere \n"
 "in the body of your email."
-msgstr "이 메일에 답변해 주십시오. 그리도 하나의 패키지 
이름을 메일 본문 중 어디든지 써서 보내 주십시오."
+msgstr "위의 패키지 중 하나를 메일 본문 중 어디든지 써서  
이 메일에 보내 주십시오."
 
 #: lib/gettor/i18n.py:64
 msgid ""
@@ -104,7 +105,7 @@ msgstr "이 예는 페르시아어 버전을 보내 줄 
것입니다. 지원하
 
 #: lib/gettor/i18n.py:76
 msgid " List of supported locales:"
-msgstr "지원하는 언어 목록"
+msgstr "지원하는 언어 목록:"
 
 #: lib/gettor/i18n.py:78
 msgid "Here is a list of all available languages:"
@@ -127,20 +128,20 @@ msgstr "gettor...@torproject.org: 아랍어\n
gettor...@torproject.or
 
 #: lib/gettor/i18n.py:92
 msgid "If you select no language, you will receive the English version."
-msgstr "언어를 선택하지 않으면, 영어 버전을 보내드립니다."
+msgstr "언어를 선택하지 않으면, 영어 버전을 보내드릴 것입
니다."
 
 #: lib/gettor/i18n.py:94
 msgid ""
 "SMALLER SIZED PACKAGES\n"
 "=="
-msgstr "작은 크기 패키지\n==="
+msgstr "저용량 패키지\n==="
 
 #: lib/gettor/i18n.py:97
 msgid ""
 "If your bandwith is low or your provider doesn't allow you to\n"
 "receive large attachments in your email, GetTor can send you several\n"
 "small packages instead of one big one."
-msgstr "귀하의 대역폭이 ë‚

[tor-commits] [translation/tails-misc_completed] Update translations for tails-misc_completed

2015-05-04 Thread translation
commit d49c02c9772bea8113dc164df70b49a86eb8a253
Author: Translation commit bot 
Date:   Mon May 4 21:15:43 2015 +

Update translations for tails-misc_completed
---
 es.po |   75 +++--
 1 file changed, 40 insertions(+), 35 deletions(-)

diff --git a/es.po b/es.po
index 6df30ca..6a92e73 100644
--- a/es.po
+++ b/es.po
@@ -4,6 +4,7 @@
 # 
 # Translators:
 # Cesar Enrique Sanchez Medina , 2014
+# el buve, 2015
 # Jose Luis , 2014-2015
 # Manuel Herrera , 2013
 # strel, 2013-2015
@@ -11,9 +12,9 @@ msgid ""
 msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-23 16:25+0100\n"
-"PO-Revision-Date: 2015-02-26 08:32+\n"
-"Last-Translator: strel\n"
+"POT-Creation-Date: 2015-05-02 23:47+0200\n"
+"PO-Revision-Date: 2015-05-04 21:11+\n"
+"Last-Translator: el buve\n"
 "Language-Team: Spanish 
(http://www.transifex.com/projects/p/torproject/language/es/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -21,11 +22,11 @@ msgstr ""
 "Language: es\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
-#: 
config/chroot_local-includes/etc/NetworkManager/dispatcher.d/60-tor-ready-notification.sh:42
+#: 
config/chroot_local-includes/etc/NetworkManager/dispatcher.d/60-tor-ready.sh:43
 msgid "Tor is ready"
 msgstr "Tor está listo"
 
-#: 
config/chroot_local-includes/etc/NetworkManager/dispatcher.d/60-tor-ready-notification.sh:43
+#: 
config/chroot_local-includes/etc/NetworkManager/dispatcher.d/60-tor-ready.sh:44
 msgid "You can now access the Internet."
 msgstr "Ahora puede acceder a Internet."
 
@@ -99,128 +100,132 @@ msgstr "_Descifrar/Verificar Portapapeles"
 msgid "_Manage Keys"
 msgstr "_Gestionar Claves"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:244
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:208
+msgid "_Open Text Editor"
+msgstr "_Abrir editor de texto"
+
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:252
 msgid "The clipboard does not contain valid input data."
 msgstr "El portapapeles no contiene datos de entrada válidos."
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:295
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:297
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:299
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:303
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:305
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:307
 msgid "Unknown Trust"
 msgstr "Confianza desconocida"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:301
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:309
 msgid "Marginal Trust"
 msgstr "Confianza reducida"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:303
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:311
 msgid "Full Trust"
 msgstr "Confianza completa"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:305
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:313
 msgid "Ultimate Trust"
 msgstr "Confianza superior"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:358
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:366
 msgid "Name"
 msgstr "Nombre"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:359
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:367
 msgid "Key ID"
 msgstr "Identificador de Clave"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:360
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:368
 msgid "Status"
 msgstr "Estado"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:392
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:400
 msgid "Fingerprint:"
 msgstr "Huella de validación:"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:395
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:403
 msgid "User ID:"
 msgid_plural "User IDs:"
 msgstr[0] "Identificador de usuario:"
 msgstr[1] "Identificadores de usuario:"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:425
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:433
 msgid "None (Don't sign)"
 msgstr "Ninguno (no firmar)"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:488
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:496
 msgid "Select recipients:"
 msgstr "Seleccionar destinatarios:"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:496
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:504
 msgid "Hide recipients"
 msgstr "Esconder destinatarios"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:499
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:507
 msgid ""
 "Hide the user IDs of all recipients of an encrypted message. Otherwise "
 "anyone that sees the encrypted message can see who the recipients are."
 msgstr "Esconder los identificadores de usuario de todos los destinatarios de 
un mensaje cifrado. De otra manera cualquiera que vea el mensaje cifrado puede 
ver

[tor-commits] [translation/tails-misc] Update translations for tails-misc

2015-05-04 Thread translation
commit 2b372fe05e5ac740888c013ba859d8bee6cccb7b
Author: Translation commit bot 
Date:   Mon May 4 21:15:38 2015 +

Update translations for tails-misc
---
 es.po |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/es.po b/es.po
index fe441ab..6a92e73 100644
--- a/es.po
+++ b/es.po
@@ -4,6 +4,7 @@
 # 
 # Translators:
 # Cesar Enrique Sanchez Medina , 2014
+# el buve, 2015
 # Jose Luis , 2014-2015
 # Manuel Herrera , 2013
 # strel, 2013-2015
@@ -12,8 +13,8 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2015-05-02 23:47+0200\n"
-"PO-Revision-Date: 2015-05-03 08:25+\n"
-"Last-Translator: runasand \n"
+"PO-Revision-Date: 2015-05-04 21:11+\n"
+"Last-Translator: el buve\n"
 "Language-Team: Spanish 
(http://www.transifex.com/projects/p/torproject/language/es/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -101,7 +102,7 @@ msgstr "_Gestionar Claves"
 
 #: config/chroot_local-includes/usr/local/bin/gpgApplet:208
 msgid "_Open Text Editor"
-msgstr ""
+msgstr "_Abrir editor de texto"
 
 #: config/chroot_local-includes/usr/local/bin/gpgApplet:252
 msgid "The clipboard does not contain valid input data."

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


[tor-commits] [translation/tails-misc_completed] Update translations for tails-misc_completed

2015-05-04 Thread translation
commit 269f2f161c0647efd60c9f3467a7cc9114865ee5
Author: Translation commit bot 
Date:   Mon May 4 19:45:38 2015 +

Update translations for tails-misc_completed
---
 fa.po |   70 ++---
 1 file changed, 37 insertions(+), 33 deletions(-)

diff --git a/fa.po b/fa.po
index 0160d0d..b10bbea 100644
--- a/fa.po
+++ b/fa.po
@@ -17,9 +17,9 @@ msgid ""
 msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-03-30 16:51+0200\n"
-"PO-Revision-Date: 2015-04-28 10:17+\n"
-"Last-Translator: Ali\n"
+"POT-Creation-Date: 2015-05-02 23:47+0200\n"
+"PO-Revision-Date: 2015-05-04 19:22+\n"
+"Last-Translator: Gilberto\n"
 "Language-Team: Persian 
(http://www.transifex.com/projects/p/torproject/language/fa/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -105,125 +105,129 @@ msgstr "رمزگشایی/تایید امضای 
کلیپ‌برد"
 msgid "_Manage Keys"
 msgstr "مدیریت کلید‌ها"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:244
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:208
+msgid "_Open Text Editor"
+msgstr "_بازکردن ویرایشگر متن"
+
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:252
 msgid "The clipboard does not contain valid input data."
 msgstr "کلیپ‌برد دادهٔ معتبری ندارد"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:295
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:297
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:299
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:303
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:305
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:307
 msgid "Unknown Trust"
 msgstr "قابل اطمینان نیست"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:301
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:309
 msgid "Marginal Trust"
 msgstr "به سختی قابل اطمینان است"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:303
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:311
 msgid "Full Trust"
 msgstr "قابل اطمینان است"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:305
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:313
 msgid "Ultimate Trust"
 msgstr "کاملاً قابل اطمینان است"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:358
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:366
 msgid "Name"
 msgstr "نام"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:359
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:367
 msgid "Key ID"
 msgstr "کلید-شناسه"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:360
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:368
 msgid "Status"
 msgstr "وضعیت"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:392
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:400
 msgid "Fingerprint:"
 msgstr "اثر انگشت:"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:395
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:403
 msgid "User ID:"
 msgid_plural "User IDs:"
 msgstr[0] "شناسه‌های کاربری:"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:425
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:433
 msgid "None (Don't sign)"
 msgstr "هیچ کدام (امضا نکن)"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:488
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:496
 msgid "Select recipients:"
 msgstr "دریافت کننده‌ها:"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:496
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:504
 msgid "Hide recipients"
 msgstr "دریافت کننده ها را مخفی کن"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:499
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:507
 msgid ""
 "Hide the user IDs of all recipients of an encrypted message. Otherwise "
 "anyone that sees the encrypted message can see who the recipients are."
 msgstr "شناسه کاربری تمام دریافت کننده‌های یک 
پیغام رمزنگاری شده را پنهان کن. در غیر 
اینصورت هر کسی که این پیغام رمزنگاری شده را 
دریافت می کند، می تواند بفهمد چه کسان دیگری 
آن را دریافت کرده اند."
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:505
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:513
 msgid "Sign message as:"
 msgstr "پیام را به این عنوان امضا کن:"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:509
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:517
 msgid "Choose keys"
 msgstr "کلید رمزنگاری را انتخاب کن"
 
-#: config/chroot_local

[tor-commits] [translation/tails-misc] Update translations for tails-misc

2015-05-04 Thread translation
commit bca6faaef786910441346fd4daa1644c06a9c320
Author: Translation commit bot 
Date:   Mon May 4 19:45:34 2015 +

Update translations for tails-misc
---
 fa.po |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fa.po b/fa.po
index e3003d0..b10bbea 100644
--- a/fa.po
+++ b/fa.po
@@ -18,8 +18,8 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2015-05-02 23:47+0200\n"
-"PO-Revision-Date: 2015-05-03 08:25+\n"
-"Last-Translator: runasand \n"
+"PO-Revision-Date: 2015-05-04 19:22+\n"
+"Last-Translator: Gilberto\n"
 "Language-Team: Persian 
(http://www.transifex.com/projects/p/torproject/language/fa/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -107,7 +107,7 @@ msgstr "مدیریت کلید‌ها"
 
 #: config/chroot_local-includes/usr/local/bin/gpgApplet:208
 msgid "_Open Text Editor"
-msgstr ""
+msgstr "_بازکردن ویرایشگر متن"
 
 #: config/chroot_local-includes/usr/local/bin/gpgApplet:252
 msgid "The clipboard does not contain valid input data."

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


[tor-commits] [check/master] Update favicon / title with check result

2015-05-04 Thread arlo
commit 4f2b003dfe56bf524ed71ed318c332af7aa7954b
Author: Arlo Breault 
Date:   Mon May 4 12:23:53 2015 -0700

Update favicon / title with check result

 * trac 15820
---
 public/base.html   |2 +-
 public/bulk.html   |1 +
 public/img/tor-not.ico |  Bin 0 -> 4286 bytes
 public/img/tor-off.ico |  Bin 0 -> 4286 bytes
 public/img/tor-on.ico  |  Bin 0 -> 4286 bytes
 public/index.html  |9 -
 6 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/public/base.html b/public/base.html
index 5673de9..2f9facc 100644
--- a/public/base.html
+++ b/public/base.html
@@ -4,7 +4,7 @@
   
   
   {{ template "title" . }}
-  
+  
   

[tor-commits] [tor-browser-spec/master] Add compiled PDF for HTTP3 position paper.

2015-05-04 Thread mikeperry
commit 272da5daa6ef1847b2b8035227ebc58cdbbdca68
Author: Mike Perry 
Date:   Mon May 4 11:16:59 2015 -0700

Add compiled PDF for HTTP3 position paper.

This commit was the initial submitted version.
---
 position-papers/HTTP3/HTTP3.pdf |  Bin 0 -> 71714 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/position-papers/HTTP3/HTTP3.pdf b/position-papers/HTTP3/HTTP3.pdf
new file mode 100644
index 000..23fccd5
Binary files /dev/null and b/position-papers/HTTP3/HTTP3.pdf differ

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


[tor-commits] [tor-browser-spec/master] [Citation needed].

2015-05-04 Thread mikeperry
commit cafc1fd6a0717c4ba24ebf9e55d0f89c39be732f
Author: Mike Perry 
Date:   Thu Apr 30 21:41:23 2015 -0700

[Citation needed].
---
 position-papers/HTTP3/HTTP3.tex |  118 +--
 1 file changed, 65 insertions(+), 53 deletions(-)

diff --git a/position-papers/HTTP3/HTTP3.tex b/position-papers/HTTP3/HTTP3.tex
index 6040902..ff08c33 100644
--- a/position-papers/HTTP3/HTTP3.tex
+++ b/position-papers/HTTP3/HTTP3.tex
@@ -48,35 +48,38 @@ education to support online privacy, anonymity, and 
censorship circumvention.
 Our primary products are the Tor network software, and the Tor Browser, which
 is based on Firefox. 
 
-In this position paper, we describe the concerns of the Tor Project with
-respect to future HTTP standardization. These concerns are broken down into
-five areas: identifier linkability, connection usage linkability,
+In this position paper, we describe the concerns and interests of the Tor
+Project with respect to future HTTP standardization. These concerns and
+interests span five areas: identifier linkability, connection usage 
linkability,
 fingerprinting linkability, traffic confidentiality and integrity, traffic
 fingerprinting and traffic analysis, and Tor network compatibility.
 
-Each of these areas of concern is communicated in a separate section of this
-position paper. We have also performed a preliminary review of HTTP/2 with
-respect to these areas, and have noted our findings inline. We will be
+Each of these areas is communicated in a separate section of this position
+paper. We have also performed a preliminary review of HTTP/2 with respect to
+these areas, and have noted our comments in each section. We will be
 performing a more in-depth review of HTTP/2 for client fingerprinting and
-other tracking issues in the coming months. 
+other tracking issues in the coming months as we modify the Firefox
+implementation for deployment in Tor Browser.
 
 \section{Identifier Linkability}
 
 Identifier linkability is the ability to use any form of browser state, cache,
-data storage, or identifier to track (link) a user between two otherwise
-independent actions. For the purposes of this position paper, we are concerned
-with any browser state that persists beyond the duration of a single
-connection.
+data storage, or identifier to track (or link) a user between two otherwise
+independent actions. For the purposes of this position paper, we concern
+ourselves with any browser state that persists beyond the duration or scope of
+a single connection.
 
-The Tor Project has designed Tor Browser with two main properties for limiting
-identifier-based tracking: First Party Isolation, and Long Term Unlinkability.
+For background, the Tor Project has designed Tor Browser with two main
+properties for limiting identifier-based tracking: First Party Isolation, and
+Long Term Unlinkability.
+% FIXME: cite design doc
 
 First Party Isolation is the property that a user's actions at one
 top-level URL bar domain cannot be correlated or linked to their actions on a
 different top-level URL bar domain. We maintain this property through a number
 of patches and modifications to various aspects of browser functionality and
 state keeping.
-% FIXME: Cite
+% FIXME: Cite design doc
 
 Long Term Unlinkability is the property that the user may completely clear all
 website-visible data and other identifiers associated, such that their future
@@ -86,15 +89,17 @@ browser tracking data in a single click (called "New 
Identity"). Our long-term
 goal is to allow users to define their relationship with individual first
 parties, and alter that relationship by resetting or blocking the associated
 tracking data on a per-site basis.
+% FIXME: Cite design doc
 
 \subsection{Identifier Linkability in HTTP/2}
 
 The Tor Project is still in the process of evaluating the stateful nature of
-HTTP/2 connections. It is likely that we will be able to isolate the usage of
-HTTP/2 connection state in a similar way to how we currently isolate HTTP
-connection state, as well as close these connections and clear that state when
-the user chooses to use a New Identity. However, it is not clear yet at this
-point how complicated this isolation will be.
+HTTP/2 connections and their associated streams and settings. It is likely
+that we will be able to isolate the usage of HTTP/2 connection state in a
+similar way to how we currently isolate HTTP connection state, as well as
+close these connections and clear that state when the user chooses to use a
+New Identity. However, it is not clear yet at this point how complicated this
+isolation will be.
 
 \subsection{Avoiding Future Identifier Linkability}
 
@@ -128,6 +133,7 @@ complexities for ensuring that requests are isolated. 
Unfortunately, unlike
 identifier usage, connection usage linkability is encouraged by the
 HTTP/2 specification in Section 9.1 (in the form of specifying that clients
 SHOULD NOT open more than one connection to a given host 

[tor-commits] [tor-browser-spec/master] Add bibliography and citations.

2015-05-04 Thread mikeperry
commit 8348b0d88fa0448d89d8146de4569ded10b57490
Author: Mike Perry 
Date:   Fri May 1 02:09:31 2015 -0700

Add bibliography and citations.
---
 position-papers/HTTP3/HTTP3.bbl |  124 ++-
 position-papers/HTTP3/HTTP3.tex |  103 +---
 2 files changed, 127 insertions(+), 100 deletions(-)

diff --git a/position-papers/HTTP3/HTTP3.bbl b/position-papers/HTTP3/HTTP3.bbl
index feb7b6f..3d9e725 100644
--- a/position-papers/HTTP3/HTTP3.bbl
+++ b/position-papers/HTTP3/HTTP3.bbl
@@ -1,60 +1,76 @@
 \begin{thebibliography}{10}
 
-\bibitem{web-send}
-Tyler Close, Rajiv Makhijani, Mark Seaborn, Kenton Varda, Johan Apelqvist,
-  Claes Nilsson, and Mike Hanson.
-\newblock {Web Introducer}.
-\newblock \url{http://web-send.org/introducer/}.
-
-\bibitem{target}
-Charles Duhigg.
-\newblock {How Companies Learn Your Secrets}.
-\newblock
-  \url{https://www.nytimes.com/2012/02/19/magazine/shopping-habits.html?pagewa%
-nted=9}.
-
-\bibitem{panopticlick}
-Peter Eckersley.
-\newblock How unique is your web browser?
-\newblock In {\em Proceedings of the 10th international conference on Privacy
-  enhancing technologies}, PETS'10, pages 1--18, Berlin, Heidelberg, 2010.
-  Springer-Verlag.
-
-\bibitem{DNT-adoption}
-Alex Fowler.
-\newblock {Mozilla Led Effort for DNT Finds Broad Support}.
-\newblock
-  \url{https://blog.mozilla.org/privacy/2012/02/23/mozilla-led-effort-for-dnt-%
-finds-broad-support/}.
-
-\bibitem{safecache}
-Collin Jackson and Dan Boneh.
-\newblock Protecting browser state from web privacy attacks.
-\newblock In {\em In Proceedings of the International World Wide Web
-  Conference}, pages 737--744, 2006.
-
-\bibitem{DNT-draft}
-J.~Mayer, A.~Narayanan, and S.~Stamm.
-\newblock {Do Not Track: A Universal Third-Party Web Tracking Opt Out}.
-\newblock \url{https://tools.ietf.org/html/draft-mayer-do-not-track-00}.
-
-\bibitem{fourthparty}
-Jonathan~R. Mayer and John~C. Mitchell.
-\newblock {Third-Party Web Tracking: Policy and Technology}.
-\newblock \url{https://www.stanford.edu/~jmayer/papers/trackingsurvey12.pdf}.
-
-\bibitem{Persona}
-Mozilla~Developer Network.
-\newblock {Persona}.
-\newblock \url{https://developer.mozilla.org/en-US/docs/persona}.
-
-\bibitem{torbrowser}
-Mike Perry.
+\bibitem{torbrowser-identifiers}
+Mike Perry, Erinn Clark, Steven Murdoch
 \newblock {The Design and Implementation of the Tor Browser}.
-\newblock \url{https://www.torproject.org/projects/torbrowser/design/}.
+\newblock {Section 4.5: Cross-Origin Identifier Unlinkability}.
+\newblock 
\url{https://www.torproject.org/projects/torbrowser/design/#identifier-linkability}.
+
+\bibitem{torbrowser-longterm}
+Mike Perry, Erinn Clark, Steven Murdoch
+\newblock {The Design and Implementation of the Tor Browser}.
+\newblock {Section 4.7: Long-Term Unlinkability via "New Identity" button}.
+\newblock 
\url{https://www.torproject.org/projects/torbrowser/design/#new-identity}.
+
+\bibitem{torbrowser-fingerprinting}
+Mike Perry, Erinn Clark, Steven Murdoch
+\newblock {The Design and Implementation of the Tor Browser}.
+\newblock {Section 4.6: Cross-Origin Fingerprinting Unlinkability}.
+\newblock 
\url{https://www.torproject.org/projects/torbrowser/design/#fingerprinting-linkability}.
+
+\bibitem{http2-spec}
+M. Belshe, R. Peon, M. Thomson
+\newblock {Hypertext Transfer Protocol version 2}.
+\newblock \url{https://http2.github.io/http2-spec/}.
+
+\bibitem{lets-encrypt}
+Mozilla, Akamai, Cisco, EFF, Identrust, Automattic
+\newblock {Let's Encrypt Certificate Authority}.
+\newblock \url{https://letsencrypt.org/}.
+
+\bibitem{encrypted-handshake}
+M. Ray
+\newblock {Transport Layer Security (TLS) Encrypted Handshake Extension}.
+\newblock 
\url{https://tools.ietf.org/html/draft-ray-tls-encrypted-handshake-00}.
+
+\bibitem{blog-wtf}
+Mike Perry
+\newblock {A Critique of Website Traffic Fingerprinting Attacks}.
+\newblock 
\url{https://blog.torproject.org/blog/critique-website-traffic-fingerprinting-attacks}
+
+\bibitem{blog-pipelining}
+Mike Perry
+\newblock {Experimental Defense for Website Traffic Fingerprinting}.
+\newblock 
\url{https://blog.torproject.org/blog/experimental-defense-website-traffic-fingerprinting}
+
+\bibitem{torbrowser-wtf}
+Mike Perry, Erinn Clark, Steven Murdoch
+\newblock {The Design and Implementation of the Tor Browser}.
+\newblock {Section 4.8: Other Defenses}.
+\newblock 
\url{https://www.torproject.org/projects/torbrowser/design/#traffic-fingerprinting-defenses}
+
+\bibitem{multihop-padding}
+Mike Perry, Marc Juarez
+\newblock {Multihop Padding Primitives}
+\newblock 
\url{https://gitweb.torproject.org/user/mikeperry/torspec.git/plain/proposals/ideas/xxx-multihop-padding-primitives.txt?h=multihop-padding-primitives}
+
+\bibitem{wfpadtools}
+Marc Juarez
+\newblock {WFPadTools}
+\newblock \url{https://bitbucket.org/mjuarezm/obfsproxy_wfpadtools/}
+
+\bibitem{tor-udp}
+Steven J. Murdoch
+\newblock {Comparison of Tor Datagram Designs}
+\newblock 
\url{https://rese

[tor-commits] [tor-browser-spec/master] Another round of cleanups.

2015-05-04 Thread mikeperry
commit 899d225375aff9f4dbd1ccf219a0a932b74d202f
Author: Mike Perry 
Date:   Fri May 1 02:50:52 2015 -0700

Another round of cleanups.
---
 position-papers/HTTP3/HTTP3.tex |  130 +++
 1 file changed, 76 insertions(+), 54 deletions(-)

diff --git a/position-papers/HTTP3/HTTP3.tex b/position-papers/HTTP3/HTTP3.tex
index d7d8aac..43fac24 100644
--- a/position-papers/HTTP3/HTTP3.tex
+++ b/position-papers/HTTP3/HTTP3.tex
@@ -20,8 +20,7 @@
 \title{The Future of HTTP and Anonymity on the Internet}
 
 % XXX: This is broken:
-\author{Georg Koppen \\ The Tor Project, Inc \\ ge...@torproject.org}
-\author{Mike Perry \\ The Tor Project, Inc \\ mikepe...@torproject.org}
+\author{Mike Perry \\ The Tor Project, Inc \\ mikepe...@torproject.org \and 
Georg Koppen \\ The Tor Project, Inc \\ g...@torproject.org}
 
 %\institute{The Internet}
 
@@ -48,7 +47,7 @@ The Tor Project is a United States 501(c)(3) non-profit 
dedicated to providing
 technology, research, and education to support online privacy, anonymity, and
 censorship circumvention. Our primary software products are the Tor network
 software, and the Tor Browser, which is based on Firefox. The Tor Project is
-actively collaborating with Mozilla to ensure that its modifications to
+actively collaborating with Mozilla to ensure that our modifications to
 Firefox are merged with the official Firefox distribution, with the long-term
 goal of providing an optional Tor-enabled mode of operation for native Firefox
 users.
@@ -88,7 +87,7 @@ Long Term Unlinkability is the property that a user's future 
activity must not
 be linked or correlated to any prior activity after that user's explicit
 request to sever this link. Tor Browser provides Long Term Unlinkability by
 allowing the user to clear all browser tracking data in a single click (called
-"New Identity")\cite{torbrowser-longterm}. Our long-term goal is to allow
+"New Identity")\cite{torbrowser-longterm}. Our eventual goal is to allow
 users to define their relationship with individual first parties, and alter
 that relationship by resetting or blocking the associated tracking data on a
 per-site basis.
@@ -110,11 +109,9 @@ narrowly scoped within the HTTP protocol. However, we also 
recognize that to a
 large degree identifier storage and the resulting linkability is primarily an
 implementation detail, and not specific to the protocol itself.
 
-Identifier linkability will become a problem if instances arise where the
-server is allowed to specify a setting or configuration property for a client
-that must persist beyond the duration of the session. In these cases, care
-must be taken to ensure that this data is cleared or isolated upon entry to
-private browsing mode, or when the user attempts to clear their private data.
+Identifier linkability will become a more serious problem in future HTTP
+versions if the server is allowed to specify a setting or configuration
+property for a client that must persist beyond the duration of the session.
 In the case of Tor Browser, we will most likely clear this state immediately
 upon connection close.
 
@@ -125,8 +122,11 @@ transport stream for requests that would otherwise be 
independent due to the
 first party isolation of their associated identifiers and browser state.
 
 Tor Browser currently enforces connection usage unlinkability at the HTTP
-layer, by creating independent HTTP connections for third party hosts that
-are sourced from different first party domains.
+layer, by creating independent HTTP connections to third party hosts that are
+sourced from different first party domains, even if HTTP requests are issued
+simultaneously to the same third party site. These connections also use
+separate, isolated paths through the Tor network based on the domain of the
+first party that sourced them.
 
 \subsection{Connection Usage Linkability with HTTP/2}
 
@@ -137,29 +137,39 @@ HTTP/2 specification in Section 9.1 (in the form of 
specifying that clients
 SHOULD NOT open more than one connection to a given host and
 port)\cite{http2-spec}.
 
+The Tor Browser will ignore this recommendation in its HTTP/2 implementation,
+and create an independent HTTP/2 connections to third parties for every first
+party domain that sources them.
+
 \subsection{Avoiding Future Connection Usage Linkability}
 
-In the future, connection usage linkability may become a problem if the notion
-of a connection becomes disassociated from the application layer, and instead
-is enforced through a collection of identifiers or stateful behavior in the
-browser. This may tend to encourage implementations that make it difficult to
-decouple the notion of a connection from the notion of a destination address.
+In the future, connection usage linkability may become a more serious problem
+if the notion of a connection becomes disassociated from the application
+layer, and instead is enforced through a collection of identifiers or stateful
+behavior in the browser (

[tor-commits] [tor-browser-spec/master] Cleanups and fixes.

2015-05-04 Thread mikeperry
commit 16ef0c1333762109fd5778dd1af4d537080c3e83
Author: Mike Perry 
Date:   Thu Apr 30 22:49:05 2015 -0700

Cleanups and fixes.
---
 position-papers/HTTP3/HTTP3.tex |  240 ---
 1 file changed, 125 insertions(+), 115 deletions(-)

diff --git a/position-papers/HTTP3/HTTP3.tex b/position-papers/HTTP3/HTTP3.tex
index ff08c33..b4d7993 100644
--- a/position-papers/HTTP3/HTTP3.tex
+++ b/position-papers/HTTP3/HTTP3.tex
@@ -19,6 +19,7 @@
 
 \title{The Future of HTTP and Anonymity on the Internet}
 
+% XXX: This is broken:
 \author{Georg Koppen \\ The Tor Project, Inc \\ ge...@torproject.org}
 \author{Mike Perry \\ The Tor Project, Inc \\ mikepe...@torproject.org}
 
@@ -36,21 +37,25 @@ with the Tor Network, avoid introducing new third party 
tracking and
 linkability vectors, and minimize client fingerprintability. We also have a
 strong interest in the development of enhancements and/or extensions that
 protect the confidentiality and integrity of HTTP traffic, as well as provide
-resistance to traffic fingerprinting and general traffic analysis. We are
-presently actively researching these areas.
+resistance to traffic fingerprinting and general traffic analysis. In fact, we
+are presently researching these areas.
 
 \end{abstract}
 
 \section{Introduction}
 
-The Tor Project, Inc is a US non-profit dedicated to providing technology and
-education to support online privacy, anonymity, and censorship circumvention.
-Our primary products are the Tor network software, and the Tor Browser, which
-is based on Firefox. 
+The Tor Project is a United States 501(c)(3) non-profit dedicated to providing
+technology, research, and education to support online privacy, anonymity, and
+censorship circumvention. Our primary software products are the Tor network
+software, and the Tor Browser, which is based on Firefox. The Tor Project is
+actively collaborating with Mozilla to ensure that its modifications to
+Firefox are merged with the official Firefox distribution, with the long-term
+goal of providing an optional Tor-enabled mode of operation for native Firefox
+users.
 
 In this position paper, we describe the concerns and interests of the Tor
 Project with respect to future HTTP standardization. These concerns and
-interests span five areas: identifier linkability, connection usage 
linkability,
+interests span six areas: identifier linkability, connection usage linkability,
 fingerprinting linkability, traffic confidentiality and integrity, traffic
 fingerprinting and traffic analysis, and Tor network compatibility.
 
@@ -61,13 +66,13 @@ performing a more in-depth review of HTTP/2 for client 
fingerprinting and
 other tracking issues in the coming months as we modify the Firefox
 implementation for deployment in Tor Browser.
 
-\section{Identifier Linkability}
+\section{Identifier Linkability Concerns}
 
 Identifier linkability is the ability to use any form of browser state, cache,
 data storage, or identifier to track (or link) a user between two otherwise
-independent actions. For the purposes of this position paper, we concern
-ourselves with any browser state that persists beyond the duration or scope of
-a single connection.
+independent actions. For the purpose of this position paper, we are
+specifically concerned with any stateful information residing in the browser's
+HTTP layer that persists beyond the duration or scope of a single connection.
 
 For background, the Tor Project has designed Tor Browser with two main
 properties for limiting identifier-based tracking: First Party Isolation, and
@@ -75,20 +80,19 @@ Long Term Unlinkability.
 % FIXME: cite design doc
 
 First Party Isolation is the property that a user's actions at one
-top-level URL bar domain cannot be correlated or linked to their actions on a
+top-level URL bar domain must not be correlated or linked to their actions on a
 different top-level URL bar domain. We maintain this property through a number
 of patches and modifications to various aspects of browser functionality and
 state keeping.
 % FIXME: Cite design doc
 
-Long Term Unlinkability is the property that the user may completely clear all
-website-visible data and other identifiers associated, such that their future
-activity cannot be linked or correlated to any activity prior to this action.
-Tor Browser provides Long Term Unlinkability by allowing the user to clear all
-browser tracking data in a single click (called "New Identity"). Our long-term
-goal is to allow users to define their relationship with individual first
-parties, and alter that relationship by resetting or blocking the associated
-tracking data on a per-site basis.
+Long Term Unlinkability is the property that a user's future activity must not
+be linked or correlated to any prior activity after that user's explicit 
request
+to sever this link. Tor Browser provides Long Term Unlinkability by allowing
+the user to clear all browser tracking data in a single click (called "New

[tor-commits] [tor-browser-spec/master] Add W3C-DNT position paper.

2015-05-04 Thread mikeperry
commit 923f8ea6e998dcee122c602a0ead4a191fde22bd
Author: Mike Perry 
Date:   Thu Apr 30 14:57:41 2015 -0700

Add W3C-DNT position paper.
---
 position-papers/W3C-DNT/W3C-DNT.bbl|   60 ++
 position-papers/W3C-DNT/W3C-DNT.pdf|  Bin 0 -> 72097 bytes
 position-papers/W3C-DNT/W3C-DNT.tex|  325 +++
 position-papers/W3C-DNT/llncs.cls  | 1016 
 .../W3C-DNT/slides/W3CDNT-Tor-slides.odp   |  Bin 0 -> 79019 bytes
 position-papers/W3C-DNT/usenix.sty |   97 ++
 6 files changed, 1498 insertions(+)

diff --git a/position-papers/W3C-DNT/W3C-DNT.bbl 
b/position-papers/W3C-DNT/W3C-DNT.bbl
new file mode 100644
index 000..feb7b6f
--- /dev/null
+++ b/position-papers/W3C-DNT/W3C-DNT.bbl
@@ -0,0 +1,60 @@
+\begin{thebibliography}{10}
+
+\bibitem{web-send}
+Tyler Close, Rajiv Makhijani, Mark Seaborn, Kenton Varda, Johan Apelqvist,
+  Claes Nilsson, and Mike Hanson.
+\newblock {Web Introducer}.
+\newblock \url{http://web-send.org/introducer/}.
+
+\bibitem{target}
+Charles Duhigg.
+\newblock {How Companies Learn Your Secrets}.
+\newblock
+  \url{https://www.nytimes.com/2012/02/19/magazine/shopping-habits.html?pagewa%
+nted=9}.
+
+\bibitem{panopticlick}
+Peter Eckersley.
+\newblock How unique is your web browser?
+\newblock In {\em Proceedings of the 10th international conference on Privacy
+  enhancing technologies}, PETS'10, pages 1--18, Berlin, Heidelberg, 2010.
+  Springer-Verlag.
+
+\bibitem{DNT-adoption}
+Alex Fowler.
+\newblock {Mozilla Led Effort for DNT Finds Broad Support}.
+\newblock
+  \url{https://blog.mozilla.org/privacy/2012/02/23/mozilla-led-effort-for-dnt-%
+finds-broad-support/}.
+
+\bibitem{safecache}
+Collin Jackson and Dan Boneh.
+\newblock Protecting browser state from web privacy attacks.
+\newblock In {\em In Proceedings of the International World Wide Web
+  Conference}, pages 737--744, 2006.
+
+\bibitem{DNT-draft}
+J.~Mayer, A.~Narayanan, and S.~Stamm.
+\newblock {Do Not Track: A Universal Third-Party Web Tracking Opt Out}.
+\newblock \url{https://tools.ietf.org/html/draft-mayer-do-not-track-00}.
+
+\bibitem{fourthparty}
+Jonathan~R. Mayer and John~C. Mitchell.
+\newblock {Third-Party Web Tracking: Policy and Technology}.
+\newblock \url{https://www.stanford.edu/~jmayer/papers/trackingsurvey12.pdf}.
+
+\bibitem{Persona}
+Mozilla~Developer Network.
+\newblock {Persona}.
+\newblock \url{https://developer.mozilla.org/en-US/docs/persona}.
+
+\bibitem{torbrowser}
+Mike Perry.
+\newblock {The Design and Implementation of the Tor Browser}.
+\newblock \url{https://www.torproject.org/projects/torbrowser/design/}.
+
+\bibitem{thirdparty}
+Dan Witte.
+\newblock \url{https://wiki.mozilla.org/Thirdparty}.
+
+\end{thebibliography}
diff --git a/position-papers/W3C-DNT/W3C-DNT.pdf 
b/position-papers/W3C-DNT/W3C-DNT.pdf
new file mode 100644
index 000..424f956
Binary files /dev/null and b/position-papers/W3C-DNT/W3C-DNT.pdf differ
diff --git a/position-papers/W3C-DNT/W3C-DNT.tex 
b/position-papers/W3C-DNT/W3C-DNT.tex
new file mode 100644
index 000..06b4e89
--- /dev/null
+++ b/position-papers/W3C-DNT/W3C-DNT.tex
@@ -0,0 +1,325 @@
+%\documentclass{llncs}
+\documentclass[letterpaper,11pt]{llncs}
+%\documentclass{article} % llncs
+
+\usepackage{usenix}
+\usepackage{url}
+\usepackage{amsmath}
+\usepackage{epsfig}
+\usepackage{epsf}
+\usepackage{listings}
+
+%\setlength{\textwidth}{6in}
+%\setlength{\textheight}{8.4in}
+%\setlength{\topmargin}{.5cm}
+%\setlength{\oddsidemargin}{1cm}
+%\setlength{\evensidemargin}{1cm}
+
+\begin{document}
+
+\title{Do Not Beg:\\Moving Beyond DNT through Privacy by Design}
+
+\author{Mike Perry \\ The Tor Project, Inc \\ mikepe...@torproject.org}
+
+%\institute{The Internet}
+
+\maketitle
+\pagestyle{plain}
+
+\begin{abstract}
+
+The Do Not Track header (henceforth DNT:1) seeks to provide privacy
+protections against third party tracking through user request and regulation.
+It is our position that while DNT:1 is potentially useful as a purely
+informational tool for browser vendors and service providers, enforcement of
+the header suffers from a number of issues including covert circumvention,
+enforcement jurisdiction, manipulation, regulatory capture, and abuse. 
Moreover,
+every privacy property that DNT:1 aims to provide through regulatory
+enforcement can be better provided through technical changes to browser and
+network behavior during private browsing modes. We therefore suggest that the
+W3C standards body focus on standardizing these technical measures, rather
+than attempting to broker negotiations over regulatory policy and law.
+
+\end{abstract}
+ 
+% XXX: Bonus References
+% Playing dumb:
+%   
http://www.forbes.com/sites/kashmirhill/2012/02/16/how-target-figured-out-a-teen-girl-was-pregnant-before-her-father-did/
+%   
https://www.nytimes.com/2012/02/19/magazine/shopping-habits.html?pagewanted=9
+% https://tools.ietf.org/id/draft-mayer-do-not-track-00.txt
+% D

[tor-commits] [tor-browser-spec/master] All your spells are checked to us!

2015-05-04 Thread mikeperry
commit 629233c1965860f535ccfe1678cf4b5ca2ae59f9
Author: Mike Perry 
Date:   Thu Apr 30 21:10:25 2015 -0700

All your spells are checked to us!
---
 position-papers/HTTP3/HTTP3.tex |   28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/position-papers/HTTP3/HTTP3.tex b/position-papers/HTTP3/HTTP3.tex
index 720bc25..6040902 100644
--- a/position-papers/HTTP3/HTTP3.tex
+++ b/position-papers/HTTP3/HTTP3.tex
@@ -101,12 +101,12 @@ point how complicated this isolation will be.
 We feel that it is very important that mechanisms for identifier usage,
 storage, and connection-related state keeping be cleanly abstracted and
 narrowly scoped within the HTTP protocol. However, we also recognize that to a
-large degree identifier usage and the resulting linkability is primarly an
+large degree identifier usage and the resulting linkability is primarily an
 implementation detail, and not specific to the protocol itself.
 
 Identifier linkability will become a problem if instances arise where the
 server is allowed to specify a setting or configuration property for a client
-that must presist beyond the duration of the session. In these cases, care
+that must persist beyond the duration of the session. In these cases, care
 must be taken to ensure that this data is cleared or isolated upon entry to
 private browsing mode, or when the user attempts to clear their private data.
 
@@ -149,7 +149,7 @@ User agent fingerprinting arises from four sources: 
end-user configuration
 details, device and hardware characteristics, operating system vendor and
 version differences, and browser vendor and version differences.
 
-The Tor Project is primarily concerned with minimzing the ability of websites
+The Tor Project is primarily concerned with minimizing the ability of websites
 to obtain or infer end user configuration details and device characteristics.
 We concern ourselves with operating system fingerprinting only to the point of
 removing ways of detecting a specific operating system version. We make no
@@ -171,7 +171,7 @@ alter our implementation's behavior accordingly.
 
 \subsection{Avoiding Future Fingerprinting Linkability}
 
-It is concievable that more fingerprinting vectors could arise in future,
+It is conceivable that more fingerprinting vectors could arise in future,
 especially if flow control and stream multiplexing decisions are delegated to
 the client, and depend on things like available system memory, available CPU
 cores, or other details. Care should be taken to avoid these situations,
@@ -188,12 +188,12 @@ the Let's Encrypt Project should eliminate the remaining 
barriers to requiring
 authenticated encryption, as opposed to deploying opportunistic mechanisms.
 
 We are also interested in efforts to encrypt the ClientHello and ServerHello
-messages in an initial forward-secure handshake, as described in the Encrytped
+messages in an initial forward-secure handshake, as described in the Encrypted
 TLS Handshake proposal. If SNI, ALPN, and the ServerHello can be encrypted
 using an ephemeral exchange that is authenticated later in the handshake,
 the adversary loses a great deal of information about the user's intended
 destination site. When large scale CDNs and multi-site load balancers are
-involved, the ulimate destination would be impossible to determine with this
+involved, the ultimate destination would be impossible to determine with this
 type of handshake in place. This will aid in defenses against traffic
 fingerprinting and traffic analysis, which we describe detail in the next
 section.
@@ -209,13 +209,13 @@ classification domain is limited by knowledge of the 
specific site being
 visited.
 
 Tor's fixed 512 byte packet size and large classification domain go a long way
-to imede this attack for minimal overhead. The 512 byte packet size helps to
+to impede this attack for minimal overhead. The 512 byte packet size helps to
 obscure some amount of length information, and Tor's link encryption conceals
 the destination website reduces classifier accuracy and capabilities, due
 largely to the Base Rate Fallacy. There was some initial controversy in the
 literature as to the exact degree to which this was the case, but after
 publicly requesting that these effects be studied in closer detail, recent
-results have confirmed and quantized the benefits conferred by Tor's unique
+results have confirmed and quantified the benefits conferred by Tor's unique
 link encryption.
 
 For this reason, we have been encouraging continued study of low-overhead
@@ -249,11 +249,11 @@ purpose (such as redirects or Javascript), but these 
mechanisms can either be
 disabled by the user, reflected in UI activity, or otherwise mitigated by Tor
 Browser
 
-In Tor Browser, we will likely close the connection after recieving some rate
-of unsolicitied PING or SETTINGS updates, and introduce delay or jitter before
+In Tor Browser, we will likely close the connection after rec

[tor-commits] [tor-browser-spec/master] Comit befour dooing speel chek.

2015-05-04 Thread mikeperry
commit 409b8c1a2f541be93b2b1126ba892a12411d3db9
Author: Mike Perry 
Date:   Thu Apr 30 21:07:16 2015 -0700

Comit befour dooing speel chek.

YOLLO!
---
 position-papers/HTTP3/HTTP3.tex |  367 +--
 1 file changed, 280 insertions(+), 87 deletions(-)

diff --git a/position-papers/HTTP3/HTTP3.tex b/position-papers/HTTP3/HTTP3.tex
index d9f2ab0..720bc25 100644
--- a/position-papers/HTTP3/HTTP3.tex
+++ b/position-papers/HTTP3/HTTP3.tex
@@ -29,98 +29,291 @@
 
 \begin{abstract}
 
+The Tor Project has a keen interest in the development of future standards
+involving the HTTP application layer and associated transport layers. At
+minimum, we seek to ensure that all future HTTP standards remain compatible
+with the Tor Network, avoid introducing new third party tracking and
+linkability vectors, and minimize client fingerprintability. We also have a
+strong interest in the development of enhancements and/or extensions that
+protect the confidentiality and integrity of HTTP traffic, as well as provide
+resistance to traffic fingerprinting and general traffic analysis. We are
+presently actively researching these areas.
 
 \end{abstract}
- 
 
 \section{Introduction}
 
-% XXX: Describe our organization? The Tor Project, Inc is a non-profit...
-
-% XXX: In this position paper, we describe the current and potential issues 
with
-
-Dangers and opportunities with resepect to browsing the Internet anonymously 
are
-often tied to the browser itself and not its underlying transport protocols:
-canvas fingerprinting, plugin enumeration and linking users via the DOM storage
-are just a few of the means the browser offers for trying to single users out.
-And even things like cookies and referrers, although belonging strictly 
speaking
-to HTTP, the transport protocol powering the web, are usually seen in the
-context of the browser itself as its additional policies shape the particular
-tracking potential of these and other transport related features.
-This is not much different for features in HTTP/2 although, compared to
-HTTP/1.1, it has a growing list of tracking risks that should be addressed in
-the specification itself. We discuss some of them below proposing ways to take
-these and other risks into account in future HTTP specifications.
-
-Apart from the dangers we just hinted at, beginning with HTTP/2 opportunities
-emerge as well: Using HTTP/2's flow control could make it easier to defend
-against adversaries sniffing a user's encrypted traffic and trying to extract
-information out of it by means of website traffic fingerprinting. We discuss
-current limitations and potential improvements for HTTP/3.
-
-\section{A Short Tracking Guide(1)}
-
-
-If we are talking about tracking on the Internet then we mainly have 
third-party
-tracking in mind. In this scenario the attacker has basically two mechanisms
-available: identifier based tracking (e.g. using cookies or cache cookies) and
-fingerprinting a user's device or environment.
-
-Additionally, we may encounter powerful parties that see a lot of a user's
-traffic due to being in a privileged position (e.g. search engines). They don't
-necessarily need to bother with third party tracking and would still be able to
-learn a lot of a user's details by correlating traffic which is endangering her
-anonymity.
-
-The defenses we develop in Tor Browser are:
-
-1) Binding identifiers to the URL bar domain. This is retaining functionality
-while preventing cross-origin identifier linkability: saving third party
-identifiers (e.g. via DOM storage) in a URL bar domain context does not make
-them available in a different URL bar domain context.
-2) Making users as uniform as possible while not breaking functionality.
-3) Providing a "New Identity" button that is clearing all browser state and
-giving the user a clean, new session.
-
-
-\subsection{User Tracking with HTTP}
-
-\subsection{Re-Using Connections}
-Coalescing connections might allow tracking users across origins just by means
-of HTTP. Together with a long keep-alive this might make it easy to correlate a
-lot of cross-domain traffic of a privacy conscious user even if she has
-JavaScript and third-party cookies disabled. Granted, having this feature in
-HTTP/2 is a big deal especially with respect to CDNs. But still we think
-allowing implementers to provide means to mitigate the issue directly in the
-specification seems worthwhile to do. This does not imply avoiding coalescing
-connections in the first place. Not at all. One could think about proposing a
-middle ground safe-guarding privacy while still providing advantages speed- and
-resource-wise: connections should not be reused across different URL bar
-domains.
-
-\subsection{Timing Side-Channels}
-
-PING and SETTINGS frames are acknowledged immediately by the client which might
-give servers the option to collect information about a client via timing
-side-channels. It is true, there are other means an attacker coul

[tor-commits] [tor-browser-spec/master] Add W3C-Identity Position Paper.

2015-05-04 Thread mikeperry
commit 832fc202564168747958e65458342f1a2919fcd6
Author: Mike Perry 
Date:   Thu Apr 30 14:58:50 2015 -0700

Add W3C-Identity Position Paper.
---
 position-papers/W3C-Identity/W3CIdentity.bbl |   73 ++
 position-papers/W3C-Identity/W3CIdentity.pdf |  Bin 0 -> 74451 bytes
 position-papers/W3C-Identity/W3CIdentity.tex |  373 ++
 position-papers/W3C-Identity/llncs.cls   | 1016 ++
 position-papers/W3C-Identity/usenix.sty  |   97 +++
 5 files changed, 1559 insertions(+)

diff --git a/position-papers/W3C-Identity/W3CIdentity.bbl 
b/position-papers/W3C-Identity/W3CIdentity.bbl
new file mode 100644
index 000..e37afe6
--- /dev/null
+++ b/position-papers/W3C-Identity/W3CIdentity.bbl
@@ -0,0 +1,73 @@
+\begin{thebibliography}{10}
+
+\bibitem{private-browsing}
+Gaurav Aggrawal, Elie Bursztein, Collin Jackson, and Dan Boneh.
+\newblock An analysis of private browsing modes in modern browsers.
+\newblock In {\em Proc. of 19th Usenix Security Symposium}, 2010.
+
+\bibitem{panopticlick}
+Peter Eckersley.
+\newblock How unique is your web browser?
+\newblock In {\em Proceedings of the 10th international conference on Privacy
+  enhancing technologies}, PETS'10, pages 1--18, Berlin, Heidelberg, 2010.
+  Springer-Verlag.
+
+\bibitem{safecache}
+Collin Jackson and Dan Boneh.
+\newblock Protecting browser state from web privacy attacks.
+\newblock In {\em In Proceedings of the International World Wide Web
+  Conference}, pages 737--744, 2006.
+
+\bibitem{security-fingerprinting}
+{Jennifer Valentino-DeVries}.
+\newblock {Evercookies and Fingerprinting: Are Anti-Fraud Tools Good for Ads?},
+  2010.
+\newblock
+  \url{http://blogs.wsj.com/digits/2010/12/01/evercookies-and-fingerprinting-f%
+inding-fraudsters-tracking-consumers/}.
+
+\bibitem{wsj-fingerprinting}
+{Julia Angwin and Jennifer Valentino-DeVries}.
+\newblock {Race Is On to 'Fingerprint' Phones, PCs}, 2010.
+\newblock
+  \url{http://online.wsj.com/article/SB100014240527487046792045756467041009595%
+46.html}.
+
+\bibitem{firefox-personas}
+Mozilla.
+\newblock Personas.
+\newblock \url{https://mozillalabs.com/personas/}.
+
+\bibitem{weave-manager}
+Mozilla.
+\newblock {The Weave Account Manager}.
+\newblock \url{https://wiki.mozilla.org/Labs/Weave/Identity/Account_Manager}.
+
+\bibitem{not-to-toggle}
+Mike Perry.
+\newblock To toggle, or not to toggle: The end of torbutton.
+\newblock
+  \url{https://lists.torproject.org/pipermail/tor-talk/2011-April/020077.html}.
+
+\bibitem{torbutton}
+Mike Perry.
+\newblock {The Torbutton Design Document}, 2011.
+\newblock \url{https://www.torproject.org/torbutton/en/design/}.
+
+\bibitem{facebook-like}
+Arnold Roosendaal.
+\newblock {Facebook Tracks and Traces Everyone: Like This!}
+\newblock {\em SSRN eLibrary}, 2010.
+
+\bibitem{tracking-identity}
+Emily Steel.
+\newblock {Online Tracking Company RapLeaf Profiles Users By Name}, 2010.
+\newblock
+  \url{http://online.wsj.com/article/SB100014240527023044105045755602432594160%
+72.html}.
+
+\bibitem{thirdparty}
+Dan Witte.
+\newblock \url{https://wiki.mozilla.org/Thirdparty}.
+
+\end{thebibliography}
diff --git a/position-papers/W3C-Identity/W3CIdentity.pdf 
b/position-papers/W3C-Identity/W3CIdentity.pdf
new file mode 100644
index 000..b749dc7
Binary files /dev/null and b/position-papers/W3C-Identity/W3CIdentity.pdf differ
diff --git a/position-papers/W3C-Identity/W3CIdentity.tex 
b/position-papers/W3C-Identity/W3CIdentity.tex
new file mode 100644
index 000..c16f241
--- /dev/null
+++ b/position-papers/W3C-Identity/W3CIdentity.tex
@@ -0,0 +1,373 @@
+%\documentclass{llncs}
+\documentclass[letterpaper,11pt]{llncs}
+%\documentclass{article} % llncs
+
+\usepackage{usenix}
+\usepackage{url}
+\usepackage{amsmath}
+\usepackage{epsfig}
+\usepackage{epsf}
+\usepackage{listings}
+
+%\setlength{\textwidth}{6in}
+%\setlength{\textheight}{8.4in}
+%\setlength{\topmargin}{.5cm}
+%\setlength{\oddsidemargin}{1cm}
+%\setlength{\evensidemargin}{1cm}
+
+\begin{document}
+
+\title{Bridging the Disconnect Between Web Identity and User Perception}
+
+\author{Mike Perry \\ The Internet \\ mikepe...@torproject.org}
+
+%\institute{The Internet}
+
+\maketitle
+\pagestyle{plain}
+
+\begin{abstract}
+
+There is a huge disconnect between how users perceive their online presence
+and the reality of their relationship with the websites they visit. This
+position paper explores this disconnect and provides some recommendations for
+making the technical reality of the web match user perception, through both
+technical improvements as well as user interface cues. By looking at all of
+the elements of tracking as though they collectively comprise "User Identity",
+we can make better decisions about improvements to both the technical and the
+interface aspects of authentication and privacy.
+
+\end{abstract}
+
+\section{Introduction}
+
+The prevailing revenue model of the web is an appealing one. Web users receive
+unfettered, frictionless access to an extensive varie

[tor-commits] [tor-browser-spec/master] Inital LaTex import of Georg's sections.

2015-05-04 Thread mikeperry
commit f550afc2aed73937cbe0ff74b30f7cc0b068033a
Author: Mike Perry 
Date:   Thu Apr 30 15:09:40 2015 -0700

Inital LaTex import of Georg's sections.
---
 position-papers/HTTP3/HTTP3.bbl  |   60 +++
 position-papers/HTTP3/HTTP3.tex  |  128 +
 position-papers/HTTP3/llncs.cls  | 1016 ++
 position-papers/HTTP3/usenix.sty |   97 
 4 files changed, 1301 insertions(+)

diff --git a/position-papers/HTTP3/HTTP3.bbl b/position-papers/HTTP3/HTTP3.bbl
new file mode 100644
index 000..feb7b6f
--- /dev/null
+++ b/position-papers/HTTP3/HTTP3.bbl
@@ -0,0 +1,60 @@
+\begin{thebibliography}{10}
+
+\bibitem{web-send}
+Tyler Close, Rajiv Makhijani, Mark Seaborn, Kenton Varda, Johan Apelqvist,
+  Claes Nilsson, and Mike Hanson.
+\newblock {Web Introducer}.
+\newblock \url{http://web-send.org/introducer/}.
+
+\bibitem{target}
+Charles Duhigg.
+\newblock {How Companies Learn Your Secrets}.
+\newblock
+  \url{https://www.nytimes.com/2012/02/19/magazine/shopping-habits.html?pagewa%
+nted=9}.
+
+\bibitem{panopticlick}
+Peter Eckersley.
+\newblock How unique is your web browser?
+\newblock In {\em Proceedings of the 10th international conference on Privacy
+  enhancing technologies}, PETS'10, pages 1--18, Berlin, Heidelberg, 2010.
+  Springer-Verlag.
+
+\bibitem{DNT-adoption}
+Alex Fowler.
+\newblock {Mozilla Led Effort for DNT Finds Broad Support}.
+\newblock
+  \url{https://blog.mozilla.org/privacy/2012/02/23/mozilla-led-effort-for-dnt-%
+finds-broad-support/}.
+
+\bibitem{safecache}
+Collin Jackson and Dan Boneh.
+\newblock Protecting browser state from web privacy attacks.
+\newblock In {\em In Proceedings of the International World Wide Web
+  Conference}, pages 737--744, 2006.
+
+\bibitem{DNT-draft}
+J.~Mayer, A.~Narayanan, and S.~Stamm.
+\newblock {Do Not Track: A Universal Third-Party Web Tracking Opt Out}.
+\newblock \url{https://tools.ietf.org/html/draft-mayer-do-not-track-00}.
+
+\bibitem{fourthparty}
+Jonathan~R. Mayer and John~C. Mitchell.
+\newblock {Third-Party Web Tracking: Policy and Technology}.
+\newblock \url{https://www.stanford.edu/~jmayer/papers/trackingsurvey12.pdf}.
+
+\bibitem{Persona}
+Mozilla~Developer Network.
+\newblock {Persona}.
+\newblock \url{https://developer.mozilla.org/en-US/docs/persona}.
+
+\bibitem{torbrowser}
+Mike Perry.
+\newblock {The Design and Implementation of the Tor Browser}.
+\newblock \url{https://www.torproject.org/projects/torbrowser/design/}.
+
+\bibitem{thirdparty}
+Dan Witte.
+\newblock \url{https://wiki.mozilla.org/Thirdparty}.
+
+\end{thebibliography}
diff --git a/position-papers/HTTP3/HTTP3.tex b/position-papers/HTTP3/HTTP3.tex
new file mode 100644
index 000..d9f2ab0
--- /dev/null
+++ b/position-papers/HTTP3/HTTP3.tex
@@ -0,0 +1,128 @@
+%\documentclass{llncs}
+\documentclass[letterpaper,11pt]{llncs}
+%\documentclass{article} % llncs
+
+\usepackage{usenix}
+\usepackage{url}
+\usepackage{amsmath}
+\usepackage{epsfig}
+\usepackage{epsf}
+\usepackage{listings}
+
+%\setlength{\textwidth}{6in}
+%\setlength{\textheight}{8.4in}
+%\setlength{\topmargin}{.5cm}
+%\setlength{\oddsidemargin}{1cm}
+%\setlength{\evensidemargin}{1cm}
+
+\begin{document}
+
+\title{The Future of HTTP and Anonymity on the Internet}
+
+\author{Georg Koppen \\ The Tor Project, Inc \\ ge...@torproject.org}
+\author{Mike Perry \\ The Tor Project, Inc \\ mikepe...@torproject.org}
+
+%\institute{The Internet}
+
+\maketitle
+\pagestyle{plain}
+
+\begin{abstract}
+
+
+\end{abstract}
+ 
+
+\section{Introduction}
+
+% XXX: Describe our organization? The Tor Project, Inc is a non-profit...
+
+% XXX: In this position paper, we describe the current and potential issues 
with
+
+Dangers and opportunities with resepect to browsing the Internet anonymously 
are
+often tied to the browser itself and not its underlying transport protocols:
+canvas fingerprinting, plugin enumeration and linking users via the DOM storage
+are just a few of the means the browser offers for trying to single users out.
+And even things like cookies and referrers, although belonging strictly 
speaking
+to HTTP, the transport protocol powering the web, are usually seen in the
+context of the browser itself as its additional policies shape the particular
+tracking potential of these and other transport related features.
+This is not much different for features in HTTP/2 although, compared to
+HTTP/1.1, it has a growing list of tracking risks that should be addressed in
+the specification itself. We discuss some of them below proposing ways to take
+these and other risks into account in future HTTP specifications.
+
+Apart from the dangers we just hinted at, beginning with HTTP/2 opportunities
+emerge as well: Using HTTP/2's flow control could make it easier to defend
+against adversaries sniffing a user's encrypted traffic and trying to extract
+information out of it by means of website traffic fingerprinting. We discuss
+current limitations and potential improvements for HTTP/3.
+
+\section{A Short

[tor-commits] [translation/tor-launcher-network-settings] Update translations for tor-launcher-network-settings

2015-05-04 Thread translation
commit 452de810795e093c328577abaadef72b55317a6e
Author: Translation commit bot 
Date:   Mon May 4 16:45:44 2015 +

Update translations for tor-launcher-network-settings
---
 ca/network-settings.dtd |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ca/network-settings.dtd b/ca/network-settings.dtd
index 7bf1ca5..b817d3c 100644
--- a/ca/network-settings.dtd
+++ b/ca/network-settings.dtd
@@ -1,4 +1,4 @@
-
+
 
 
 

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


[tor-commits] [translation/tails-misc] Update translations for tails-misc

2015-05-04 Thread translation
commit 1b63617330713c29e2e604af074d4be828b31870
Author: Translation commit bot 
Date:   Mon May 4 16:45:51 2015 +

Update translations for tails-misc
---
 ca.po |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ca.po b/ca.po
index 1a8b0d0..025a1ba 100644
--- a/ca.po
+++ b/ca.po
@@ -13,8 +13,8 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2015-05-02 23:47+0200\n"
-"PO-Revision-Date: 2015-05-03 08:25+\n"
-"Last-Translator: runasand \n"
+"PO-Revision-Date: 2015-05-04 16:33+\n"
+"Last-Translator: laia_\n"
 "Language-Team: Catalan 
(http://www.transifex.com/projects/p/torproject/language/ca/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -102,7 +102,7 @@ msgstr "_Gestió de Claus"
 
 #: config/chroot_local-includes/usr/local/bin/gpgApplet:208
 msgid "_Open Text Editor"
-msgstr ""
+msgstr "_Obre l'editor de textos"
 
 #: config/chroot_local-includes/usr/local/bin/gpgApplet:252
 msgid "The clipboard does not contain valid input data."

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


[tor-commits] [translation/tails-misc_completed] Update translations for tails-misc_completed

2015-05-04 Thread translation
commit c0b9b7268da55ba47d44c59d98f23cd83a5ff545
Author: Translation commit bot 
Date:   Mon May 4 16:45:55 2015 +

Update translations for tails-misc_completed
---
 ca.po |   76 ++---
 1 file changed, 40 insertions(+), 36 deletions(-)

diff --git a/ca.po b/ca.po
index cddcd71..025a1ba 100644
--- a/ca.po
+++ b/ca.po
@@ -7,14 +7,14 @@
 # Assumpta Anglada , 2014
 # Eloi García i Fargas, 2014
 # Humbert , 2014
-# laia_ , 2014-2015
+# laia_, 2014-2015
 msgid ""
 msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-23 16:25+0100\n"
-"PO-Revision-Date: 2015-03-20 19:32+\n"
-"Last-Translator: laia_ \n"
+"POT-Creation-Date: 2015-05-02 23:47+0200\n"
+"PO-Revision-Date: 2015-05-04 16:33+\n"
+"Last-Translator: laia_\n"
 "Language-Team: Catalan 
(http://www.transifex.com/projects/p/torproject/language/ca/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -22,11 +22,11 @@ msgstr ""
 "Language: ca\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
-#: 
config/chroot_local-includes/etc/NetworkManager/dispatcher.d/60-tor-ready-notification.sh:42
+#: 
config/chroot_local-includes/etc/NetworkManager/dispatcher.d/60-tor-ready.sh:43
 msgid "Tor is ready"
 msgstr "Tor es troba actiu"
 
-#: 
config/chroot_local-includes/etc/NetworkManager/dispatcher.d/60-tor-ready-notification.sh:43
+#: 
config/chroot_local-includes/etc/NetworkManager/dispatcher.d/60-tor-ready.sh:44
 msgid "You can now access the Internet."
 msgstr "Ara ja pots accedir a Internet."
 
@@ -100,128 +100,132 @@ msgstr "_Desxifrar/Xifrar el Portapapers"
 msgid "_Manage Keys"
 msgstr "_Gestió de Claus"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:244
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:208
+msgid "_Open Text Editor"
+msgstr "_Obre l'editor de textos"
+
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:252
 msgid "The clipboard does not contain valid input data."
 msgstr "El portapapers no conté dades d'entrada vàlides."
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:295
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:297
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:299
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:303
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:305
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:307
 msgid "Unknown Trust"
 msgstr "Confiança desconeguda"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:301
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:309
 msgid "Marginal Trust"
 msgstr "Confiança marginal"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:303
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:311
 msgid "Full Trust"
 msgstr "Plena confiança"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:305
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:313
 msgid "Ultimate Trust"
 msgstr "Confiança fins al final"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:358
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:366
 msgid "Name"
 msgstr "Nom"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:359
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:367
 msgid "Key ID"
 msgstr "ID de la Clau"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:360
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:368
 msgid "Status"
 msgstr "Estat"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:392
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:400
 msgid "Fingerprint:"
 msgstr "Empremta digital:"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:395
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:403
 msgid "User ID:"
 msgid_plural "User IDs:"
 msgstr[0] "ID d'usuari:"
 msgstr[1] "IDs d'usuari:"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:425
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:433
 msgid "None (Don't sign)"
 msgstr "Cap (no signat)"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:488
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:496
 msgid "Select recipients:"
 msgstr "Sel·lecciona destinataris"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:496
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:504
 msgid "Hide recipients"
 msgstr "Oculta destinataris"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:499
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:507
 msgid ""
 "Hide the user IDs of all recipients of an encrypted message. Otherwise "
 "anyone that sees the encrypted message can see who the recipients are."
 msgstr "Oculta els IDs d'usuari de tots els receptors del missatge xifrat. 
Altrament, qualsevol persona que vegi el missatge xifrat veurà qui són els 
destinataris."
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:505
+#: config/chroot_lo

[tor-commits] [translation/tor-launcher-network-settings_completed] Update translations for tor-launcher-network-settings_completed

2015-05-04 Thread translation
commit 535b47abffafc346d3297c2f10e62a53f7b54742
Author: Translation commit bot 
Date:   Mon May 4 16:45:47 2015 +

Update translations for tor-launcher-network-settings_completed
---
 ca/network-settings.dtd |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ca/network-settings.dtd b/ca/network-settings.dtd
index 7bf1ca5..b817d3c 100644
--- a/ca/network-settings.dtd
+++ b/ca/network-settings.dtd
@@ -1,4 +1,4 @@
-
+
 
 
 

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


[tor-commits] [translation/https_everywhere_completed] Update translations for https_everywhere_completed

2015-05-04 Thread translation
commit ca90406acdd4cbd351380f6bde23ddfad0364725
Author: Translation commit bot 
Date:   Mon May 4 16:45:25 2015 +

Update translations for https_everywhere_completed
---
 ca/ssl-observatory.dtd |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ca/ssl-observatory.dtd b/ca/ssl-observatory.dtd
index ce27c0e..1d22c96 100644
--- a/ca/ssl-observatory.dtd
+++ b/ca/ssl-observatory.dtd
@@ -1,6 +1,6 @@
 
 
-
+
 
 
 ___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [translation/gettor] Update translations for gettor

2015-05-04 Thread translation
commit 2b4fcee766cd41cc06e5ba668e849465bf0287dc
Author: Translation commit bot 
Date:   Mon May 4 16:45:06 2015 +

Update translations for gettor
---
 ca/gettor.po |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ca/gettor.po b/ca/gettor.po
index 53b2048..708a66d 100644
--- a/ca/gettor.po
+++ b/ca/gettor.po
@@ -9,7 +9,7 @@
 # Eloi García i Fargas, 2014
 # Humbert , 2014
 # Jacob Appelbaum , 2009
-# laia_ , 2014
+# laia_, 2014-2015
 # Roger Esteve , 2013
 # Xavier Romero Aguadé , 2014
 msgid ""
@@ -17,8 +17,8 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2013-01-19 13:40+0100\n"
-"PO-Revision-Date: 2015-02-02 11:11+\n"
-"Last-Translator: Assumpta Anglada \n"
+"PO-Revision-Date: 2015-05-04 16:33+\n"
+"Last-Translator: laia_\n"
 "Language-Team: Catalan 
(http://www.transifex.com/projects/p/torproject/language/ca/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -28,7 +28,7 @@ msgstr ""
 
 #: lib/gettor/i18n.py:27
 msgid "Hello, This is the \"GetTor\" robot."
-msgstr "Hola, aquest es el robot \"GetTor\""
+msgstr "Hola, aquest és el robot \"GetTor\""
 
 #: lib/gettor/i18n.py:29
 msgid "Thank you for your request."

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


[tor-commits] [translation/gettor_completed] Update translations for gettor_completed

2015-05-04 Thread translation
commit 18e6a542180f2766ce9fd049729eab48430820ab
Author: Translation commit bot 
Date:   Mon May 4 16:45:10 2015 +

Update translations for gettor_completed
---
 ca/gettor.po |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ca/gettor.po b/ca/gettor.po
index 53b2048..708a66d 100644
--- a/ca/gettor.po
+++ b/ca/gettor.po
@@ -9,7 +9,7 @@
 # Eloi García i Fargas, 2014
 # Humbert , 2014
 # Jacob Appelbaum , 2009
-# laia_ , 2014
+# laia_, 2014-2015
 # Roger Esteve , 2013
 # Xavier Romero Aguadé , 2014
 msgid ""
@@ -17,8 +17,8 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2013-01-19 13:40+0100\n"
-"PO-Revision-Date: 2015-02-02 11:11+\n"
-"Last-Translator: Assumpta Anglada \n"
+"PO-Revision-Date: 2015-05-04 16:33+\n"
+"Last-Translator: laia_\n"
 "Language-Team: Catalan 
(http://www.transifex.com/projects/p/torproject/language/ca/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -28,7 +28,7 @@ msgstr ""
 
 #: lib/gettor/i18n.py:27
 msgid "Hello, This is the \"GetTor\" robot."
-msgstr "Hola, aquest es el robot \"GetTor\""
+msgstr "Hola, aquest és el robot \"GetTor\""
 
 #: lib/gettor/i18n.py:29
 msgid "Thank you for your request."

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


[tor-commits] [translation/https_everywhere] Update translations for https_everywhere

2015-05-04 Thread translation
commit 8cecd0f9a0271db751e9548628f9ddb4d7681e30
Author: Translation commit bot 
Date:   Mon May 4 16:45:19 2015 +

Update translations for https_everywhere
---
 ca/ssl-observatory.dtd |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ca/ssl-observatory.dtd b/ca/ssl-observatory.dtd
index ce27c0e..1d22c96 100644
--- a/ca/ssl-observatory.dtd
+++ b/ca/ssl-observatory.dtd
@@ -1,6 +1,6 @@
 
 
-
+
 
 
 ___
tor-commits mailing list
tor-commits@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits


[tor-commits] [tor/master] Merge branch 'feature3523_027'

2015-05-04 Thread nickm
commit e8db9d0c94f44115a6c64ad891f7e37c2f1828f0
Merge: d472952 841c4aa
Author: Nick Mathewson 
Date:   Mon May 4 11:41:50 2015 -0400

Merge branch 'feature3523_027'

 changes/feature3523  |3 +
 src/or/control.c |  198 --
 src/or/control.h |9 +++
 src/or/directory.c   |6 ++
 src/or/rendservice.c |   48 +++-
 src/or/rendservice.h |4 +
 6 files changed, 246 insertions(+), 22 deletions(-)

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


[tor-commits] [tor/master] Add "+HSPOST" and related "HS_DESC" event flags to the controller.

2015-05-04 Thread nickm
commit 841c4aa71505e9fea877f45223a0b01fade8a754
Author: Donncha O'Cearbhaill 
Date:   Sun Mar 22 13:31:53 2015 +

Add "+HSPOST" and related "HS_DESC" event flags to the controller.

"+HSPOST" and the related event changes allow the uploading of HS
descriptors via the control port, and more comprehensive event
monitoring of HS descriptor upload status.
---
 changes/feature3523  |3 +
 src/or/control.c |  198 --
 src/or/control.h |9 +++
 src/or/directory.c   |6 ++
 src/or/rendservice.c |   48 +++-
 src/or/rendservice.h |4 +
 6 files changed, 246 insertions(+), 22 deletions(-)

diff --git a/changes/feature3523 b/changes/feature3523
new file mode 100644
index 000..f11d1d3
--- /dev/null
+++ b/changes/feature3523
@@ -0,0 +1,3 @@
+  o Major features (controller):
+- New HSPOST command to upload a hidden service descriptor. 
+  Closes ticket 3523. Patch by "DonnchaC".
diff --git a/src/or/control.c b/src/or/control.c
index 950e989..ead255f 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -36,17 +36,14 @@
 #include "networkstatus.h"
 #include "nodelist.h"
 #include "policies.h"
-#include "rendcommon.h"
-#include "rendservice.h"
 #include "reasons.h"
 #include "rendclient.h"
 #include "rendcommon.h"
+#include "rendservice.h"
 #include "rephist.h"
 #include "router.h"
 #include "routerlist.h"
 #include "routerparse.h"
-#include "rendclient.h"
-#include "rendcommon.h"
 
 #ifndef _WIN32
 #include 
@@ -170,6 +167,8 @@ static int handle_control_usefeature(control_connection_t 
*conn,
  const char *body);
 static int handle_control_hsfetch(control_connection_t *conn, uint32_t len,
   const char *body);
+static int handle_control_hspost(control_connection_t *conn, uint32_t len,
+ const char *body);
 static int handle_control_add_onion(control_connection_t *conn, uint32_t len,
 const char *body);
 static int handle_control_del_onion(control_connection_t *conn, uint32_t len,
@@ -3424,6 +3423,101 @@ handle_control_hsfetch(control_connection_t *conn, 
uint32_t len,
   return 0;
 }
 
+/** Implementation for the HSPOST command. */
+static int
+handle_control_hspost(control_connection_t *conn,
+  uint32_t len,
+  const char *body)
+{
+  static const char *opt_server = "SERVER=";
+  smartlist_t *args = smartlist_new();
+  smartlist_t *hs_dirs = NULL;
+  const char *encoded_desc = body;
+  size_t encoded_desc_len = len;
+
+  char *cp = memchr(body, '\n', len);
+  char *argline = tor_strndup(body, cp-body);
+
+  /* If any SERVER= options were specified, try parse the options line */
+  if (!strcasecmpstart(argline, opt_server)) {
+/* encoded_desc begins after a newline character */
+cp = cp + 1;
+encoded_desc = cp;
+encoded_desc_len = len-(cp-body);
+
+smartlist_split_string(args, argline, " ",
+   SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0);
+SMARTLIST_FOREACH_BEGIN(args, const char *, arg) {
+  if (!strcasecmpstart(arg, opt_server)) {
+const char *server = arg + strlen(opt_server);
+const node_t *node = node_get_by_hex_id(server);
+
+if (!node) {
+  connection_printf_to_buf(conn, "552 Server \"%s\" not found\r\n",
+   server);
+  goto done;
+}
+if (!node->rs->is_hs_dir) {
+  connection_printf_to_buf(conn, "552 Server \"%s\" is not a HSDir"
+ "\r\n", server);
+  goto done;
+}
+/* Valid server, add it to our local list. */
+if (!hs_dirs)
+  hs_dirs = smartlist_new();
+smartlist_add(hs_dirs, node->rs);
+  } else {
+connection_printf_to_buf(conn, "512 Unexpected argument \"%s\"\r\n",
+ arg);
+goto done;
+  }
+} SMARTLIST_FOREACH_END(arg);
+  }
+
+  /* Read the dot encoded descriptor, and parse it. */
+  rend_encoded_v2_service_descriptor_t *desc =
+  tor_malloc_zero(sizeof(rend_encoded_v2_service_descriptor_t));
+  read_escaped_data(encoded_desc, encoded_desc_len, &desc->desc_str);
+
+  rend_service_descriptor_t *parsed = NULL;
+  char *intro_content = NULL;
+  size_t intro_size;
+  size_t encoded_size;
+  const char *next_desc;
+  if (!rend_parse_v2_service_descriptor(&parsed, desc->desc_id, &intro_content,
+&intro_size, &encoded_size,
+&next_desc, desc->desc_str, 1)) {
+/* Post the descriptor. */
+char serviceid[REND_SERVICE_ID_LEN_BASE32+1];
+if (!rend_get_service_id(parsed->pk, serviceid)) {
+  smartlist_t *descs = smartlist_new();
+  smartlist_add(descs, desc);
+
+  /* We are about to trigger HS descriptor upload so send the OK now
+   * beca

[tor-commits] [translation/tails-misc] Update translations for tails-misc

2015-05-04 Thread translation
commit a7f8ece29d4396b7456f150d10f36afc9c796b82
Author: Translation commit bot 
Date:   Mon May 4 14:15:37 2015 +

Update translations for tails-misc
---
 pt.po |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/pt.po b/pt.po
index 9750f6e..6020536 100644
--- a/pt.po
+++ b/pt.po
@@ -7,6 +7,7 @@
 # André Monteiro , 2014
 # sierleunam , 2014
 # testsubject67 , 2014
+# Henrique Rodrigues , 2015
 # Koh Pyreit , 2013
 # Andrew_Melim , 2014
 # Pedro Albuquerque , 2014-2015
@@ -16,8 +17,8 @@ msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2015-05-02 23:47+0200\n"
-"PO-Revision-Date: 2015-05-03 08:25+\n"
-"Last-Translator: runasand \n"
+"PO-Revision-Date: 2015-05-04 14:14+\n"
+"Last-Translator: Henrique Rodrigues \n"
 "Language-Team: Portuguese 
(http://www.transifex.com/projects/p/torproject/language/pt/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -105,7 +106,7 @@ msgstr "_Gerir Chaves"
 
 #: config/chroot_local-includes/usr/local/bin/gpgApplet:208
 msgid "_Open Text Editor"
-msgstr ""
+msgstr "_Open Editor de Texto"
 
 #: config/chroot_local-includes/usr/local/bin/gpgApplet:252
 msgid "The clipboard does not contain valid input data."

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


[tor-commits] [translation/tails-misc_completed] Update translations for tails-misc_completed

2015-05-04 Thread translation
commit c74205d4c9eb4d0f6dc1971e3957a6a19bb4d619
Author: Translation commit bot 
Date:   Mon May 4 14:15:40 2015 +

Update translations for tails-misc_completed
---
 pt.po |   75 +++--
 1 file changed, 40 insertions(+), 35 deletions(-)

diff --git a/pt.po b/pt.po
index 6767c4e..6020536 100644
--- a/pt.po
+++ b/pt.po
@@ -7,6 +7,7 @@
 # André Monteiro , 2014
 # sierleunam , 2014
 # testsubject67 , 2014
+# Henrique Rodrigues , 2015
 # Koh Pyreit , 2013
 # Andrew_Melim , 2014
 # Pedro Albuquerque , 2014-2015
@@ -15,9 +16,9 @@ msgid ""
 msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-02-23 16:25+0100\n"
-"PO-Revision-Date: 2015-02-25 15:32+\n"
-"Last-Translator: alfalb.as\n"
+"POT-Creation-Date: 2015-05-02 23:47+0200\n"
+"PO-Revision-Date: 2015-05-04 14:14+\n"
+"Last-Translator: Henrique Rodrigues \n"
 "Language-Team: Portuguese 
(http://www.transifex.com/projects/p/torproject/language/pt/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -25,11 +26,11 @@ msgstr ""
 "Language: pt\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
-#: 
config/chroot_local-includes/etc/NetworkManager/dispatcher.d/60-tor-ready-notification.sh:42
+#: 
config/chroot_local-includes/etc/NetworkManager/dispatcher.d/60-tor-ready.sh:43
 msgid "Tor is ready"
 msgstr "O Tor está pronto"
 
-#: 
config/chroot_local-includes/etc/NetworkManager/dispatcher.d/60-tor-ready-notification.sh:43
+#: 
config/chroot_local-includes/etc/NetworkManager/dispatcher.d/60-tor-ready.sh:44
 msgid "You can now access the Internet."
 msgstr "Poderá agora aceder à Internet."
 
@@ -103,128 +104,132 @@ msgstr "_Desencriptar/Verificar área de transferência"
 msgid "_Manage Keys"
 msgstr "_Gerir Chaves"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:244
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:208
+msgid "_Open Text Editor"
+msgstr "_Open Editor de Texto"
+
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:252
 msgid "The clipboard does not contain valid input data."
 msgstr "A área de transferência não contém dados de entrada válidos."
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:295
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:297
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:299
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:303
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:305
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:307
 msgid "Unknown Trust"
 msgstr "Fidedignidade Desconhecida"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:301
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:309
 msgid "Marginal Trust"
 msgstr "Fidedignidade Marginal"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:303
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:311
 msgid "Full Trust"
 msgstr "Fidedignidade Total"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:305
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:313
 msgid "Ultimate Trust"
 msgstr "Fidedignidade Máxima"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:358
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:366
 msgid "Name"
 msgstr "Nome"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:359
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:367
 msgid "Key ID"
 msgstr "ID da Chave"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:360
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:368
 msgid "Status"
 msgstr "Estado"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:392
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:400
 msgid "Fingerprint:"
 msgstr "Impressão digital:"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:395
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:403
 msgid "User ID:"
 msgid_plural "User IDs:"
 msgstr[0] "ID do Utilizador:"
 msgstr[1] "IDs do Utilizador:"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:425
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:433
 msgid "None (Don't sign)"
 msgstr "Nenhum (não assinar)"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:488
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:496
 msgid "Select recipients:"
 msgstr "Seleccionar destinatários:"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:496
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:504
 msgid "Hide recipients"
 msgstr "Ocultar destinatários"
 
-#: config/chroot_local-includes/usr/local/bin/gpgApplet:499
+#: config/chroot_local-includes/usr/local/bin/gpgApplet:507
 msgid ""
 "Hide the user IDs of all recipients of an encrypted message. Otherwise "
 "anyone that sees the encrypted message can see who the recipients are."
 msgstr "Esconda os IDs de utilizador de todos os destinatários de uma 
mensagem encriptada. De outra f

[tor-commits] [tor/master] Make `GETINFO hs/client/desc/id/` actually work (#14845).

2015-05-04 Thread nickm
commit d4729524d1d8291f617a1634d804127bac79d96e
Author: Yawning Angel 
Date:   Sat May 2 11:45:46 2015 +

Make `GETINFO hs/client/desc/id/` actually work (#14845).

Not in any released version of tor.
---
 src/or/control.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/or/control.c b/src/or/control.c
index 950e989..8ef3c5c 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1740,7 +1740,7 @@ getinfo_helper_dir(control_connection_t *control_conn,
   return -1;
 }
 
-if (rend_cache_lookup_entry(question, -1, &e) > 0) {
+if (!rend_cache_lookup_entry(question, -1, &e)) {
   /* Descriptor found in cache */
   *answer = tor_strdup(e->desc);
 } else {

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


[tor-commits] [translation/tor_animation] Update translations for tor_animation

2015-05-04 Thread translation
commit b10c8e91dbc7c6fc57812b58eb675aaa67a218ae
Author: Translation commit bot 
Date:   Mon May 4 11:15:53 2015 +

Update translations for tor_animation
---
 ko.srt |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/ko.srt b/ko.srt
index 07486e0..6d7ddf9 100644
--- a/ko.srt
+++ b/ko.srt
@@ -67,8 +67,7 @@ Tor 브라우저를 통한 접속은 3중 보안을 거치게 
되며,
 
 16
 00:00:50,280 --> 00:00:53,520
-which enables us to communicate
-anonymously over the Internet.
+인터넷 상에서 익명으로 활동할 수 있도록 말이죠.
 
 17
 00:00:56,560 --> 00:00:58,280

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


[tor-commits] [translation/tor_animation] Update translations for tor_animation

2015-05-04 Thread translation
commit 239442ef7cffe2b51d90074bac703543ecc457b6
Author: Translation commit bot 
Date:   Mon May 4 10:15:52 2015 +

Update translations for tor_animation
---
 ko.srt |   61 +
 1 file changed, 29 insertions(+), 32 deletions(-)

diff --git a/ko.srt b/ko.srt
index 78c998d..07486e0 100644
--- a/ko.srt
+++ b/ko.srt
@@ -40,126 +40,123 @@ and so much more information
 about you and your life
 
 10
-00:00:29,620 --> 00:00:32,460
+00:00:29,200 --> 00:00:31,500
 which you probably didn't mean
 to share with unknown strangers,
 
 11
-00:00:32,920 --> 00:00:35,840
+00:00:31,700 --> 00:00:34,000
 who could easily use this data
 to exploit you.
 
 12
-00:00:36,220 --> 00:00:38,120
+00:00:34,500 --> 00:00:37,000
 But not if you're using Tor!
 
 13
-00:00:39,140 --> 00:00:42,840
-Tor Browser protects our privacy
-and identity on the Internet.
+00:00:37,140 --> 00:00:40,840
+Tor 브라우저는 개인정보 및 사생활 등을 지켜 드립니다.
 
 14
-00:00:43,560 --> 00:00:46,760
-Tor secures your connection
-with three layers of encryption
+00:00:41,560 --> 00:00:44,760
+Tor 브라우저를 통한 접속은 3중 보안을 거치게 되며,
 
 15
-00:00:46,940 --> 00:00:51,760
-and passes it through three voluntarily
-operated servers around the world,
+00:00:44,940 --> 00:00:49,760
+전 세계에서 자발적으로 운영되고 있는 서버를 3군데 경유
합니다.
 
 16
-00:00:52,280 --> 00:00:55,520
+00:00:50,280 --> 00:00:53,520
 which enables us to communicate
 anonymously over the Internet.
 
 17
-00:00:58,560 --> 00:01:00,280
+00:00:56,560 --> 00:00:58,280
 Tor also protects our data
 
 18
-00:01:00,400 --> 00:01:03,900
+00:00:58,400 --> 00:01:01,900
 against corporate or government targeted
 and mass surveillance.
 
 19
-00:01:04,880 --> 00:01:09,340
+00:01:02,880 --> 00:01:07,340
 Perhaps you live in a repressive country
 which tries to control and surveil the Internet.
 
 20
-00:01:09,900 --> 00:01:13,800
+00:01:07,900 --> 00:01:11,800
 Or perhaps you don't want big corporations
 taking advantage of your personal information.
 
 21
-00:01:14,880 --> 00:01:17,640
+00:01:12,880 --> 00:01:15,640
 Tor makes all of its users
 to look the same
 
 22
-00:01:17,920 --> 00:01:20,800
+00:01:15,920 --> 00:01:18,800
 which confuses the observer
 and makes you anonymous.
 
 23
-00:01:21,500 --> 00:01:24,980
+00:01:19,500 --> 00:01:22,980
 So, the more people use the Tor network,
 the stronger it gets
 
 24
-00:01:25,140 --> 00:01:29,800
+00:01:23,140 --> 00:01:27,800
 as it's easier to hide in a crowd
 of people who look exactly the same.
 
 25
-00:01:30,700 --> 00:01:33,240
+00:01:28,700 --> 00:01:31,240
 You can bypass the censorship
 without being worried about
 
 26
-00:01:33,400 --> 00:01:36,100
+00:01:31,400 --> 00:01:34,100
 the censor knowing what you do
 on the Internet.
 
 27
-00:01:38,540 --> 00:01:41,440
+00:01:36,540 --> 00:01:39,440
 The ads won't follow you
 everywhere for months,
 
 28
-00:01:41,640 --> 00:01:43,300
+00:01:39,640 --> 00:01:41,300
 starting when you first
 clicked on a product.
 
 29
-00:01:45,880 --> 00:01:49,380
+00:01:43,880 --> 00:01:47,380
 By using Tor, the sites you visit
 won't even know who you are,
 
 30
-00:01:49,540 --> 00:01:51,760
+00:01:47,540 --> 00:01:49,760
 from what part of the world
 you're visiting them,
 
 31
-00:01:51,920 --> 00:01:53,920
+00:01:49,920 --> 00:01:51,920
 unless you login and tell them so.
 
 32
-00:01:56,200 --> 00:01:57,840
+00:01:54,200 --> 00:01:55,840
 By downloading and using Tor,
 
 33
-00:01:58,200 --> 00:02:00,560
+00:01:56,200 --> 00:01:58,560
 you can protect the people
 who need anonymity,
 
 34
-00:02:00,880 --> 00:02:03,640
+00:01:58,880 --> 00:02:01,640
 like activists, journalists and bloggers.
 
 35
-00:02:04,000 --> 00:02:09,000
+00:02:02,000 --> 00:02:07,000
 Download and use Tor! Or run a relay!
 

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


[tor-commits] [torbutton/master] Bug 15915: Hide circuit display if it is disabled.

2015-05-04 Thread gk
commit fc05d63ab7f01fabf60d31a9795349054a7b
Author: anonym 
Date:   Mon May 4 11:04:29 2015 +0200

Bug 15915: Hide circuit display if it is disabled.

If extensions.torbutton.display_circuit = false from the start, then
myController will never be set, so when we call stop() we won't call
syncDisplayWithSelectedTab(false) to hide the circuit display.
---
 src/chrome/content/tor-circuit-display.js |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/chrome/content/tor-circuit-display.js 
b/src/chrome/content/tor-circuit-display.js
index 4197944..2da7f0a 100644
--- a/src/chrome/content/tor-circuit-display.js
+++ b/src/chrome/content/tor-circuit-display.js
@@ -315,8 +315,8 @@ let setupDisplay = function (host, port, password, 
enablePrefName) {
   let myController = null,
   stopCollectingIsolationData = null,
   stop = function() {
+syncDisplayWithSelectedTab(false);
 if (myController) {
-  syncDisplayWithSelectedTab(false);
   if (stopCollectingIsolationData) {
stopCollectingIsolationData();
   }

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


[tor-commits] [tor-browser-bundle/master] Update meek to 0.18.

2015-05-04 Thread gk
commit 0db1987644292794b35b0681c27ec175f372861b
Author: David Fifield 
Date:   Fri May 1 04:01:28 2015 +

Update meek to 0.18.

This undoes a regression related to TOR_PT_EXIT_ON_STDIN_CLOSE that
broke meek on Windows 7.
---
 gitian/versions   |2 +-
 gitian/versions.alpha |2 +-
 gitian/versions.beta  |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gitian/versions b/gitian/versions
index 26b116b..0645ff3 100755
--- a/gitian/versions
+++ b/gitian/versions
@@ -25,7 +25,7 @@ FTEPROXY_TAG=597f8378f6f4f3de570b8e1064c2e4cb8d67fbd0 # tag 
0.2.19
 LIBDMG_TAG=dfd5e5cc3dc1191e37d3c3a6118975afdd1d7014
 TXSOCKSX_TAG=216eb0894a1755872f4789f9458aa6cf543b8433 # unsigned 
habnabit/1.13.0.2
 GOPTLIB_TAG=0.2
-MEEK_TAG=0.17
+MEEK_TAG=0.18
 FAKETIME_TAG=70aa6b394d9341522dffe8a5a5cf5929e82cc6b9 # unsigned v0.9.6
 GOED25519_TAG=c4161f4c7483313562781c61b9a20aba73daf9de
 GOSIPHASH_TAG=42ba037e748c9062a75e0924705c43b893edefcd
diff --git a/gitian/versions.alpha b/gitian/versions.alpha
index 86e163d..aa6257d 100755
--- a/gitian/versions.alpha
+++ b/gitian/versions.alpha
@@ -25,7 +25,7 @@ FTEPROXY_TAG=597f8378f6f4f3de570b8e1064c2e4cb8d67fbd0 # tag 
0.2.19
 LIBDMG_TAG=dfd5e5cc3dc1191e37d3c3a6118975afdd1d7014
 TXSOCKSX_TAG=216eb0894a1755872f4789f9458aa6cf543b8433 # unsigned 
habnabit/1.13.0.2
 GOPTLIB_TAG=0.2
-MEEK_TAG=0.17
+MEEK_TAG=0.18
 FAKETIME_TAG=70aa6b394d9341522dffe8a5a5cf5929e82cc6b9 # unsigned v0.9.6
 GOED25519_TAG=c4161f4c7483313562781c61b9a20aba73daf9de
 GOSIPHASH_TAG=42ba037e748c9062a75e0924705c43b893edefcd
diff --git a/gitian/versions.beta b/gitian/versions.beta
index 854e422..0341c4e 100755
--- a/gitian/versions.beta
+++ b/gitian/versions.beta
@@ -25,7 +25,7 @@ FTEPROXY_TAG=597f8378f6f4f3de570b8e1064c2e4cb8d67fbd0 # tag 
0.2.19
 LIBDMG_TAG=dfd5e5cc3dc1191e37d3c3a6118975afdd1d7014
 TXSOCKSX_TAG=216eb0894a1755872f4789f9458aa6cf543b8433 # unsigned 
habnabit/1.13.0.2
 GOPTLIB_TAG=0.2
-MEEK_TAG=0.17
+MEEK_TAG=0.18
 
 GITIAN_TAG=tor-browser-builder-3.x-6
 

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


[tor-commits] [translation/tor_animation] Update translations for tor_animation

2015-05-04 Thread translation
commit 44833ca5cf4acfb368fc50c61635089d95817ca6
Author: Translation commit bot 
Date:   Mon May 4 09:16:02 2015 +

Update translations for tor_animation
---
 da.srt |   59 +--
 1 file changed, 29 insertions(+), 30 deletions(-)

diff --git a/da.srt b/da.srt
index ca7ccfa..b2c3fe0 100644
--- a/da.srt
+++ b/da.srt
@@ -84,82 +84,81 @@ og masse overvågning.
 
 19
 00:01:02,880 --> 00:01:07,340
-Perhaps you live in a repressive country
-which tries to control and surveil the Internet.
+MÃ¥ske lever du i et undertrykket land,
+der prøver at kontrollere og overvåge Internettet.
 
 20
 00:01:07,900 --> 00:01:11,800
-Or perhaps you don't want big corporations
-taking advantage of your personal information.
+Eller måske vil du ikke have store virksomheder
+til at have fordel af din personlige information.
 
 21
 00:01:12,880 --> 00:01:15,640
-Tor makes all of its users
-to look the same
+Tor får alle dens brugere
+til at se ens ud
 
 22
 00:01:15,920 --> 00:01:18,800
-which confuses the observer
-and makes you anonymous.
+hvilket forvirrer den observerende
+og gør dig anonym.
 
 23
 00:01:19,500 --> 00:01:22,980
-So, the more people use the Tor network,
-the stronger it gets
+Så, jo flere folk der bruger Tor netværket,
+jo stærkere bliver det
 
 24
 00:01:23,140 --> 00:01:27,800
-as it's easier to hide in a crowd
-of people who look exactly the same.
+da det er nemmere at gemme sig i mængden
+af folk der ser helt ens ud.
 
 25
 00:01:28,700 --> 00:01:31,240
-You can bypass the censorship
-without being worried about
+Du kan omgå censur
+uden at bekymre dig om
 
 26
 00:01:31,400 --> 00:01:34,100
-the censor knowing what you do
-on the Internet.
+censuren ved hvad du laver på Internettet.
 
 27
 00:01:36,540 --> 00:01:39,440
-The ads won't follow you
-everywhere for months,
+Reklamerne vil ikke forfølge dig
+over det hele i flere måneder,
 
 28
 00:01:39,640 --> 00:01:41,300
-starting when you first
-clicked on a product.
+siden du første gang
+klikkede på et produkt
 
 29
 00:01:43,880 --> 00:01:47,380
-By using Tor, the sites you visit
-won't even know who you are,
+Ved at bruge Tor, vil siden du besøger
+Ikke engang vide hvem du er,
 
 30
 00:01:47,540 --> 00:01:49,760
-from what part of the world
-you're visiting them,
+fra hvilken del af verden
+du besøger dem,
 
 31
 00:01:49,920 --> 00:01:51,920
-unless you login and tell them so.
+med mindre du logger ind og fortæller dem det.
 
 32
 00:01:54,200 --> 00:01:55,840
-By downloading and using Tor,
+Ved at downloade og bruge Tor,
 
 33
 00:01:56,200 --> 00:01:58,560
-you can protect the people
-who need anonymity,
+kan du beskytte folk
+der har brug for anonymitet,
 
 34
 00:01:58,880 --> 00:02:01,640
-like activists, journalists and bloggers.
+som aktivister, journalister og bloggere.
 
 35
 00:02:02,000 --> 00:02:07,000
-Download and use Tor! Or run a relay!
+Download og brug Tor! Eller brug det på relæ!
 

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


[tor-commits] [translation/tor_animation_completed] Update translations for tor_animation_completed

2015-05-04 Thread translation
commit 77b50de44a6e34c29a34eee55ca485623085b4ff
Author: Translation commit bot 
Date:   Mon May 4 09:16:06 2015 +

Update translations for tor_animation_completed
---
 da.srt |  164 
 1 file changed, 164 insertions(+)

diff --git a/da.srt b/da.srt
new file mode 100644
index 000..b2c3fe0
--- /dev/null
+++ b/da.srt
@@ -0,0 +1,164 @@
+1
+00:00:00,660 --> 00:00:02,780
+Vi er blevet meget vant til Internettet.
+
+2
+00:00:03,120 --> 00:00:07,700
+Vi deler konstant vores information
+om os selv og vores privatliv:
+
+3
+00:00:08,000 --> 00:00:09,960
+mad vi spiser, folk vi møder,
+
+4
+00:00:10,180 --> 00:00:12,480
+steder vi besøger, og ting vi læser.
+
+5
+00:00:13,280 --> 00:00:14,640
+Lad mig forklare det bedre.
+
+6
+00:00:14,920 --> 00:00:17,740
+Lige nu,
+hvis prøver at slå dig op,
+
+7
+00:00:18,060 --> 00:00:22,480
+vil de finde din virkelige identitet,
+præcise lokation, operativsystem,
+
+8
+00:00:22,800 --> 00:00:26,500
+alle de sider du har besøgt,
+browseren du bruger til at surfe på nettet,
+
+9
+00:00:26,700 --> 00:00:29,140
+og meget mere information
+om dig og dit liv
+
+10
+00:00:29,200 --> 00:00:31,500
+hvilket du sikkert ikke mente
+at dele med tilfældige fremmede,
+
+11
+00:00:31,700 --> 00:00:34,000
+der nemt kunne bruge dette data
+til at udnytte dig.
+
+12
+00:00:34,500 --> 00:00:37,000
+Men ikke hvis du bruger Tor!
+
+13
+00:00:37,140 --> 00:00:40,840
+Tor Browser beskytter vores privatliv
+og vores identitet på Internettet.
+
+14
+00:00:41,560 --> 00:00:44,760
+Tor sikrer din forbindelse
+med tre lags kryptering
+
+15
+00:00:44,940 --> 00:00:49,760
+og fører det gennem tre frivilligt
+opererede servere rundt omkring i verden,
+
+16
+00:00:50,280 --> 00:00:53,520
+hvilket gør os i stand til at kommunikere
+anonymt over Internettet.
+
+17
+00:00:56,560 --> 00:00:58,280
+Tor beskytter også vores data
+
+18
+00:00:58,400 --> 00:01:01,900
+mod virksomhedernes eller regeringernes målrettede
+og masse overvågning.
+
+19
+00:01:02,880 --> 00:01:07,340
+MÃ¥ske lever du i et undertrykket land,
+der prøver at kontrollere og overvåge Internettet.
+
+20
+00:01:07,900 --> 00:01:11,800
+Eller måske vil du ikke have store virksomheder
+til at have fordel af din personlige information.
+
+21
+00:01:12,880 --> 00:01:15,640
+Tor får alle dens brugere
+til at se ens ud
+
+22
+00:01:15,920 --> 00:01:18,800
+hvilket forvirrer den observerende
+og gør dig anonym.
+
+23
+00:01:19,500 --> 00:01:22,980
+Så, jo flere folk der bruger Tor netværket,
+jo stærkere bliver det
+
+24
+00:01:23,140 --> 00:01:27,800
+da det er nemmere at gemme sig i mængden
+af folk der ser helt ens ud.
+
+25
+00:01:28,700 --> 00:01:31,240
+Du kan omgå censur
+uden at bekymre dig om
+
+26
+00:01:31,400 --> 00:01:34,100
+censuren ved hvad du laver på Internettet.
+
+27
+00:01:36,540 --> 00:01:39,440
+Reklamerne vil ikke forfølge dig
+over det hele i flere måneder,
+
+28
+00:01:39,640 --> 00:01:41,300
+siden du første gang
+klikkede på et produkt
+
+29
+00:01:43,880 --> 00:01:47,380
+Ved at bruge Tor, vil siden du besøger
+Ikke engang vide hvem du er,
+
+30
+00:01:47,540 --> 00:01:49,760
+fra hvilken del af verden
+du besøger dem,
+
+31
+00:01:49,920 --> 00:01:51,920
+med mindre du logger ind og fortæller dem det.
+
+32
+00:01:54,200 --> 00:01:55,840
+Ved at downloade og bruge Tor,
+
+33
+00:01:56,200 --> 00:01:58,560
+kan du beskytte folk
+der har brug for anonymitet,
+
+34
+00:01:58,880 --> 00:02:01,640
+som aktivister, journalister og bloggere.
+
+35
+00:02:02,000 --> 00:02:07,000
+Download og brug Tor! Eller brug det på relæ!
+

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


[tor-commits] [translation/bridgedb] Update translations for bridgedb

2015-05-04 Thread translation
commit e8b5b9e5e5b8f8c7b01116f19ba177f91d1879e0
Author: Translation commit bot 
Date:   Mon May 4 09:15:04 2015 +

Update translations for bridgedb
---
 fr/LC_MESSAGES/bridgedb.po |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fr/LC_MESSAGES/bridgedb.po b/fr/LC_MESSAGES/bridgedb.po
index 4a9ed38..885ddb9 100644
--- a/fr/LC_MESSAGES/bridgedb.po
+++ b/fr/LC_MESSAGES/bridgedb.po
@@ -15,14 +15,14 @@
 # mehditaileb , 2011
 # Onizuka, 2013
 # themen , 2014
-# Towinet, 2014
+# Towinet, 2014-2015
 # Yannick Heintz, 2014
 msgid ""
 msgstr ""
 "Project-Id-Version: The Tor Project\n"
 "Report-Msgid-Bugs-To: 
'https://trac.torproject.org/projects/tor/newticket?component=BridgeDB&keywords=bridgedb-reported,msgid&cc=isis,sysrqb&owner=isis'POT-Creation-Date:
 2015-03-19 22:13+\n"
-"PO-Revision-Date: 2015-04-19 08:23+\n"
-"Last-Translator: runasand \n"
+"PO-Revision-Date: 2015-05-04 09:14+\n"
+"Last-Translator: Towinet\n"
 "Language-Team: French 
(http://www.transifex.com/projects/p/torproject/language/fr/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -216,7 +216,7 @@ msgid ""
 "To enter bridges into Tor Browser, first go to the %s Tor Browser download\n"
 "page %s and then follow the instructions there for downloading and starting\n"
 "Tor Browser."
-msgstr ""
+msgstr "Pour entrer (saisir) des ponts dans le Navigateur Tor (Tor Browser), 
allez tout d'abord à la %s page de téléchargement du navigateur Tor %s puis 
suivez les instructions là-bas afin de télécharger puis démarrer le 
navigateur Tor."
 
 #. TRANSLATORS: Please DO NOT translate "Tor".
 #: lib/bridgedb/strings.py:126

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


[tor-commits] [translation/torbutton-torbuttondtd] Update translations for torbutton-torbuttondtd

2015-05-04 Thread translation
commit 65a4cb5f40d8a2b5d1951f5cfaad06f0a0c9399d
Author: Translation commit bot 
Date:   Mon May 4 09:15:52 2015 +

Update translations for torbutton-torbuttondtd
---
 da/torbutton.dtd |4 ++--
 fr/torbutton.dtd |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/da/torbutton.dtd b/da/torbutton.dtd
index b9147d1..04900c4 100644
--- a/da/torbutton.dtd
+++ b/da/torbutton.dtd
@@ -153,8 +153,8 @@
 
 
 
-
-
+
+
 
 
 
diff --git a/fr/torbutton.dtd b/fr/torbutton.dtd
index ad6f07a..fa0a532 100644
--- a/fr/torbutton.dtd
+++ b/fr/torbutton.dtd
@@ -161,8 +161,8 @@
 
 
 
-
-
+
+
 
 
 

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


[tor-commits] [translation/bridgedb_completed] Update translations for bridgedb_completed

2015-05-04 Thread translation
commit 128b7186bc6781f35a422167d2db2e7b1de16a9e
Author: Translation commit bot 
Date:   Mon May 4 09:15:08 2015 +

Update translations for bridgedb_completed
---
 fr/LC_MESSAGES/bridgedb.po |   34 +-
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/fr/LC_MESSAGES/bridgedb.po b/fr/LC_MESSAGES/bridgedb.po
index 58eef87..885ddb9 100644
--- a/fr/LC_MESSAGES/bridgedb.po
+++ b/fr/LC_MESSAGES/bridgedb.po
@@ -15,15 +15,14 @@
 # mehditaileb , 2011
 # Onizuka, 2013
 # themen , 2014
-# Towinet, 2014
+# Towinet, 2014-2015
 # Yannick Heintz, 2014
 msgid ""
 msgstr ""
 "Project-Id-Version: The Tor Project\n"
-"Report-Msgid-Bugs-To: 
'https://trac.torproject.org/projects/tor/newticket?component=BridgeDB&keywords=bridgedb-reported,msgid&cc=isis,sysrqb&owner=isis'\n"
-"POT-Creation-Date: 2015-02-03 03:24+\n"
-"PO-Revision-Date: 2015-02-14 18:31+\n"
-"Last-Translator: Boubou \n"
+"Report-Msgid-Bugs-To: 
'https://trac.torproject.org/projects/tor/newticket?component=BridgeDB&keywords=bridgedb-reported,msgid&cc=isis,sysrqb&owner=isis'POT-Creation-Date:
 2015-03-19 22:13+\n"
+"PO-Revision-Date: 2015-05-04 09:14+\n"
+"Last-Translator: Towinet\n"
 "Language-Team: French 
(http://www.transifex.com/projects/p/torproject/language/fr/)\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -43,7 +42,7 @@ msgstr ""
 #. "fteproxy"
 #. "Tor"
 #. "Tor Browser"
-#: lib/bridgedb/HTTPServer.py:122
+#: lib/bridgedb/HTTPServer.py:107
 msgid "Sorry! Something went wrong with your request."
 msgstr "Désolé ! Un problème est survenu suite à votre requête."
 
@@ -214,26 +213,27 @@ msgstr "Comment démarrer l'utilisation de vos Bridges."
 #: lib/bridgedb/strings.py:121
 #, python-format
 msgid ""
-"To enter bridges into Tor Browser, follow the instructions on the %s Tor\n"
-"Browser download page %s to start Tor Browser."
-msgstr "Pour entrer des ponts dans Tor Browser, suivez les instructions sur la 
%s page de téléchargement de Tor Browser %s pour démarrer Tor Browser."
+"To enter bridges into Tor Browser, first go to the %s Tor Browser download\n"
+"page %s and then follow the instructions there for downloading and starting\n"
+"Tor Browser."
+msgstr "Pour entrer (saisir) des ponts dans le Navigateur Tor (Tor Browser), 
allez tout d'abord à la %s page de téléchargement du navigateur Tor %s puis 
suivez les instructions là-bas afin de télécharger puis démarrer le 
navigateur Tor."
 
 #. TRANSLATORS: Please DO NOT translate "Tor".
-#: lib/bridgedb/strings.py:125
+#: lib/bridgedb/strings.py:126
 msgid ""
 "When the 'Tor Network Settings' dialogue pops up, click 'Configure' and 
follow\n"
 "the wizard until it asks:"
 msgstr "Quand la boite de dialogue 'Paramètres Réseaux Tor' s'affiche, 
cliquez 'Configurer' et suivez l'assistant jusqu'à ce qu’il demande :"
 
 #. TRANSLATORS: Please DO NOT translate "Tor".
-#: lib/bridgedb/strings.py:129
+#: lib/bridgedb/strings.py:130
 msgid ""
 "Does your Internet Service Provider (ISP) block or otherwise censor 
connections\n"
 "to the Tor network?"
 msgstr "Est-ce que votre fournisseur d'accès à Internet (FAI) bloquent ou 
censurent les connexions vers le réseau Tor ?"
 
 #. TRANSLATORS: Please DO NOT translate "Tor".
-#: lib/bridgedb/strings.py:133
+#: lib/bridgedb/strings.py:134
 msgid ""
 "Select 'Yes' and then click 'Next'. To configure your new bridges, copy and\n"
 "paste the bridge lines into the text input box. Finally, click 'Connect', 
and\n"
@@ -241,29 +241,29 @@ msgid ""
 "button in the 'Tor Network Settings' wizard for further assistance."
 msgstr "Sélectionnez 'Oui' et ensuite cliquez 'Suivant'. Pour configurer vos 
nouvelles bridges, copiez et collez les lignes bridge dans la prochaine case de 
saisie de texte. Enfin, cliquez 'Connexion', et tout devrait marcher ! Si vous 
avez des difficultés, essayez le bouton 'Aide' dans 'Paramètres Réseaux Tor' 
pour plus d’assistance."
 
-#: lib/bridgedb/strings.py:141
+#: lib/bridgedb/strings.py:142
 msgid "Displays this message."
 msgstr "Afficher ce message."
 
 #. TRANSLATORS: Please try to make it clear that "vanilla" here refers to the
 #. same non-Pluggable Transport bridges described above as being
 #. "plain-ol'-vanilla" bridges.
-#: lib/bridgedb/strings.py:145
+#: lib/bridgedb/strings.py:146
 msgid "Request vanilla bridges."
 msgstr "Demander les bridges vanilles."
 
-#: lib/bridgedb/strings.py:146
+#: lib/bridgedb/strings.py:147
 msgid "Request IPv6 bridges."
 msgstr "Demander IPv6 bridges."
 
 #. TRANSLATORS: Please DO NOT translate the word the word "TYPE".
-#: lib/bridgedb/strings.py:148
+#: lib/bridgedb/strings.py:149
 msgid "Request a Pluggable Transport by TYPE."
 msgstr "Demander un Pluggable Transport par TYPE."
 
 #. TRANSLATORS: Please DO NOT translate "BridgeDB".
 #. TRANSLATORS: Please DO NOT translate "GnuPG".
-#: lib/bridgedb/strings.py:151
+#: lib/bridgedb/strings.py:152
 msgid "Get a copy of BridgeDB's public Gnu

[tor-commits] [translation/tor_animation] Update translations for tor_animation

2015-05-04 Thread translation
commit 232dba3f1e6532baecaf3e8f3cb80e7d1a5505df
Author: Translation commit bot 
Date:   Mon May 4 08:45:54 2015 +

Update translations for tor_animation
---
 da.srt |   22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/da.srt b/da.srt
index 12314c2..ca7ccfa 100644
--- a/da.srt
+++ b/da.srt
@@ -55,32 +55,32 @@ Men ikke hvis du bruger Tor!
 
 13
 00:00:37,140 --> 00:00:40,840
-Tor Browser protects our privacy
-and identity on the Internet.
+Tor Browser beskytter vores privatliv
+og vores identitet på Internettet.
 
 14
 00:00:41,560 --> 00:00:44,760
-Tor secures your connection
-with three layers of encryption
+Tor sikrer din forbindelse
+med tre lags kryptering
 
 15
 00:00:44,940 --> 00:00:49,760
-and passes it through three voluntarily
-operated servers around the world,
+og fører det gennem tre frivilligt
+opererede servere rundt omkring i verden,
 
 16
 00:00:50,280 --> 00:00:53,520
-which enables us to communicate
-anonymously over the Internet.
+hvilket gør os i stand til at kommunikere
+anonymt over Internettet.
 
 17
 00:00:56,560 --> 00:00:58,280
-Tor also protects our data
+Tor beskytter også vores data
 
 18
 00:00:58,400 --> 00:01:01,900
-against corporate or government targeted
-and mass surveillance.
+mod virksomhedernes eller regeringernes målrettede
+og masse overvågning.
 
 19
 00:01:02,880 --> 00:01:07,340

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


[tor-commits] [translation/tor_animation] Update translations for tor_animation

2015-05-04 Thread translation
commit a615e480b6c85b57a41f96dc97e3da917ff9c1c0
Author: Translation commit bot 
Date:   Mon May 4 07:15:55 2015 +

Update translations for tor_animation
---
 da.srt |   90 
 1 file changed, 45 insertions(+), 45 deletions(-)

diff --git a/da.srt b/da.srt
index 78c998d..12314c2 100644
--- a/da.srt
+++ b/da.srt
@@ -1,165 +1,165 @@
 1
 00:00:00,660 --> 00:00:02,780
-We've gotten very used to the Internet.
+Vi er blevet meget vant til Internettet.
 
 2
 00:00:03,120 --> 00:00:07,700
-We are constantly sharing information
-about ourselves and our private lives:
+Vi deler konstant vores information
+om os selv og vores privatliv:
 
 3
 00:00:08,000 --> 00:00:09,960
-food we eat, people we meet,
+mad vi spiser, folk vi møder,
 
 4
 00:00:10,180 --> 00:00:12,480
-places we go, and the stuff we read.
+steder vi besøger, og ting vi læser.
 
 5
 00:00:13,280 --> 00:00:14,640
-Let me explain it better.
+Lad mig forklare det bedre.
 
 6
 00:00:14,920 --> 00:00:17,740
-Right at this moment,
-if someone attempts to look you up,
+Lige nu,
+hvis prøver at slå dig op,
 
 7
 00:00:18,060 --> 00:00:22,480
-they'll see your real identity,
-precise location, operating system,
+vil de finde din virkelige identitet,
+præcise lokation, operativsystem,
 
 8
 00:00:22,800 --> 00:00:26,500
-all the sites you've visited,
-the browser you use to surf the web,
+alle de sider du har besøgt,
+browseren du bruger til at surfe på nettet,
 
 9
 00:00:26,700 --> 00:00:29,140
-and so much more information
-about you and your life
+og meget mere information
+om dig og dit liv
 
 10
-00:00:29,620 --> 00:00:32,460
-which you probably didn't mean
-to share with unknown strangers,
+00:00:29,200 --> 00:00:31,500
+hvilket du sikkert ikke mente
+at dele med tilfældige fremmede,
 
 11
-00:00:32,920 --> 00:00:35,840
-who could easily use this data
-to exploit you.
+00:00:31,700 --> 00:00:34,000
+der nemt kunne bruge dette data
+til at udnytte dig.
 
 12
-00:00:36,220 --> 00:00:38,120
-But not if you're using Tor!
+00:00:34,500 --> 00:00:37,000
+Men ikke hvis du bruger Tor!
 
 13
-00:00:39,140 --> 00:00:42,840
+00:00:37,140 --> 00:00:40,840
 Tor Browser protects our privacy
 and identity on the Internet.
 
 14
-00:00:43,560 --> 00:00:46,760
+00:00:41,560 --> 00:00:44,760
 Tor secures your connection
 with three layers of encryption
 
 15
-00:00:46,940 --> 00:00:51,760
+00:00:44,940 --> 00:00:49,760
 and passes it through three voluntarily
 operated servers around the world,
 
 16
-00:00:52,280 --> 00:00:55,520
+00:00:50,280 --> 00:00:53,520
 which enables us to communicate
 anonymously over the Internet.
 
 17
-00:00:58,560 --> 00:01:00,280
+00:00:56,560 --> 00:00:58,280
 Tor also protects our data
 
 18
-00:01:00,400 --> 00:01:03,900
+00:00:58,400 --> 00:01:01,900
 against corporate or government targeted
 and mass surveillance.
 
 19
-00:01:04,880 --> 00:01:09,340
+00:01:02,880 --> 00:01:07,340
 Perhaps you live in a repressive country
 which tries to control and surveil the Internet.
 
 20
-00:01:09,900 --> 00:01:13,800
+00:01:07,900 --> 00:01:11,800
 Or perhaps you don't want big corporations
 taking advantage of your personal information.
 
 21
-00:01:14,880 --> 00:01:17,640
+00:01:12,880 --> 00:01:15,640
 Tor makes all of its users
 to look the same
 
 22
-00:01:17,920 --> 00:01:20,800
+00:01:15,920 --> 00:01:18,800
 which confuses the observer
 and makes you anonymous.
 
 23
-00:01:21,500 --> 00:01:24,980
+00:01:19,500 --> 00:01:22,980
 So, the more people use the Tor network,
 the stronger it gets
 
 24
-00:01:25,140 --> 00:01:29,800
+00:01:23,140 --> 00:01:27,800
 as it's easier to hide in a crowd
 of people who look exactly the same.
 
 25
-00:01:30,700 --> 00:01:33,240
+00:01:28,700 --> 00:01:31,240
 You can bypass the censorship
 without being worried about
 
 26
-00:01:33,400 --> 00:01:36,100
+00:01:31,400 --> 00:01:34,100
 the censor knowing what you do
 on the Internet.
 
 27
-00:01:38,540 --> 00:01:41,440
+00:01:36,540 --> 00:01:39,440
 The ads won't follow you
 everywhere for months,
 
 28
-00:01:41,640 --> 00:01:43,300
+00:01:39,640 --> 00:01:41,300
 starting when you first
 clicked on a product.
 
 29
-00:01:45,880 --> 00:01:49,380
+00:01:43,880 --> 00:01:47,380
 By using Tor, the sites you visit
 won't even know who you are,
 
 30
-00:01:49,540 --> 00:01:51,760
+00:01:47,540 --> 00:01:49,760
 from what part of the world
 you're visiting them,
 
 31
-00:01:51,920 --> 00:01:53,920
+00:01:49,920 --> 00:01:51,920
 unless you login and tell them so.
 
 32
-00:01:56,200 --> 00:01:57,840
+00:01:54,200 --> 00:01:55,840
 By downloading and using Tor,
 
 33
-00:01:58,200 --> 00:02:00,560
+00:01:56,200 --> 00:01:58,560
 you can protect the people
 who need anonymity,
 
 34
-00:02:00,880 --> 00:02:03,640
+00:01:58,880 --> 00:02:01,640
 like activists, journalists and bloggers.
 
 35
-00:02:04,000 --> 00:02:09,000
+00:02:02,000 --> 00:02:07,000
 Download and use Tor! O