Skip to content

jimfenton/notif-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nōtifs Agent

Nōtifs (short for notifications) provides a method for users to receive opt-in notifications from services of their choice. Examples of such services (notifiers) include emergency alerts, messages from personal devices like alarm systems, news alerts, newsletters, and advertising. A more complete description of Nōtifs can be found here.

The Nōtifs agent is the central collection and distribution point for a given user's notifications. The complete agent actually has two parts:

  1. The data path, which accepts HTTP requests from notifiers, stores nōtifs in a database, and generates requested alerts to the user.
  2. The management interface, which allows users to manage their active nōtifs and authorizations, processes new authorization requests, and allows them to set up alerting methods and rules.

This repository contains the code for (1), the data path, which is considered to be the most performance sensitive. The code for (2), the management interface, is in the notif-mgmt repository. In addition, there is a notifier library written in Python and a simple demo application that generates nōtifs in the notif-notifier repository.

This code is written in Go, and has been tested using Go version 1.3.3. It interfaces with a SQL database (tested using PostgreSQL 9.4.9), in which nōtifs, authorizations, methods, rules, and user settings are stored. It also uses the following library that may require separate installation:

This can be installed with the go get command.

The SQL database used by the Nōtifs agent is specified through a configuration file that is located at /etc/notifs/agent.cfg . This file contains a bit of JSON to specify the hostname, username, database name, and password for the database. For example, it might contain:

{"host":"localhost","dbname":"notifs","user":"notifs","password":"whatever"}

It is highly recommended that the database be password protected (and not with "whatever")!

The agent does not attempt to daemonize itself. One way to run the agent in the background is to use:

nohup notif-agent &

About

Sample agent for receiving and storing nōtifs from notifiers and generating user alerts

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages