Alertmanager to ntfy-sh webhook container for Kubernetes deployments
Find a file
2024-11-17 07:30:40 +00:00
.forgejo/workflows Update .forgejo/workflows/build.yaml.inactive 2024-09-08 15:37:58 +00:00
.taskfiles chore: add more building tools and scripts 2024-09-09 21:27:32 +02:00
docker chore(deps): update nixos/nix docker tag to v2.25.1 2024-11-14 01:00:14 +00:00
examples chore: add more building tools and scripts 2024-09-09 21:27:32 +02:00
src Merge pull request 'chore(deps): update dependency go to v1.23.3' (#23) from renovate/go-1.x into main 2024-11-09 00:46:57 +00:00
.gitignore initial commit 2022-11-02 14:46:55 +01:00
default.nix feat: add severityMapper 2024-09-09 21:27:32 +02:00
flake.lock chore: add latest changes and a build 2024-08-11 21:02:39 +02:00
flake.nix feat: add severityMapper 2024-09-09 21:27:32 +02:00
LICENSE chore: add latest changes and a build 2024-08-11 21:02:39 +02:00
mock.json initial commit 2022-11-02 14:46:55 +01:00
module.nix Make the config name actually how it is in the readme 2024-02-04 23:51:05 +01:00
README.md chore: add more building tools and scripts 2024-09-09 21:27:32 +02:00
renovate.json Add renovate.json 2024-08-08 01:00:55 +00:00
Taskfile.yaml chore: add more building tools and scripts 2024-09-09 21:27:32 +02:00

alertmanager-ntfy

Listen for webhooks from Alertmanager and send them to ntfy push notifications

Configuration is done with environment variables.

Variable Description Example
HTTP_ADDRESS Adress to listen on localhost
HTTP_PORT Port to listen on 8080
NTFY_SERVER_URL ntfy server to send to https://ntfy.sh
NTFY_USER ntfy user for basic auth myuser
NTFY_PASS ntfy password for basic auth supersecret

Nix

For Nix/Nixos users a flake.nix is provided to simplify the build. It also privides app to test the hooks with mocked data from mock.json

Build

nix build .#container

Push to registry

nix run .#push-container

Run directly

nix run

Test alerts

nix run '.#mock-hook'

Module

The flake also includes a NixOS module for ease of use. A minimal configuration will look like this:


# Add to flake inputs
inputs.alertmanager-ntfy.url = "github:pinpox/alertmanager-ntfy";

# Import the module in your configuration.nix
imports = [
	self.inputs.alertmanager-ntfy.nixosModules.default
];

# Enable and set options
services.alertmanager-ntfy = {
	enable = true;
	httpAddress = "localhost";
	httpPort = "9999";
	ntfyTopic = "https://ntfy.sh/test";
	ntfyPriority = "high";
	envFile = "/var/src/secrets/alertmanager-ntfy/envfile";
};

🤩 Gratitude

This repo is based on the work by pinpox/alertmanager-ntfy. Adaptions has been made for Kubernetes deployment.