[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r23741: {arm} Hiding private controller options by default. (in arm/trunk: . src/interface)



Author: atagar
Date: 2010-11-03 16:39:29 +0000 (Wed, 03 Nov 2010)
New Revision: 23741

Modified:
   arm/trunk/armrc.sample
   arm/trunk/src/interface/configStatePanel.py
Log:
Hiding private controller options by default.



Modified: arm/trunk/armrc.sample
===================================================================
--- arm/trunk/armrc.sample	2010-11-03 16:27:12 UTC (rev 23740)
+++ arm/trunk/armrc.sample	2010-11-03 16:39:29 UTC (rev 23741)
@@ -64,12 +64,16 @@
 #   displays scrollbars when the torrc content is longer than the display
 # maxLinesPerEntry
 #   max number of lines to display for a single entry in the torrc
+# showPrivateOptions
+#   tor provides config options of the form "__<option>" that can be dangerous
+#   to set, if true arm provides these on the config panel
 
 features.config.type 0
 features.config.state.colWidth.option 25
 features.config.state.colWidth.value 15
 features.config.file.showScrollbars true
 features.config.file.maxLinesPerEntry 8
+features.config.showPrivateOptions false
 
 # 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

Modified: arm/trunk/src/interface/configStatePanel.py
===================================================================
--- arm/trunk/src/interface/configStatePanel.py	2010-11-03 16:27:12 UTC (rev 23740)
+++ arm/trunk/src/interface/configStatePanel.py	2010-11-03 16:39:29 UTC (rev 23741)
@@ -8,7 +8,8 @@
 
 from util import conf, panel, torTools, torConfig, uiTools
 
-DEFAULT_CONFIG = {"features.config.state.colWidth.option": 25,
+DEFAULT_CONFIG = {"features.config.showPrivateOptions": False,
+                  "features.config.state.colWidth.option": 25,
                   "features.config.state.colWidth.value": 15}
 
 TOR_STATE, ARM_STATE = range(1, 3) # state to be presented
@@ -125,6 +126,10 @@
         line = configOptionQuery[lineNum]
         confOption, confType = line.strip().split(" ", 1)
         
+        # skips private entires if not set to show them
+        if not self._config["features.config.showPrivateOptions"] and confOption.startswith("__"):
+          continue
+        
         cat, arg, desc = None, "", ""
         descriptionComp = torConfig.getConfigDescription(confOption)
         if descriptionComp: cat, arg, desc = descriptionComp