Thorben Günther
c5575c3dc1
Simplify HTTP Basic Authentication middleware
2023-07-19 16:00:20 +02:00
Thorben Günther
a908ce78ab
readme: Move example config out
2023-07-19 15:17:36 +02:00
Thorben Günther
913a076c52
Implement graceful shutdown
2023-07-17 16:39:16 +02:00
Thorben Günther
4fcb1f952c
cache/redis: Rig up timeout with context
2023-07-14 15:10:40 +02:00
Thorben Günther
e0e1281ec3
http: Use own server
2023-07-14 12:47:22 +02:00
Thorben Günther
fab51ab54b
http: Use own multiplexer
2023-07-14 12:38:43 +02:00
Thorben Günther
a9fa7e4b23
config: Switch default values of alert mode and cache type
...
By default alerts will no longer be split apart and any caching
functionality will be disabled. With this the behaviour will be closer
to what the user has configured in Alertmanger/Prometheus itself.
2023-07-12 19:17:47 +02:00
Thorben Günther
3f545efc95
cache: Add a "disabled" cache
2023-07-12 19:13:47 +02:00
Thorben Günther
b2a1ab61c9
cache: Move creation logic into cache package
2023-07-12 19:00:25 +02:00
Thorben Günther
c70b82e9ab
config: Move to own package
2023-07-12 14:56:48 +02:00
Thorben Günther
e66cc0d858
cache/redis: Try to ping redis on cache creation
...
Otherwise the bridge would continue to run even if the cache is not
available.
2023-07-10 12:20:16 +02:00
Thorben Günther
dc9078c3f5
publish: Try to decode ntfy error string
2023-07-07 23:20:03 +02:00
Thorben Günther
7efc6cdbc2
Add phone call support
...
Implements: https://todo.xenrox.net/~xenrox/ntfy-alertmanager/18
2023-07-07 21:37:11 +02:00
Thorben Günther
b58f93bd4f
Upgrade dependencies
2023-07-05 14:02:59 +02:00
Thorben Günther
025ad78a60
Add ntfy email support
...
Implements: https://todo.xenrox.net/~xenrox/ntfy-alertmanager/15
2023-03-09 17:02:05 +01:00
Thorben Günther
3bdecb70da
readme: Add more contribution links
2023-03-09 13:27:52 +01:00
Thorben Günther
de1c9c58ae
docker: Add redis section to docker-compose file
...
With a persistent volume.
2023-03-08 22:42:29 +01:00
Thorben Günther
53bd3b4e58
config: Add redis-url
2023-03-08 22:19:27 +01:00
Thorben Günther
054c163ffb
cache: Support redis
...
Closes: https://todo.xenrox.net/~xenrox/ntfy-alertmanager/11
2023-03-08 22:18:30 +01:00
Thorben Günther
652d46d972
config: Add cache type
2023-03-08 16:31:12 +01:00
Thorben Günther
d35b77fbc9
cache: Move to own interface package
...
With this interface it will be easy to support multiple cache types.
2023-03-08 16:16:21 +01:00
Thorben Günther
5a8a85f0f9
Sort labels alphabetically
...
Closes: https://todo.xenrox.net/~xenrox/ntfy-alertmanager/13
2023-02-21 14:37:26 +01:00
Thorben Günther
82a22c8959
Simplify outgoing Basic Authentication
2023-02-21 14:12:21 +01:00
Thorben Günther
d7fdd85b72
multi mode: Simplify code
...
Just like it's done in the single mode.
2023-02-21 14:02:19 +01:00
Thorben Günther
cd848543b3
Slightly improve logging
2023-02-21 14:00:21 +01:00
Thorben Günther
af7469d97b
Rename receiver to bridge
2023-02-21 13:57:21 +01:00
Thorben Günther
5e346aa9f2
config: Forbid to set a user/password without the other
2023-02-21 12:10:13 +01:00
Thorben Günther
41fb0f7766
ntfy: Support authentication via access-tokens
...
Implements: https://todo.xenrox.net/~xenrox/ntfy-alertmanager/14
2023-02-21 11:50:50 +01:00
Thorben Günther
37714a4a64
tests: Remove comments from test config
2023-02-20 13:39:57 +01:00
Thorben Günther
b58ce4acb3
Set default header for User-Agent
2023-02-20 13:27:41 +01:00
Thorben Günther
f1dfde6891
Add icon support
...
Implements: https://todo.xenrox.net/~xenrox/ntfy-alertmanager/12
2023-02-20 13:08:59 +01:00
Thorben Günther
1daa751cb2
Move http.Client to receiver struct
2023-02-17 01:45:14 +01:00
Thorben Günther
84c4c45d5b
version: Use linker flag
...
Embedding the version file is slightly annoying for packaging, because
the release tarball is not a git repository and so "go generate" would
fail. Instead a packager would have to manually create the version.txt
file.
With using a linker flag, the version string has a graceful fallback.
2023-02-16 13:06:21 +01:00
Thorben Günther
8a387ff834
Add tags for resolved alerts
...
Implements: https://todo.xenrox.net/~xenrox/ntfy-alertmanager/8
2023-02-12 17:09:23 +01:00
Thorben Günther
df02ee5303
cache: Only cache the alert if it was published successfully
2023-02-12 16:50:18 +01:00
Thorben Günther
4b5c309a3c
Upgrade dependencies
2023-02-12 16:37:03 +01:00
Thorben Günther
a329d4dc52
silence: Fix broken ntfy action
...
A silence action was added even when "base-url" was not set. This action
would of course fail, since there was no valid URL scheme given.
The action button is now removed in that case.
2023-02-12 16:32:34 +01:00
Thorben Günther
38fa5f9f71
silence: Parse Alertmanager API response
2023-02-12 16:07:49 +01:00
Thorben Günther
81ff7bd90e
alertmanger: Add setting to overwrite URL
2023-02-12 14:58:37 +01:00
Thorben Günther
7bb448b5eb
Refactor structs to use map[string]string
2023-02-12 14:40:32 +01:00
Thorben Günther
1b986078f0
silence: Don't add silence action to resolved alerts
2023-02-12 14:32:05 +01:00
Thorben Günther
0a3ead8b6e
silence: Add to multi alert-mode as well
2023-02-12 14:28:24 +01:00
Thorben Günther
1e44ba5694
alertmanager: Support basic auth
2023-02-12 14:15:02 +01:00
Thorben Günther
c919ec9af2
Add ability to silence alerts with ntfy action
...
For now only for the single alert mode.
This is implemented as an action button, that will send an API request
to ntfy-alertmanager itself instead of Alertmanager. Here ntfy-alertmanager
acts as a proxy and will then do the API request for actually creating
the silence in Alertmanager.
This is founded in a limitation of ntfy, that seemingly does not allow a
json body with more than one key.
2023-02-12 03:04:17 +01:00
Thorben Günther
34c0574163
config: Add required settings for silencing alerts
2023-02-11 13:56:06 +01:00
Thorben Günther
7a6b7c9cdb
cache: Take alert status (firing, resolved) into account
...
Otherwise a resolved alert would not trigger a notification, since its
fingerprint - which is a generated hash from the labels - remains the
same.
2023-02-08 20:41:05 +01:00
Thorben Günther
1a4081a312
Log incoming, parsed alert
2023-02-08 20:41:04 +01:00
Thorben Günther
0508f37896
cache: Add config options for duration and cleanup interval
2023-02-08 20:41:03 +01:00
Thorben Günther
d20d76d2b3
single mode: Cache alert fingerprints
...
If ntfy-alertmanager breaks alertmanager's grouping feature, it should
take care of caching alerts on its own.
2023-02-08 20:41:03 +01:00
Thorben Günther
8933ccd825
Support sending grouped alerts on their own
2023-02-08 20:41:02 +01:00