mirror of
https://github.com/google/alertmanager-irc-relay.git
synced 2024-12-02 16:09:25 +01:00
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>
This commit is contained in:
parent
286efdd365
commit
c122337b53
@ -38,6 +38,7 @@ type Config struct {
|
||||
IRCHost string `yaml:"irc_host"`
|
||||
IRCPort int `yaml:"irc_port"`
|
||||
IRCUseSSL bool `yaml:"irc_use_ssl"`
|
||||
IRCVerifySSL bool `yaml:"irc_verify_ssl"`
|
||||
IRCChannels []IRCChannel `yaml:"irc_channels"`
|
||||
MsgTemplate string `yaml:"msg_template"`
|
||||
MsgOnce bool `yaml:"msg_once_per_alert_group"`
|
||||
@ -54,6 +55,7 @@ func LoadConfig(configFile string) (*Config, error) {
|
||||
IRCHost: "irc.freenode.net",
|
||||
IRCPort: 7000,
|
||||
IRCUseSSL: true,
|
||||
IRCVerifySSL: true,
|
||||
IRCChannels: []IRCChannel{IRCChannel{Name: "#airtest"}},
|
||||
MsgOnce: false,
|
||||
UsePrivmsg: false,
|
||||
|
5
irc.go
5
irc.go
@ -77,7 +77,10 @@ func NewIRCNotifier(config *Config, alertMsgs chan AlertMsg) (*IRCNotifier, erro
|
||||
ircConfig.Server = strings.Join(
|
||||
[]string{config.IRCHost, strconv.Itoa(config.IRCPort)}, ":")
|
||||
ircConfig.SSL = config.IRCUseSSL
|
||||
ircConfig.SSLConfig = &tls.Config{ServerName: config.IRCHost}
|
||||
ircConfig.SSLConfig = &tls.Config{
|
||||
ServerName: config.IRCHost,
|
||||
InsecureSkipVerify: !config.IRCVerifySSL,
|
||||
}
|
||||
ircConfig.PingFreq = pingFrequencySecs * time.Second
|
||||
ircConfig.Timeout = connectionTimeoutSecs * time.Second
|
||||
ircConfig.NewNick = func(n string) string { return n + "^" }
|
||||
|
Loading…
Reference in New Issue
Block a user