mirror of
https://github.com/TwiN/gatus.git
synced 2024-11-07 08:34:15 +01:00
feat(alerting): alert teams add client insecure option (#864)
* feat: alert teams add client insecure option * feat(docs): add comment for `ClientConfig` field * fix typo --------- Co-authored-by: raojinlin <raojinlin302@gmail.com> Co-authored-by: TwiN <twin@linux.com>
This commit is contained in:
parent
de2d41ed88
commit
fc09981779
@ -1182,11 +1182,14 @@ Here's an example of what the notifications look like:
|
||||
| `alerting.teams.title` | Title of the notification | `"🚨 Gatus"` |
|
||||
| `alerting.teams.overrides[].group` | Endpoint group for which the configuration will be overridden by this configuration | `""` |
|
||||
| `alerting.teams.overrides[].webhook-url` | Teams Webhook URL | `""` |
|
||||
| `alerting.teams.client.insecure` | Whether to skip TLS verification | `false` |
|
||||
|
||||
```yaml
|
||||
alerting:
|
||||
teams:
|
||||
webhook-url: "https://********.webhook.office.com/webhookb2/************"
|
||||
client:
|
||||
insecure: false
|
||||
# You can also add group-specific to keys, which will
|
||||
# override the to key above for the specified groups
|
||||
overrides:
|
||||
|
@ -19,6 +19,9 @@ type AlertProvider struct {
|
||||
// DefaultAlert is the default alert configuration to use for endpoints with an alert of the appropriate type
|
||||
DefaultAlert *alert.Alert `yaml:"default-alert,omitempty"`
|
||||
|
||||
// ClientConfig is the configuration of the client used to communicate with the provider's target
|
||||
ClientConfig *client.Config `yaml:"client,omitempty"`
|
||||
|
||||
// Overrides is a list of Override that may be prioritized over the default configuration
|
||||
Overrides []Override `yaml:"overrides,omitempty"`
|
||||
|
||||
@ -54,7 +57,7 @@ func (provider *AlertProvider) Send(ep *endpoint.Endpoint, alert *alert.Alert, r
|
||||
return err
|
||||
}
|
||||
request.Header.Set("Content-Type", "application/json")
|
||||
response, err := client.GetHTTPClient(nil).Do(request)
|
||||
response, err := client.GetHTTPClient(provider.ClientConfig).Do(request)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user