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
Serge Zaitsev
18e93c7077
Chore: Remove bus ( #47511 )
...
* Chore: Remove bus
* remove unused const
2022-04-08 16:15:06 +02: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
Serge Zaitsev
4ce7978cd8
Chore: Remove bus from notification service ( #46813 )
...
* Chore: Remove bus from notification service
* fix signature
* fix function signature in tests
2022-03-22 09:04:30 +01:00
Alexander Weaver
703d7deeda
Alerting: Add integration tests for dual-stage email templating ( #43484 )
...
* Resolve merge conflicts
* Remove cruft from local exploration
* Move integration tests to intercept using new abstraction layer instead of channel
* Fix linter error after rebase
2022-03-01 10:49:49 -06:00
Kat Yang
f582e6c86a
Chore: Remove bus from password ( #44482 )
...
* Chore: Remove bus from password
* Refactor: Remove bus from password.go and adjust tests
* remove sqlstore dependency from notifications
* Chore: Remove bus from password
* Refactor: Remove bus from password.go and adjust tests
* remove sqlstore dependency (again)
* remove fmt printf
* fix dependencies in http server
* fix renamed method in tests
Co-authored-by: Serge Zaitsev <serge.zaitsev@grafana.com>
2022-02-03 10:33:46 +01:00
idafurjes
12420260ef
Remove bus from org invite api ( #44530 )
...
* Remove bus from org invite api
* Fix lint
* Remove comment
2022-01-31 17:24:52 +01:00
Serge Zaitsev
84a5910e56
Chore: Remove bus from ngalert ( #44465 )
...
* pass notification service down to the notifiers
* add ns to all notifiers
* remove bus from ngalert notifiers
* use smaller interfaces for notificationservice
* attempt to fix the tests
* remove unused struct field
* simplify notification service mock
* trying to resolve issues in the tests
* make linter happy
* make linter even happier
* linter, you are annoying
2022-01-26 16:42:40 +01:00
Alexander Weaver
c68eefd398
Alerting: Add abstraction layer and testing hooks in front of SMTP dialer ( #43875 )
...
* Add abstraction layer above SMTP communication
* Fix issues with attachments and sync command
* Tests for bad SMTP behavior
* Separate tests between async and sync entry points. Test difference between them
* Return interface so Wire can properly map types
* Address feedback from George
2022-01-13 15:19:15 -06:00
idafurjes
65e60759fb
Rename AddEventListenerCtx to AddEventListener and PublishCtx to Publish ( #43566 )
2022-01-04 09:36:01 +01:00
idafurjes
8e6d6af744
Rename DispatchCtx to Dispatch ( #43563 )
2021-12-28 17:36:22 +01:00
idafurjes
7936c4c522
Rename AddHandlerCtx to AddHandler ( #43557 )
2021-12-28 16:08:07 +01:00
idafurjes
9880a843ed
Add context to notifications ( #42578 )
2021-12-01 17:56:08 +01:00
idafurjes
a65e0be110
Replace AddEventListener with AddEventListenerCtx and Publish with PublishCtx ( #42284 )
2021-11-29 14:23:24 +01:00
Katarina Yang
c4306f9b3e
Chore: add context to login ( #41316 )
...
* Chore: add context to login attempt file and tests
* Chore: add context
* Chore: add context to login and login tests
* Chore: continue adding context to login
* Chore: add context to login query
2021-11-08 15:53:51 +01:00
Serge Zaitsev
125e284da2
Chore: Refactor GoConvey in notification service package ( #40897 )
...
* refactor goconvey in notification service package
* avoid return after t.skip
2021-10-26 18:08:04 +02:00
Arve Knudsen
78596a6756
Migrate to Wire for dependency injection ( #32289 )
...
Fixes #30144
Co-authored-by: dsotirakis <sotirakis.dim@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
Co-authored-by: spinillos <selenepinillos@gmail.com>
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Co-authored-by: Leonard Gram <leo@xlson.com>
2021-08-25 15:11:22 +02:00
Djairho Geuens
4cadbba686
Email: Allow configuration of content types for email notifications ( #34530 )
...
* Alerting: Allow configuration of content types for email notifications
* Fix lint error
* Improves email templates
* Improve configuration documentation
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
* Improve code comments
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
* Improve configuration documentation
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
* Improve email template
* Remove unnecessary predeclaration
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* Adds handling for unrecognized content type
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* Move utility function outside of util package
* Fixes syntax
* Remove unused package
* Fix lint error
* improve email templates
* Fix test
* Alerting: Allow configuration of content types for email notifications
* Fix lint error
* Improves email templates
* Improve configuration documentation
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
* Improve code comments
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
* Improve configuration documentation
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
* Improve email template
* Remove unnecessary predeclaration
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* Adds handling for unrecognized content type
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* Move utility function outside of util package
* Fixes syntax
* Remove unused package
* Fix lint error
* improve email templates
* Fix test
* Fix comment style
Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
* Fix template formatting
* Add test and improve error handling
* Fix test
* Fix formatting
* Fix formatting
* Improve documentation and regenerates txt template
* Update docs/sources/administration/configuration.md
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
Co-authored-by: Djairho Geuens <djairho.geuens@ae.be>
Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Ganesh Vernekar <15064823+codesome@users.noreply.github.com>
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-07-19 13:31:51 +03:00
Carl Bergquist
06dc2b24bf
dont consider invalid email address a failed email ( #33671 )
...
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2021-05-04 12:07:50 +02:00
Carl Bergquist
58a325a4e4
Instrumentation: Add success rate metrics for email notifications ( #33359 )
...
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2021-04-27 11:15:07 +02:00
Ganesh Vernekar
0b788b5ce8
AlertingNG: Notification channel for emails ( #31768 )
...
* Email notification channel in ngalert
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Use existing templating system
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
* Update template and add unit tests
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
2021-03-18 14:55:11 +00:00
Arve Knudsen
47f13abf7a
Backend: Migrate to using non-global configuration ( #31856 )
...
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-03-10 12:41:29 +01: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
3fdf4be529
Chore: Enable more go-ruleguard rules ( #29781 )
...
* Chore: Enable more go-ruleguard rules
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-12-14 15:51:59 +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
taciomcosta
10ff4eecef
Backend: fix IPv6 address parsing erroneous ( #28585 )
...
* Backend: Fix parsing of client IP address
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-11-25 07:55:22 +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
Arve Knudsen
7897c6b7d5
Chore: Fix staticcheck issues ( #28854 )
...
* Chore: Fix issues reported by staticcheck
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
* Undo changes
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-11-05 11:57:20 +01:00
Arve Knudsen
41d432b5ae
Chore: Enable whitespace linter ( #25903 )
...
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-06 20:17:28 +02:00
Arve Knudsen
d1e6214a4a
Chore: Enable scopelint Go linter ( #25896 )
...
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-06-29 17:04:38 +02: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
Agnès Toulet
b5b019dfcf
Notifications: fix reply-to option for emails ( #25748 )
2020-06-22 18:56:49 +02:00
Arve Knudsen
07582a8e85
Chore: Fix various spelling errors in back-end code ( #25241 )
...
* Chore: Fix various spelling errors in back-end code
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>>
2020-06-01 17:11:25 +02:00
thameezb
16297da298
Email Notifications: Add StartTLSPolicy config flag ( #24574 )
2020-05-13 16:33:40 +02:00
Mario Trangoni
5116420e9a
Fix misspell issues ( #23905 )
...
* Fix misspell issues
See,
$ golangci-lint run --timeout 10m --disable-all -E misspell ./...
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
* Fix codespell issues
See,
$ codespell -S './.git*' -L 'uint,thru,pres,unknwon,serie,referer,uptodate,durationm'
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
* ci please?
* non-empty commit - ci?
* Trigger build
Co-authored-by: bergquist <carl.bergquist@gmail.com>
Co-authored-by: Kyle Brandt <kyle@grafana.com>
2020-04-29 21:37:21 +02:00
Carl Bergquist
f9962eabff
chore: avoid aliasing imports in services ( #22499 )
2020-02-29 13:35:15 +01:00
Marcus Efraimsson
0f0772b629
Alerting: Adds support for sending a single email to all recipients in notification channel ( #21091 )
...
When an alert is sent by e-mail, the process sends an e-mail to
each recipient separately. This PR is a single delivery to all recipients.
For companies that use e-mail extensively, this is necessary in order
not to overload the sending queue.
Replaces #18013
Fixes #12650
Co-authored-by: Henrique Oliveira <holiiveira@users.noreply.github.com>
2020-01-10 16:06:33 +01: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
Sofia Papagiannaki
de075e529d
Build: Fix potential case-insensitive import collision for github.com/Unknwon/com ( #18915 )
...
* update gopkg.in/macaron.v1
* update github.com/go-macaron/binding
* update github.com/go-macaron/session
* Substitute github.com/Unknwon/com with github.com/unknwon/com
* Clean up modules using `go mod tidy`
* Substitute github.com/Unknwon/bra with github.com/unknwon/bra
2019-09-09 14:22:06 +03:00
Oleg Gaidarenko
c5bca40566
Email: add reply-to and direct attachment ( #18715 )
...
* Add support for `Reply-To` header
* Allow direct attachment
Don't have tests yet, but they will follow
2019-08-26 16:44:18 +02:00
Carl Bergquist
c55e6016bf
backend: replace /pkg/errors with errutil ( #17065 )
2019-05-15 12:20:17 +02:00
Oleg Gaidarenko
29ad72f048
Chore: reintroduce gosec ( #17021 )
...
It seems gosec memory issue was recently fixed.
We should be good to go again
Ref securego/gosec#307
2019-05-13 14:56:36 +03:00
zhulongcheng
2fff8f77dc
move log package to /infra ( #17023 )
...
ref #14679
Signed-off-by: zhulongcheng <zhulongcheng.me@gmail.com>
2019-05-13 08:45:54 +02:00
zhulongcheng
34f6dda6e6
Notification: attempt to send notifications to all given email addresses ( #16881 )
...
Signed-off-by: zhulongcheng <zhulongcheng.me@gmail.com>
2019-05-10 08:39:51 +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
Oleg Gaidarenko
c1289b308f
Chore: revise some of the gosec rules ( #16713 )
2019-05-01 11:36:02 +02:00
Navaneesh Kumar
5ea823a65a
Fix: Alert email variable name typo fixed ( #16232 )
2019-03-27 09:42:20 +01: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
Mario Trangoni
dde650905d
Fix megacheck issue unused code.
...
I removed some code, and commented out other one.
See,
$ gometalinter --vendor --disable-all --disable=gotype --enable=megacheck --deadline 6m ./... | grep unused
pkg/api/avatar/avatar.go💯 26⚠️ func (*CacheServer).mustInt is unused (U1000) (megacheck)
pkg/api/folder_test.go:136:6⚠️ func callGetFolderByUID is unused (U1000) (megacheck)
pkg/api/folder_test.go:141:6⚠️ func callDeleteFolder is unused (U1000) (megacheck)
pkg/api/live/hub.go:40:15⚠️ func (*hub).removeConnection is unused (U1000) (megacheck)
pkg/components/imguploader/azureblobuploader.go:130:5⚠️ var client is unused (U1000) (megacheck)
pkg/middleware/middleware_test.go:438:28⚠️ func (*scenarioContext).withInvalidApiKey is unused (U1000) (megacheck)
pkg/services/alerting/ticker.go:40:18⚠️ func (*Ticker).updateOffset is unused (U1000) (megacheck)
pkg/services/notifications/notifications_test.go:12:6⚠️ type testTriggeredAlert is unused (U1000) (megacheck)
pkg/services/sqlstore/dashboard_service_integration_test.go:935:6⚠️ type scenarioContext is unused (U1000) (megacheck)
pkg/services/sqlstore/dashboard_service_integration_test.go:939:6⚠️ type scenarioFunc is unused (U1000) (megacheck)
pkg/services/sqlstore/dashboard_service_integration_test.go:941:6⚠️ func dashboardGuardianScenario is unused (U1000) (megacheck)
pkg/services/sqlstore/transactions_test.go:13:6⚠️ type testQuery is unused (U1000) (megacheck)
2018-10-01 18:23:59 +02:00