Jo
062d255124
Handle ioutil deprecations ( #53526 )
...
* replace ioutil.ReadFile -> os.ReadFile
* replace ioutil.ReadAll -> io.ReadAll
* replace ioutil.TempFile -> os.CreateTemp
* replace ioutil.NopCloser -> io.NopCloser
* replace ioutil.WriteFile -> os.WriteFile
* replace ioutil.TempDir -> os.MkdirTemp
* replace ioutil.Discard -> io.Discard
2022-08-10 15:37:51 +02:00
Matthew Jacobson
efa0d90093
Alerting: Fix Teams notifier not failing on 200 response with error ( #52254 )
...
Team's webhook API does not always use the status code to communicate errors.
There are cases where it returns 200 and an error message in the body.
For example, 429 - Too Many Requests or when the message is too large.
Instead, what we should be looking for is a response body = "1".
https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using?tabs=cURL#send-messages-using-curl-and-powershell
2022-07-14 13:15:18 -04:00
Kristin Laemmert
bda3dd24e4
chore: remove golang.org/x/net/context in favor of stdlib ( #47532 )
...
This PR removes golang.org context imports under pkg/services/* and replaces them with the stdlib context.
Closes #44178
2022-04-11 08:46:21 -04:00
Santiago
4b1af6fb06
Fix empty contact point URLs when template parsing fails ( #47029 )
...
* fix empty URLs
* leave URL templating, use fallback
* better fix, new tests cases
* fix linting errors
2022-03-31 15:57:48 -03:00
Arve Knudsen
c2cad26ca9
Chore: Disable default golangci-lint filter ( #29751 )
...
* Disable default golangci-lint filter
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
* Chore: Fix linter warnings
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-12-15 09:32:06 +01:00
Arve Knudsen
ac09baae7d
Chore: Use Header.Set method instead of Header.Add ( #29804 )
...
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-12-14 15:13:01 +01:00
Will Browne
d796c61946
Security: Fixes minor security issue with alert notification webhooks that allowed GET & DELETE requests #29330
2020-11-24 10:42:54 +01:00
Mitsuhiro Tanda
9f82cd4713
Slack: Support use of chat.postMessage ( #25818 )
...
* set bearer token if token is provided
* update slack notification document
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-26 20:47:06 +02:00
Arve Knudsen
2a78d2a61c
pkg/services: Check errors ( #19712 )
...
* pkg/services: Check errors
* pkg/services: Don't treat context.Canceled|context.DeadlineExceeded as error
2019-10-22 14:08:18 +02:00
Carl Bergquist
a86b8c8a04
http: remove dualstack since its deprecated ( #16940 )
...
Deprecated: Fast Fallback is enabled by default. To
disable, set FallbackDelay to a negative value.
https://golang.org/src/net/dial.go
2019-05-08 10:37:48 +02:00
fredbcode
110ffb69de
Fix bug tls renegociation problem in Notification channel (webhook) #14800
2019-01-13 21:42:33 +01:00
bergquist
24636da800
closes the body properly on successful webhooks
...
this commit also adds a test docker container
for receiving alerting web hook requests
2018-12-27 16:08:13 +01:00
Torkel Ödegaard
e5e8b9800c
merge: fixed conflicts in discord PR
2018-05-07 15:40:43 +02:00
Torkel Ödegaard
df71fe33fd
refactor: refactoring notification service to use new service registry hooks
2018-04-27 14:15:17 +02:00
Mario Trangoni
c1742df9ac
remove unused variables detected by varcheck
2018-04-18 19:04:37 +02:00
Andrzej Ressel
30f048965c
Merge branch 'master' into feature/discord
2018-04-08 20:09:56 +02:00
Ivan Babrou
9a4ae30227
Enable dualstack in every net.Dialer, fixes #9364
...
Default transport enables it:
* https://github.com/golang/go/blob/d2826d3e06/src/net/http/transport.go#L42-L46
```
DialContext: (&net.Dialer{
Timeout: 30 * time.Second,
KeepAlive: 30 * time.Second,
DualStack: true,
}).DialContext,
```
See also: https://github.com/golang/go/issues/15324
2017-09-27 22:29:48 -07:00
Andrzej Ressel
1bf982439b
Sending image
2017-03-23 21:53:54 +01:00
bergquist
412b8998a8
webhooks: get proxy settings from ini file
...
closes #7710
2017-03-02 13:57:28 +01:00
bergquist
05952688c5
tech: avoid using http.DefaultClient
2017-02-24 17:22:12 +01:00
bergquist
03354bc49a
tech: replace context.TODO with background ctx
2017-02-24 09:20:28 +01:00
bergquist
f5d8a75381
tech(webhook): remove redundant if statement
2017-01-19 09:29:40 +01:00
huydx
376d2d56bf
(feature) add LINE notify to notifier
2017-01-19 17:26:53 +09:00
bergquist
b81e97c99c
webhook: adds json content-type
...
closes #6822
2016-12-05 10:46:04 +01:00
bergquist
d1eceedf55
feat(webhook): add httpmethod to webhook
...
closes #6255
2016-10-18 16:50:16 +02:00
Carl Bergquist
c38f6ff182
Make alerting notifcations sync ( #6158 )
...
* tech(routines): move the async logic from notification to alerting notifier
* tech(notification): reduce code dupe
* fix(notification): dont touch the response unless its an error
* feat(alerting): make alerting exeuction async but flow sync
* tech(alerting): remove commented code
* tech(alerting): remove unused code
* tech(alerting): fix typo
* tech(alerting): implement Context on EvalContext
* tech(alerting): wait for all alerts to return
* feat(alerting): dont allow alert responses to cancel
* Revert "feat(alerting): dont allow alert responses to cancel"
This reverts commit 324b006c96
.
* feat(alerting): give alerts some time to finish before closing down
2016-10-03 09:38:03 +02:00
bergquist
a49c21df3a
fix(png-renderer): increase timeouts
2016-09-22 19:24:18 +02:00
bergquist
d6fdb598b0
fix(alerting): gofmt
2016-08-08 14:46:47 +02:00
Torkel Ödegaard
ae5f8a76d9
feat(alerting): lots of progress on notifications, refactored them out to their own package, restored webhook notitication and added slack notification
2016-07-27 12:09:55 +02:00
bergquist
72e23bca5f
tech(alerting): improve/cleanup logging
2016-06-16 08:56:19 +02:00
bergquist
2e809cae05
tech(alerting): enforce POST for webhooks
2016-06-16 08:16:16 +02:00
bergquist
efea3bc9cb
feat(alerting): skeleton commit for webhook
2016-06-16 08:16:16 +02:00