20220104-notify,_only_smaller.md (1708B)
1 [ntfy](https://ntfy.sh) is an opensource publish-subscribe (pub-sub) notification service. 2 3 Publishing a message can be as simple as using HTTP PUT/POST with `curl`. 4 ``` 5 curl -d "Schway, backups successful" ntfy.sh/pyratebackups 6 ``` 7 8 Publishing can be done in your choice of language (python, php, go, etc.) or via the [Android app](https://ntfy.sh/docs/subscribe/phone/). Take a look at the [docs](https://ntfy.sh/docs/publish/) for more examples. 9 10 Messages can handle titles, priorities, and tags (including emojis). 11 ``` 12 curl -H "Title: pyratebackups" \ 13 -H "Priority: high" \ 14 -H "Tags: warning,rotating_light,skull" \ 15 -d "Frak, backups shit the bed" ntfy.sh/pyratebackups 16 ``` 17 18 Topics (e.g. "pyratebackups") can be anything you want, but there is no authentication so anybody can subscribe. 19 20 Subscribing to topics can be done through the ntfy webUI, the Android app, or using the [API](https://ntfy.sh/docs/subscribe/api/) in your own app. 21 22 ntfy can also be [self-hosted](https://ntfy.sh/docs/install/). Packages are available for Debian/Ubuntu, Fedora/CentOS/RHEL, Arch, as well as a binary and a docker image. 23 24 I usually set up an email notification in my scripts, but have been trying `ntfy` out for a few weeks now. Adding a `curl` command to my scripts then subscribing via the Android app was really simple to do, and now I get instant notifications whole also reducing the noise in my mailbox. 25 26 ## see also 27 There are some great notification tools out there, a few to check out are: 28 29 * [gotify](https://gotify.net/) 30 * [apprise](https://pypi.org/project/apprise/) 31 * [pingme](https://pingme.lmno.pk/#/) 32 33 I like the look of apprise so may trial that at some point in the coming months.