To create new wiki account, please join us on #znc at Libera.Chat and ask admins to create a wiki account for you. You can say thanks to spambots for this inconvenience.

Configuration: Difference between revisions

From ZNC
Jump to navigation Jump to search
Created page with "{{Languages|Configuration}} == File locations == * '''Configuration''' - ZNC gets its configuration by reading the file <code>~/.znc/configs/znc.conf</code>. * '''Misc''' - ..."
 
>Crocket
No edit summary
Line 39: Line 39:
* '''Listener''' = ''[web_only|irc_only] [host or IP] [+]port'' - Configuration of listening port. Use ''web_only'' or ''irc_only'', if you don't want port to be universal. Put host/IP before the port with a space between to bind to a specific IP ''(notice that in this case the listener can't listen on both ipv4 and ipv6)''. Then goes the port ZNC will listen on. If the port is prepended with a '+' (without space) then ZNC listens using SSL. You can have several listeners in one ZNC. (Introduced in [[ChangeLog/0.090|0.090]], see next chapter for older versions)
* '''Listener''' = ''[web_only|irc_only] [host or IP] [+]port'' - Configuration of listening port. Use ''web_only'' or ''irc_only'', if you don't want port to be universal. Put host/IP before the port with a space between to bind to a specific IP ''(notice that in this case the listener can't listen on both ipv4 and ipv6)''. Then goes the port ZNC will listen on. If the port is prepended with a '+' (without space) then ZNC listens using SSL. You can have several listeners in one ZNC. (Introduced in [[ChangeLog/0.090|0.090]], see next chapter for older versions)
* '''Listener4''' or '''Listener6''' - Exactly the same as '''Listener''', but will use only IPv4 or IPv6.
* '''Listener4''' or '''Listener6''' - Exactly the same as '''Listener''', but will use only IPv4 or IPv6.
* '''SSLCertFile''' - It's the TLS/SSL certificate file from which znc reads its server certificate.
* '''ConnectDelay''' - The time every connection will be delayed, in seconds. Some servers refuse your connection if you reconnect too fast. This affects the connection between ZNC and the IRC server; not the connection between your IRC client and ZNC.
* '''ConnectDelay''' - The time every connection will be delayed, in seconds. Some servers refuse your connection if you reconnect too fast. This affects the connection between ZNC and the IRC server; not the connection between your IRC client and ZNC.
* '''ServerThrottle''' - The time between two connect attempts to the same hostname.
* '''ServerThrottle''' - The time between two connect attempts to the same hostname.

Revision as of 14:41, 17 January 2012

File locations

  • Configuration - ZNC gets its configuration by reading the file ~/.znc/configs/znc.conf.
  • Misc - Other files are also stored in the ~/.znc directory, such as the SSL certificate (znc.pem) and the PidFile (znc.pid).
  • Local Modules - Stored in ~/.znc/modules. ZNC will look in the local module directory first when trying to load a module.
  • Global Modules - Stored in /usr/local/lib/znc by default (where /usr/local is the prefix you chose). This is /usr/lib/znc if you used the Debian package.
  • Binaries - znc, znc-config, and znc-buildmod are all stored in /usr/bin by default. You can change this when you configure by using ./configure --prefix=/whatever/path/you/want.

Editing config

In most cases you don't need to edit znc.conf directly. Use webadmin instead. Editing znc.conf by hand can produce race condition with ZNC accessing the config.

If you really need to edit znc.conf by hand when ZNC is running, do the following:

  1. pkill -SIGUSR1 znc
    to save current runtime configuration to znc.conf
  2. Edit znc.conf
  3. pkill -SIGHUP znc
    to make ZNC reread its config.

Removing modules

To remove modules, you can simply delete them from the specific folder. No other configuration changes or restarts are neccesary. ZNC looks for *.so files when searching for modules. To keep a module you can also change its file extension, for example: mv sample.so sample.so_.

Creating a config file

To generate a basic configuration file, run znc --makeconf after installation. It is NOT a good idea to create a new config file manually, please use znc --makeconf!

Config file structure

Basically, a configuration file consists of the following settings:

  • AnonIPLimit - Limits the number of unidentified connections per IP.
  • MaxBufferSize - Sets the global Max Buffer Size a user can have.
  • Listener = [web_only|irc_only] [host or IP] [+]port - Configuration of listening port. Use web_only or irc_only, if you don't want port to be universal. Put host/IP before the port with a space between to bind to a specific IP (notice that in this case the listener can't listen on both ipv4 and ipv6). Then goes the port ZNC will listen on. If the port is prepended with a '+' (without space) then ZNC listens using SSL. You can have several listeners in one ZNC. (Introduced in 0.090, see next chapter for older versions)
  • Listener4 or Listener6 - Exactly the same as Listener, but will use only IPv4 or IPv6.
  • SSLCertFile - It's the TLS/SSL certificate file from which znc reads its server certificate.
  • ConnectDelay - The time every connection will be delayed, in seconds. Some servers refuse your connection if you reconnect too fast. This affects the connection between ZNC and the IRC server; not the connection between your IRC client and ZNC.
  • ServerThrottle - The time between two connect attempts to the same hostname.
  • ISpoofFile - ZNC will write the ident of the user trying to connect to this file. Very useful if your shell supports oidentd.
  • ISpoofFormat - The format of the ISpoofFile.
  • PidFile - Make ZNC write a pid file. ZNC does not need this itself. See the FAQ on info how to crontab ZNC.
  • StatusPrefix - The prefix for the status and module queries. This setting may be overwritten by users.
  • LoadModule - Loads a global module on startup.
  • MOTD - The "message of the day" which is sent to clients on connect via notice from *status. Can be specified multiple times.
  • BindHost - This is a list of allowed bindhosts. It is used by the webadmin module for users to select one. (Set different bindhosts in "Settings" on your Webadmin-Interface first - one per line - to make them appear in users configs afterwards)
  • User - The user definition, you can have more than one. Each user may only connect to one network, so you need a separate user for each network. This is intended behavior! (See the FAQ about multiple networks)
    • Pass - Used by the client to connect to ZNC. A hash may be generated using znc --makepass.
    • Nick, AltNick, Ident, RealName, VHost - Your IRC user info. VHost is the IP address to bind to on outbound connections. Use this if your host has multiple IPs and you want to use something specific (say for a vanity domain name in the reverse lookup).
    • DCCVHost - This is the IP address used for DCC bouncing.
    • QuitMsg - The default quit message ZNC will use when you jump servers or call shutdown.
    • StatusPrefix - The prefix for the status and module queries.
    • ChanModes - Default modes ZNC will set when you join an empty channel.
    • Buffer - This is the amount of lines that the playback buffer will store before dropping off the oldest line. The buffers are stored in the memory by default.
    • KeepBuffer - If set to true, it will buffer channels even while you are attached, and play the whole buffer back to you each time you connect. If set to false, it won't buffer while you are attached, and the buffer will be reset upon each playback.
    • MultiClients - Set this to true, if you want to be able to connect with multiple clients at once.
    • BounceDCCs - If set to true, the DCCs will be bounced by ZNC.
    • DenyLoadMod - If set to true, the user isn't able to load modules.
    • DenySetBindHost - If set to true, the user isn't able to change his vhost.
    • Admin - If set to true, the user has admin rights (e.g. in the webadmin module).
    • DCCLookupMethod - If set to default, ZNC will use the IP the clients sends for the DCC connections; if set to client, ZNC will use the IP the client connects from.
    • TimestampFormat - The format for the timestamps used in buffers, for example [%H:%M:%S]
    • AppendTimestamp - Whether to append the timestamps to the message or not
    • PrependTimestamp - Whether to prepend the timestamps to the message or not
    • TimezoneOffset - Set this if the servertime differs from your local time, so you'll get correct times in your timestamps. The unit is hours and is added to ZNC's perception of current time. Fractional values are possible.
    • JoinTries - How often should ZNC try to join if the first join failed, e.g. due to channel mode +i/+k or if you're banned.
    • MaxJoins - How many channels should ZNC join at once. Lower this if you get disconnected for 'Excess flood.
    • Allow - By default everyone is able to connect to ZNC as this user. With an Allow line you can restrict access to the specified IPs. Wildcards (*) are supported and multiple Allow lines can be set up.
    • LoadModule - Load a module for this user on startup.
    • Server - Adds a server to the list of servers this user will be able to connect to. If you want ZNC to connect to the IRC server using SSL, put '+' in front of the port number. The IP can be IPv6. If the server requires a password, just add it as the third argument. Format: Server = <IP-Address/Host> [+]<Port> [<Password>]
    • CTCPReply - A request-reply-pair for CTCP-requests. Format: <request> <reply>, e.g. VERSION unknown v1.0
    • IRCConnectEnabled - If set to false, user doesn't connect to IRC servers.
    • Chan - Channels you want ZNC to join when connecting.
      • Key - Key for the channel.
      • Modes - Use this to override the ChanModes setting set in the User section.
      • Buffer - Use this to override the Buffer setting set in the User section.
      • KeepBuffer - Use this to override the KeepBuffer setting set in the User section.
      • Detached - If true, ZNC will join this channel as detached so that the IRC client will not be bothered by it.

Old versions

Before 0.096

  • BindHost was named vHost

Before 0.090:

  • Listen was similar to Listener4 from last version, without irc_only/web_only support.
  • Listen6 was similar to Listener or Listener6 (depending on your OS) from last version, without irc_only/web_only support.