IRC Bot engine
New in version 2017.7.0.
Example Configuration
engines:
- ircbot:
nick: <nick>
username: <username>
password: <password>
host: irc.oftc.net
port: 7000
channels:
- salt-test
- '##something'
use_ssl: True
use_sasl: True
disable_query: True
allow_hosts:
- salt/engineer/.*
allow_nicks:
- gtmanfred
Available commands on irc are:
return pong
return <stuff> targeted at the user who sent the commands
fire event on the master or minion event stream with the tag salt/engines/ircbot/<tag> and a data object with a list of everything else sent in the message
Example of usage
08:33:57 @gtmanfred > !ping
08:33:57 gtmanbot > gtmanfred: pong
08:34:02 @gtmanfred > !echo ping
08:34:02 gtmanbot > ping
08:34:17 @gtmanfred > !event test/tag/ircbot irc is useful
08:34:17 gtmanbot > gtmanfred: TaDa!
[DEBUG ] Sending event: tag = salt/engines/ircbot/test/tag/ircbot; data = {'_stamp': '2016-11-28T14:34:16.633623', 'data': ['irc', 'is', 'useful']}
Alias for field number 1
Alias for field number 2
Alias for field number 0
Alias for field number 5
Alias for field number 4
Alias for field number 6
Alias for field number 3
Alias for field number 7
Alias for field number 1
Alias for field number 0
Alias for field number 2
IRC Bot for interacting with salt.
Nickname of the connected Bot.
irc server (example - irc.oftc.net).
irc port. Default: 6667
password for authenticating. If not provided, user will not authenticate on the irc server.
channels to join.
connect to server using ssl. Default: False
authenticate using sasl, instead of messaging NickServ. Default: False
Note
This will allow the bot user to be fully authenticated before joining any channels
command character to look for. Default: !
hostmasks allowed to use commands on the bot. Default: False True to allow all False to allow none List of regexes to allow matching
Nicks that are allowed to use commands on the bot. Default: False True to allow all False to allow none List of regexes to allow matching
Disable commands from being sent through private queries. Require they be sent to a channel, so that all communication can be controlled by access to the channel. Default: True
Warning
Unauthenticated Access to event stream
This engine sends events calls to the event stream without authenticating them in salt. Authentication will need to be configured and enforced on the irc server or enforced in the irc channel. The engine only accepts commands from channels, so non authenticated users could be banned or quieted in the channel.
/mode +q $~a # quiet all users who are not authenticated /mode +r # do not allow unauthenticated users into the channel
It would also be possible to add a password to the irc channel, or only allow invited users to join.