[tor-bugs] #8108 [Tor]: Implement IncludeFile (or similar) directive in torrc

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Jan 30 17:31:52 UTC 2013


#8108: Implement IncludeFile (or similar) directive in torrc
-------------------------+--------------------------------------------------
 Reporter:  mr-4         |          Owner:                    
     Type:  enhancement  |         Status:  new               
 Priority:  normal       |      Milestone:                    
Component:  Tor          |        Version:  Tor: 0.2.4.9-alpha
 Keywords:               |         Parent:                    
   Points:               |   Actualpoints:                    
-------------------------+--------------------------------------------------
 Use case: I have multiple torrcX configurations (X=1,2...) and instead of
 duplicating quite a few torrc options in all those files, it would be
 better if I could have IncludeFile (or similar) directive to ask tor to
 parse the extra file and include the options listed there at the point
 where they are specified. For example:

 torrc1 (present day)
 ====================
 SocksPolicy accept 127.0.0.1:*
 SocksPolicy accept 127.0.0.28:*
 [...]
 SocksPort 9050
 SocksListenAddress 127.0.0.1:9050
 SocksPolicy accept 10.0.1.0/24:*
 SocksPolicy accept 10.0.2.0/24:*
 SocksPolicy accept 10.0.3.0/24:*
 SocksPolicy accept 10.0.4.0/24:*
 SocksPolicy reject *:*
 ReachableAddresses *:9001, *:9090-9091
 ExcludeNodes <large_list>
 [...]

 torrc2 (present day)
 ====================
 [...]
 SocksPort 9050
 SocksListenAddress 127.0.0.1:9050
 SocksPolicy accept 10.0.1.0/24:*
 SocksPolicy accept 10.0.2.0/24:*
 SocksPolicy accept 10.0.3.0/24:*
 SocksPolicy accept 10.0.4.0/24:*
 SocksPolicy reject *:*
 ReachableAddresses *:9001, *:9090-9091
 ExcludeNodes <large_list>
 [...]

 Note that the majority of Socks* options, as well as ReachableAddresses
 and ExcludeNodes are duplicated in both files. If I had the opportunity to
 use IncludeFile option, then I could do something like:

 torrc.inc
 =========
 SocksPort 9050
 SocksListenAddress 127.0.0.1:9050
 SocksPolicy accept 10.0.1.0/24:*
 SocksPolicy accept 10.0.2.0/24:*
 SocksPolicy accept 10.0.3.0/24:*
 SocksPolicy accept 10.0.4.0/24:*
 SocksPolicy reject *:*
 ReachableAddresses *:9001, *:9090-9091
 ExcludeNodes <large_list>

 torrc1
 ======
 SocksPolicy accept 127.0.0.1:*
 SocksPolicy accept 127.0.0.28:*
 [...]
 IncludeFile torrc.inc
 [...]

 torrc2
 ======
 [...]
 IncludeFile torrc.inc
 [...]

 In this case, if I need to change one of the "common" options all I have
 to do is change the torrc.inc file and not trash all my torrcX files and
 change each and every option in them.

 That is particularly painful if I have to maintain a list of my
 ExcludeNodes for example.

 Another useful "technique" in which the IncludeFile directive will be very
 handy is if some/all of the options listed in torrc.inc are auto-generated
 (building ExcludeNodes statement from parsing an updated version of a
 geoip database for example) - that way I don't even need to lift my finger
 and go through all my torrcX files and update those options and will just
 run the appropriate (shell) script to build torrc.inc and that will be
 that.

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/8108>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list