marco-c / mercurius

Generic Web Push server

Home Page:https://mozcurius.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mercurius

Cross-platform web push center. Site allows to proxy a POST request to a full featured push notification. Especially useful for services without web presence, originally came out as an IRSSI notification system.

Secure, as no data is stored except of generated token, machine id with an endpoint and connected client names.

We're currently running a publicly available development server under Heroku.

Check the post on Mozilla's hacks page to see a real live usecase.

Build Status dependencies devdependencies

API

POST /notify

Send a notification to a user.

The body of the request is a JSON object containing:

  • token;
  • client - the client sending the notification (e.g. 'Irssi');
  • payload;
  • (optional) TTL (Time-To-Live of the notification).

The payload is a JSON object containing the parameters of the nofication to be shown to the user:

  • title: the title of the notification;
  • body: the body of the notification.

Example:

{
    "token": "aToken",
    "client": "someClient",
    "payload": {
        "title": "IRSSI",
        "body": "a message"
    }
}

VARIABLES

Mandatory :

  • REDISCLOUD_URL (Ex. redis://localhost:6379)

Optional

  • GCM_API_KEY : Your Google API Key to send notification to Chrome.
  • DISABLE_SSL_REDIRECT : Disable the built-in SSL redirection.

INSTALL

Install Redis database and set REDISCLOUD_URL environment variable to its host (redis://localhost:6379)

DOCKER

  • clone this repo
cd mercurius && docker build -t="mercurius" .
docker run --publish 4000:4000 -e REDISCLOUD_URL="redis://localhost:6379" -e GCM_API_KEY="" -e DISABLE_SSL_REDIRECT="1" mercurius

About

Generic Web Push server

https://mozcurius.herokuapp.com/

License:Apache License 2.0


Languages

Language:JavaScript 92.1%Language:CSS 4.8%Language:HTML 3.0%Language:Shell 0.1%