Commit graph

102 commits

Author SHA1 Message Date
Thorben Günther
8868bfa20d
Run gofmt 2023-09-28 13:42:49 +02:00
Thorben Günther
9a030f2902
config: Fix test 2023-09-28 13:41:23 +02:00
Jackson Chen
9b4b135a39
implement priority for resolved alerts 2023-09-28 13:05:28 +02:00
Thorben Günther
3baffc9bef
Send HTTP error code when failing to decode payload 2023-09-28 12:59:10 +02:00
Thorben Günther
d2eef546d5
Remove unnecessary Body.close() calls
The server will close those.
2023-09-22 22:35:16 +02:00
Thorben Günther
86afe915f3
publish: Move fingerprint conversion to config parsing
We only really need to do it once, not every time a new message gets
published.
2023-08-28 00:36:41 +02:00
Thorben Günther
1abacacab4
publish: Improve certificate fingerprint output 2023-08-27 16:53:19 +02:00
Thorben Günther
8f28182111
config.scfg: Add instructions to obtain cert fingerprint 2023-08-25 22:46:41 +02:00
Thorben Günther
ad2bc1fd89
publish: Improve certificate verification
Remove colons and convert to lower case. hex.EncodeToString outputs a
lower case string.
2023-08-25 22:36:00 +02:00
Thorben Günther
25e65db8bd
Add support for self signed ntfy certificates
A fingerprint can be specified in the configuration file. If it matches
the one from the server certificate, it will be accepted.

Closes: https://todo.xenrox.net/~xenrox/ntfy-alertmanager/22
2023-08-25 14:57:54 +02:00
Thorben Günther
1bfb814f14
Revert "ci: Don't fail on staticcheck"
This reverts commit 960ab04165.

The latest release fixes the issue.
2023-08-20 19:41:31 +02:00
Thorben Günther
960ab04165
ci: Don't fail on staticcheck 2023-08-16 01:20:37 +02:00
Thorben Günther
2dcfb7270e
Add CORS middleware
Fixes: https://todo.xenrox.net/~xenrox/ntfy-alertmanager/21
2023-08-16 01:18:51 +02:00
Thorben Günther
c0a0e3c264
Upgrade go-utils
Maybe I should really set GOPROXY="direct"...
2023-08-13 16:06:09 +02:00
Thorben Günther
ddd41a6341
Add option for setting the logging format 2023-08-13 16:02:02 +02:00
Thorben Günther
6d64c21549
Use Logger.With to create child loggers for the handlers
With that it will be easier to check on which endpoint a failure
happened.
2023-08-13 15:16:26 +02:00
Thorben Günther
dab77f6393
Use "log/slog" for logging 2023-08-13 14:48:27 +02:00
Thorben Günther
057b2e15f6
functions: Use slices package for sorting
From Go 1.21 release notes[1]:
New slices package for common operations on slices of any element type.
This includes sorting functions that are generally faster and more
ergonomic than the sort package.

[1]: https://go.dev/blog/go1.21
2023-08-11 13:50:53 +02:00
Thorben Günther
164e30b37d
Use slices.Contains from the standard library 2023-08-11 13:39:19 +02:00
Thorben Günther
1d08b724da
Upgrade dependencies 2023-08-11 12:57:29 +02:00
Thorben Günther
fe9c71e310
Bump Go version 2023-08-11 12:56:31 +02:00
Thorben Günther
94a2b9aded
readme: Add aur package 2023-07-20 01:59:08 +02:00
Thorben Günther
e8918ce3e7
docker: Release 0.3.0 2023-07-19 16:38:40 +02:00
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