diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8088647 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Matt Foxx + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 4810628..ed8fc80 100644 --- a/README.md +++ b/README.md @@ -1 +1,59 @@ -# deploy-ntfy-alerter \ No newline at end of file +# Deploy a Gotify [Alerter](https://komo.do/docs/resources#alerter) + +Part of the [*Komodo Hub* collection.](https://github.com/komodo-hub/komodo-hub) + +Deploys an [Alerter](https://komo.do/docs/resources#alerter) that pushes to [ntfy](https://ntfy.sh/). Docker image built from [foxxmd/komodo-utilities](https://github.com/FoxxMD/komodo-utilities). + +## Requirements + +* A running ntfy instance ([installation docs](https://docs.ntfy.sh/)) +* A topic to push to + +## Komodo Resource TOML + +```toml +[[stack]] +name = "ntfy-alerter" +[stack.config] +repo = "foxxmd/deploy-ntfy-alerter" +file_paths = [ + "compose.yaml", +] +environment = """ + ## Required + + # Your Gotify instance URL + NTFY_URL = https://ntfy.example.com + + # App Token created for Komodo + NTFY_TOPIC = MyTopic + + ## Optional + + # Auth + #NTFY_USER=[[NTFY_USER]] + #NTFY_PASSWORD=[[NTFY_PASSWORD]] + + # Set the Gotify Priority level based on Komodo alert severity + #NTFY_OK_PRIORITY=3 + #NTFY_WARNING_PRIORITY=5 + #NTFY_CRITICAL_PRIORITY=8 +""" + +[[variable]] +name = "NTFY_USER" +value = "MyUser" +is_secret = true + +[[variable]] +name = "NTFY_PASSWORD" +value = "MyPass" +is_secret = true + +[[alerter]] +name = "ntfy" +[alerter.config] +enabled = true +endpoint.type = "Custom" +endpoint.params.url = "http://ntfy-alerter-ip:7000" +``` \ No newline at end of file diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..86b23ea --- /dev/null +++ b/compose.yaml @@ -0,0 +1,11 @@ +services: + komodo-ntfy: + image: foxxmd/komodo-ntfy-alerter:latest + restart: unless-stopped + environment: + - NTFY_URL=${NTFY_URL} + - NTFY_TOPIC=${NTFY_TOPIC} + - NTFY_USER= + - NTFY_PASSWORD= + ports: + - "7000:7000" \ No newline at end of file