aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSteven Hazel <sah@freehaven.net>2003-10-15 07:19:38 +0000
committerSteven Hazel <sah@freehaven.net>2003-10-15 07:19:38 +0000
commita54a65dfb68b41bf86c5d3e72f33beb6773c6983 (patch)
tree722f7717e186ce2d17b5d05b817e62239b3916b5 /src
parent0149c4ed555db821e9331f1925fae46638a30f46 (diff)
downloadtor-a54a65dfb68b41bf86c5d3e72f33beb6773c6983.tar.gz
tor-a54a65dfb68b41bf86c5d3e72f33beb6773c6983.zip
- cause configure to create a tor.sh which will have directories set
correctly based on how configure was run - cause tor to guess the location of torrc more intelligently - cause cause src/config/torrc and src/conf/sample-server-torrc to be generated with contents that are correct for the way configure was run - cause "make install" to put torrc, sample-server-torrc, and dirservers somewhere intelligent svn:r587
Diffstat (limited to 'src')
-rw-r--r--src/config/Makefile.am4
-rw-r--r--src/config/sample-server-torrc.in20
-rw-r--r--src/config/torrc.in12
-rw-r--r--src/or/config.c4
4 files changed, 37 insertions, 3 deletions
diff --git a/src/config/Makefile.am b/src/config/Makefile.am
index a4401b369b..8ff9132e7d 100644
--- a/src/config/Makefile.am
+++ b/src/config/Makefile.am
@@ -1,3 +1,5 @@
+confdir = $(sysconfdir)/tor
-EXTRA_DIST = dirservers oprc sample-orrc
+EXTRA_DIST = dirservers
+conf_DATA = dirservers torrc sample-server-torrc
diff --git a/src/config/sample-server-torrc.in b/src/config/sample-server-torrc.in
new file mode 100644
index 0000000000..d0005fd81f
--- /dev/null
+++ b/src/config/sample-server-torrc.in
@@ -0,0 +1,20 @@
+# Configuration file for a typical tor node
+
+# The directory for keeping all the config/data for this node
+DataDirectory @LOCALSTATEDIR@/lib/tor
+# A unique handle for this node
+Nickname moria4
+
+# Ports for various services. Comment out or set to 0 if you're not
+# offering that service.
+ORPort 9004 # listening for cell-speaking connections
+APPort 9024 # listening for socks-speaking connections
+#DirPort 0
+
+# Leave this set, or we'll be treated like a client.
+OnionRouter 1
+
+# List of routers. Tor nodes only know about the directory servers
+# at the beginning, and from them they get a list of currently up nodes.
+RouterFile @CONFDIR@/dirservers
+
diff --git a/src/config/torrc.in b/src/config/torrc.in
new file mode 100644
index 0000000000..eabdabe2e6
--- /dev/null
+++ b/src/config/torrc.in
@@ -0,0 +1,12 @@
+# Configuration file for a typical tor client
+# (listen for applications only)
+
+# List of routers. Tor nodes only know about the directory servers
+# at the beginning, and from them they get a list of currently up nodes.
+RouterFile @CONFDIR@/dirservers
+
+# Ports for various services. Comment out if you're not running that
+# service.
+#ORPort 9001
+APPort 9050
+
diff --git a/src/or/config.c b/src/or/config.c
index ae14d3bff7..2402a64e9b 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -220,8 +220,8 @@ int getconfig(int argc, char **argv, or_options_t *options) {
}
if(i < argc-1) { /* we found one */
fname = argv[i+1];
- } else { /* didn't find one, try /etc/torrc */
- fname = "/etc/torrc";
+ } else { /* didn't find one, try CONFDIR */
+ fname = CONFDIR "/torrc";
}
log(LOG_DEBUG,"Opening config file '%s'",fname);