DareNET IRCd Configuration/1.5
m (→General block) |
(→Connect block) |
||
| (62 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 | + | 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 | + | 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 | + | 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 | |
| + | </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.}} | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
== General block == | == General block == | ||
| - | {| class="simpletable" | + | {| class="simpletable" width="100%" |
| - | |Requirement: | + | |width="250px"|Requirement: |
|REQUIRED | |REQUIRED | ||
|- | |- | ||
|Old conf format equivalents: | |Old conf format equivalents: | ||
| - | |M:name:vhost:description::numeric | + | |<code>M:name:vhost:description::numeric</code> |
|} | |} | ||
| + | The General block defines information about the server itself. It is required for the server to start. | ||
| + | <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. | |
| - | + | == Admin block == | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | {| class="simpletable" width="100%" | |
| - | + | |width="250px"|Requirement: | |
| - | {| class=" | + | |SUGGESTED |
| - | | 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. |
| - | | Requirement: | + | |
| - | | | + | 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: | + | |Old conf format equivalents: |
| - | | I: | + | |<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. | |
| - | < | + | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | '''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. | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | 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. | |
| - | {| class=" | + | There may be multiple Client blocks; at least one is recommended. |
| - | | Requirement: | + | |
| - | | OPTIONAL | + | == Motd block == |
| + | |||
| + | {| class="simpletable" width="100%" | ||
| + | |width="250px"|Requirement: | ||
| + | |OPTIONAL | ||
|- | |- | ||
| - | | Old conf format equivalents: | + | |Old conf format equivalents: |
| - | | T: | + | |<code>T:hostmask|classnumber:path</code> |
|} | |} | ||
| - | + | The Motd blocks allow a different Message of the Day to be shown to connecting clients based on their origin. | |
| - | <pre> | + | <html><pre><strong>Motd</strong> { |
| - | { | + | <span class="comment">/* host: a hostmask, class number or class name to match against. */</span> |
| - | + | host = <span class="qstring">"*.jp"</span>; | |
| - | + | ||
| - | + | ||
| - | + | <span class="comment">/* file: the path to the MOTD file to be shown (relative to DPATH). */</span> | |
| + | file = <span class="qstring">"jp.motd"</span>; | ||
| + | }; | ||
| + | </pre></html> | ||
| - | + | More then one <code>host</code> field may be present in an Motd block. | |
| - | + | There may be multiple Motd blocks. | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | == Connect | + | == Connect block == |
| - | {| class=" | + | {| class="simpletable" width="100%" |
| - | | Requirement: | + | |width="250px"|Requirement: |
| - | | OPTIONAL | + | |OPTIONAL |
|- | |- | ||
| - | | Old conf format equivalents: | + | |Old conf format equivalents: |
| - | | C: | + | |<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 | + | The Connect blocks define links to other servers. |
| - | + | <html><pre><strong>Connect</strong> { | |
| + | <span class="comment">/* name: the name of the server. */</span> | ||
| + | name = <span class="qstring">"uplink.darenet.org"</span>; | ||
| - | < | + | <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. | |
| - | + | */</span> | |
| - | + | host = <span class="qstring">"192.168.0.1"</span>; | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | <span class="comment">/* password: the password we send and accept. */</span> | |
| + | password = <span class="qstring">"somepass"</span>; | ||
| - | + | <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>; | ||
| - | + | <span class="comment">/* class: the class this server should be placed in. */</span> | |
| + | class = <span class="qstring">"Server"</span>; | ||
| - | + | <span class="comment">/* maxhops: the max number of hops a hub may introduce. If a hub | |
| - | < | + | * tries to introduce servers farther away than what is specified here, an SQUIT is |
| - | + | * issued. The 'leaf' token is an alias for "maxhops = 0;". | |
| - | + | */</span> | |
| - | + | maxhops = <span class="integer">2</span>; | |
| - | + | ||
| - | + | <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>; | |
| - | == | + | <span class="comment">/* autoconnect: (optional) determines if we should try to |
| + | * automatically connect to this server. The default is to autoconnect. | ||
| + | */</span> | ||
| + | autoconnect = no; | ||
| + | }; | ||
| + | </pre></html> | ||
| - | {| class=" | + | There may be multiple Connect blocks. |
| - | | Requirement: | + | |
| - | | OPTIONAL | + | == CRule block == |
| + | |||
| + | {| class="simpletable" width="100%" | ||
| + | |width="250px"|Requirement: | ||
| + | |OPTIONAL | ||
|- | |- | ||
| - | | Old conf format equivalents: | + | |Old conf format equivalents: |
| - | | D: | + | |<code>D:servermask::rule</code><br /><code>d:servermask::rule</code> |
|} | |} | ||
| - | + | The CRule (connection rule) blocks control ircd-darenet's advanced, real-time rule-based routing decision making system. | |
| - | + | <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>; | ||
| - | < | + | <span class="comment">/* rule: the connection rule. */</span> |
| - | + | rule = <span class="qstring">"connected(amsterdam.eu.*)"</span>; | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | <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> | ||
| - | + | If more than one server mask is present in a single crule, the rule will apply to all servers. | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | See doc/readme.crules for more information on the crule system, including examples of allowed rules. | |
| - | + | ||
| - | + | There may be multiple CRule blocks. | |
| - | + | ||
| - | + | ||
| - | + | ||
== Port Block == | == Port Block == | ||
| - | {| class=" | + | {| class="simpletable" width="100%" |
| - | | Requirement: | + | |width="250px"|Requirement: |
| - | | | + | |REQUIRED |
|- | |- | ||
| - | | Old conf format equivalents: | + | |Old conf format equivalents: |
| - | | P: | + | |<code>P:hostmask:interface:<[CES][H]>:port</code> |
|} | |} | ||
| - | + | The Port blocks define where the server will accept connections. At least one port block is required to start. | |
| - | + | <html><pre><strong>Port</strong> { | |
| + | <span class="comment">/* port: the specific port to listen on. */</span> | ||
| + | port = <span class="integer">7325</span>; | ||
| - | < | + | <span class="comment">/* mask: (optional) the IP address (or a range of IP addresses) that |
| - | + | * the server will allow connections from. | |
| - | + | */</span> | |
| - | + | mask = <span class="qstring">"127.0.*.*"</span>; | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | <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>; | ||
| - | + | <span class="comment">/* server: setting this to yes makes this a server only port. */</span> | |
| + | server = yes; | ||
| - | + | <span class="comment">/* hidden: (optional) setting this to 'yes' makes the port | |
| + | * "hidden" from stats replies. | ||
| + | */</span> | ||
| + | hidden = yes; | ||
| - | < | + | <span class="comment">/* crypt: (optional) setting this to 'yes' makes the port accept |
| - | + | * SSL connections. | |
| - | + | */</span> | |
| - | + | crypt = yes; | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | < | + | <span class="comment">/* exempt: (optional) setting this to 'yes' makes the port exempt |
| - | + | * from connection restrictions during a timed /RESTART or /DIE. | |
| - | + | */</span> | |
| - | + | exempt = no; | |
| - | + | }; | |
| - | };</ | + | </pre></html> |
| - | + | The <code>mask</code> field should only contain IP addresses (CIDR notation is supported) or '*', if used. This does not use DNS in any way, so you cannot use it to allow *.dk or *.uk, for example. Attempting to specify anything other than IP addresses will result in the port allowing connections from anyone (as if you used '*'). | |
| - | {| class=" | + | If the <code>vhost</code> field (i.e., bind address) is not specified, the server will listen on all available interfaces for that port. |
| - | | Requirement: | + | |
| - | | SUGGESTED | + | There may be multiple Port blocks. |
| + | |||
| + | == Operator block == | ||
| + | |||
| + | {| class="simpletable" width="100%" | ||
| + | |width="250px"|Requirement: | ||
| + | |SUGGESTED | ||
|- | |- | ||
| - | | Old conf format equivalents: | + | |Old conf format equivalents: |
| - | | O: | + | |<code>O:host:password:name:flags:class</code><br /><code>o:host:password:name:flags:class</code> |
|} | |} | ||
| - | The Operator | + | The Operator blocks define server operators. One or more of these blocks is recommended if you intend to maintain your server. |
| - | + | <html><pre><strong>Operator</strong> { | |
| + | <span class="comment">/* name: the oper's username. */</span> | ||
| + | name = <span class="qstring">"johndoe"</span>; | ||
| - | + | <span class="comment">/* host: the user@host/IP mask required for this operator. CIDR | |
| + | * notation is supported. Multiple host="" lines are supported. | ||
| + | */</span> | ||
| + | host = <span class="qstring">"god@*"</span>; | ||
| + | host = <span class="qstring">"*@127.0.0.1"</span>; | ||
| - | < | + | <span class="comment">/* password: the password required to oper. By default, the password is |
| - | + | * hashed using the system's native crypt() function. Other password | |
| - | + | * mechanisms are available; the umkpasswd utility located in the ircd | |
| - | + | * directory can hash passwords using those mechanisms. If you use a | |
| - | + | * password format that is not generated by umkpasswd, ircd-darenet will | |
| - | + | * not recognize the oper's password. | |
| - | + | */</span> | |
| - | + | password = <span class="qstring">"/home/irc/keys/johndoe.key"</span>; | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | <span class="comment">/* flags: misc options for the oper. */</span> | |
| + | flags = <span class="qstring">"OAWInFR"</span>; | ||
| - | + | <span class="comment">/* snomask: (optional) specific server notice mask on oper up. If this | |
| + | * is specified, an oper will not be given sno_default. | ||
| + | */</span> | ||
| + | snomask = <span class="qstring">"+cegGiKorRs"</span>; | ||
| - | + | <span class="comment">/* privileges: (optional) you can specify privileges an oper will be | |
| + | * explicitly granted (or denied) upon opering. Any privileges defined | ||
| + | * will override any privilege settings that may be present in the class | ||
| + | * block specified above, and the default setting for those privileges. | ||
| + | */</span> | ||
| + | local = no; routing = yes; routeinfo = yes; | ||
| + | }; | ||
| + | </pre></html> | ||
| - | + | The <code>name</code> and <code>password</code> fields match the parameters of the <code>OPER</code> command. To authenticate as an IRC operator, a client must match one of the <code>host</code> fields, which may be a resolved hostname or IP address. | |
| - | + | To use an unencrypted password, prefix the password with '$PLAIN', e.g., "$PLAIN$aPpLe". | |
| - | + | If you want to use a more secure password authentication system, generate a 1024bit RSA key, and specify the path to the key as the password (as shown in the example above), and add 'R' to the <code>flags</code> field. This will use the <code>/CHALLENGE</code> system instead of <code>/OPER</code>. See doc/challenge.txt for more details. | |
| - | + | A client may also use their SSL client certificate fingerprint to authenticate as an IRC operator. To use this method, specify the client's certificate fingerprint as the password, and add 'S' to the <code>flags</code> field. | |
| - | + | Only one password authentication method may be used at a time. That is, you cannot use <code>CHALLENGE</code> and SSL client certificate fingerprint at the same time. | |
| - | + | There are currently 9 different oper flags: | |
| + | * o - Local operator | ||
| + | * O - Global operator | ||
| + | * A - Server administrator | ||
| + | * r - This operator block may be used from remote servers | ||
| + | * W - Allowed to set user mode +W | ||
| + | * I - Allowed to set user mode +I | ||
| + | * n - Allowed to set user mode +n | ||
| + | * F - Allowed to set user mode +F | ||
| + | * S - Use SSL client certificate fingerprint to <code>/OPER</code> | ||
| + | * R - Use <code>/CHALLENGE</code> password authentication system. | ||
| + | * j - Allowed to use juped nicknames. | ||
| - | + | The <code>class</code> field specifies the connection class the client will be placed in, regardless of their previous connection class. If not specified, the default class is used; see the Class block description for details. | |
| - | + | There may be multiple Operator blocks. | |
| - | + | == UWorld block == | |
| - | + | {| class="simpletable" width="100%" | |
| + | |width="250px"|Requirement: | ||
| + | |OPTIONAL | ||
| + | |- | ||
| + | |Old conf format equivalents: | ||
| + | |<code>U:server:jupednicks:*</code> | ||
| + | |} | ||
| - | + | The Uworld block defines "U-lined" servers, which are allowed to do special network things. Used for network services. | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | <html><pre><strong>UWorld</strong> { | |
| + | <span class="comment">/* name: the server name or wildcard mask the "U-line" applies to. */</span> | ||
| + | name = <span class="qstring">"services.darenet.org"</span>; | ||
| + | name = <span class="qstring">"stats.darenet.org"</span>; | ||
| + | }; | ||
| + | </pre></html> | ||
| - | + | UWorld servers are permitted to do things typical network services would want to do, such as apply network bans, manage channel modes, etc; the details are too numerous and complex to provide here. | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | There may be multiple UWorld blocks; all blocks are combined into one list. | |
| - | {| class=" | + | == NickJupe block == |
| - | | Requirement: | + | |
| - | | OPTIONAL | + | {| class="simpletable" width="100%" |
| + | |width="250px"|Requirement: | ||
| + | |OPTIONAL | ||
|- | |- | ||
| - | | Old conf format equivalents: | + | |Old conf format equivalents: |
| - | | U: | + | |<code>U:server:jupednicks:*</code> |
|} | |} | ||
| - | + | The NickJupe blocks disallow certain nicknames from being used. | |
| - | <pre> | + | <html><pre><strong>NickJupe</strong> { |
| - | { | + | <span class="qstring">"ChanServ"</span> = <span class="qstring">"Reserved for Services"</span>; |
| - | + | <span class="qstring">"NickS?rv"</span> = <span class="qstring">"Reserved for Services"</span>; | |
| - | };</pre> | + | }; |
| + | </pre></html> | ||
| - | + | Entries are specified in a key-value format, with the key being the nick to disallow (the '*' and '?' wildcards are supported), and the value being the reason (a single-line reason for the restriction, which is sent to clients along with the rejection notice). | |
| - | + | There may be multiple NickJupe blocks; all blocks are combined into one list. | |
| - | + | == Quarantine block == | |
| - | + | {| class="simpletable" width="100%" | |
| - | + | |width="250px"|Requirement: | |
| - | + | |OPTIONAL | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | {| class=" | + | |
| - | | Requirement: | + | |
| - | | OPTIONAL | + | |
|- | |- | ||
| - | | Old conf format equivalents: | + | |Old conf format equivalents: |
| - | | | + | |<code>Q:channel:reason</code> |
|} | |} | ||
| - | + | The Quarantine blocks disallow certain channel names from being used by non-opers. | |
| - | + | <html><pre><strong>Quarantine</strong> { | |
| + | <span class="qstring">"#help"</span> = <span class="qstring">"For assistance, please join #Support instead."</span>; | ||
| + | }; | ||
| + | </pre></html> | ||
| - | < | + | Entries are specified in a key-value format, with the key being the channel to disallow, and the value being the reason (a single-line reason for the restriction, which is sent to clients along with the rejection notice). Note, these are only checked at <code>/JOIN</code>, so if you add a channel and rehash, users will not be kicked if they're already in the channel. |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | There may be multiple Quarantine blocks; all blocks are combined into one list. | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
== Ban Block == | == Ban Block == | ||
| Line 670: | Line 651: | ||
<mask> is an ident@ip/host/cidr mask that is to match the user to be exempted. <flags> is one or more of the following flags to specify what the exempt is to match. | <mask> is an ident@ip/host/cidr mask that is to match the user to be exempted. <flags> is one or more of the following flags to specify what the exempt is to match. | ||
| + | * k - Except affects KLINEs. | ||
* g - Except affects GLINEs. | * g - Except affects GLINEs. | ||
* i - Except affects ident challenges (see IDENT_CHALLENGE feature). | * i - Except affects ident challenges (see IDENT_CHALLENGE feature). | ||
| - | * | + | * n - Except for notilde. |
* s - Except affects SHUNs. | * s - Except affects SHUNs. | ||
* z - Except affects ZLINEs. | * z - Except affects ZLINEs. | ||
| Line 682: | Line 664: | ||
NOTE: For throttling/clone exemptions (I), only IP addresses are supported, since these checks are performed before any DNS resolutions or identd replies are received. | NOTE: For throttling/clone exemptions (I), only IP addresses are supported, since these checks are performed before any DNS resolutions or identd replies are received. | ||
| + | NOTE: For notilde (n), IP/Host is required. | ||
Example block: | Example block: | ||
| Line 687: | Line 670: | ||
<c>Except | <c>Except | ||
{ | { | ||
| - | + | mask = "*@*.darenet.org"; | |
flags = "kgzsL"; | flags = "kgzsL"; | ||
};</c> | };</c> | ||
| Line 693: | Line 676: | ||
<c>Except | <c>Except | ||
{ | { | ||
| - | + | mask = "*@127.0.0.1"; | |
| - | flags = " | + | flags = "I"; |
};</c> | };</c> | ||
| Line 816: | Line 799: | ||
host = "127.0.0.1"; | host = "127.0.0.1"; | ||
username = "*"; | username = "*"; | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
};</c> | };</c> | ||
Current revision as of 18:00, 17 June 2013
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:
blockname {
name = value;
name = "string";
name = 123;
tag;
};
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 */ // C++ style single-line # Shell style single-line
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.
General block
| Requirement: | REQUIRED |
| Old conf format equivalents: | M:name:vhost:description::numeric
|
The General block defines information about the server itself. It is required for the server to start.
General {
/* name: the name of our server. */
name = "test.area.zone.darenet.org";
/* description: the description of our server. */
description = "ircd-darenet test server";
/* numeric: the unique server numeric for our server. It must be a
* digit between 0 and 4095, and is not updated on a rehash.
*/
numeric = 999;
/* 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.
*/
vhost = "192.169.0.1";
/* ssl_private_key: our ssl private key. */
ssl_private_key = "etc/ircd.key";
/* ssl_pem: file containing our ssl certificate and private key */
ssl_pem = "etc/ircd.pem";
/* dpass: (optional) password for DIE command. */
dpass = "encrypted pass";
/* rpass: (optional) password for RESTART command. */
rpass = "$PLAIN$password";
};
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.
Admin block
| Requirement: | SUGGESTED |
| Old conf format equivalents: | A:line1:line2:line3
|
The Admin block defines information that can be retrieved with the /ADMIN command.
Admin {
location = "DareNET - http://www.darenet.org";
location = "Infrastructure Team";
contact = "<infrastructure@darenet.org>";
};
Not all lines are required. There may only be one Admin block.
Class block
| Requirement: | RECOMMENDED |
| Old conf format equivalents: | Y:class:pingfreq::maxlinks:sendq (clients)Y:class:pingfreq:connectfreq:maxlinks:sendq (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.
Class {
/* name: a name for the connection class. */
name = "Users";
/* pingfreq: how often to PING idle connections. */
pingfreq = 1 minute 30 seconds;
/* sendq: send buffer limit (i.e., the amount of data allowed in
* a client's queue before they are dropped.
*/
sendq = 100 kilobytes;
/* maxlinks: the maximum number of connections that may use this
* class. May be between 0 and 4,000,000,000.
*/
maxlinks = 100;
/* usermode: an optional list of user modes that should set
* upon the user while connecting.
*/
usermode = "+iw";
/* maxchans: the maximum number of channels that clients may join.
*/
maxchans = 50;
};
Class {
name = "Opers";
pingfreq = 2 minutes;
sendq = 100 kilobytes;
maxlinks = 10;
usermode = "+iw";
whox;
};
Class {
name = "Server";
pingfreq = 3 minutes;
/* 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).
*/
connectfreq = 5 minutes;
/* maxlinks: for server classes, specifies the maximum number of
* servers to autoconnect to. This should be 0 for hubs, and 1 for leafs.
*/
maxlinks = 0;
sendq = 10 megabytes;
};
Class {
name = "Leaf_Server";
pingfreq = 3 minutes;
connectfreq = 5 minutes;
maxlinks = 1;
sendq = 10 megabytes;
};
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
| Requirement: | RECOMMENDED |
| Old conf format equivalents: | I:ipmask:passwd:hostmask:port:class
|
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.
Client {
/* 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.
*/
host = "*@*.wirehub.net";
/* ip: unresolved user@ip mask allowed to connect. */
ip = "*@195.86.128.*";
/* password: (optional) password that is required to use this block.
* This password string is not encrypted.
*/
password = "letMEHin";
/* class: the class the user should be placed in. */
class = "Users";
/* 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.
*/
maxlinks = 6;
/* port: (optional) a port to limit this block to. */
port = 6660;
};
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 host and ip 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 ip / host 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: 002 Your host is 2.darenet.org[jolan.ppro]. running version ... In this example, "jolan.ppro" is the name used for matching; therefore, UNIX domain sockets and connections to localhost would match a block containing: host = "*@jolan.ppro";.
The host 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 ip field attempts to match against the IP address only. An ident may be specified to match against, as well.
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.
You need only specify a host or ip field, not both. If both are used, host is matched against first.
There may be multiple Client blocks; at least one is recommended.
Motd block
| Requirement: | OPTIONAL |
| Old conf format equivalents: | T:hostmask|cla |