[tor-bugs] #1922 [Tor]: torrc.d-style configuration directories

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Aug 27 15:26:44 UTC 2013


#1922: torrc.d-style configuration directories
-----------------------------+------------------------------
     Reporter:  aa138346     |      Owner:
         Type:  enhancement  |     Status:  new
     Priority:  normal       |  Milestone:  Tor: unspecified
    Component:  Tor          |    Version:
   Resolution:               |   Keywords:  tor-client
Actual Points:               |  Parent ID:
       Points:               |
-----------------------------+------------------------------

Comment (by proper):

 I am copying in here, what Nick said at the duplicate of this one (#8291)
 and what I answered.

 Replying to
 [https://trac.torproject.org/projects/tor/ticket/8291?cnum_edit=4#comment:2
 comment:2 nickm]:
 > Some quick thoughts:
 >    * Changing the *default* search path for torrc is probably not a
 great idea; it would break anybody who is using the current default
 location.

 Changing from /etc/tor/torrc to /etc/torrc was indeed no good idea. Sorry
 for suggesting it.

 Replying to
 [https://trac.torproject.org/projects/tor/ticket/8291?cnum_edit=4#comment:2
 comment:2 nickm]:
 >    * Having a tor.d directory is an okay idea. You'll need a fairly
 rigorous definition of what order the files in it are read, and how they
 interact with torrc and the defaults_torrc (if any).  (Make sure you
 understand how the defaults-torrc logic works here before designing
 anything; make sure it can be reused.)

 I think this way would be good:

 defaults_torrc gets overruled by /etc/tor/torrc gets overruled by
 /etc/tor.d/10_something gets overruled by /etc/tor.d/20_somethingelse.

 The same in other words:

 defaults_torrc: lowest priority
 /etc/tor/torrc: normal priority
 /etc/tor/tor.d: highest priority

 Sourcing /etc/tor.d/ in lexical order, i.e. first source
 /etc/tor.d/10_something, then source /etc/tor.d/20_somethingelse. If
 /etc/tor.d/10_something contains "CookieAuthentication 0" and
 /etc/tor.d/20_somethingelse contains "CookieAuthentication 1", then
 "CookieAuthentication 1" will win.

 This is the way it usually works on Linux for folders such as
 /etc/profile.d, and the run-parts(8) tool works the same way.

 Replying to
 [https://trac.torproject.org/projects/tor/ticket/8291?cnum_edit=4#comment:2
 comment:2 nickm]:
 > * SAVECONF will need to treat definitions in /etc/tor.d as defaults, so
 that when it replaces torrc, it doesn't copy all of tor.d into torrc.

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


More information about the tor-bugs mailing list