Commit Graph

13 Commits

Author SHA1 Message Date
Alvar Penning
5aed9591e1 Detect connection loss through IRC PONG
In the current state, the alertmanager-irc-relay already sends minutely
IRC PINGs. This allows to check the IRC connection's health in protocol
without having to deal with specific TCP settings. However, even when
we are sending those PINGs, we don't process the server's PONGs or their
absence.

On one of my alertmanager-irc-relay instances, the time between the last
received PONG and the TCP read to fail was round about fifteen minutes.
All this time, the connection was already dead, but there was no attempt
to reestablish it.

The introduces changes keep book on the last received PONG and fails if
there was no new PONG within twice the pingFrequencySecs time. When
establishing a new connection during the SetupPhase, the current time
will be set as the last PONG's time to reset the time comparison.
2023-06-07 15:39:54 +02:00
Erik Mackdanz
8342a1be9d Allow customized NickServ and ChanServ 2022-10-08 11:02:16 -05:00
Luca Bigliardi
33fe9e4ef8 Handle Atheme NickServ IDENTIFY NOTICE
Update list of nickserv identify patterns to support Atheme (
https://github.com/atheme/atheme/blob/master/modules/nickserv/main.c#L80
), used by libera.chat .

Signed-off-by: Luca Bigliardi <shammash@google.com>
2021-06-13 23:11:11 +02:00
Luca Bigliardi
cace8c91fe fix config declaration typo
Signed-off-by: Luca Bigliardi <shammash@google.com>
2021-04-17 23:17:38 +02:00
Luca Bigliardi
a63bfa3aad explicitly handle nickserv identify request
handle nickserv identify requests instead of blindly issuing a message
when connected

this helps if nickserv's state is wiped and we are being asked to
re-identify

introduce a `nickserv_identify_patterns` config option. these patterns
are used to guess identify requests of the various nickserv implementations

Signed-off-by: Luca Bigliardi <shammash@google.com>
2021-04-16 18:17:08 +02:00
Filippo Giunchedi
f03c45406c Make alert channel size configurable (and bigger)
Signed-off-by: Filippo Giunchedi <filippo@wikimedia.org>
2020-11-25 16:06:12 +01:00
Luca Bigliardi
aa63009ab4 Support environment variables in the config file
Signed-off-by: Luca Bigliardi <shammash@google.com>
2020-11-05 16:44:56 +01:00
Luca Bigliardi
826f088241 Handle IRC server password
Introduce optional config parameter 'irc_host_password' to specify the
IRC server password.

Signed-off-by: Luca Bigliardi <shammash@google.com>
2020-11-05 11:05:15 +01:00
Luca Bigliardi
96acecb3a5 Use safe host / channel default
Use nonexistent irc server and empty channel list as default config
options to avoid unwanted surprises when testing the bot.

Addresses https://github.com/google/alertmanager-irc-relay/issues/5

Signed-off-by: Luca Bigliardi <shammash@google.com>
2020-03-05 09:12:02 +00:00
Luca Bigliardi
c122337b53 Add config option to skip SSL certs checks
This addresses https://github.com/google/alertmanager-irc-relay/issues/3

Signed-off-by: Luca Bigliardi <shammash@google.com>
2020-03-05 08:49:31 +00:00
Luca Bigliardi
ae6594c606 Add config option to deliver alerts with PRIVMSG
Add `use_privmsg` config option to deliver alerts with PRIVMSG instead
of the default NOTICE.

This addresses a use case described in
https://github.com/google/alertmanager-irc-relay/pull/1 .

Signed-off-by: Luca Bigliardi <shammash@google.com>
2020-01-25 18:03:13 +00:00
Luca Bigliardi
4e1aeaf931 s/notice/msg/
Use a more generic name as there is soon going to be support for PRIVMSG
(see https://github.com/google/alertmanager-irc-relay/pull/1 for
background).

This introduces a backward-incompatible change in the config file for
these two parameters:
- notice_template -> msg_template
- notice_once_per_alert_group -> msg_once_per_alert_group

I am not introducing the new parameters with a deprecation plan since
both parameters are relatively secondary to the core functioning of the
bot (and this is a free time project after all).

Signed-off-by: Luca Bigliardi <shammash@google.com>
2020-01-25 16:42:59 +00:00
Luca Bigliardi
60632b16e6 Initial code check-in
Signed-off-by: Luca Bigliardi <shammash@google.com>
2018-05-21 15:49:47 +01:00