[tor-commits] [nyx/master] Validation for missing torrc entries no longer used

atagar at torproject.org atagar at torproject.org
Sun Feb 14 02:55:49 UTC 2016


commit 2c0461af5690b17b47e59dc356415e63a8b3c0a0
Author: Damian Johnson <atagar at torproject.org>
Date:   Sat Feb 6 12:36:19 2016 -0800

    Validation for missing torrc entries no longer used
    
    Now that we no longer log torrc validation issues checking for missing options
    is moot.
---
 nyx/util/tor_config.py | 22 +---------------------
 nyxrc.sample           | 15 ---------------
 2 files changed, 1 insertion(+), 36 deletions(-)

diff --git a/nyx/util/tor_config.py b/nyx/util/tor_config.py
index 3ffb435..fd610f7 100644
--- a/nyx/util/tor_config.py
+++ b/nyx/util/tor_config.py
@@ -7,7 +7,6 @@ from nyx.util import tor_controller
 from stem.util import conf, enum, str_tools, system
 
 CONFIG = conf.config_dict('nyx', {
-  'features.torrc.validate': True,
   'torrc.alias': {},
   'torrc.units.size.b': [],
   'torrc.units.size.kb': [],
@@ -19,9 +18,6 @@ CONFIG = conf.config_dict('nyx', {
   'torrc.units.time.hour': [],
   'torrc.units.time.day': [],
   'torrc.units.time.week': [],
-  'startup.data_directory': '~/.nyx',
-  'features.config.descriptions.enabled': True,
-  'features.config.descriptions.persist': True,
   'tor.chroot': '',
 })
 
@@ -45,10 +41,9 @@ TIME_MULT = {'sec': 1, 'min': 60, 'hour': 3600, 'day': 86400, 'week': 604800}
 # enums for issues found during torrc validation:
 # DUPLICATE  - entry is ignored due to being a duplicate
 # MISMATCH   - the value doesn't match tor's current state
-# MISSING    - value differs from its default but is missing from the torrc
 # IS_DEFAULT - the configuration option matches tor's default
 
-ValidationError = enum.Enum('DUPLICATE', 'MISMATCH', 'MISSING', 'IS_DEFAULT')
+ValidationError = enum.Enum('DUPLICATE', 'MISMATCH', 'IS_DEFAULT')
 
 MULTILINE_PARAM = None  # cached multiline parameters (lazily loaded)
 
@@ -237,21 +232,6 @@ def validate(contents = None):
 
         issues_found.append((line_number, ValidationError.MISMATCH, ', '.join(display_values)))
 
-  # checks if any custom options are missing from the torrc
-
-  for option in custom_options:
-    # In new versions the 'DirReqStatistics' option is true by default and
-    # disabled on startup if geoip lookups are unavailable. If this option is
-    # missing then that's most likely the reason.
-    #
-    # https://trac.torproject.org/projects/tor/ticket/4237
-
-    if option == 'DirReqStatistics':
-      continue
-
-    if option not in seen_options:
-      issues_found.append((None, ValidationError.MISSING, option))
-
   return issues_found
 
 
diff --git a/nyxrc.sample b/nyxrc.sample
index 64eb7a3..186df2b 100644
--- a/nyxrc.sample
+++ b/nyxrc.sample
@@ -33,9 +33,6 @@ features.colorOverride none
 # Includes unicode characters in the interface.
 features.printUnicode true
 
-# Checks the torrc for issues, warning and hilighting problems if true
-features.torrc.validate true
-
 # Set this if you're running in a chroot jail or other environment where tor's
 # resources (log, state, etc) should have a prefix in their paths.
 
@@ -112,18 +109,6 @@ features.config.state.showPrivateOptions false
 features.config.state.showVirtualOptions false
 features.config.file.maxLinesPerEntry 8
 
-# Descriptions for tor's configuration options can be loaded from its man page
-# to give usage information on the settings page. They can also be persisted to
-# a file to speed future lookups.
-# ---------------------------
-# enabled
-#   allows the descriptions to be fetched from the man page if true
-# persist
-#   caches the descriptions (substantially saving on future startup times)
-
-features.config.descriptions.enabled true
-features.config.descriptions.persist true
-
 # General graph parameters
 # ------------------------
 # height





More information about the tor-commits mailing list