The goal of this tutorial is to set up a simple REST API that allows you to send XMPP messages to an existing XMPP account. This can be easily integrated into monitoring solutions or other scripts that send out status information.
While there are command-line tools like go-sendxmpp that send messages by connecting to an XMPP server directly, this guide is specifically about providing an HTTP interface.
curl "https://ntfy.stdmsg.tech:5281/msg/[email protected]" \ -u [email protected]:secret \ -H "Content-Type: text/plain" \ -d "Your flat white is done"
Hint: If you don’t have an XMPP account to receive these messages, you can create one on a public server from within Conversations (F-Droid, Google Play) or another XMPP client of your choosing.
Requirements
This guide assumes you have a relatively clean install of Debian 13. However, using other Linux distributions or integrating this into an install with existing services will probably work as well. The only other requirement is that you have a domain. Any subdomain over which you control the A record will do. In this tutorial, we will use the domain ntfy.stdmsg.tech (be sure to replace it with your own).
Setup
Installation
We are installing Prosody IM, the community modules and certbot (to get certificates).
apt install prosody prosody-modules lua-unbound liblua5.4-dev certbot
... continue reading