[READ-ONLY] Mirror of https://github.com/FoxxMD/deploy-ntfy-alerter.
0

Configure Feed

Select the types of activity you want to include in your feed.

12 1 0

Clone this repository

https://tangled.org/foxxmd.dev/deploy-ntfy-alerter https://tangled.org/did:plc:ia4efqynfwd7uphnn72s5lyx
git@tangled.org:foxxmd.dev/deploy-ntfy-alerter git@tangled.org:did:plc:ia4efqynfwd7uphnn72s5lyx

For self-hosted knots, clone URLs may differ based on your setup.



README.md

Deploy a ntfy Alerter#

Part of the Komodo Hub collection.

Deploys an Alerter that pushes to ntfy. Docker image built from foxxmd/komodo-utilities.

Supports optional authentication via query param, username/password, and access token.

Requirements#

Deploying#

Use either of the methods below.

Komodo Resource Sync#

Create a Resource Sync with the TOML configuration below to

  • create the Stack to run deploy-ntfy-alerter
  • add the Ntfy User/Password or Token Variable and
  • setup the Alerter + configuration

Steps:

  • Open Komodo Dashboard -> Syncs -> New Resource Sync
  • Choose Mode -> UI Defined
    • Toggle the following to active:
      • Include Sync Resources
      • Include Sync Variables

Add the below configuration to Resource File field and then modify variables for your environment (NTFY_URL, endpoint.params.url, etc...)

[[stack]]
name = "ntfy-alerter"
[stack.config]
repo = "foxxmd/deploy-ntfy-alerter"
file_paths = [
  "compose.yaml",
]
environment = """
  ## Required

  ## Your ntfy instance URL
  NTFY_URL = https://ntfy.example.com

  ## Topic to be used for for Komodo
  NTFY_TOPIC = MyTopic

  ## Optional

  ## Auth

  ## https://docs.ntfy.sh/publish/#username-password
  #NTFY_USER=[[NTFY_USER]]
  #NTFY_PASSWORD=[[NTFY_PASSWORD]]
  ## https://docs.ntfy.sh/publish/#access-tokens
  #NTFY_TOKEN=[[NTFY_TOKEN]]

  # Below need to add to `compose.yaml` as well

  ## Set the ntfy Priority level based on Komodo alert severity
  #NTFY_OK_PRIORITY=3
  #NTFY_WARNING_PRIORITY=5
  #NTFY_CRITICAL_PRIORITY=8

  # Set whether to include Komodo Severity Level in notification title
  #LEVEL_IN_TITLE=true

  # Prefixes messages with a checkmark when the Alert is in the 'Resolved' state
  #INDICATE_RESOLVED=true

  # Filter if an alert is pushed based on its Resolved status
  # * leave unset to push all alerts
  # * otherwise, alerts will only be pushed if Alert is one of the comma-separated states set here
  #ALLOW_RESOLVED_TYPE=resolved,unresolved

  ## Delay alerts with below types for X milliseconds 
  ## and cancel pushing alert if it is resolved within that time
  #UNRESOLVED_TIMEOUT_TYPES=ServerCpu,ServerMem
  #UNRESOLVED_TIMEOUT=2000
"""

[[variable]]
name = "NTFY_USER"
value = "MyUser"
is_secret = true

[[variable]]
name = "NTFY_PASSWORD"
value = "MyPass"
is_secret = true

[[variable]]
name = "NTFY_TOKEN"
value = "MyAccessToken"
is_secret = true

[[alerter]]
name = "ntfy"
[alerter.config]
enabled = true
endpoint.type = "Custom"
endpoint.params.url = "http://ntfy-alerter-ip:7000"

Save the sync and then Execute Sync to create the Alerter.

Manual setup#

Create a new Stack with the following for compose.yaml file.

services:
  komodo-ntfy:
    image: foxxmd/komodo-ntfy-alerter:latest
    restart: unless-stopped
    env_file:
      - ./.env
    ports:
      - "7000:7000"

Add the following to the Stack -> Config -> Environment section:

## Required

## Your ntfy instance URL
NTFY_URL = https://ntfy.example.com

## Topic to be used for for Komodo
NTFY_TOPIC = MyTopic

## Optional

## Auth

## https://docs.ntfy.sh/publish/#username-password
#NTFY_USER=[[NTFY_USER]]
#NTFY_PASSWORD=[[NTFY_PASSWORD]]
## https://docs.ntfy.sh/publish/#access-tokens
#NTFY_TOKEN=[[NTFY_TOKEN]]

# Below need to add to `compose.yaml` as well

## Set the ntfy Priority level based on Komodo alert severity
#NTFY_OK_PRIORITY=3
#NTFY_WARNING_PRIORITY=5
#NTFY_CRITICAL_PRIORITY=8

# Set whether to include Komodo Severity Level in notification title
#LEVEL_IN_TITLE=true

# Prefixes messages with a checkmark when the Alert is in the 'Resolved' state
#INDICATE_RESOLVED=true

# Filter if an alert is pushed based on its Resolved status
# * leave unset to push all alerts
# * otherwise, alerts will only be pushed if Alert is one of the comma-separated states set here
#ALLOW_RESOLVED_TYPE=resolved,unresolved

## Delay alerts with below types for X milliseconds 
## and cancel pushing alert if it is resolved within that time
#UNRESOLVED_TIMEOUT_TYPES=ServerCpu,ServerMem
#UNRESOLVED_TIMEOUT=2000

Make sure to replace placeholder values. [[NTFY_USER]] is a Komodo Variable.

After deploying the Stack create a new Alerter

  • Endpoint: Custom
    • In the Endpoint field set the IP:PORT of the komodo-ntfy-alerter stack you created IE http://192.168.YOUR.IP:7000
  • Optionally, set any Alert Types you may need

Save the Alerter and then Test Alerter to make sure everything is ready to use.