# $Id: OpenFT.conf.template,v 1.12 2004/09/03 01:06:12 hexwab Exp $
###############################################################################

###############################################################################
# MAIN

[main]

#
# Node classification.  This value is very important and will determine your
# potential role on the network.  The following settings are allowed:
#
# 1  (USER)
#
#  Basic class that all nodes implicitly belong to.  This node will maintain
#  very few TCP connections on the network and perform almost no tasks other
#  than to upload to other users.  Users who do not have direct Internet
#  connections will be forced into this class.
#
# 3  (SEARCH)
#
#  Responsible for manging indexes of a large group of directly connected
#  children (run-time modifier for the USER class), responding to and
#  forwarding search requests from peers, as well as directing push requests
#  so that indirectly connected users may still share files.
#
#  Please note that this class will require a much greater amount of both
#  local and network resources.  If you select this, pay very close attention
#  to the database environment settings several configuration options down.
#  For reference, there are several fully functioning search nodes on
#  "average" broadband connections, such as 768/128kbit (my node *sigh*).
#
#  Keeping your node up-to-date is absolutely essential for this node class.
#  Please check for regular updates and be sure that you are always running
#  the latest version.
#
# 5  (INDEX)
#
#  Meta node used in favor of user nodes when attempting new connections to
#  the network.  This node class is also responsible for managing statistics
#  information for the virtual clusters created by SEARCH nodes.  Reliability
#  is the largest requirement here.
#
# If you're unsure it is highly recommended that you select 1 (the default).
# A setting of 7 will select both a SEARCH and INDEX node.
#
class = 1

#
# Core listening port.  OpenFT uses a compacted binary protocol for the core
# communication with other nodes.  If this machine is unable to provide both
# port and http_port to the outside directly (blocked by either by a firewall
# or a NAT setup) you should select 0 here.
#
# NOTE:
#  If you are unable to route this port (along with the HTTP port) you will be
#  unable to download from other users with that same inability.  You will,
#  however, maintain the ability to upload to other non-firewalled users.
#  Selecting non-zero when the port is not available to the outside will cause
#  very broken behaviour, namely search results will be extremely unreliable.
#
# Default: random (1215, 2215)
#
port = 1816

#
# HTTP server port.  OpenFT's implementation also makes use of HTTP for all
# file transfers.  See above for more details.  Please provide a valid port
# here regardless of your firewall state.
#
# Default: random (2216, 3216)
#
http_port = 2452

#
# Arbitrary name you'd like to associate with your node.  This field is
# optional and it is NOT to be trusted.  The name is not unique to the
# network.  Please do not choose useless aliases.
#
alias = 

###############################################################################
# SEARCH NODE SETTINGS

[connections]

#
# Maximum number of "active" nodes that are allowed connection at any given
# time.  The default value (-1) is used to calculate a suitable value for
# most search nodes based on their current max child configuration and other
# parameters.  If you wish to take on additional connections, please note
# that you must set your maximum file descriptor limit accordingly (provided
# that the internal setrlimit() call is unable to sufficiently increase your
# current limits).  Consult your shell's manual regarding ulimits for more
# details.
#
max_active = -1

###############################################################################
# SEARCH NODE SETTINGS

[search]

#
# Boolean setting determining whether or not to print token search queries
# through the main logging facility.  This can become quite noisy and may
# inflate the size of the log file enormously.
#
noisy = 0

# Maximum number of "child" nodes you are able to support.  If you
# feel that you have adequate processing power and memory, you may
# increase this value until the load is no longer acceptable.  Please
# be sure to read the max_active and env_cache settings in this section
# before you change the default value.  
#
children = 150

# Absolute path where the search database environment should be
# stored.  Make sure to provide a path with plenty of disk space
# (~100-300MB) and on a device with fast access time.  If your OS
# supports a swap-backed RAM disk (e.g. tmpfs on Linux), this would be
# an ideal use for it.
#
# NOTE: As always, this path is in UNIX format, so Windows users will
# need to hack around this accordingly.  If you aren't sure what I
# mean by this, you need to go back and read giftd.conf documentation.
#
env_path = ~/.giFT/OpenFT/db

# Total cache size for the entire search database environment.  Units
# are specified in bytes, and as such you will not be allowed to
# specify 1GB or higher.  Specifications less than 500MB (and we
# expect you will specify less than that) are subject to a 20%
# inflation due to some libdb implementation detail.
#
# Cache size depends mostly on the maximum number of children: the
# table below contains some sane defaults as a rough guide (assuming
# an average of 250 files shared per child).  Note that the files you
# are sharing are also stored in the db, so if you're sharing
# significantly more than 250 files you may need to take this into
# account.  Memory usage is the approximate increase over the usage of
# a USER node.
#
#  Cache size   Memory usage    Children    Files
# =================================================
#   23592960         30Mb           80      20000
#   31457280         40Mb          120      30000
#   41943040         50Mb          160      40000
#   52428800         60Mb          200      50000
#   62914560         75Mb          240      60000
#   78643200         90Mb          360      90000
#
# Setting cache size too high has no adverse effects other than
# excessive memory usage.  Setting cache size too low will result in a
# lot of disk usage (with a resultant drop in performance).  While not
# a perfectly reliable indicator, if the size (actual disk usage - it's
# sparse) of tokens.index in the db environment (see above) is larger
# than the cache size, the cache size is probably set too low.
#
# Also bear in mind that the daemon itself should never need to be
# swapped out; OS-level swapping will render giFT almost unusable.
# 
env_cache = 31457280

###############################################################################
# LAN MODE FACILITIES

[local]

#
# OpenFT offers a special configuration for users who wish to operate a
# network from within a local area network (LAN).  This mode causes giFT to
# reject authorization from any non-local address as well as advertising it's
# presence via the local UDP broadcast.  If this switch is non-zero you will
# not be able to contact the main network.
#
lan_mode = 0

#
# When LAN mode is enabled, this configuration switch is used to verify
# which hosts are allowed connection to the core OpenFT port.  It is
# highly recommended that you just don't touch this, regardless of what
# lan_mode's value is.
#
# NOTE:
#  This switch provides a very crude loophole that could allow you to create
#  a "private" OpenFT network between a list of known nodes.  Using this
#  "feature" is going to be quite cumbersome as it is intended to be used
#  by developers only.  You have been warned.
#
hosts_allow = LOCAL
