Thorben Günther
add22b771a
Remove default ntfy server setting
...
Setting this to "https://ntfy.sh " has security implications: If the user
forgets to set his server, but uses the new short form for topics, the
notification will be sent to "ntfy.sh" and could expose information.
2024-11-21 12:21:12 +01:00
Thorben Günther
109b0f52c0
Mirror docker image to Codeberg
2024-11-20 14:02:44 +01:00
Thorben Günther
182444df3a
Expose context to cache functions
2024-11-09 14:13:33 +01:00
Thorben Günther
ea58dec539
maxNTFYActions should be const
2024-11-07 20:02:22 +01:00
Thorben Günther
d25169e203
docker: Fix warnings
...
"FromAsCasing: 'as' and 'FROM' keywords' casing do not match"
2024-11-07 14:24:33 +01:00
Thorben Günther
bd1abedac1
Allow setting topic through URL query parameters
...
Closes: https://codeberg.org/xenrox/ntfy-alertmanager/issues/2
2024-11-07 14:09:49 +01:00
Thorben Günther
84a45a909b
config: Allow to separate the ntfy topic from the server
2024-11-07 13:54:21 +01:00
Thorben Günther
9b9d71d648
Fix linter warnings
2024-11-06 15:09:49 +01:00
Thorben Günther
dbe860e429
docker: Recommend valkey
...
References: https://todo.xenrox.net/~xenrox/ntfy-alertmanager/24
2024-11-06 15:06:29 +01:00
Thorben Günther
652c8b32cd
Limit number of ntfy actions
...
ntfy supports a maximum of three actions. If more a defined, the sending
of the message will fail. To prevent this, the surplus actions will be
removed.
2024-11-06 14:45:15 +01:00
Thorben Günther
e85b5e6ea5
Let a label specify its own ntfy topic
...
References: https://todo.xenrox.net/~xenrox/ntfy-alertmanager/9
2024-11-06 14:16:36 +01:00
Thorben Günther
f4483532f5
Add support for displaying the alert's GeneratorURL
2024-11-06 14:01:01 +01:00
Thorben Günther
fa1a7916f0
Add testing setup
2024-11-06 13:03:29 +01:00
Thorben Günther
b3d5045ca7
Try out just
2024-11-03 19:38:20 +01:00
Thorben Günther
a4e11fc6c4
ci: Install docker-buildx
...
Fix for:
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
Install the buildx component to build images with BuildKit:
2024-09-22 01:49:28 +02:00
Thorben Günther
6f2df702ed
ci: Push docker images to own registry as well
2024-09-20 00:50:42 +02:00
Thorben Günther
f2cac349c6
Support logging to file
2024-09-11 22:45:56 +02:00
Thorben Günther
a1d620b6d2
Improve example config
...
List default settings and clearly display options.
2024-09-11 22:38:15 +02:00
Thorben Günther
765235c0ca
config: Remove unused config field
...
The implementation did not use this field after all.
2024-09-11 22:18:44 +02:00
Thorben Günther
af3857d162
config: Use "example.com" domain
...
This is recommended by RFC2606[1].
[1]: https://datatracker.ietf.org/doc/html/rfc2606
2024-09-11 22:12:21 +02:00
Thorben Günther
dc9741b798
config: ReadConfig -> Read
...
The function is already in the config package, the old naming is
redundant.
2024-09-11 22:02:50 +02:00
Thorben Günther
6c2521eeca
config: Support "include" directive
...
With this directive other configuration files can be imported into the
main config. Can be useful for keeping secrets out of the latter.
Closes: https://todo.xenrox.net/~xenrox/ntfy-alertmanager/23
2024-09-11 21:53:26 +02:00
Thorben Günther
8ea629264d
readme: Link Codeberg mirror
2024-07-23 17:46:13 +02:00
Thorben Günther
7295d210b8
docker: docker-compose.yml -> compose.yaml
...
Further removed the obsolete "version".
2024-07-23 17:32:20 +02:00
Thorben Günther
e1ae4d2e43
readme: Update explanation for resolved alerts
...
Priority is supported as well.
2023-09-28 13:48:14 +02:00
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