A couple of open source solutions for delivering notifications

Open services for managing notifications on mobile platforms will be useful not only for administrators, but also for developers within pet projects. We'll tell you which tools can be used as an alternative to proprietary ones.

Photo: Mathyas Kurmann / Unsplash.com

Photo: Mathyas Kurmann / Unsplash.com

All the solutions that we will talk about today can be considered an alternative to the service Firebase Cloud Messaging (FCM). Since it is owned by Google, many users worries data privacy issue. Of course, you can configure notification encryption, but this approach leads to additional complications and potential delays. At the same time, alternative platforms may be of interest in case of problems with access to Google servers for one reason or another.

Gotify – to send messages to the server

This solution introduced enthusiast from Berlin in 2018 and released it is licensed from MIT. By default, the tool works with SQLite, but some users may not have enough of its performance, then you can connect PostgreSQL, MySQL or MariaDB.

The role of the client is played by a browser or an Android application available in the catalog F-Droidand also in the form APK. For stable operation, the author suggests disabling battery optimization on your phone, otherwise Gotify will not be able to send notifications in the background. To prevent notifications from being too intrusive, you can set their priority – for example, the most important ones will come with sound and vibration. On end devices you can only view and delete notifications – by default, send them to the server will not work. However, this functionality can be implemented using Gotify-CLI or another HTTP client (including curl).

One of the features of the solution is plugins. Can take advantage ready-made community developments to set up sending notifications in Slack or integration with monitoring system Nagios. You can write your own extensions and include them in repository project – will help with development documentationincluding for API.

Regarding issues related to information security, Gotify allows use reverse proxy. It can be deployed using Nginx, HAProxy, Apache and Caddy 2. The last option will be simpler – in the config there is enough indicate corresponding port.

In the community, the tool is used to solve both work and personal problems. For example, Hacker News resident shared details of his project – using Gotify, he implemented the transmission of notifications from the Zulip chat. Some apply a tool for delivering alerts from home security cameras. Although a number of users still note certain shortcomings. So, despite the optimization, the mobile client quickly spends phone battery.

ntfy – notifications without registration and SMS

Release ntfy took place in 2021 under double license Apache License 2.0 and GPLv2. Later, paid plans were introduced to support the project, but the tool can still be deployed on your own server. The solution is based on the “publish-subscribe pattern” message transmission principle. In this case, messages are divided into classes and do not contain information about recipients (subscribers). In this case, subscribers interact with one or more message classes and are abstracted from specific senders (publishers).

There are two ways to send alerts: using PUT or POST requests, as well as CLI. The CLI supports Windows, macOS, Linux and its distributions – detailed installation guides for each system can be found in documentation. To enable communication with other services, the API can be configured either using websockets or as an HTTP request stream in JSON, SSE or TEXT format. Interesting functions of the software interface include filtering messages by ID, content, title, tags, and priority.

Novu – when you need your own notification center

This tool for developers was published by a specialist from Israel in 2021 under the MIT license. Now the project is being developed by the community, which totals almost 400 participants. Novu architecture feature is is that it divides communication tasks into components. Each of them is assigned certain functions: from message transmission to data management. This separation simplifies maintenance of the notification system and its scaling.

There are two options for deployment – in the cloud or on a local server. The first option is more suitable for business and implies paid tariff. In the second case, the developer receives full control over alerts and ample opportunities for customization. The easiest way run Novu is in a Docker container, but the authors recommend double-checking the default settings.

Photo: Tim Mossholder / Unsplash.com

Photo: Tim Mossholder / Unsplash.com

Interestingly, the solution provides a single API, thanks to which you can build your own notification center to work with different communication channels: SMS, chats, mail, push notifications. However, it is worth noting that the tool supports MongoDB and Redis database, which may not be enough for some categories of users.

UnifiedPush – when an alternative protocol is needed

This – protocol to send push notifications on Android. He came out in 2021 licenses Apache-2.0. Applications that support UnifiedPush can receive all notifications through a dedicated distributor that maintains a single connection to the server. As a distributor you can choose already mentioned ntfy, NextPush, Conversations and other services, as well as write your own.

In the community hope to increase the number of clients supporting the protocol. Now they more twenty, including applications for Matrix servers and the decentralized social network Mastodon. If UnifiedPush becomes widespread enough, developers will become more willing to use it.

Apprise – lightweight and affordable

Apprise is library Python allowing send alerts via email, SMS and even via Discord. The author is a developer from Canada who released the project in 2018 under license BSD 2-Clause. He also wrote the Home Assistant home control app, which integrates with Apprise via API.

Solution stands as a proxy server and allows you to easily manage notification delivery services. To connect an application to the library, it is enough to register the diagram and configuration – in general it looks like this:

schema://credentials/?optional_configuration

For example, for Discord it could be discord://webhook_id/webhook_tokenfor Gotify – gotify://hostname/token. A complete list of supported services and examples of their settings is available in repositories on GitHub.

The notifications themselves can be sent using the CLI or configuration files in format YAML and TEXT. Messages can come in MARKDOWN, HTML and TEXT format.

As for the API, it allows you to manage groups of recipients using tags such as devops, admin, family. The main advantage of the software interface is its lightness, which is achieved by the absence of SSL encryption and additional dependencies. Even more about API capabilities – in documentation.

Among other interesting features of the solution, it is worth noting that all messages are sent asynchronously to ensure quick response. Plus – the tool automatically splits large notifications into smaller ones so that the number of characters does not exceed platform limits – for example, 1024 symbol for a message in Telegram with attached media files. The library is also compatible with legacy systems such as CentOS 6+.

Overall the community is supportive responds about the solution – for many, it really simplified working with notifications. Some express It’s a pity that you can’t work with the tool within Node.js. Experts also note the absence of an Apprise “server” with configuration files. While they have to duplicate files for each project.

Further Reading

Build a topology and test fault tolerance: a selection of open source solutions for network emulation. In this article we look at Containerlab, Mininet, Kathará, IMUNES, CORE, Toxiproxy and Cloonix – tools that allow you to build virtual network laboratories, simulate topologies based on containers or VMs, check fault tolerance and test network software.

Pet projects and solutions from open source organizations: a selection of open tools for network monitoring. We are considering the capabilities of five solutions: Sniffnet, Leaf Node Monitoring, Portmaster, HertzBeat and Gyeeta. They allow you to obtain data about domain names and host providers, check the operation of sites and servers, monitor application activity, and view analytics for various protocols.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *