From 96acecb3a51cb12868f0e26f38b5ced23ed41b26 Mon Sep 17 00:00:00 2001 From: Luca Bigliardi Date: Thu, 5 Mar 2020 09:12:02 +0000 Subject: [PATCH] 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 --- config.go | 4 ++-- irc.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config.go b/config.go index 97adfb7..827abe6 100644 --- a/config.go +++ b/config.go @@ -52,11 +52,11 @@ func LoadConfig(configFile string) (*Config, error) { IRCNick: "alertmanager-irc-relay", IRCNickPass: "", IRCRealName: "Alertmanager IRC Relay", - IRCHost: "irc.freenode.net", + IRCHost: "example.com", IRCPort: 7000, IRCUseSSL: true, IRCVerifySSL: true, - IRCChannels: []IRCChannel{IRCChannel{Name: "#airtest"}}, + IRCChannels: []IRCChannel{}, MsgOnce: false, UsePrivmsg: false, } diff --git a/irc.go b/irc.go index 875cdef..902d8b7 100644 --- a/irc.go +++ b/irc.go @@ -215,7 +215,7 @@ func (notifier *IRCNotifier) Run() { keepGoing := true for keepGoing { if !notifier.Client.Connected() { - log.Printf("Connecting to IRC") + log.Printf("Connecting to IRC %s", notifier.Client.Config().Server) notifier.BackoffCounter.Delay() if err := notifier.Client.Connect(); err != nil { log.Printf("Could not connect to IRC: %s", err)