|
@@ -39,22 +39,53 @@ IRC formatting is supported (see a full [list of codes](tcplistener/colours.go#L
|
39
|
39
|
echo "Status is%GREEN OK %NORMAL" | nc irccat-host 12345
|
40
|
40
|
|
41
|
41
|
## HTTP → IRC
|
42
|
|
-There's a similar HTTP endpoint for sending messages. You can use curl in lieu
|
43
|
|
-of netcat, with "-d @-" to read POST data from stdin, like so:
|
44
|
|
-
|
45
|
|
- echo "Hello world" | curl -d @- http://irccat-host/send
|
46
|
42
|
|
47
|
|
-Everything that works via netcat also works by POST to /send.
|
|
43
|
+HTTP listeners are configured by setting keys under `http.listeners`.
|
48
|
44
|
|
49
|
|
-There are also endpoints which support app-specific webhooks, currently:
|
|
45
|
+### Generic HTTP Endpoint
|
|
46
|
+```json
|
|
47
|
+ "generic": true
|
|
48
|
+```
|
50
|
49
|
|
51
|
|
-* Grafana alerts can be sent to `/grafana`. They will be sent to the
|
52
|
|
- channel defined in `http.listeners.grafana`.
|
|
50
|
+An endpoint for sending messages similar to the TCP port. You can use curl in lieu
|
|
51
|
+of netcat, with "-d @-" to read POST data from stdin, like so:
|
53
|
52
|
|
54
|
|
-More HTTP listeners welcome!
|
|
53
|
+ echo "Hello world" | curl -d @- http://irccat-host/send
|
55
|
54
|
|
56
|
|
-Note that there is (currently) no authentication on the HTTP endpoints,
|
57
|
|
-so you should make sure you firewall them from the world.
|
|
55
|
+Everything that works via netcat also works by POST to /send. Note that this endpoint
|
|
56
|
+is unauthenticated.
|
|
57
|
+
|
|
58
|
+### Grafana Webhook
|
|
59
|
+```json
|
|
60
|
+ "grafana": "#channel"
|
|
61
|
+```
|
|
62
|
+
|
|
63
|
+Grafana alerts can be sent to `/grafana`. They will be sent to the
|
|
64
|
+channel defined in `http.listeners.grafana`. Note that this endpoint is currently
|
|
65
|
+unauthenticated.
|
|
66
|
+
|
|
67
|
+### GitHub Webhooks
|
|
68
|
+```json
|
|
69
|
+ "github": {
|
|
70
|
+ "secret": "my_secret",
|
|
71
|
+ "default_channel": "#channel",
|
|
72
|
+ "repositories": {
|
|
73
|
+ "irccat": "#irccat-dev"
|
|
74
|
+ }
|
|
75
|
+ }
|
|
76
|
+```
|
|
77
|
+
|
|
78
|
+Receives GitHub webhooks at `/github`. Currently supports issues, issue comments,
|
|
79
|
+pull requests, pushes, and releases. The webhook needs to be configured to post data
|
|
80
|
+as JSON, not as form-encoded.
|
|
81
|
+
|
|
82
|
+The destination channel for notifications from each respository is set in
|
|
83
|
+`http.listeners.github.repositories.repo_name`, where `repo_name` is the name of the
|
|
84
|
+repository, lowercased.
|
|
85
|
+
|
|
86
|
+If `http.listeners.github.default_channel` is set, received notifications will be
|
|
87
|
+sent to this channel unless overriden in `http.listeners.github.repositories`. Otherwise,
|
|
88
|
+unrecognised repositories will be ignored.
|
58
|
89
|
|
59
|
90
|
## IRC → Shell
|
60
|
91
|
You can use irccat to execute commands from IRC:
|