Russ Garrett 058f0f4eee Add option to close TCP connection after message | 7 lat temu | |
---|---|---|
examples | 7 lat temu | |
httplistener | 7 lat temu | |
tcplistener | 7 lat temu | |
.travis.yml | 7 lat temu | |
LICENSE | 7 lat temu | |
README.md | 7 lat temu | |
auth.go | 7 lat temu | |
command.go | 7 lat temu | |
main.go | 7 lat temu |
A reimplementation of irccat, the original ChatOps tool, in Go.
irccat lets you easily send events to IRC channels from scripts and other applications.
Download the latest
release from Github, put
the example
config
in /etc/irccat.json
or the local directory and customise it, and run!
Just cat a string to the TCP port -- it’ll be sent to the first channel defined in your channel list:
echo "Hello world" | nc -q 0 irccat-host 12345
Or specify a channel or nickname to send to:
echo "#channel Hello world" | nc -q 0 irccat-host 12345
echo "@nick Hello world" | nc -q 0 irccat-host 12345
IRC formatting is supported (see a full list of codes):
echo "Status is%GREEN OK %NORMAL" | nc -q 0 irccat-host 12345a
There’s a simple HTTP endpoint for sending messages:
curl -X POST http://irccat-host:8045/send -d
'{"to": "#channel", "body": "Hello world"}
There are also endpoints which support app-specific webhooks, currently:
/grafana
. They will be sent to the
channel defined in http.listeners.grafana
.More HTTP listeners welcome!
Note that there is (currently) no authentication on the HTTP endpoints, so you should make sure you firewall them from the world.
You can use irccat to execute commands from IRC:
?commandname string of arguments
This will call your commands.handler
script with the command-line
arguments:
nickname [channel] respond_to commandname [string of arguments]
irccat will only recognise commands from users in private message if
the user is joined to commands.auth_channel
defined in the config.