[tor-commits] [arm/master] Wizard option for relaying over low ports

atagar at torproject.org atagar at torproject.org
Mon Jul 4 15:40:32 UTC 2011


commit ca124f16b2eee34624f61a54a763562019fc8aa8
Author: Damian Johnson <atagar at torproject.org>
Date:   Sun Jul 3 20:06:26 2011 -0700

    Wizard option for relaying over low ports
    
    Option to use port 443 for relaying and 80 for directory mirroring rather than
    the more conventional 9001/9030. This will make a 'tor-arm' user if it doesn't
    already exist and use that for the torrc User entry.
---
 src/cli/wizard.py |   15 +++++++++++----
 src/settings.cfg  |    4 ++++
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/cli/wizard.py b/src/cli/wizard.py
index 80d2fd1..8239487 100644
--- a/src/cli/wizard.py
+++ b/src/cli/wizard.py
@@ -9,19 +9,20 @@ import curses
 import cli.popups
 import cli.controller
 
-from util import enum, connections, uiTools
+from util import connections, enum, uiTools
 
 # basic configuration types we can run as
 RelayType = enum.Enum("RELAY", "EXIT", "BRIDGE", "CLIENT")
 
 # all options that can be configured
-Options = enum.Enum("DIVIDER", "NICKNAME", "CONTACT", "NOTIFY", "BANDWIDTH", "LIMIT", "CLIENT", "PORTFORWARD", "STARTUP", "NOTICE", "POLICY", "WEBSITES", "EMAIL", "IM", "MISC", "PLAINTEXT", "DISTRIBUTE", "BRIDGED", "BRIDGE1", "BRIDGE2", "BRIDGE3", "REUSE")
+Options = enum.Enum("DIVIDER", "NICKNAME", "CONTACT", "NOTIFY", "BANDWIDTH", "LIMIT", "CLIENT", "LOWPORTS", "PORTFORWARD", "STARTUP", "NOTICE", "POLICY", "WEBSITES", "EMAIL", "IM", "MISC", "PLAINTEXT", "DISTRIBUTE", "BRIDGED", "BRIDGE1", "BRIDGE2", "BRIDGE3", "REUSE")
 RelayOptions = {RelayType.RELAY:   (Options.NICKNAME,
                                     Options.CONTACT,
                                     Options.NOTIFY,
                                     Options.BANDWIDTH,
                                     Options.LIMIT,
                                     Options.CLIENT,
+                                    Options.LOWPORTS,
                                     Options.PORTFORWARD,
                                     Options.STARTUP),
                 RelayType.EXIT:    (Options.NICKNAME,
@@ -30,6 +31,7 @@ RelayOptions = {RelayType.RELAY:   (Options.NICKNAME,
                                     Options.BANDWIDTH,
                                     Options.LIMIT,
                                     Options.CLIENT,
+                                    Options.LOWPORTS,
                                     Options.PORTFORWARD,
                                     Options.STARTUP,
                                     Options.DIVIDER,
@@ -44,9 +46,9 @@ RelayOptions = {RelayType.RELAY:   (Options.NICKNAME,
                                     Options.BANDWIDTH,
                                     Options.LIMIT,
                                     Options.CLIENT,
+                                    Options.LOWPORTS,
                                     Options.PORTFORWARD,
-                                    Options.STARTUP
-                                   ),
+                                    Options.STARTUP),
                 RelayType.CLIENT:  (Options.BRIDGED,
                                     Options.BRIDGE1,
                                     Options.BRIDGE2,
@@ -218,6 +220,11 @@ def showWizard():
   config[Options.REUSE].setValidator(_circDurationValidator)
   
   # enables custom policies when 'custom' is selected and disables otherwise
+  lowPortsOpt = config[Options.LOWPORTS]
+  disclaimerNotice = [config[Options.NOTICE]]
+  lowPortsOpt.setValidator(functools.partial(_toggleEnabledAction, disclaimerNotice))
+  _toggleEnabledAction(disclaimerNotice, lowPortsOpt, lowPortsOpt.getValue())
+  
   policyOpt = config[Options.POLICY]
   customPolicies = [config[opt] for opt in CUSTOM_POLICIES]
   policyOpt.setValidator(functools.partial(_toggleEnabledAction, customPolicies))
diff --git a/src/settings.cfg b/src/settings.cfg
index 7f2953f..53da315 100644
--- a/src/settings.cfg
+++ b/src/settings.cfg
@@ -349,6 +349,7 @@ wizard.message.client This will make use of the Tor network without contributing
 
 wizard.toggle Notify => Yes, No
 wizard.toggle Client => Enabled, Disabled
+wizard.toggle Lowports => Yes, No
 wizard.toggle Portforward => Enabled, Disabled
 wizard.toggle Startup => Yes, No
 wizard.toggle Notice => Yes, No
@@ -374,6 +375,7 @@ wizard.default Notify => true
 wizard.default Bandwidth => 5 MB/s
 wizard.default Startup => true
 wizard.default Client => false
+wizard.default Lowports => true
 wizard.default Portforward => true
 wizard.default Notice => true
 wizard.default Policy => false
@@ -404,6 +406,7 @@ wizard.label.opt Notify => Issue Notification
 wizard.label.opt Bandwidth => Relay Speed
 wizard.label.opt Limit => Monthly Limit
 wizard.label.opt Client => Client Usage
+wizard.label.opt Lowports => Low Relaying Ports
 wizard.label.opt Portforward => Port Forwarding
 wizard.label.opt Startup => Run At Startup
 wizard.label.opt Notice => Disclaimer Notice
@@ -431,6 +434,7 @@ wizard.description.opt Notify => Sends automated email notifications to the abov
 wizard.description.opt Bandwidth => Limit for the average rate at which you relay traffic.
 wizard.description.opt Limit => Maximum amount of traffic to relay each month. Some ISPs, like Comcast, cap their customer's Internet usage so this is an easy way of staying below that limit.
 wizard.description.opt Client => Enable this if you would like to use Tor yourself. This opens or closes the SOCKS port used by applications for connecting to Tor.
+wizard.description.opt Lowports => Relays using port 443 rather than 9001. This helps some users that would otherwise be blocked, but requires that tor is started with root permissions (after that it lowers itself to those of a 'tor-arm' user).
 wizard.description.opt Portforward => If needed, attempts NAT traversal using UPnP and NAT-PMP. This allows for automatic port forwarding on most home routers.
 wizard.description.opt Startup => Runs Tor in the background when the system starts.
 wizard.description.opt Notice => Provides a disclaimer that this is an exit on port 80 (http://www.atagar.com/exitNotice).





More information about the tor-commits mailing list