diff --git a/README.md b/README.md index 088c179..75bc0b8 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,30 @@ Supports optional authentication via query param, username/password, and access * A running ntfy instance ([installation docs](https://docs.ntfy.sh/)) * A topic to push to -## Komodo Resource TOML +## Deploying + +Use **either** of the methods below. + +### Komodo Resource Sync + +
+ +Create a [Resource Sync](https://komo.do/docs/sync-resources) with the TOML configuration below to + +* create the [Stack](https://komo.do/docs/resources#stack) to run deploy-ntfy-alerter +* add the Ntfy User/Password or Token [Variable](https://komo.do/docs/variables) and +* setup the [Alerter](https://komo.do/docs/resources#alerter) + configuration + +Steps: + +* Open Komodo Dashboard -> Syncs -> **New Resource Sync** +* Choose Mode -> UI Defined + * Toggle the following to active: + * Managed + * 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...) ```toml [[stack]] @@ -85,4 +108,82 @@ name = "ntfy" enabled = true endpoint.type = "Custom" endpoint.params.url = "http://ntfy-alerter-ip:7000" -``` \ No newline at end of file +``` + +**Save** the sync and then **Execute Sync** to create the Alerter. + +
+ +## Manual setup + +
+ +Create a new [**Stack**](https://komo.do/docs/resources#stack) with the following for `compose.yaml` file. + +```yaml +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: + +```ini +## 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](https://komo.do/docs/variables). + +After deploying the Stack create a new [Alerter](https://komo.do/docs/resources#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. + +
\ No newline at end of file