Log in | Back to darenet.org

DareNET IRCd Configuration/1.5

(motd Block)
(Connect block)
 
(51 intermediate revisions not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__
-
This is a reference guide for ircd-darenet 1.4.1+'s configuration file.
+
This is a reference guide for ircd-darenet 1.5.x's configuration file.
-
The configuration format consists of various blocks, each containing name-value pairs, tags and/or string data. It is designed to be easily readable by both human and ircd.
+
The configuration format consists of various blocks, each containing name-value pairs, tags or string data. It is designed to be easily readable by both human ircd.
-
A block consists of a block name, an opening '{' brace, statements, a closing '}' brace, and a ';' semicolon. A statement consists of a name possibly followed by an '=' equals sign and a value, ending with a semicolon. All strings are surrounded by '"' double quotes.
+
A block consists of a name, an opening '{' brace, statements, a closing '}' brace, and a ';' semicolon. A statement consists of a name possibly followed by an '=' equals sign and a value, ending with a semicolon. All strings must be surrounded by '"' double quotes.
A sample block:
A sample block:
Line 15: Line 15:
};</pre></html>
};</pre></html>
-
All elements of the configuration are separated by whitespace, and can be packed on one line, or broken up over several lines. Whitespace is defined as space, tab or carriage return/linefeed. Three form of comments are allowed:
+
All elements of the configuration are separated by whitespace, and can be packed on one line, or broken up over several lines. Whitespace is defined as space, tab or carriage return/linefeed. Three forms of comments are allowed:  
-
* C style single/multi-line
+
<pre>/* C style single/multi-line */
-
* C++ style single-line
+
-
* Shell style single-line
+
-
'''Important notes:''' When the configuration file is parsed, blocks are used in reverse order than how they are listed. This means you should start multiple block definitions with the "fall through", and end with the most detailed. Class {} blocks MUST be specified before anything that uses them. That means they must be defined before client {}, connect {} and operator {}.
+
// C++ style single-line
-
Times / durations are written as:
+
# Shell style single-line
 +
</pre>
-
* A number in seconds (e.g., 60)
+
{{info|text=Blocks are used in the reverse order than how they're listed, when the configuration file is parsed. This means you should start multiple block definitions with the "fall through", and end with the most detailed.}}
-
* 1 hours 30 minutes 10 seconds
+
-
* An arithmetic expression (e.g., 1*60+20)
+
-
 
+
-
Valid units of time:
+
-
 
+
-
* Decade, year, month, week, day, hour, minute, second
+
-
 
+
-
Valid units of size:
+
-
 
+
-
* terabyte / tbyte
+
-
* gigabyte / gbyte
+
-
* megabyte / mbyte
+
-
* kilobyte / kbyte
+
-
* byte
+
-
 
+
-
Sizes and times may be specified as singular or plural.
+
== General block ==
== General block ==
-
{| class="simpletable"
+
{| class="simpletable" width="100%"
|width="250px"|Requirement:
|width="250px"|Requirement:
|REQUIRED
|REQUIRED
Line 55: Line 38:
The General block defines information about the server itself. It is required for the server to start.
The General block defines information about the server itself. It is required for the server to start.
-
<html><pre><strong>general</strong> {
+
<html><pre><strong>General</strong> {
     <span class="comment">/* name: the name of our server. */</span>
     <span class="comment">/* name: the name of our server. */</span>
     name = <span class="qstring">"test.area.zone.darenet.org"</span>;
     name = <span class="qstring">"test.area.zone.darenet.org"</span>;
Line 65: Line 48:
     * digit between 0 and 4095, and is not updated on a rehash.
     * digit between 0 and 4095, and is not updated on a rehash.
     */</span>
     */</span>
-
     numeric = <span class="integer"> 999</span>;
+
     numeric = <span class="integer">999</span>;
     <span class="comment">/* vhost: the IP to bind to when we connect outward to other servers.
     <span class="comment">/* vhost: the IP to bind to when we connect outward to other servers.
Line 92: Line 75:
== Admin block ==
== Admin block ==
-
{| class="simpletable"
+
{| class="simpletable" width="100%"
|width="250px"|Requirement:
|width="250px"|Requirement:
|SUGGESTED
|SUGGESTED
Line 102: Line 85:
The Admin block defines information that can be retrieved with the <code>/ADMIN</code> command.
The Admin block defines information that can be retrieved with the <code>/ADMIN</code> command.
-
<html><pre><strong>admin</strong> {
+
<html><pre><strong>Admin</strong> {
     location = <span class="qstring">"DareNET - http://www.darenet.org"</span>;
     location = <span class="qstring">"DareNET - http://www.darenet.org"</span>;
     location = <span class="qstring">"Infrastructure Team"</span>;
     location = <span class="qstring">"Infrastructure Team"</span>;
Line 113: Line 96:
== Class block ==
== Class block ==
-
{| class="simpletable"
+
{| class="simpletable" width="100%"
|width="250px"|Requirement:
|width="250px"|Requirement:
|RECOMMENDED
|RECOMMENDED
Line 124: Line 107:
The Class blocks define connection classes. All connections to the server are associated with a "connection class", whether they be incoming or outgoing (initiated by the server), be they clients or servers.
The Class blocks define connection classes. All connections to the server are associated with a "connection class", whether they be incoming or outgoing (initiated by the server), be they clients or servers.
-
<html><pre><strong>class</strong> {
+
<html><pre><strong>Class</strong> {
     <span class="comment">/* name: a name for the connection class. */</span>
     <span class="comment">/* name: a name for the connection class. */</span>
     name = <span class="qstring">"Users"</span>;
     name = <span class="qstring">"Users"</span>;
Line 141: Line 124:
     maxlinks = <span class="integer">100</span>;
     maxlinks = <span class="integer">100</span>;
-
     <span class="comment">/* usermode: an optional list of user modes that should be set
+
     <span class="comment">/* usermode: an optional list of user modes that should set
     * upon the user while connecting.
     * upon the user while connecting.
     */</span>
     */</span>
     usermode = <span class="qstring">"+iw"</span>;  
     usermode = <span class="qstring">"+iw"</span>;  
 +
 +
    <span class="comment">/* maxchans: the maximum number of channels that clients may join.
 +
    */</span>
 +
    maxchans = <span class="integer">50</span>;
};
};
-
<strong>class</strong> {
+
<strong>Class</strong> {
     name = <span class="qstring">"Opers"</span>;
     name = <span class="qstring">"Opers"</span>;
     pingfreq = 2 minutes;
     pingfreq = 2 minutes;
Line 156: Line 143:
};
};
-
<strong>class</strong> {
+
<strong>Class</strong> {
     name = <span class="qstring">"Server"</span>;
     name = <span class="qstring">"Server"</span>;
     pingfreq = 3 minutes;
     pingfreq = 3 minutes;
Line 175: Line 162:
};
};
-
<strong>class</strong> {
+
<strong>Class</strong> {
     name = <span class="qstring">"Leaf_Server"</span>;
     name = <span class="qstring">"Leaf_Server"</span>;
     pingfreq = 3 minutes;
     pingfreq = 3 minutes;
Line 190: Line 177:
There may be multiple Class blocks; at least one is recommended.
There may be multiple Class blocks; at least one is recommended.
-
== Client Block ==
+
== Client block ==
-
{| class="simpletable"
+
{| class="simpletable" width="100%"
|width="250px"|Requirement:
|width="250px"|Requirement:
|RECOMMENDED
|RECOMMENDED
Line 202: Line 189:
The Client blocks define the hosts client connections are allowed from, and places them into classes. While the server will start without a Client block, it will not be usable.
The Client blocks define the hosts client connections are allowed from, and places them into classes. While the server will start without a Client block, it will not be usable.
-
<html><pre><strong>client</strong> {
+
<html><pre><strong>Client</strong> {
     <span class="comment">/* host: resolved user@host mask allowed to connect. This is optional
     <span class="comment">/* host: resolved user@host mask allowed to connect. This is optional
-
     * if you are using the ip mask to match against.
+
     * if you are using the ip mask to match against.  Additionally, if you specify *@loc for
 +
    * this field it will match all LOC users.
     */</span>
     */</span>
     host = <span class="qstring">"*@*.wirehub.net"</span>;
     host = <span class="qstring">"*@*.wirehub.net"</span>;
Line 230: Line 218:
</pre></html>
</pre></html>
-
The server uses a default deny policy for incoming connections; at least one Client block must be supplied if you wish to use your server.
+
The server uses a default deny policy for incoming connections. You need to define at least one Client block if you wish to use your server.
-
The <code>host</code> and <code>ip</code> tokens specify which connections the block matches. The server always performs DNS and ident lookups for connections. If DNS cannot find a hostname, the IP is used instead. If ident cannot get a valid response, "unknown" is used during this state. The client's resolved hostname, IP address, ident reply, and username (from the USER line) are used according to the results of the matches described below.
+
The <code>host</code> and <code>ip</code> fields specify which connections the block matches. The server always performs a DNS and ident lookup for connections. If DNS cannot find a hostname, the IP address is used instead. If ident cannot get a valid reply, "unknown" is used during this state. The client's resolved hostname, IP address, ident reply, and username (from the USER line) are used according to the results of the matches described below.
-
Note: There is a special case for UNIX domain sockets and localhost connections. In these cases, the <code><ip mask></code> field is compared with the name of the server (thus not with any IP number representation). The name of the server is the one returned in the numeric 002 reply.
+
'''Note:''' There is a specify case for UNIX domain sockets and localhost connections. In these cases, the <code>ip / host</code> field is compared with the name of the server, and thus not with any IP number representation. The name of the server is that returned in the numeric 002 reply, example: <code>002 Your host is 2.darenet.org[jolan.ppro]. running version ...</code> In this example, "jolan.ppro" is the name used for matching; therefore, UNIX domain sockets and connections to localhost would match a block containing: <code>host = "*@jolan.ppro";</code>.
-
For example: <code>002 Your host is 2.darenet.org[jolan.ppro]. running version ...</code>
+
The <code>host</code> field attempts to match first against the resolved hostname, if available, and then against the IP address. To include the connection's ident reply in the match, use a mask in the form "ident@host". If a client matches, it appears on IRC using its resolved hostname.
-
In the above example, "jolan.ppro" is the name used for matching; therefore, UNIX domain sockets and connections to localhost would match a block containing: <code>host = "*@jolan.ppro";</code>
+
The <code>ip</code> field attempts to match against the IP address only. An ident may be specified to match against, as well.
-
The <code>host</code> token attempts to match first against the resolved hostname if available, then against the IP address. To include the connection's ident response in the match, use a mask in the form "ident@host". If a client matches this token, it appears on IRC using its resolved name.
+
'''Note:''' If the ident portion is specified in a mask (i.e., "ident@host" instead of "host"), and no ident reply is received from the client, it will appear on IRC with its username prefixed with a '~' tilde. If the matching mask used only the "host" form, the client's username is not prefixed. If a valid ident reply is received, it is always used and not prefixed.
-
The <code>ip</code> token attempts to match against the IP address only. An ident may be specified to match against, as well.
+
You need only specify a <code>host</code> or <code>ip</code> field, not both. If both are used, <code>host</code> is matched against first.
-
 
+
-
If the matching mask used ident ("ident@host" instead of "host"), and no ident response was received from the client, it appears on IRC with its username prefixed with '~'. If the matching mask used only the "host" form, the client's username is not prefixed. If a valid ident response was received, it is always used (without prefixed), regardless of the mask form.
+
-
 
+
-
Only one of the <code>host</code> and <code>ip</code> tokens is needed; if both are used, host is matched first. For typical configurations, using only the <code>host</code> token with a "*@host" or "ident@host" mask is recommended.
+
There may be multiple Client blocks; at least one is recommended.
There may be multiple Client blocks; at least one is recommended.
Line 252: Line 236:
== Motd block ==
== Motd block ==
-
{| class="simpletable"
+
{| class="simpletable" width="100%"
|width="250px"|Requirement:
|width="250px"|Requirement:
|OPTIONAL
|OPTIONAL
|-
|-
|Old conf format equivalents:
|Old conf format equivalents:
-
|<code>T:hostmask|classnumber:path</code>
+
|<code>T:hostmask&#124;classnumber:path</code>
|}
|}
The Motd blocks allow a different Message of the Day to be shown to connecting clients based on their origin.
The Motd blocks allow a different Message of the Day to be shown to connecting clients based on their origin.
-
<html><pre><strong>motd</strong> {
+
<html><pre><strong>Motd</strong> {
     <span class="comment">/* host: a hostmask, class number or class name to match against. */</span>
     <span class="comment">/* host: a hostmask, class number or class name to match against. */</span>
     host = <span class="qstring">"*.jp"</span>;
     host = <span class="qstring">"*.jp"</span>;
Line 271: Line 255:
</pre></html>
</pre></html>
-
More then one 'host' entry may be present in an Motd block.
+
More then one <code>host</code> field may be present in an Motd block.
There may be multiple Motd blocks.
There may be multiple Motd blocks.
-
== Connect Block ==
+
== Connect block ==
-
{| class="wikitable" width="40%" style="font-size: 97%; text-align: left;"
+
{| class="simpletable" width="100%"
-
| Requirement:
+
|width="250px"|Requirement:
-
| OPTIONAL
+
|OPTIONAL
|-
|-
-
| Old conf format equivalents:
+
|Old conf format equivalents:
-
| C:line, H:line, L:line
+
|<code>C:host:cpassword:name:port:class</code><br /><code>N:host:apassword:name:flags:class</code><br /><code>H:host::name:maxhops</code><br /><code>L:host::mask:depth</code>
|}
|}
-
Connect {} blocks define what servers the server may connect to, and which servers are allowed to connect.
+
The Connect blocks define links to other servers.
-
IRC servers connect to other servers forming a network with a star or tree topology. Loops are not allowed. In this network, two servers can be distinguished: "hub" and "leaf". Leaf servers connect to hubs; hubs connect to each other. Of course, many servers can't be directly classified in either of these categories. Both a fixed and a rule-based decision making system for server links exists to aide ircd in deciding what links to allow, what to let humans do themselves and what links to (forcefully) disallow.
+
<html><pre><strong>Connect</strong> {
 +
    <span class="comment">/* name: the name of the server. */</span>
 +
    name = <span class="qstring">"uplink.darenet.org"</span>;
-
<pre>Connect
+
    <span class="comment">/* host: the host or IP to connect to. If a hostname is used it
-
{
+
    * must match the reverse dns of the server.
-
  name = "servername";
+
    */</span>
-
  host = "hostnameORip";
+
    host = <span class="qstring">"192.168.0.1"</span>;
-
  password = "passwd";
+
-
  port = portno;
+
-
  class = "classname";
+
-
  maxhops = 2;
+
-
  hub;
+
-
  leaf = no;
+
-
  autoconnect = no;
+
-
};</pre>
+
-
The "port" field defines the default port the server tries to connect to if an operator uses /CONNECT without specifying a port. This is also the port used when the server attempts to auto-connect to the remote server. You may tell ircd-darenet to not automatically connect to a server by adding <code>"autoconnect = no;"</code>; the default is to auto connect.
+
    <span class="comment">/* password: the password we send and accept. */</span>
 +
    password = <span class="qstring">"somepass"</span>;
-
The maxhops field causes an SQUIT if a hub tries to introduce servers farther away than that; the element 'leaf;' is an alias for a maxhops of 0. The hub field limits the names of servers that may be introduced by a hub; the element 'hub;' is an alias for <code>hub = "*";</code>.
+
    <span class="comment">/* port: the port to connect to this server on. This is also the
 +
    * port used when the server attempts to auto-connect (if enabled).
 +
    */</span>
 +
    port = <span class="integer">7325</span>;
-
Example block:
+
    <span class="comment">/* class: the class this server should be placed in. */</span>
 +
    class = <span class="qstring">"Server"</span>;
-
Our primary uplink:
+
    <span class="comment">/* maxhops: the max number of hops a hub may introduce. If a hub
-
<c>Connect
+
    * tries to introduce servers farther away than what is specified here, an SQUIT is
-
{
+
    * issued. The 'leaf' token is an alias for "maxhops = 0;".  
-
  name = "servername.hub.darenet.org";
+
    */</span>
-
  host = "1.2.3.4";
+
    maxhops = <span class="integer">2</span>;
-
  password = "passwd";
+
-
  port = 7325;
+
-
  class = "Server";
+
-
  hub;
+
-
};</c>
+
-
== CRULE Block ==
+
    <span class="comment">/* hub: (optional) the mask of servers that this server may hub
 +
    * for. The tag 'hub' is an alias for 'hub = "*";'.
 +
    */</span>
 +
    hub = <span class="qstring">"*.us.darenet.org"</span>;
-
{| class="wikitable" width="40%" style="font-size: 97%; text-align: left;"
+
    <span class="comment">/* autoconnect: (optional) determines if we should try to
-
| Requirement:
+
    * automatically connect to this server. The default is to autoconnect.
-
| OPTIONAL
+
    */</span>
 +
    autoconnect = no; 
 +
};
 +
</pre></html>
 +
 
 +
There may be multiple Connect blocks.
 +
 
 +
== CRule block ==
 +
 
 +
{| class="simpletable" width="100%"
 +
|width="250px"|Requirement:
 +
|OPTIONAL
|-
|-
-
| Old conf format equivalents:
+
|Old conf format equivalents:
-
| D:line, d:line
+
|<code>D:servermask::rule</code><br /><code>d:servermask::rule</code>
|}
|}
-
For an advanced, real-time rule-based routing decision making system, you can use the crule {} blocks. For more information, see doc/readme.crules. If more than one server mask is present in a single rule, the rule applies to all servers.
+
The CRule (connection rule) blocks control ircd-darenet's advanced, real-time rule-based routing decision making system.
-
Using <code>all = yes;</code> makes the rule always apply; otherwise, it only applies to auto connects.
+
<html><pre><strong>CRule</strong> {
 +
    <span class="comment">/* server: rules will be applied towards servers matching this mask. */</span>
 +
    server = <span class="qstring">"*.eu.darenet.org"</span>;
-
<pre>CRULE
+
    <span class="comment">/* rule: the connection rule. */</span>
-
{
+
    rule = <span class="qstring">"connected(amsterdam.eu.*)"</span>;
-
  server = "servermask";
+
-
  rule = "connectrule";
+
-
  all = yes;
+
-
};</pre>
+
-
Example blocks:
+
    <span class="comment">/* all: (optional) setting this to 'yes' will make the rule always
 +
    * apply; otherwise, it only applies to autoconnects.
 +
    */</span>
 +
    all = yes;
 +
};
 +
</pre></html>
-
<c>CRULE
+
If more than one server mask is present in a single crule, the rule will apply to all servers.
-
{
+
-
  server = "*.us.darenet.org";
+
-
  rule = "connected(*.us.darenet.org)";
+
-
};</c>
+
-
Recommended for all leafs:
+
See doc/readme.crules for more information on the crule system, including examples of allowed rules.
-
<c>CRULE
+
 
-
{
+
There may be multiple CRule blocks.
-
  server = "*";
+
-
  rule = "directcon(*)";
+
-
};</c>
+
== Port Block ==
== Port Block ==
-
{| class="wikitable" width="40%" style="font-size: 97%; text-align: left;"
+
{| class="simpletable" width="100%"
-
| Requirement:
+
|width="250px"|Requirement:
-
| SUGGESTED
+
|REQUIRED
|-
|-
-
| Old conf format equivalents:
+
|Old conf format equivalents:
-
| P:line
+
|<code>P:hostmask:interface:<[CES][H]>:port</code>
|}
|}
-
As more users use the server, you will notice delays when trying to connect to the primary listening port. It is possible, via Port {} blocks, to specify additional ports for the ircd to listen for connections on. De facto ports are: 6667 - standard; 6660-6669, 7000 - additional client ports; 6697 & 9999 = SSL. DareNET uses 7325 for server listener ports.
+
The Port blocks define where the server will accept connections. At least one port block is required to start.
-
These are just hints, they are in no way official IANA or IETF policies. IANA says we should use port 194, but that requires us to run as root, so we don't do that.
+
<html><pre><strong>Port</strong> {
 +
    <span class="comment">/* port: the specific port to listen on. */</span>
 +
    port = <span class="integer">7325</span>;
-
<pre>Port
+
    <span class="comment">/* mask: (optional) the IP address (or a range of IP addresses) that
-
{
+
    * the server will allow connections from.
-
  port = number;
+
    */</span>
-
  mask = "ipmask";
+
    mask = <span class="qstring">"127.0.*.*"</span>;
-
  // Use this to control the interface you bind to.
+
-
  vhost = "virtual host ip";
+
-
  // Setting to yes makes this server only.
+
-
  server = yes;
+
-
  // Setting to yes makes the port "hidden" from stats.
+
-
  hidden = yes;
+
-
  // Setting to yes makes the port accept SSL connections from clients.
+
-
  crypt = yes;
+
-
  // Setting to yes makes the port exempt from connection restrictions
+
-
  // during a timed /restart or /die.
+
-
  exempt = yes;
+
-
};</pre>
+
-
The mask setting allows you to specify a range of IP addresses that you will allow connections from. This should only contain IP addresses and '*' if used. This field only uses IP addresses. This does not use DNS in any way, so you can't use it to allow *.jp or *.uk, and so on. Attemptinh to specify anything other than numbers, dots and starts [0-9.*] will result in the port allowing connections from anyone.
+
    <span class="comment">/* vhost: (optional) set a specific IP/host the port (listed after
 +
    * the 'port' token) will listen for.
 +
    */</span>
 +
    vhost = <span class="qstring">"127.0.0.1"</span>;
-
The <virtual host> setting allows multiple homed hosts to specify which interface to use on a port by port basis. If an interface is not specified, the default interface will be used. The interface MUST be the complete IP address for a real hardware interface on the machine running ircd. If you want to use virtual hosting YOU MUST USE THIS; otherwise, it WILL bind to all interfaces -- not what most people seem to expect.
+
    <span class="comment">/* server: setting this to yes makes this a server only port. */</span>
 +
    server = yes;
-
Example blocks:
+
    <span class="comment">/* hidden: (optional) setting this to 'yes' makes the port
 +
    * "hidden" from stats replies.
 +
    */</span>
 +
    hidden = yes;
-
<c>Port
+
    <