OpenNap-NG Reference Manual

Version 0.60

May 2005

Table of Contents






Introduction


Originally, Napster was a distributed file sharing service which allowed users to transfer files directly between their clients for free. A centralized server kept track of all available files and provided clients the ability to search the index of available files. In addition, instant messages (private chat) and group chat services similar to IRC were also provided.

OpenNap is a free Open Source effort to create a version of the proprietary Napster server. We want to express our thanx here to drscholl, who made an excellent job of programming.

OpenNap-NG is the new generation of Opennap, after drscholl had ceased to develop any further. Many new features and bugfixes have been included.

Opennap NG 0.60 is the latest development efforts from spring 2005 to keep the spirit alive.

Note that Opennap NG 0.60 is not a direct successor of previous versions 0.47 and 0.47.2! It's another branch from 0.46 instead, including lot more bug fixes and feature extensions than the 0.47.2 branch. New features marked as "since 0.47H" are not contained in 0.47.2!

We would gladly welcome everyone who also has got new ideas and wants to participate in this project. We also want to announce that we want to merge this fork of opennap with drscholls as soon as he reappears. The main goal is a common codebase. The most current version of this document can be obtained here.





Features:






System requirements


General:   A computer with reasonable amount of RAM (see below) and an internet connection. Machine availability, including internet connection, of 24h / day is preferred but not required. A flatrate connection to the internet with unlimited (or inexpensive) data transfer volume is recommended.

Operating systems:       Precompiled binary versions are available for Linux x86 and Windows. Versions for many other Unices can be created by compiling the sources yourself. We learned that Opennap NG 0.49 compiles and probably also runs fine on FreeBSD and Solaris, however we currently can neither confirm that nor support it directly. Recommended minimum Linux kernel version is 2.2. Linux 2.4 or later is required if a server is to serve more than 1000 users. Windows NT, 2K or XP (any editions) should be used for stable server operation. Windows 95, 98 and ME are known not to support server operations very well at all.

CPU:   CPU speed is important when it comes to serve file searches and transfer requests for a large number of users. For a standard filesharing Opennap NG server the rule of thumb for x86-compatible CPUs is that every 500 MHz allow you to serve 1000 users. That is, if you have a 2 GHz machine, you should be able (in theory) to serve 4000 users without noteworthy lag on one machine. For chatting only servers, with filesharing disabled, the requirements are believed to be 100 MHz or less per 1000 users.

RAM:   Offering filesharing services with Opennap NG is fairly RAM-consumptive. The rule of thumb is that on Linux systems 1000 files take 300 to 350 KB of RAM, while on Windows systems 1000 files take 400 to 500 KB of RAM. The difference comes from the totally different memory management concepts of those operating systems. So if you have 1 GB of RAM to spend, you should be able to handle nearly 3 million files on Linux and about 2 million files on Windows. For chat-only servers RAM demands are negligible.

Internet bandwidth:   Demands for internet bandwidth are highly variable, depending on how many users are connected, how many files are maintained, how many browse and search results per request may be returned, etc. In general, a single server with reasonable settings receives about 2 to 3 times the amount of data of what it sends. During regular operation the demands should be about 15 KB/sec. incoming and 7 KB/sec. outgoing traffic per 1000 users on a standalone server. Especially outgoing traffic can be adjusted or limited by a number of settings, such as max_results (I), max_browse_result (I), notify_exceed_frequency (I) and others. If being connected to other servers of similar capacity, traffic demands can easily be doubled or tripled, due to state and request exchanges with other servers. During initial fillup phase, shortly after a server has been started, almost all availabe bandwidth could be consumed by incoming filelists of newly connecting users. Not having enough bandwidth may just cause some lag for up to half an hour after server restart, but doesn't essentially limit your serving capacity. Opennap NG offers multiple means to throttle initial server fillup, to reduce or prevent lag.

Harddisk:   Opennap NG itself basically operates completely RAM-based. The harddisk is only used to load the server program and occasionally dump updated user and ban lists. As of 0.60, Opennap NG is capable of storing log output directly into files on harddisk, which may increase demands. With default log levels and about 500 users on a standalone server, there will be approximately 15 MB of log output produced per day. While increasing log level will increase harddisk space demands as well, decreasing them will decrease demands as well. Windows users who want to use the GUI config tool need to consider disk space requirements of GTK+ as well, which, if not already being installed, requires another 20 MB.

Additional software requirements:   Server operation: no additional software besides standard libraries is required. libz may be the least common of them, especially on some Windows installations. No X windows is required to run the Opennap NG server itself on Unix. The GUI config tool isn't required either to run the server.

Build process: Opennap NG 0.60 requires GCC >= 3.x (GNU Compiler Collection), a portable and efficient programmer's toolset available for free at http://www.gnu.org/ (for Unix) and http://www.mingw.org/ (for Windows). Other, proprietary or commercial compilers are not supported at this time. Important: don't use GCC 2.95.x or earlier. Due to bugs in those older compiler versions either unreliable binaries may be created or the sources won't compile at all. Use GCC 3.x to get most reliable binaries. No compiler is required if you just use one of the available precompiled binary packages.

GUI configuration tool: The GUI configuration tool requires the Gimp Toolkit (GTK+) 2.x. It's available for free at http://www.gtk.org/download (sources, mainly for Linux / Unix users) and http://gimp-win.sourceforge.net/old.html (binaries for Windows users). Only the GTK+ Runtime version is needed, the GTK+ Development version is not needed.

X-windows server: As a GUI application, on Unix / Linux systems the config tool obviously requires an installed X windows server system as well.






Getting Opennap NG software


The homepage and main location to obtain sourcecode and precompiled binary versions of Opennap NG in many flavours from is http://opennap-ng.sourceforge.net.

Via CVS you can also obtain various older (and possibly newer) versions. To get the newest CVS version try this: for updating only type in the Opennap NG directory





Quick start


Advice: before starting your own server you should be familiar with using client software. You should have been connecting to other existing servers and networks to gain some basic understanding about the features provided by the Napster protocol. See http://www.gotnap.com for a list of existing, free servers using the Napster protocol.

After installation of the binary files, before first server start:
  1. Set up opennap-config.txt!
    It's mandatory you adjust at least some variables in the config file, either using the config tool (preferred way) or via any text editor! Especially variables from the Napigator (GotNap) support and network groups should be set accordingly, namely server_name, server_ports, report_name, report_port, stat_server_user and stat_server_pass. You can adjust other variables later, as you learn about their meanings.

  2. Set up your Elite user account!
    Initially the userbase contains just one elite user account named Elite with the password elite. Nick and password must be changed prior to launching the server for the first time. Otherwise you'll be experiencing a severe security hazard!
    Note that after the first start of Opennap NG the passwords will be encrypted and stored encrypted. Plaintext passwords won't be kept or stored by the server at all! After the first server start you must not reedit the password fields of the opennap-users.txt file! To change passwords afterwards, start the server, connect with your client (i.e. Lopster, Xnap or WinMX) to it using your elite nick. Then use the client-specific facility to change the password. I.e. in Lopster this is the /pass command, in TekNap it is the /setpassword command. Please check the documentation of your client to see how password changes are carried out.

  3. Set up your network, firewall, etc.
    Make sure the configured server port (default: 8888) is open (not firewalled) on your computer. If you are connected to the internet via a router or gateway, make sure the server port is properly forwarded. Your server port must be reachable from the outside world. Otherwise no users from the outside world will be able to connect to your server.

  4. Start
    You may then start the server. Note, on Linux / Unix the default data directory is /usr/share/opennap-ng/ (others can be chosen by using -c switch at command line). On Windows it's the current directory. However, start menu entries and desktop icons on Windows are configured to switch to the directory in which Opennap NG was installed prior to launching it, so there's nothing more to care about.





Compiling the server


These instructions describe building (compiling) Opennap NG the Unix way, which currently is the only supported way. The suggested tool for building Opennap NG natively under Windows is MinGW (Minimalist GNU for Windows, http://www.mingw.org), an open source and free compiler and tools set which bases on common development tools of the Unix world. Since using MinGW requires skills in Unix usage and Unix utilities, which the average Windows user (even many developers) doesn't have, Windows users are encouraged to use the binary package of Opennap NG instead. Currently no in-depth instructions for how to build Opennap NG on Windows are available.

Important: in any case, GCC version >= 3.x is required! With 2.95.x or older versions, Opennap NG either aborts compilation with errors or produces unstable binaries!


Unix Platforms


After you have unpacked the source, or obtained the CVS version, run the provided configure script. The following configure options are of note:

--
  
disable-meminfo
Disable custom memory management system. Variable max_mem and runtime memory stats output of Opennap NG depend on meminfo being enabled. However, there is a small memory usage overhead by this, usually about 15%. With meminfo disabled you may reduce memory usage by Opennap NG slightly but won't know exactly how much memory Opennap NG is consuming and when it is about to consume more.

--
  
disable-protnet
Disable the Protnet variable.

--
  
disable-warnings
Turns off all C compiler warnings during compilation. Although being preconfigured to use very high sensivity of warnings there shouldn't be many left, anyway.

-- enable-chroot
Compile support for running OpenNap-NG in a chroot() jail. This prevents the server from being able to read/write any files outside of its data directory. Useful for parnoid people. OpenNap-NG must be run setuid root (at which point it will drop privs) in order for this to work.

-- enable-debug
Turns on debugging information to catch memory leaks and buffer overruns. This is usually not suitable for "production" environments because of the extra memory use and significant performance impact, but good for small test servers. The more testing the more likely bugs can be squashed.

--
  
enable-email
Enables support for storing the email addresses of users obtained from the nickname registration command. By default this information is not kept and the server will always return unknown if this information is requested. Note that sane users don't enter correct email addresses nowadays so this feature is generally of little use.

-- enable-gprof
Adds the -pg option to gcc to generate profiling information suitable for digestion by gprof. Profiling gives a detailed output of what the server is spending its time doing so that bottlenecks can be detected and server performance can be increased. This option is useful for programmers only.

-- enable-resume
Enables the server-side support for resuming downloads. This option makes the server use more memory because it has to store to MD5 hash values for all shared files in addition to the other information. Note that most clients don't support this feature so it is generally of little use.

-- enable-router
Compiles a routing-only version of the OpenNap-NG server. This disables the file sharing commands for local clients, only allows users of level Admin or greater to log in, and simply routes all other messages to linked servers. This is ideal for use as a hub server to connect a cluster of other servers together.

--
  
with-fd-setsize=SIZE
Under some BSD systems, this may set FD_SETSIZE, the hard maximum number of connections the server can support via the select() system call. On some Unix systems, including Linux, this is a constant, hardcoded in system libraries and / or kernels, and actually can't be changed. On Windows machines there is no size restriction for supported connections via select().
Most modern Unices, including Linux and BSD, feature the newer and more efficient poll() syscall. This syscall has no inherent limitation on number of supported connections. If poll() is available and detected on your OS, Opennap NG will automatically utilize it instead of select().
Note that on Linux kernels prior to 2.4.0 there existed a hardcoded limit of total files or connections any process could handle. This limit defaulted to 1024. Neither with poll() nor select() it is possible to handle more than roughly 1000 connections on those kernels, without changing that constant and recompiling the kernel.

-- enable-jmm
This is a new experimental option. It enables use of Jondo's Memory Management in Opennap NG, a rather low level a replacement for malloc(), free() and other standard memory management functions. JMM is optimized to handle huge amounts of small memory chunks, as they are used in Opennap NG. The three main differences between JMM and conventional MM are:
  • JMM reduces RAM wastage by approx. 70% - 85%. This means a total reduction of RAM demands by Opennap NG by 10% - 20%.
  • JMM is able to return unneeded RAM to the system, at least occasionally.
  • JMM is a bit slower than conventional MM, i.e. utilizes a bit more CPU.
The following constraints are to be regarded when using JMM:
  • JMM is still experimental code. It probably cannot be regarded stable as yet.
  • JMM doesn't work (as yet) on 64 bit systems in 64 bit mode (i.e. AMD64)
  • JMM doesn't work (as yet) on big endian systems (ie.e most non-x86 CPUs)
  • JMM uses only mmap() / munmap() (where available). This implies the following limitations:
    • Windows doesn't have mmap() support at all, only malloc() / free() will be used there.
    • JMM doesn't work at all with Linux 2.2.x and earlier, as the mmap() function of those kernels wasn't implemented properly. Linux 2.4.x or later is required.
    • In Linux, the use of mmap() is limited by the kernel setting /proc/sys/vm/max_map_count (default: 65536). The default value means that Opennap NG might be able to use no more than 250 MB of RAM! Set it to 262144 or 524288 prior to starting Opennap NG to enable it to access up to 1 GB or 2 GB, respectively. Changing this setting requires root privileges.
   

Once you have run the configure script, simply type make. At this point you may wish to run make install to install OpenNap-NG in the default location, but this is not required for the server to run.






Invocation (command line parameters)


There are a few command line parameters which Opennap NG understands, to alter its operation. They are as follows:

Parameter Description
-c <directory> Specify data directory for Opennap NG, where files like opennap-config.txt and opennap-users.txt are located. On Unix platforms the default is /usr/local/share/opennap-ng/. On Windows platforms the default is the current directory. Note that the default for data files installation on Windows is C:\Program Files\Opennap NG 0.60\.
-b Run Opennap NG as a background process (daemon). Any output to stdout is disabled in this mode.
-D Don't listen on stats port
-h Print help information, offering a brief version of this description.
-i <ip_addr> Listen only on the given IP address instead of all available interfaces of a machine. This makes sense only on machines with multiple network interfaces.
-p <portnum> Override the port number specified in file opennap-config.txt and listen on the port specified here, instead.
-r Disable remote configuration commands. This is exactly the same as setting remote_config in file opennap-config.txt to on.
-s Channels may only be created by privileged users. This is exactly the same as setting strict_channels in file opennap-config.txt to on.
-V Display seever version to stdout and exit.







Files


OpenNap NG uses several different data files. Typically they are stored in /usr/local/share/opennap-ng/ for UNIX platforms, and c:\program files\opennap-ng-0.60\ for Win32 platforms.

Important: regard the changed filenames from previous Opennap versions prior to NG 0.49!

All files are plain ASCII files and may be edited or viewed using any text editor. However, changes apply only if the server gets restarted or rehashed. Some of the files are periodically overwritten by the server while it's running, so the best way is to change and save them only when the server is not running.

opennap-bans.txt list of server-wide bans on clients
opennap-block.txt REs (regular expressions) to define allowed and disallowed files
opennap-config.txt main configuration file containing server options
opennap-channels.txt      database of predefined group chat channels
opennap-filter.txt list of words to skip when searching/indexing files
opennap-log.txt optional log file stored by Opennap NG
opennap-motd.txt message of the day, the text shown to users when they log in
opennap-servers.txt database of servers to link with
opennap-state.txt frequently updated server status page
opennap-users.txt registered users database





opennap-bans.txt


This file contains a persistent list of server-wide bans. It specifies either nicks or IP addresses or combinations of both which are not allowed to login. The server will read this upon startup. It will be dumped frequently during operation and when the server is shut down via a killserver command. If you need to edit this file, you must shut down the server prior to editing it, or your changes will be lost. Each line in this file should be of the form:
	<target> <nick> <when> "<reason>" <timeout>
Notes: ban records are shared among linked servers. Rules for automatically banning clients are not. While being optional in earlier versions of Opennap NG, <timeout> has become a mandatory value meanwhile. Unlimited bans don't make any sense. They just waste your resources and are unlikely to hinder banned users to reenter your server if they make use of advanced tricks. If particular people keep misbehaving there are enough automatic means to ban them again and again. If they decide to cease misbehaving there should be a chance for them to reconnect after some time.





opennap-block.txt


Note: this section describes the new version 2 format of opennap-block.txt. Opennap NG 0.60 still understands the older, simple block file format of versions prior to 0.60 but that's regarded a legacy and not described here.

The file has to begin with a line containing the string ":version 2" only. All following lines are either blank, comments (starting with a "#") or regular expressions of any class. All regular expressions in this file are case-insensitive. There may be any number of expressions of a valid class. There are five distinct classes of expressions supported in version 2 file format: The first character of a line specifies the class which the following regular expression belongs to.

Class Affects Char Description
blocked files - This is the traditional class; the only one which was properly supported by older versions of Opennap NG. All filenames matching any expression of this class will be silently ignored by the server. They won't be stored in internal server file lists and won't be returned as search results or show up on server based browses. Attempting to share blocked files has no immediate further consequences for the user attempting to share them, although he may fall under limits imposed by max_block_pct and eject_limit_files.
The common use of blocked expressions is to specify file types (extensions) you don't want to have listed on your server, i.e. \.(jpg|gif|ico) (for some image formats which are unsuitable for an Opennap NG server). If you want your server to stay (mostly) free of porn expressions like these would be suitable: p[o0}rn|f[ui]ck|xxx. Note that blocked files still appear on direct browses, as that operation bypasses the server and its internal lists.
criminal files ! All filenames matching any expression of this class are considered criminal (really bad). They will not only be blocked (ignored by the server), but users who attempt to share any of those files will be automatically banned for criminal_ban_ttl seconds.
You should be careful what to enter to this class and use precise and unambiguous terms only. By specifying too loose keywords you may ban a lot of users who try to share harmless stuff only. I.e., specifying simple terms like ass or sex in this class is a bad idea as there are certainly a lot of harmless files with terms "bass" or "sexy" in their names. Putting general porn terms into criminal class is not recommended as you may quickly lose the majority of your users by doing this.
must match files + If opennap-block.txt contains any expression of this class, all files to be shared by users must match at least one of them in order to be accepted. Files whose names don't match any of the given must match class expressions are blocked (ignored).
Use expressions of this class to restrict your server to accept files of reasonable types only, i.e. \.(mp3|ogg|wmv|avi|mpg|mpeg|mov), to accept sound and video files only. It is strongly recommended to use a must match expression for your server, since nowadays quite many users attempt to trick you and other users by sharing large amounts of all sorts of obscure or artificial but certainly useless file types.
invalid searches  searches ? If a user searches for a term which matches any of the invalid searches expression and the variable invalid_search_ban_ttl is nonzero then that user will be immediatly ejected and banned. You should make sure you specify clear, unambigious terms referring to perversities or other unwanted stuff only. Otherwise a lot of innocent users could be ejected for just searching for something they don't even know that it's deprecated on your server. A mods+ notification will be sent on every automatic ban due to searching for invalid keywords.
invalid nicks nicks @ If a user tries to login using a nick which matches any of the expressions of the invalid nicks class the login will be rejected. The user will not be banned explicitly (as he couldn't ever login with the same nick anyway). However, the user will be unable for ibl_ban_ttl seconds to reconnect to the server.

Depending on the values of notify_block_sources and notify_block_targets, Mods+, the affected user and / or the server log may receive notifications about blocked files being shared.

It is strongly recommended to have good knowledge and some experience with Regular Expressions before attempting to write new expression sets from scratch or significantly modify existing ones. Regular Expressions can be very tricky and have a high potential for both redundancy and optimizations. While compact and optimized REs can save performance, bloated and redundant REs can severly slow down a server. Especially avoid using any word in more than one of the three file classes!

To maintain optimum performance the sum of all REs shouldn't exceed 500 characters. If your REs exceed a total of 1000 characters your server performance will likely suffer significantly and your expressions likely deserve to be optimized further.

Note: as of Opennap NG 0.60 you have to activate at least one expression of either blocked, criminal or must match classes! The server will refuse to start if no block rules are enabled! Running a server with no block rules at all is an invitation for abusers to share not only lots of useless crap but also really criminal and pervert stuff. With respect to all sane users of an Opennap NG server, this irresponsible mode of operation isn't supported any more!

See the sample / default file opennap-block.txt (in the doc/examples/ directory of the source distribution) for a number of examples of useful expressions.





opennap-config.txt


The main configuration file of Opennap NG. Consists of numerous configuration variables, one per line. The form is: var value. Each of the values is a string, boolean, integer, bitmap or list, depending on the variable. Empty lines or lines beginning with a "#" are treated as comments. Comments must start at new lines. The configuration variables are typed as follows. (B) = boolean, (I) = integer, (M) = bitmap, (S) = string variable. Integer values are interpreted as decimals by default. If the numbers are preced by a "0x" then they're interpreted as hexadecimal values, which may be easier to input for some bitmap variables like log_level. Booleans can take the values "on" / "yes" / "1" or "off" / "no" / "0".

See section Configuration for detailed descriptions of variables, groups, default values, availability and changes.





opennap-channels.txt


Note: this section describes the channel file format version 2, which is new to Opennap NG 0.60.

The channels file specifies all predefined channels on the server. Each line in this file should be of the form:
	<channel> <flags> <limit> <level> "<topic>"
Note: typically you edit this file once before starting your server. You should never edit it while the server is running or your changes will be lost. The server always writes out its state when it shuts down, because new information about the channel may have been set. If you want to edit it by hand, you should first shut down your server. See the sample.channels file as a basis to start your own configuration. See also: strict_channels.






opennap-filter.txt


This file contains a list of words that should not be indexed when clients share files. This is most commonly used to weed out very common words such as `mp3' or `the' to save on server resources, since it is expected that none of these words will be very useful when searching. Files containing filtered keywords in their name are still indexed, you just can't use these particular words to find that file. In certain cases, a file may contain no valid words and thus won't be able to be found via the search mechanism. However, the file will show up when browsing the client's filelist, and therefore can still be downloaded. See the sample.filter file as a basis to start your own configuration.

Unless the persistent_filter setting is enabled, the server won't change this file. The list of filtered keywords may grow in server memory as it runs, but won't be stored in the file. This way, after each server restart the filter list will be the same. This is the behaviour of earlier Opennap NG versions. If persistent_filter is enabled, the server will periodically store the updated list of filtered search keywords. But beware: this list (and the file as well then) can only grow, they will never shrink! This can easily lead to a situation in which many hundreds of keywords become filtered, even rather particular ones like certain artist's names, which will prevent files by those artists to be searchable by their name at all. If persistent filters are enabled, server owners should check from time to time the contents of this file and remove some potentially indispensable key words. Raise file_count_threshold to reduce chances of particular keywords to get into the filtered list.





opennap-log.txt


If logging to file is enabled via the log_targets variable, log messages are written to this file. The sorts of log messages this file receives can be specified via the log_level variable. Format of log messages to be written into this file is specified by log_fmt and log_timefmt. The general format of log entries (one per line) is this:

    [level] [filename] [function name] [line number] <log message>

Automatic log splitting is provided by the two vriables log_split_mb and log_split_hours. If either of them is set and any of the split conditions becomes true, the current opennap-log.txt will be closed and renamed to a file of the pattern opennap-log-yyyymmdd-nn.txt. yyyy is the current year, mm is the current month, dd is the current day. nn is the index of the log file within that day, in case multiple log files are created for the same day.

On server start, Opennap NG will neither append to nor overwrite existing opennap-log.txt files. Instead, it will always start with renaming existing opennap-log.txt files to the next free filename of the pattern described.





opennap-motd.txt


Message Of The Day
. This file contains the text the server sends to your client when you log in. MOTDs may be coloured, which is to be controlled by escape codes. However, this is a feature being supported by few clients only.

The MOTD must be a plain ASCII text file. Colors are changed by inserting a CTRL-C character (ASCII 3), followed by a two-digits color code. Only the foreground (text) colour may be changed in a MOTD. The following table shows all available color codes:

Digits Color            Digits Color            Digits Color
01 Black   30 Black   50 Dark gray
02 Blue 31 Red 51 Light red
03 Green 32 Green 52 Light green
04 Red 33 Brown 53 Yellow
05 Brown 34 Blue 54 Light blue
06 Purple 35 Purple 55 Light purple
07 Light red 36 Cyan 56 Light cyan
08 Yellow 37 Grey 57 White
09 Light green 38 White 58 Grey
10 Cyan    
11 Light cyan
12 Light blue
13 Light purple
14 Dark gray
15 Grey
16 White

For historical reasons, the two digit groups 3x and 5x are preferred in a MOTD. They may have a greater compatibility to more clients than the 0x and 1x digit groups. The default color, if no color codes are used, is expected to be 58. However, this may vary among clients as well.

Each new line of the MOTD starts with default color again. So if you want to have multiple lines entirely using a custom color you need to specify the desired color code before the first visible character of each line.

Example: to insert a piece of light green text into a MOTD line, write the following:
    This is a line with a ^C52light green text^C58 part.
Note that "^C" isn't two characters! It's just one CTRL-C ASCII character. You need a text editor which is capable of inserting raw ASCII characters into the text. Not all text editors are capable of this.





opennap-servers.txt


The servers file contains a list of servers which are allowed to link. Each line in this file is of the form:
<server_name> <remote_pass> <local_pass> <port> [alias]
where server_name is the DNS name of the remote server (the remote server should have its server_name set to this value), remote_pass is the password expected from the remote server to authenticate (prove its identity), and local_pass is the password your server uses to authenticate to the remote server. port is the TCP port on the server to connect to. alias is an optional string which will be used to refer to this server instead of its DNS name. This is useful for defining hub servers where you might not want the DNS name to be revealed to users, or you want to use a different name instead of the ip address (if you don't have a reverse DNS record). Note that if a server you want to link to uses an alias name you must enter the alias name in opennap-servers.txt, too. Lines that begin with a pound sign (#) or any space character (tab, etc.) are ignored. See the sample.server file as a basis to start your own configuration.





opennap-state.txt


This file contains an ASCII representation of all supported server statistics. It always contains all stats groups of stats_fmt. It is usually being updated frequently, every live_stats seconds. Together with suitable Unix tools like watch and cat this provides an easy way for live monitoring server stats. The ASCII format of this file makes it also suitable for easy postprocessing and evaluation by scripts written in languages like Perl or Python. See section stats output for an indepth description of all fields being contained in this file.





opennap-user.txt


Lines starting with a hash (#) are comments and are ignored. Each line of the database should be of the format:
<nickname> <password> <email> <level> <created> <lastseen>
Examples:
lewser 1,N6BeTWZ4,fWJx95pWVcd2wTJk3ZCFBw blah@email.com Leech 0 0
poweruser 1,3aYmWBkH,o4BAAYyOD61bc28Eef8+5w my@address.com Elite 0 0






Configuration


Opennap NG operation is controlled by numerous variable settings, located in file opennap-config.txt. The configuration variables are typed as follows. (B) = boolean, (I) = integer, (M) = bitmap, (S) = string variable. Integer values are interpreted as decimals by default. If the numbers are preced by a "0x" then they're interpreted as hexadecimal values, which may be easier to input for some bitmap variables like log_level. Booleans can take the values "on" / "yes" / "1" or "off" / "no" / "0". Numbers behind variables denote availability since the respective Opennap NG version.

Note that 0.47H doesn't refer to Opennap NG 0.47 or 0.47.2 but to an inofficial version which was never published. The following is a list of all variables supported by Opennap NG 0.60.

chat control:
irc_channels (B)
max_channel_length (I)
max_topic (I)
max_user_channels (I)
strict_channels (B)

content management:
allow_share (B)
ascii_filenames_pct (I) (0.60)
eject_limit_files (I)
eject_limit_libsize (I)
eject_limits_conjunction (B) (0.60)
fix_xnap_path (I) (0.47H)
index_ignore_suffix (B)
index_path_depth (I)
leech_share (B) (0.47H)
max_file_size (I) (0.49)
max_shared (I)
min_file_size (I)

flood protection:
break_mx_queue (B)
evaluate_search_abuse_after_secs (I)
evaluate_search_abuse_after_tags (I)
file_count_threshold (I)
flood_ban_ttl (I) (0.49)
flood_commands (I)
flood_eject (I) (0.49)
flood_time (I)
ibl_ttl (I)
login_interval (I)
login_timeout (I)
max_clones (I)
max_command_length (I)
max_login_ban_ttl (I) (0.60)
max_login_count (I) (0.60)
max_login_time (I) (0.60)
max_searches_per_minute (I)
max_tags_per_minute (I)
max_whois_ban_ttl (I) (0.49)
max_whois_count (I) (0.49)
max_whois_time (I) (0.49)
register_interval (I
persistent_filter (B) (0.60)

log verbosity:
critical_delay (I) (0.47H)
live_stats (I) (0.60)
log_fmt (M) (0.60)
log_ignore_abuse (I) (0.47H)
log_mode (B)
log_level (M) (0.60)
log_split_hours (I) (0.60)
log_split_mb (I) (0.60)
log_targets (M) (0.60)
log_timefmt (S) (0.47H)
loopcount_output_interval (I) (0.47H)
stat_click (I)
stats_fmt (M) (0.60)
verbose_too_many (B) (0.47H)

  

mod+ notification:
max_queue_notify (I) (0.60)
no_mod_annoying (B)

notify_block_sources (I) (0.60)
notify_block_targets (M) (0.60)
notify_mod_abuse (B)
notify_mod_abuse_frequency (I)
notify_no_uploads (I) (0.60)

GotNap (Napigator) support:
report_ip (S)
report_name (S)
report_port (S)
server_alias (S)
stats_port (I)
stat_server_host (S)
stat_server_pass (S)
stat_server_port (I)
stat_server_user (S)

network:
auto_link (B)
auto_relink_count (I) (0.60)
auto_relink_idelay (I) (0.60)
auto_relink_pdelay (I) (0.60)
listen_address (S)
max_time_delta (I)
min_read (I)
ping_interval (I)
search_timeout (I)
server_name (S)
server_ports (S)
server_queue_length (I)
warn_time_delta (I

performance:
auto_restart (I) (0.60)
client_queue_length (I)
compression_level (I)
max_browse_num (I) (0.60)
max_browse_result (I)
max_connections (I)
max_hotlist (I)
max_ignore (I)
max_mem (I) (0.60)
max_new_users_count (I) (0.47H)
max_new_users_time (I) (0.47H)
max_reason (I)
max_results (I)
max_searches_pending (I)
max_uploading (I) (0.49)
persistent_filter (B) (0.60)
remote_browse (B)
search_max_cache_entries (I)
server_chunk (I)
set_process_priority (I) (0.60)

  

security:
ban_target_spec (I) (0.60)
cloak_user_level (I)
(0.49)
level_to_set_flags (I)
no_share_level (I) (0.49)
protnet (S)
remote_config (B)
set_server_nicks (S)
user_db_interval (I)
usermode (S)

user management:
allow_dynamic_ghosts (B)
alnum_nicks (B) (0.49)
auto_friend_filenum (I) (0.60)
auto_register (B)
clones_allow_level (I) (0.49)
criminal_ban_ttl (I) (0.60)
default_ban_ttl (0.49)
discipline_ignorers_ban_ttl (I)
eject_after (I)
eject_ban_ttl (I)
eject_grace_time (I)
eject_leeches (B)
eject_no_channels_only (B)
eject_when_full (B)
friend_expire (I) (0.60)
ghost_kill (I)
invalid_clients (S)
invalid_nicks (S)
invalid_search_ban_ttl (I) (0.60)
leech_ban_ttl (I) (0.60)
leech_grace (I) (0.60)
leech_ratio (I) (0.60)
max_block_pct (I) (0.49)
max_block_pct_ban_ttl (I) (0.49)
max_client_string (I)
max_nick_length (I)
min_nick_length (I) (0.60)
nick_expire (I)
portscan_ban_ttl (I) (0.60)
portscan_notify (I) (0.60)
registered_only (B)
restrict_registration (B)
valid_clients (S) (0.47H)
who_was_time (I)

user notification:
browse_nag (B) (0.46)
motd_fmt (M) (0.60)
notify_exceed_frequency (I) (0.47H)
notify_user_abuse (B)
notify_user_abuse_frequency (I)
verbose_ban_msg (M) (0.60)

Unix specific:
connection_hard_limit (I)
lock_memory (B)
max_data_size (I)
max_rss_size (I)
set_group (S) (0.60)
set_user (S) (0.60)





Changed variables


The following variables from previous versions were either removed or changed their type or meaning:

Variable Change Note
allow_dynamic_ghosts (B) Replaced by ghost_kill (I)
ascii_filenames (B) Replaced by ascii_filenames_pct (I)
block_winmx (B) Replaced by invalid_clients (S) and valid_clients (S)
break_mx_queue (B) Type change from integer to boolean
browse_nag (B) Type change from integer to boolean
discipline_block (B) Removed functionality replaced and extended by block class criminal of opennap-block.txt file.
discipline_block_ban_ttl (I) Renamed to criminal_ban_ttl (I). Applies to matches of filenames against criminal class of expressions in file opennap-block.txt.
discipline_block_mod (B) Removed Mods+ are to be banned automatically under no circumstances! They are part of the staff. De-mod or ban them manually if they did something wrong and you want to get rid of them!
discipline_ignorers (B) Removed Redundant setting! Set discipline_ignorers_ban_ttl to nonzero to killban Mod+ ignorers, zero to turn it off.
eject_also_bans (B) Removed Redundant setting! Set eject_ban_ttl to nonzero to turn this feature on, zero to turn it off. Auto-ejecting without banning is pointless.
eject_leeches (B)   from integer to boolean
eject_nochannels (B) Renamed to eject_no_channels_only (B) to better reflect its meaning.
ghost_kill (I) Type change from boolean to integer to allow multiple modes.
log_blocked (B) Removed obsoleted by notify_block_mode (I)
log_channel (B) Removed obsoleted by log_targets (I)
log_mode (B) Renamed to log_level_change (B)
log_stdout (B) Removed obsoleted by log_targets (I)
loglevel (S) Replaced by log_level (I)
max_new_users_per_minute (I)    Replaced by max_new_users_count (I) and max_new_users_time (I). This setting never worked correctly.
max_searches (I) Renamed to max_searches_pending (I), to better reflect its meaning.
no_mod_annoying (B) Type change from integer to boolean
notify_mod_abuse (B) Type change from integer to boolean
notify_mod_block (B) Removed obsoleted by notify_block_mode (I)
notify_user_abuse (B) Type change from integer to boolean
notify_user_block (B) Removed obsoleted by notify_block_mode (I)
ping_server (I) Renamed to ping_server_interval (I)

The default values of some variables have changed. This measure has been taken to assist server newbies with values that have proven to be reasonable. For existing config files, in which values are explicitly specified, nothing changes.

However, server owners should feel encouraged to compare their values with recommended values, as some of them are the result of late stress and efficency tests. Also, not all meanings of variables have been properly understood by all server owners in the past. As the verbosity of this documentation increases we hope to be able to address some existing misconceptions.





Detailed list of configuration variables


Note that configuration variables marked as "since 0.47H" (and above) are not contained in previous official version 0.47 and 0.47.2!



allow_share Group: content managment Type: boolean Default: on  
Controls whether or not clients are allowed to share files via the server. If set to off this server doesn't accept any files to share and operates as a chat server only.



alnum_nicks Group: user management Type: boolean Default: off Since: NG 0.49
If set to on, only old-fashioned alphanumerical user nicks will be accepted. They may consist of upper and lowercase letters "A" - "Z" and "a" - "z", digits "0" - "9", a hyphen "-" and an underscore "_" only. Nicks containing any other character will be rejected on login by the server.



ascii_filenames_pct Group: content management Type: integer Default: 0 Since: NG 0.60
If set to a value between 1 and 100, filenames to be shared must consist of at least this percentage value of 7-bit printable ASCII (32 - 126) characters. For instance, a value of 90 (recommended) allows one non-ASCII character every nine ASCII characters, hence forbidding completely cryptic filenames while likely still allowing filenames containing a few language-specific foreign chars, like in french, german, spanish, etc. This results in filenames that should be readable in english and a limited number of other languages. Especially filenames consisting of foreign language characters like Kanji (japanese), russian or others are not accepted. This helps keeping out incomprehensible filenames, hence potentially unwelcome or dangerous content. Filenames containing a higher percentage of non-ASCII characters than this value are blocked (and count for max_block_pct, eject_limit_files and similar of that user). Not that percentage calculation applies to all characters in filename plus optional path, which may be sent by a client.



auto_friend_filenum Group: user management Type: integer Default: 0 Since: NG 0.60
When set to non-zero, any client sharing at least this number of files will be automatically assigned the Friend flag. This will allow such users to connect any time to the server, even when it's full and ordinary users would be rejected. Hence, setting this variable honors and endorses users who share much to visit the server again. Only those files are counted which actually passed all block conditions, such as min_file_size, ascii_filenames_pct and the block expressions. A useful value for this is 5000.



auto_link Group: network Type: boolean Default: off  
When set to on, Opennap-NG will automatically attempt to link to all servers listed in the servers file when it starts up for the first time.



auto_register Group: user management Type: boolean Default: off  
When set to on, the server will automatically register a nickname the first time it is used. When off, nicknames will only be registered when the client explicitly requests it. Please regard that many users don't care about correct passwords in filesharing networks and neither do some clients. Actually, an increasing number of users use random passwords on each connect. Those users won't be able to connect more than once to a server with auto_register set on, See also: registered_only, register_interval and nick_expire.



auto_relink_count Group: network Type: integer Default: 0 Since: NG 0.60
Together with auto_relink_idelay and auto_relink_pdelay this variable controls server auto-relink. All three must be set to nonzero to enable auto_relink. If a linked server delinks without a manual delink command having been issued then other servers, in larger networks preferably the router, can automatically attempt to relink the lost server. This variable sets the maximum number of automatic relink attempts carried out by the server before it gives up. Reasonable values are probably 5 to 10, unless you want the server to continue auto-relink attempts nearly forever. Mods+ are notified on relink attempts. Automatic relink sequence ends on any of these three events:
  1. the delinked server has linked again
  2. a manual delink command is issued towards the already delinked server
  3. auto_relink_count numbers of relink attempts have been made without success



auto_relink_idelay Group: user management Type: integer Default: 300 Since: NG 0.60
Together with auto_relink_count and auto_relink_pdelay this variable controls server auto-relink. All three must be set to nonzero to enable auto_relink. If a linked server delinks without a manual delink command having been issued then other servers, in larger networks preferably the router, can automatically attempt to relink the lost server. This variable sets the initial delay for automatic server relinking. When a server delink is detected, auto_relink_idelay seconds will be waited before the first automatic relink attempt. This value shouldn't be too low, as the reason for the other server having delinked could be a system reboot, software upgrade or other events which prevent it from being relinkable again immediately. reasonable values are probably 3 to 10 minutes (values 180 to 600). Note that the value of this setting is rounded up to the next multiple of 60, hence providing a one minute resolution. Mods+ are notified on relink attempts.



auto_relink_pdelay Group: user management Type: integer Default: 120 Since: NG 0.60
Together with auto_relink_count and auto_relink_idelay this variable controls server auto-relink. All three must be set to nonzero to enable auto_relink. If a linked server delinks without a manual delink command having been issued then other servers, in larger networks preferably the router, can automatically attempt to relink the lost server. This variable sets the periodic delay for ongoing server relinking attempts. When a server delink is detected, auto_relink_idelay seconds will be waited before the first automatic relink attempt. If the first attempt was not successful then further attempts will be issued periodically every auto_relink_pdelay seconds. reasonable values are likely between 2 and 5 minutes (values 120 - 300). Note that the value of this setting is rounded up to the next multiple of 60, hence providing a one minute resolution. Mods+ are notified on relink attempts.



auto_restart Group: performance Type: integer Default: 0 Since: NG 0.60
When set to nonzero, enables auto-restart of Opennap NG in case of improper termination (i.e. crash). Together with the auto_relink-settings this significantly increases availability of Opennap NG in case of unexpected failure events. The numeric value specifies the number of seconds to wait before relaunching the server after a crash. Reasonable values are 5 to 60 (seconds). If in auto_restart mode, the only ways to terminate Opennap NG is by an Admin or Elite sending a killserver message or the server owner killing / ending the Opennap NG processes locally.



ban_target_spec Group: security Type: integer Default: 1 Since: NG 0.60
This variable specifies the format of ban targets when created by any of the automatic ban features of the server. This determines the strictness or range of particular ban entries. There are three reasonable values with the following target formats:

Value    Description Ban target format
1 username only username!*
2 IP address only *!a.b.c.d
3 Username and IP address   username!a.b.c.d

All formats have their pros and cons:
  • Username only bans particular nicks regardless of their IP address. If the banned nick originates from a dialup internet connection with frequently changing IP addresses this could save multiple ban entries, hence make the banlist shorter. However, innocent other users attempting to connect using the same nick wouldn't be able to login. Also note that some clients provide random nicks on each connect. Banning them by nick only wouldn't prevent them from reconnecting immediately again, using a different nick next time.

  • IP address only will reject all connect attempts from the given IP address, regardless of the nick being used. This is the most sweeping target type. However, regard that many clients may connect via dialup internet connections, hence changing their IP address often. The banned user could then relogin again using another IP address. Instead, a different user could inherit the banned IP address and be rejected. If the banned client reconnects using a different IP address and continues his misbehaviour then it would be banned again (and again), creating potentially multiple ban entries for one and the same client. On the other hand, there are some cable ISPs known who provide distinct customers the same IP address. Hence banning by IP address only could also prevent some other (presumably innocent) users from connecting to the server.

  • Username and IP address is the most precise ban target. It will ban only particular nicks connecting from a particular IP address. This target format avoids penalizing other clients for the misbehaviour of one particular client. However, regard that many clients may connect via dialup internet connections, hence changing their IP address often. If the banned client reconnects using a different IP address and continues his misbehaviour then it would be banned again (and again), creating potentially multiple ban entries for one and the same client.
Note that the format of manual bans (issued by Mods+) is not affected by this variable. Manual bans can always be created using any of the available formats.



break_mx_ queue Group: flood protection Type: boolean Default: off  
Some buggy clients send a lot of privmsgs containing //WantQueue. If this value is set to on then these privmsgs will be blocked on the server this user is connected to. To get a picture what a waste of bandwidth occures when not switching this to on grep your opennap-ng logfile for "privmsg"opennap/opennap-ng/doc/. It should display something like:
privmsg: all 205: 43000 705596 Bytes - 205WQ: 39096 (90.9%) 431382 Bytes (61.1%)
privmsg: all 205: 44000 720813 Bytes - 205WQ: 40030 (91.0%) 441662 Bytes (61.3%)

after only some hours of uptime. 205WQ is the count and the size of privmsgs containing a queueing message.



browse_nag Group: user notification Type: boolean Default: on Since NG 0.46
When set to on users are nagged when their client issues an old 211 server browse request without at least trying the newer 640 direct browse command.



client_queue_length Group: performance Type: integer Default: 262 144  
Sets the maximum number of bytes that can be queued for a client connection. If this threshold is reached, it is assumed that the client is either dead, or the network link can not sustain the level of output, and the server automatically closes down the client connection. This is necessary so that dead clients don't consume all of the servers memory. Note that this size doesn't represent a static buffer which is always allocated for every client. Most clients won't need any output buffers at all since data for them can be sent out instantly and received fast enough. Buffering takes place only if a client has requested a huge bunch of data which can't be sent by the OS in one turn, or when the client has actually disconnected already and won't receive any further data at alll. Client buffers are dynamically allocated on demand by Opennap NG. Their typical lifetime is within 2 seconds. They are freed as soon as buffered data could be sent or the client disconnects.



cloak_user_ level Group: security Type: integer Default: 0 Since: NG 0.49
If non-zero, ordinary users who are whois'ing others will always receive "user" as userlevel information of the user being whois'ed. Users won't be able to identify Moderators, Administrators and Elites. This feature is to protect server staff, if responsible ones prefer to stay undiscovered. More precisely, the values of this setting have the following meaning:
0 =  always return real userlevel to all users
1 =  return real user level to users who are at least flagged "friend"
2 =  only Moderators, Administrators and Elites will be reported real userlevels of others on whois'ing



clones_allow_level Group: user management Type: integer Default: 3 Since: NG 0.49
If non-zero, specifies which user levels are exempt from clone detection and ejection. Without clone detection, an arbitrary number of connections from the same IP address are allowed to connect. All user levels equal or above the specified value are exempt from clone detection. The default value is to exempt Admins and Elites from clone detection. Actual clone detection setting is done via the max_clones variable. Here, the possible values are:
0 =  clone detection affects all and everyone
1 =  users (with the friend flag only!) and above are exempt
2 =  Moderators and above are exempt
3 = Administrators and Elites are exempt
4 = Only Elites are exempt from clone detection



compression_level Group: performance Type: integer Default: 1  
The zlib compression level to use when compressing server to server connections. 0 means no compression, 1 is least effort, 9 is best compression. The higher the number, the more CPU it will consume. Level 1 compresses text by about 50%, which is good enough for most applications.



connection_ hard_limit Group: Unix specific Type: integer Default: depends on OS  
Sets the maximum number of file descriptors available to the server process. Generally this is used to increase the default number available. Note that in order to increase the default maximum, the server needs to be started as root (OpenNap-NG will drop privileges and run as the uid/gid specified by set_user and set_group then). Note: under Linux (< 2.4.x) connection_hard_limit cannot be changed and is always 1024.



criminal_ban_ttl Group: user management Type: integer Default: 604 800 Since: NG 0.60
If file opennap-block.txt contains any active expressions of class criminal, any user who attempts to share at least one file that matches active expressions of this class will be banned for criminal_ban_ttl seconds.



criticial_ delay Group: log verbosity Type: integer Default: 5 Since: NG 0.47H
The server contains some internal performance validation code. After it got stuck in particular subroutines for too long, (freezing, also causing lag), it can report the duration and cause of this event to the log. Messages are of the form "checkdelay: level x, stuck for y seconds in block z". The error log level must be enabled for these messages to be emitted. This setting specifies the threshold in seconds for such delays to be reported. All freezes which have taken longer than this will be reported. These messages may be helpful in detecting and confirming server lag, identify its origins and possibly hint on correcting server parameters to reduce these events. To non-programmers the messages may appear incomprehensible, though.



default_ ban_ttl Group: user management Type: integer Default: 5 184 000 Since: NG 0.49
How long bans last if no timeout value was entered. The default value is 60 days (~2 months). Longer and shorter bans can still be specified, and other feature-specific ban ttls aren't affected either. Just absolutely unlimited bans aren't supported any more; every ban has its expiration period.



discipline_ ignorers_ ban_ttl Group: user management Type: integer Default: 2 592 000  
When a user ignores a mod+ this is annoying enough. But when the mod killbans the user just to have the user relogging in with another nick this hits the spot multiplied by -1. This feature takes some care of these cases. If you set this value to nonzero then a user who ignores a Mod+ will be killed and banned for this number of seconds. The default is 30 days. Set this to 0 to allow users to ignore Mods+ without sanctions. However, remember the meaning of Moderators is to be listened to and not to be ignored.



eject_after Group: user management Type: integer Default: 120  
Specifies the number of seconds after initial login to the server for which the client is exempt from being killed for not sharing enough when the server is full (see eject_limit). This should be large enough to allow a client to start sharing files before getting killed.



eject_ban_ttl Group: user management Type: integer Default: 7200  
If a user doesn't share enough appropriate files he gets ejected and banned for this number of seconds. If this value is 0 no general ejection for not sharing enough will occur. However, regard max_block_pct and max_block_pct_ban_ttl, which supplies an independent and different approach for this. Mods+ will never be ejected for not sharing enough. This sort of ejection is affected by the following settings: eject_limit_files, eject_limit_libsize, min_file_size and max_file_size and file opennap-block.txt The default value is 2 hours. Increase it to slightly reduce your internet traffic. Experience has shown that 98% to 99% of users don't care about being banned for not sharing enough on a particular server, resulting in them connecting again and being banned again and again, as soon as this ban TTL expires.



eject_grace_time Group: user management Type: integer Default: 600  
If the eject_limits are on then a freshly started server may killban users because the load on such a server is so high that some users are not able to get their files shared in time or even may time out when sharing on a low bandwidth server. The variable eject_grace_time is the time in seconds after which the eject_limits are checked right after the serverstart. The default value is ten minutes (600 seconds).



eject_leeches Group: user management Type: boolean Default: off  
When eject_when_full is set, kill leeches to allow another user to login, even if they are sharing over the required amount of files.



eject_limit_ files Group: content management Type: integer Default: 0  
The min amount of files a user has to share in order to be exempt from eject_when_full. Any client that shares either eject_limit_files+1 files or 'eject_limit_libsize+1 Kilobytes will not be disconnected. This setting helps fighting freeloaders. Mods+ will never be ejected for not sharing enough. See also eject_limits_conjunction to alter the conjunction between these two varaibles.



eject_limit_ libsize Group: content management Type: integer Default: 0  
The min amount of Kilobytes a user has to share in order to be exempt from eject_when_full. Any client that shares either eject_limit_files+1 files or eject_limit_libsize+1 Kilobytes will not be disconnected. This setting helps fighting freeloaders. Mods+ will never be ejected for not sharing enough. See also eject_limits_conjunction to alter the conjunction between these two varaibles.


eject_limits_ conjunction Group: content management Type: boolean Default: on Since: Opennap NG 0.60
This variable determines the relationship between variables eject_limit_files and eject_limit_libsize. If it is on (default) then both limits must be missed by a user to be ejected (AND-conjunction). This is the behaviour of all previous Opennap NG versions. If this variable is set to off then only one of the limits need to be missed for the user to be ejected (OR-conjunction). Note that automatic ejection on users takes place only if eject_when_full is set to on, or if the level of a user is leech and eject_leeches is on.



eject_no_ channels_only Group: user management Type: boolean Default: on Since: NG 0.49
Normally eject_when_full will eject users who aren't sharing enough regardless of if they are chatting. eject_no_channels_only set to on ejects only users who are not in a channel and not sharing enough. If set to off, users who aren't sharing enough are ejected regardless of if they are in channels or not. In other words: on protects chatters from ejection.



eject_when_ full Group: user management Type: boolean Default: on  
If set to on, the server will disconnect the longest connected client which is not sharing any files when the server is full (eg., when it has reached max_connections clients). This allows room to be made for those clients which are sharing files. See also eject_leeches, eject_limit_libsize, and eject_limit_files This setting helps fighting freeloaders. Note: mods+ and Friends are exempt and will never be ejcted automatically, even if they are sharing no files.



evaluate_ search_ abuse_after_ secs Group: flood protection Type: integer Default: 120  
After how many seconds should max_searches_per_minute be evaluated? This is to prevent that a freshly connected user will be prosecuted because he is initally searching all of his incompletes.



evaluate_ search_ abuse_after_ tags Group: flood protection Type: integer Default: 100  
After how many tags in total should max_searches_per_minute be evaluated? This is to prevent that a freshly connected user will be prosecuted because he is initally searching all of his incompletes. After evaluate_search_abuse_after_tags requests the counter starts counting.



file_count_ threshold Group: flood protection Type: integer Default: 5 000  
When a indexed file search token (one word) contains more than this number of matching files, the server will warn in its log output. This gives the ability to add this term to the list of filtered words.



fix_xnap_ path Group: content management Type: integer Default: 1 Since: NG 0.47H
Some versions of the XNap client use to share each file in its own directory named by just a number. The results of browsing such users look stupid on many other clients and make it difficult to get an overview over the files offered. This setting provides some ways to deal with this mess. It only affects files to be shared with a plain number as the top level directory name.

Value Action
0 Let messy paths pass unchanged.
1 Just remove the top level part of the directory. I.e "2047\This is the song.mp3" would become "This is the song.mp3". This value results in flat filelists for those buggy clients. However, they're usually easier to overview than the original structure.
2 Put the entry into an artifical directory named by the first letter of the actual file. I.e. "2047\This is the song.mp3" would become "T\This is the song.mp3". This reduces the number of directories significantly.
3 (Non-functional!) Put the entry into an artificial directory named by the first word (seperated by the first non-alphanumeric character) of the actual file. I.e. "2047\This is the song.mp3" would become "This\This is the song.mp3".



flood_ ban_ttl Group: flood protection Type: integer Default: 86400 Since: NG 0.49
If flood_eject is non-zero then this setting specifies the ban TTL in seconds for exceeding flood limits. The default is 1 day.



flood_ commands Group: flood protection Type: integer Default: 0  
This variable, along with flood_time, allow for server-side flood protection. When set to a value greater than zero, the server will not allow clients to issue more than this number of commands in flood_time seconds. Any client attempting to send commands faster than the allowed limit is throttled back. A recommended value pair is 100 commands in 10 seconds, to allow clients to occasionally repeat multiple searches. Intentional flooders will easily exceed this.



flood_eject Group: flood protection Type: integer Default: 0 Since: NG 0.49
If flood_eject and flood_ban_ttl are both non-zero, clients exceeding the flood threshold specified by flood_time and flood_commands this number of times will be automatically ejected and banned. Setting this to a low value like 1 or 2 is not recommended! Clients which exceed the flood limits don't always do this on purpose or even knowingly. Occasionally exceeding flood thresholds can happen to many clients. Hence, if this feature is to be used, minimum values of 4 or 5 are recommended. Otherwise you could quickly find large numbers of users getting banned. The same is true, if flood_commands and flood_time are set too low.



flood_time Group: flood protection Type: integer Default: 100  
This variable, along with flood_commands, allow for server-side flood protection. When set to a value greater than zero, the server will not allow clients to issue more than this number of commands in flood_time seconds. Any client attempting to send commands faster than the allowed limit is throttled back. A recommended value pair is 100 commands in 10 seconds, to allow clients to occasionally repeat multiple searches. Intentional flooders will easily exceed this.



friend_expire Group: user management Type: integer Default: 2 592 000 Since: NG 0.60
Specifies the time in seconds of after which unused registered users with the Friend flag set are expired and returned to the pool of available nicknames. User accounts without any flags expire after nick_expire seconds. Accounts of Mods+ and higher levels never expire. Since friends and their accounts are more valuable than ordinary "anonymous" registered user accounts this value should be between 2 and 4 times higher than nick_expire. The default for this variable is 30 days. See also auto_register.



ghost_kill Group: user management Type: integer Default: 1 Since: NG 0.49
If non-zero, ghosts may be killed. Despite the possibility of ghost kill deadlocks it is recommended to enable ghost kill, since the harmless and innocent ghosts use to outweigh malicious ones by far.
0 =  Disable ghost killing
1 =  Enable ghost killing
This variable was changed in 0.49 from boolean to integer type to implement additional submodes. However, as field tests showed they implied other problems, additional submodes have been withdrawn again, for the time being.



ibl_ttl Group: flood protection Type: integer Default: 0  
The Internal Ban List is an optimization means which is used to keep out excessive clients. If a client reconnects too fast, keeps using an invalid nick or an invalid client, then the IP of this user is banned for ibl_ttl seconds. Checks against entries in the IBL are much faster than checks against entries in the main ban list. The user trying to connect will be disconnected immediately, without even getting a "You are banned..." message delivered. Clients may display this as "server read error"s, "connection timeout"s or similar.

Please note that if for some reason any Moderator or Admin or Elite gets into this list upon an connection attempt, he won't be able to connect to the server for ibl_ttl seconds either! That is because the connection request will be rejected before any nicks or passwords are transmitted to the server. There is currently also no way to "unban" an entry from the IBL. So this value shouldn't be too high. 10 minutes (600) is a reasonable value. It should not exceed 1 hour (3600). A value of 0 disables this feature.



index_ignore_suffix Group: content management Type: boolean Default: on  
Controls whether or not the filename extensions of shared files are included in the searchable index. Also see index_path_depth.



index_path_ depth Group: content management Type: integer Default: 2  
Controls how many levels of directory are included when adding shared files to the searchable index. Often times the leading parts of the path are completely useless for searching (eg., C:\Program Files\My Music\Rock\) and just consumes a lot of memory. This variable counts from the end of the path backwards, so the higher the value, the more of the beginning of the path it will include. Also see index_ignore_suffix.



invalid_ clients Group: user management Type: string list Default: (null)  
This is a string list of clients that are not allowed on your server. Some clients can't/don't share, some clients are broken, etc. This list can be superseded by valid_clients.

Example: invalid_clients *floodster*,*mp3rage*,*rapigator*



invalid_nicks Group: user management Type: string list Default: (null)  
invalid_nicks is a list of invalid client nicks, ones which you do not want on your network for some reason or another.

Example: invalid_nicks joey2cool,*trade*



invalid_search_ ban_ttl Group: user management Type: integer Default: 43 200 Since: NG 0.60
If there are active expressions of class invalid search in file opennap-block.txt and a client searches for any terms matching any of those expressions it will be immediately ejected and banned for this period (in seconds).



irc_channels Group: chat control Type: boolean Default: on  
When set, Opennap-NG requires all channel names to begin with # or &.



leech_ban_ttl Group: user management Type: integer Default: 0 Since: NG 0.60
If leech_ratio and leech_grace are both nonzero then any convicted leech will be killed and banned for this number of seconds.



leech_grace Group: user management Type: integer Default: 20 Since: NG 0.60
Together with leech_ratio this variable specifies the threshold for users being regarded leeches and becoming subject to optional auto leech ejection. If nonzero, this variable sets the number of "free" downloads each user has. That is, the number of initial downloads which don't count for leech_ratio. For leech detection and ejection to be enabled, this variable must be set to at least 1. A value of 0 disables leech detection.



leech_ratio Group: user management Type: integer Default: 20 Since: NG 0.60
Together with leech_grace this variable specifies the threshold for users being regarded leeches and becoming subject to optional auto leech ejection. If nonzero, this variable sets the maximum upload:download ratio a user must stay within in order to avoid being regarded a leech. In other words: a user must commit at least one upload every leech_ratio downloads. For instance, if leech_ratio is set to 10 then a user must upload at least one file per every 10 downloads. If leech_ban_ttl is nonzero, the leech will be automatically ejected and banned. Otherwise just a notification to all Mods+ will be generated, reporting the leech. Set either leech_ratio or leech_grace to zero to disable leech detection. If nonzero, a value of at least 20 is recommended. If you set this to lower than 20 you will find many users getting banned. If you set this to 10 or lower you may find almost the majority of your users getting banned. There are many leeches out there.


leech_share Group: content management Type: boolean Default: on Since: NG 0.47H
If set to on then users with level leech may still share and upload files. This may give them a chance to gain back regular user level if Mods+ decide to honor it. If set to off then users with level leech can't share nor upload any files. Leeches never can download any files.



level_to_ set_flags Group: security Type: integer Default: 2  
Minimum level a user must have to assign userflags to other users. Values are: 0 = Leech, 1 = User, 2 = Moderator (default), 3 = Admin, 4 = Elite. Values below 2 are not sensible.



listen_ address Group: network Type: string Default: 0.0.0.0  
By default, the server will listen on all interfaces on the system. You can force it to listen only on a single interface by specifying the IP address of the interface in this option.



live_stats Group: log verbosity Type: integer Default: 5 Since: NG 0.60
This variable sets the update interval for the live stats output feature of Opennap NG in seconds. Typi