DareNET IRCd Configuration/1.5
m (→Ban Block) |
(→Connect block) |
||
| (75 intermediate revisions not shown) | |||
| Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
| - | This is a reference guide for ircd-darenet 1. | + | 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 or string data. It is designed to be easily readable by both human ircd. | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | 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: | |
| - | / | + | <html><pre><strong>blockname</strong> { |
| + | name = value; | ||
| + | name = <span class="qstring">"string"</span>; | ||
| + | name = <span class="integer">123</span>; | ||
| + | tag; | ||
| + | };</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 forms of comments are allowed: | |
| - | + | ||
| - | Whitespace | + | |
| - | + | <pre>/* C style single/multi-line */ | |
| - | + | // C++ style single-line | |
| - | + | # Shell style single-line | |
| + | </pre> | ||
| + | {{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.}} | ||
| - | {| class=" | + | == General block == |
| - | | Requirement: | + | |
| - | | REQUIRED | + | {| class="simpletable" width="100%" |
| + | |width="250px"|Requirement: | ||
| + | |REQUIRED | ||
|- | |- | ||
| - | | Old conf format equivalents: | + | |Old conf format equivalents: |
| - | | M: | + | |<code>M:name:vhost:description::numeric</code> |
|} | |} | ||
| - | The General | + | The General block defines information about the server itself. It is required for the server to start. |
| - | <pre>General | + | <html><pre><strong>General</strong> { |
| - | { | + | <span class="comment">/* name: the name of our server. */</span> |
| - | + | name = <span class="qstring">"test.area.zone.darenet.org"</span>; | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | <span class="comment">/* description: the description of our server. */</span> | |
| + | description = <span class="qstring">"ircd-darenet test server"</span>; | ||
| - | + | <span class="comment">/* numeric: the unique server numeric for our server. It must be a | |
| + | * digit between 0 and 4095, and is not updated on a rehash. | ||
| + | */</span> | ||
| + | numeric = <span class="integer">999</span>; | ||
| - | + | <span class="comment">/* vhost: the IP to bind to when we connect outward to other servers. | |
| + | * It must contain either a * or a valid ipv4 address in dotted quad notation. | ||
| + | */</span> | ||
| + | vhost = <span class="qstring">"192.169.0.1"</span>; | ||
| - | + | <span class="comment">/* ssl_private_key: our ssl private key. */</span> | |
| + | ssl_private_key = <span class="qstring">"etc/ircd.key"</span>; | ||
| - | + | <span class="comment">/* ssl_pem: file containing our ssl certificate and private key */</span> | |
| + | ssl_pem = <span class="qstring">"etc/ircd.pem"</span>; | ||
| - | + | <span class="comment">/* dpass: (optional) password for DIE command. */</span> | |
| + | dpass = <span class="qstring">"encrypted pass"</span>; | ||
| - | + | <span class="comment">/* rpass: (optional) password for RESTART command. */</span> | |
| + | rpass = <span class="qstring">"$PLAIN$password"</span>; | ||
| + | }; | ||
| + | </pre></html> | ||
| - | + | The server name may only be changed by a server restart. The description can be changed on rehash, but will not propagate to other linked servers. | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | There must be exactly one General block. | |
| - | {| class=" | + | == Admin block == |
| - | | Requirement: | + | |
| - | | SUGGESTED | + | {| class="simpletable" width="100%" |
| + | |width="250px"|Requirement: | ||
| + | |SUGGESTED | ||
|- | |- | ||
| - | | Old conf format equivalents: | + | |Old conf format equivalents: |
| - | | A: | + | |<code>A:line1:line2:line3</code> |
|} | |} | ||
| - | The Admin | + | The Admin block defines information that can be retrieved with the <code>/ADMIN</code> command. |
| - | + | <html><pre><strong>Admin</strong> { | |
| + | location = <span class="qstring">"DareNET - http://www.darenet.org"</span>; | ||
| + | location = <span class="qstring">"Infrastructure Team"</span>; | ||
| + | contact = <span class="qstring">"<infrastructure@darenet.org>"</span>; | ||
| + | }; | ||
| + | </pre></html> | ||
| - | + | Not all lines are required. There may only be one Admin block. | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | == Class block == | |
| - | + | {| class="simpletable" width="100%" | |
| - | { | + | |width="250px"|Requirement: |
| - | + | |RECOMMENDED | |
| - | + | |- | |
| - | + | |Old conf format equivalents: | |
| - | + | |<code>Y:class:pingfreq::maxlinks:sendq (clients)</code><br /><code>Y:class:pingfreq:connectfreq:maxlinks:sendq (servers)</code> | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | | | + | |
| - | | | + | |
|- | |- | ||
| - | |||
| - | |||
|} | |} | ||
| - | The Class | + | 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. |
| - | <pre>Class | + | <html><pre><strong>Class</strong> { |
| - | { | + | <span class="comment">/* name: a name for the connection class. */</span> |
| - | + | name = <span class="qstring">"Users"</span>; | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | <span class="comment">/* pingfreq: how often to PING idle connections. */</span> | |
| + | pingfreq = 1 minute 30 seconds; | ||
| - | + | <span class="comment">/* sendq: send buffer limit (i.e., the amount of data allowed in | |
| + | * a client's queue before they are dropped. | ||
| + | */</span> | ||
| + | sendq = 100 kilobytes; | ||
| - | + | <span class="comment">/* maxlinks: the maximum number of connections that may use this | |
| + | * class. May be between 0 and 4,000,000,000. | ||
| + | */</span> | ||
| + | maxlinks = <span class="integer">100</span>; | ||
| - | + | <span class="comment">/* usermode: an optional list of user modes that should set | |
| + | * upon the user while connecting. | ||
| + | */</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> { | |
| + | name = <span class="qstring">"Opers"</span>; | ||
| + | pingfreq = 2 minutes; | ||
| + | sendq = 100 kilobytes; | ||
| + | maxlinks = <span class="integer">10</span>; | ||
| + | usermode = <span class="qstring">"+iw"</span>; | ||
| + | whox; | ||
| + | }; | ||
| - | + | <strong>Class</strong> { | |
| + | name = <span class="qstring">"Server"</span>; | ||
| + | pingfreq = 3 minutes; | ||
| - | + | <span class="comment">/* connectfreq: this token applies only to servers, and specifies | |
| + | * the frequency that the server tries to auto connect. Setting this to 0 will cause a | ||
| + | * server to attempt to connect repeatedly, with no delay until the maxlinks condition | ||
| + | * is satisfied (which is not a good thing). | ||
| + | */</span> | ||
| + | connectfreq = 5 minutes; | ||
| - | + | <span class="comment">/* maxlinks: for server classes, specifies the maximum number of | |
| + | * servers to autoconnect to. This should be 0 for hubs, and 1 for leafs. | ||
| + | */</span> | ||
| + | maxlinks = <span class="integer">0</span>; | ||
| - | + | sendq = 10 megabytes; | |
| - | + | }; | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | }; | + | |
| - | == | + | <strong>Class</strong> { |
| + | name = <span class="qstring">"Leaf_Server"</span>; | ||
| + | pingfreq = 3 minutes; | ||
| + | connectfreq = 5 minutes; | ||
| + | maxlinks = 1; | ||
| + | sendq = 10 megabytes; | ||
| + | }; | ||
| + | </pre></html> | ||
| - | {| class=" | + | For connection classes intended for operator use, you can specify privileges the operator should be granted when the Operator block names the class. The local privilege MUST be defined by either the Class or Operator block. It is highly recommended that most privileges be explicitly specified in the operator's Operator block on DareNET. |
| - | | | + | |
| + | A "default" class is created internally. This class is used when no other class is specified, but its settings are not useful for most situations. Custom classes are strongly recommended. | ||
| + | |||
| + | There may be multiple Class blocks; at least one is recommended. | ||
| + | |||
| + | == Client block == | ||
| + | |||
| + | {| class="simpletable" width="100%" | ||
| + | |width="250px"|Requirement: | ||
| + | |RECOMMENDED | ||
| + | |- | ||
| + | |Old conf format equivalents: | ||
| + | |<code>I:ipmask:passwd:hostmask:port:class</code> | ||
|} | |} | ||
| - | + | 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. | |
| - | <pre>Client | + | <html><pre><strong>Client</strong> { |
| - | { | + | <span class="comment">/* host: resolved user@host mask allowed to connect. This is optional |
| - | + | * 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> | |
| - | + | host = <span class="qstring">"*@*.wirehub.net"</span>; | |
| - | + | ||
| - | + | ||
| - | + | <span class="comment">/* ip: unresolved user@ip mask allowed to connect. */</span> | |
| + | ip = <span class="qstring">"*@195.86.128.*"</span>; | ||
| - | + | <span class="comment">/* password: (optional) password that is required to use this block. | |
| + | * This password string is not encrypted. | ||
| + | */</span> | ||
| + | password = <span class="qstring">"letMEHin"</span>; | ||
| - | + | <span class="comment">/* class: the class the user should be placed in. */</span> | |
| + | class = <span class="qstring">"Users"</span>; | ||
| - | + | <span class="comment">/* maxlinks: if specified, the server will only accept clients when | |
| + | * the total number of connections to the network from the same IP number doesn't exceed | ||
| + | * this number. | ||
| + | */</span> | ||
| + | maxlinks = <span class="integer">6</span>; | ||
| - | < | + | <span class="comment">/* port: (optional) a port to limit this block to. */</span> |
| + | port = <span class="integer">6660</span>; | ||
| + | }; | ||
| + | </pre></html> | ||
| - | + | 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. | |
| - | <code>host | + | 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 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>. | |
| - | + | 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. | |
| - | < | + | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | The <code>ip</code> field attempts to match against the IP address only. An ident may be specified to match against, as well. | |
| - | < | + | |
| - | + | ||
| - | + | ||
| - | + | ||