Дамян Иванов
and 3 contributors


kgb-bot - an IRC bot helping collaborative work


kgb-bot [--config file] [--foreground] [--simulate file]


--config file

Specify configuration file to load. Default is /etc/kgb-bot/kgb.conf.

--config-dir directory

Specify directory with configuration files to load. All files like *.conf are loaded, in alphabetical order. Default is /etc/kgb-bot/kgb.conf.d.


Do not detach from console, print log messages to STDERR and do not become a daemon, useful for debugging.

--simulate file

Do not connect to IRC. Instead, output each notification line to the given file, like:

    #chan repo user branch revision module changed-paths
    #chan repo commit message line 1
    #chan repo commit message line 2

There are no colour codes in the output, unless --simulate-color is also given.


Include color codes in the file used by --simulate.


Log additional debugging information

webhook_request request response dirmatch

Handler for webhook HTTP request.

This handler only processes the HTTP part, parsing URI parameters and POST contents.

The actual processing and IRC notification is done via an appropriate gitlab_webhook_* event, asynchronously.


Handle a gitlab webhook call for the push event (branch update).

Expects the body of the POST request (decoded, as a hash reference) in ARG0 and all the request parameters in ARG1.

The request is expected to conform to the GitLab webhook documentation at https://salsa.debian.org/help/user/project/integrations/webhooks.md#push-events.

The request parameters should look like the result of the CGI's param() method.

Supported parameters (?param=value&param=value2...)


The name of the channel to post notifications to. Leading hash sign is optional and should be URL-encoded if present (%23).


The name of the IRC network, servicing the channel. Supported networks are configured by the bot's admin.


A boolean flag, indicating that the notifications shouldn't also be posted to the #commits channel on Freenode.


A boolean flag enabling colors. Defaults to true.


Optional text to prepend to the commit ID.


If true, IRC notification uses notice messages, instead of privmsg. Defaults to 1.

notice messages are usually less intrusive.

squash_threshold number

For push events, limit the commit notifications to the given number. If a branch update contains more commits, the usual notifications are replaced by a single notification about the number of the pushed commits.

Default: 20