From fc09981779df34608a2cea507579bd046f6fe902 Mon Sep 17 00:00:00 2001 From: raojinlin Date: Sun, 22 Sep 2024 08:26:30 +0800 Subject: [PATCH] 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 Co-authored-by: TwiN --- README.md | 3 +++ alerting/provider/teams/teams.go | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bb281f66..bd78b4ec 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/alerting/provider/teams/teams.go b/alerting/provider/teams/teams.go index 671649be..e61e2ee4 100644 --- a/alerting/provider/teams/teams.go +++ b/alerting/provider/teams/teams.go @@ -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 }