User Tools

Site Tools


melanobot:configuration

Configuration

Command Line

The command line option --config file can be used to select a specific configuration file, otherwise the program tries to locate one. When trying to locate a config files the following directories are searched (in this order):

  • (Current directory)
  • (Directory containing the executable)
  • ~/.config/melanobot
  • ~/.melanobot

All configuration values can be overridden by command line options.

Eg: melanobot --connections.irc.nick=OtherNick

Supported file formats

The config file can be in one of the following formats:

  • XML
  • JSON
  • INI
  • INFO

For more details see http://www.boost.org/doc/libs/1_55_0/doc/html/boost_propertytree/parsers.html

Keys

Legend: key default value Description

  • log Container of the log settings
    • debug 0 If 1 shows some additional information on critical errors
    • string_format ansi-utf8 Output string encoding
    • timestamp [Y-m-d H:i:s] timestamp format, empty ⇒ no timestamps
    • logfile File to use as log (Will still output to stdout as well)
    • verbosity container for verbosity level
      • log_type 2 higher values ⇒ more log shown
  • services Container for service set up
    • web – Web request service
  • templates – Container for template definitions
  • bot – Bot definition, can contain:
    • Connections – Connection block, format depends on the type of connection:
      • enabled 1 – If 0 the connection will be completely ignored from the config.
      • name – (REQUIRED)
      • protocol – (REQUIRED) one of the following:
        • ircIRC server/bouncer
        • xonotic – Xonotic server integration
        • stdin – Asynchronous standard input

Value Formats

*.string_format

log_type

Log types are defined by various modules

  • ircIRC connection messages
  • xon – Xonotic connection messages
  • std – Standard input
  • web – HTTP request messages
  • sys – System messages

Templates

The template system allows to create complex handler with custom parameters.

Template Definition

Templates are defined in the templates top-level group. Their name is determined by the key used here.

They are required to have the type key, which specifies which handler type this template is going to become. (Most likely Group is the most useful).

Then it can contain anything allowed in a definition of the corresponding handler type.

In addition to the normal handler keys, template definitions allow to declare parameters, which will be replaced when the template is instantiated. Parameters are defined as simple keys whose name starts with @ their value (if any) will be used as default when not expressed by the instantiation.

All values containing those parameters (including the @) will be replaced to the correct values.

Template Instantiation

A template instantiation uses the same form as a handler instantiation with "Template" as type.

The require the key template to be the name of the template to instantiate.

Then any parameter defined in the template can be assigned a value. Here parameters don't use the leading @.

melanobot/configuration.txt · Last modified: 2015/05/26 15:35 (external edit)