4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-07-05 09:24:03 +00:00

Update mattermost library (#2152)

* Update mattermost library

* Fix linting
This commit is contained in:
Wim
2024-05-24 23:08:09 +02:00
committed by GitHub
parent 65d78e38af
commit d16645c952
1003 changed files with 89451 additions and 114025 deletions

View File

@ -1,3 +1,4 @@
//go:build !windows && !nacl && !plan9
// +build !windows,!nacl,!plan9
package targets
@ -19,7 +20,7 @@ type Syslog struct {
// SyslogOptions provides parameters for dialing a syslog daemon.
type SyslogOptions struct {
IP string `json:"ip,omitempty"` // deprecated
IP string `json:"ip,omitempty"` // deprecated (use Host instead)
Host string `json:"host"`
Port int `json:"port"`
TLS bool `json:"tls"`
@ -55,6 +56,11 @@ func (s *Syslog) Init() error {
network := "tcp"
var config *tls.Config
host := s.params.Host
if host == "" {
host = s.params.IP
}
if s.params.TLS {
network = "tcp+tls"
config = &tls.Config{InsecureSkipVerify: s.params.Insecure}
@ -66,7 +72,7 @@ func (s *Syslog) Init() error {
config.RootCAs = pool
}
}
raddr := fmt.Sprintf("%s:%d", s.params.IP, s.params.Port)
raddr := fmt.Sprintf("%s:%d", host, s.params.Port)
if raddr == ":0" {
// If no IP:port provided then connect to local syslog.
raddr = ""