Browse Source

A new config file option to connect to tcp and udp at once has been added. Also some clarifications have been put into the sample config file.

master
Dirk Engling 12 years ago
parent
commit
a564fd4b0c
2 changed files with 33 additions and 26 deletions
  1. +7
    -2
      opentracker.c
  2. +26
    -24
      opentracker.conf.sample

+ 7
- 2
opentracker.c View File

@ -2,7 +2,7 @@
It is considered beerware. Prost. Skol. Cheers or whatever.
Some of the stuff below is stolen from Fefes example libowfat httpd.
$Id: opentracker.c,v 1.196 2008/10/06 03:42:51 erdgeist Exp $ */
$Id: opentracker.c,v 1.197 2008/10/06 11:42:03 erdgeist Exp $ */
/* System */
#include <string.h>
@ -312,6 +312,11 @@ int parse_configfile( char * config_filename ) {
/* Scan for commands */
if(!byte_diff(p,15,"tracker.rootdir" ) && isspace(p[15])) {
set_config_option( &g_serverdir, p+16 );
} else if(!byte_diff(p,14,"listen.tcp_udp" ) && isspace(p[14])) {
uint16_t tmpport = 6969;
if( !scan_ip4_port( p+15, tmpip, &tmpport )) goto parse_error;
ot_try_bind( tmpip, tmpport, FLAG_TCP ); ++bound;
ot_try_bind( tmpip, tmpport, FLAG_UDP ); ++bound;
} else if(!byte_diff(p,10,"listen.tcp" ) && isspace(p[10])) {
uint16_t tmpport = 6969;
if( !scan_ip4_port( p+11, tmpip, &tmpport )) goto parse_error;
@ -436,4 +441,4 @@ while( scanon ) {
return 0;
}
const char *g_version_opentracker_c = "$Source: /home/cvsroot/opentracker/opentracker.c,v $: $Revision: 1.196 $\n";
const char *g_version_opentracker_c = "$Source: /home/cvsroot/opentracker/opentracker.c,v $: $Revision: 1.197 $\n";

+ 26
- 24
opentracker.conf.sample View File

@ -1,29 +1,28 @@
# opentracker config file
#
# I) ip addresses for tcp connections, either bind to INADDR_ANY port 6969
# (when no shell option is present)
# I) Address opentracker will listen on, using both, tcp AND udp family
# (note, that port 6969 is implicite if ommitted).
#
# listen.tcp 0.0.0.0
# If no listen option is given (here or on the command line), opentracker
# listens on 0.0.0.0:6969 tcp and udp.
#
# or specify them one by one (shell option -i 192.168.0.1 -p 6969)
# (note, that :6969 is implicite)
# listen.tcp_udp 0.0.0.0
# listen.tcp_udp 192.168.0.1:80
# listen.tcp_udp 10.0.0.5:6969
#
# listen.tcp 192.168.0.1
# listen.tcp 192.168.0.2:6969
# listen.tcp 192.168.0.3:6969
# II) the same goes for udp connections (shell option -i 192.168.0.1 -P 6969)
# To only listen on tcp or udp family ports, list them this way:
#
# listen.tcp 0.0.0.0
# listen.udp 192.168.0.1:6969
#
# Note, that using 0.0.0.0 for udp sockets may yield surprising results.
# An answer packet sent on that socket will not necessarily have the
# source address that the requesting client may expect, but any address
# on that interface
# on that interface.
#
# III) If opentracker runs in a non-open mode, point it to files containing
# II) If opentracker runs in a non-open mode, point it to files containing
# all torrent hashes that it will serve (shell option -w)
#
# access.whitelist /path/to/whitelist
@ -33,28 +32,31 @@
# access.blacklist ./blacklist
#
# It is pointless and hence not possible to compile black AND white
# listing, so choose one of those options. File format is straight
# forward: "<hex info hash>\n<hex info hash>\n..."
# listing, so choose one of those options at compile time. File format
# is straight forward: "<hex info hash>\n<hex info hash>\n..."
#
# IV) ip address to listen for incoming and sending out outgoing live sync
# packets (shell option -i 192.168.0.1 -s 9696), port 9696 is default.
# III) Live sync uses udp multicast packets to keep a cluster of opentrackers
# synchronized. This option tells opentracker which port to listen for
# incoming live sync packets. The ip address tells opentracker, on which
# interface to join the multicast group, those packets will arrive.
# (shell option -i 192.168.0.1 -s 9696), port 9696 is default.
#
# livesync.cluster.listen 192.168.0.1:9696
#
# Note that two udp sockets will be opened. One on ip address 0.0.0.0
# port 9696, that will join the multicast group 224.23.42.1 for incoming
# port 9696, that will join the multicast group 224.0.42.23 for incoming
# udp packets and one on ip address 192.168.0.1 port 9696 for outgoing
# udp packets.
#
# As of now one and only one ip address must be given, if opentracker
# was built with the WANT_SYNC_LIVE feature
# was built with the WANT_SYNC_LIVE feature.
#
# V) Sync between trackers running in a cluster is restricted to packets
# IV) Sync between trackers running in a cluster is restricted to packets
# coming from trusted ip addresses. While source ip verification is far
# from perfect, the authors of opentracker trust in the correct
# application of tunnels, filters and LAN setups (shell option -A)
# application of tunnels, filters and LAN setups (shell option -A).
#
# livesync.cluster.node_ip 192.168.0.4
# livesync.cluster.node_ip 192.168.0.5
@ -66,13 +68,13 @@
# batchsync.cluster.admin_ip 10.1.1.1
#
# VI) Control directory where opentracker will chdir to. So all black/white
# list files may be put in that directory. (shell option -d)
# V) Control directory where opentracker will chdir to. So all black/white
# list files may be put in that directory (shell option -d).
#
# tracker.rootdir /usr/local/etc/opentracker
#
# VII) opentracker can be told to answer to a "GET / HTTP"-request with a
# redirect to another location (shell option -r)
# VI) opentracker can be told to answer to a "GET / HTTP"-request with a
# redirect to another location (shell option -r).
#
# tracker.redirect_url https://your.tracker.local/

Loading…
Cancel
Save