* support loading webhook URL from a file
/cc #2498
Signed-off-by: Simon Rozet <me@simonrozet.com>
* notify/webhook: add test for reading url from file
Signed-off-by: Simon Rozet <me@simonrozet.com>
* notify/pushover: add tests for reading secrets from files
Signed-off-by: Simon Rozet <me@simonrozet.com>
---------
Signed-off-by: Simon Rozet <me@simonrozet.com>
* support loading pushover secrets from files
Add the user_key_file and token_file keys to the pushover config.
/cc https://github.com/prometheus/alertmanager/issues/2498
Signed-off-by: Simon Rozet <me@simonrozet.com>
* Add check for templated Opsgenie receiver config
Solves #2887, where Opsgenie responder type can be templated according
to docs, but configuration logic checked for specific list of values only.
Signed-off-by: Erki Esken <erki@esken.net>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
- Move away from Webhook to APIRUL
- Make the Room ID a require field
- Set Authorization Credentails via Headers
Signed-off-by: gotjosh <josue.abreu@gmail.com>
The validation should fail if both `api_key` and `api_key_file` are
defined. I think there was a typo in the original PR (#2728) that
enforced `api_url` and `api_key_file` not being defined at the same
time.
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* notify: add markdown support for wechat
Signed-off-by: Jason Cooper <master@deamwork.com>
* docs: update WeChat receiver configuration document
Signed-off-by: Jason Cooper <master@deamwork.com>
* fix: check WeChat msgType, apply default if not present
Signed-off-by: Jason Cooper <master@deamwork.com>
* chore: remove unnecessary comment
Signed-off-by: Jason Cooper <master@deamwork.com>
* fix: simplify msgType process
Signed-off-by: Jason Cooper <master@deamwork.com>
* docs: wechat configs document update
Signed-off-by: Jason Cooper <master@deamwork.com>
* fix: apply error message suggestions
Signed-off-by: Jason Cooper <master@deamwork.com>
* test: add test for regex
Signed-off-by: Jason Cooper <master@deamwork.com>
* fix: wechat message safe param
Signed-off-by: Jason Cooper <master@deamwork.com>
`^apple|banana|cherry$` finds matches to either of `^apple`, `banana`, or `cherry$`, so strings like `apple0`, `1banana2`, `3cherry` are accepted; I believe this wasn't intentional.
Signed-off-by: NODA, Kai <nodakai@gmail.com>
* Support adding custom fields to VictorOps notifications
* Response to feedback
* Added logic to validate victorops custom fields to config load time
* Cleanup victorops notifier of logic duplicated in config check
* rebase and further cleanup from feedback
* another grammer fix
Signed-off-by: Jason Roberts <jroberts@drud.com>
* config: validate URLs at config load time
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Address Brian and Lucas comments
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Shallow copy of URL instead of reparsing it
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Unshadow net/url package
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Make a deep-copy of URL struct
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
The YAML strict mode doesn't allow mapping keys that are duplicates. If
someone wants to override one of the default keys in the Details hash,
the unmarshal function returns an error because the key is already
defined by DefaultPagerdutyConfig.
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* WECHAT support by ybyang2/berlinsaint
* correct the whitespace
* add some TestFile and modify some naming errors by ybyang2/berlinsaint
* modify wechat retry test expect
* template error
* add newline
Signed-off-by: yb_home <berlinsaint@126.com>
* fmt some pr code
* use the @stuartnelson3 the test-ci-wechat bingdata.go
* notify go add wechat
* Adding check for webhook's URL formatting
Since alertmanager will fail silently when trying to send to a schemaless URL, provide a way to check that a URL is properly formatted in alertmanager
* updating error message as requested