mirror of
https://github.com/google/alertmanager-irc-relay.git
synced 2025-01-07 10:42:48 +01:00
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>
This commit is contained in:
parent
c122337b53
commit
96acecb3a5
@ -52,11 +52,11 @@ func LoadConfig(configFile string) (*Config, error) {
|
|||||||
IRCNick: "alertmanager-irc-relay",
|
IRCNick: "alertmanager-irc-relay",
|
||||||
IRCNickPass: "",
|
IRCNickPass: "",
|
||||||
IRCRealName: "Alertmanager IRC Relay",
|
IRCRealName: "Alertmanager IRC Relay",
|
||||||
IRCHost: "irc.freenode.net",
|
IRCHost: "example.com",
|
||||||
IRCPort: 7000,
|
IRCPort: 7000,
|
||||||
IRCUseSSL: true,
|
IRCUseSSL: true,
|
||||||
IRCVerifySSL: true,
|
IRCVerifySSL: true,
|
||||||
IRCChannels: []IRCChannel{IRCChannel{Name: "#airtest"}},
|
IRCChannels: []IRCChannel{},
|
||||||
MsgOnce: false,
|
MsgOnce: false,
|
||||||
UsePrivmsg: false,
|
UsePrivmsg: false,
|
||||||
}
|
}
|
||||||
|
2
irc.go
2
irc.go
@ -215,7 +215,7 @@ func (notifier *IRCNotifier) Run() {
|
|||||||
keepGoing := true
|
keepGoing := true
|
||||||
for keepGoing {
|
for keepGoing {
|
||||||
if !notifier.Client.Connected() {
|
if !notifier.Client.Connected() {
|
||||||
log.Printf("Connecting to IRC")
|
log.Printf("Connecting to IRC %s", notifier.Client.Config().Server)
|
||||||
notifier.BackoffCounter.Delay()
|
notifier.BackoffCounter.Delay()
|
||||||
if err := notifier.Client.Connect(); err != nil {
|
if err := notifier.Client.Connect(); err != nil {
|
||||||
log.Printf("Could not connect to IRC: %s", err)
|
log.Printf("Could not connect to IRC: %s", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user