esl / MongoosePush

MongoosePush is a simple Elixir RESTful service allowing to send push notification via FCM and/or APNS.
Apache License 2.0
108 stars 24 forks source link
apns elixir fcm gcm http2 mongooseim notifications push rest

MongoosePush

CircleCI Coverage Status

MongoosePush is a simple, RESTful service written in Elixir, providing the ability to send push notifications to FCM (Firebase Cloud Messaging) and/or APNS (Apple Push Notification Service) via their HTTP/2 API.

Documentation

Documentation is available at: https://esl.github.io/MongoosePush

Quick start

Running from DockerHub

We provide prebuilt MongoosePush images. Configuration requires either an FCM token, APNS certificates or an APNS token. Depending on your usecase, you can have some or all of them in a standalone MongoosePush instance or using a docker container. For the full configuration you need to set the following directory structure up:

If you want to use APNS token authentication you need to provide token and set key_id and team_id environment variables. To see how to obtain token and key_id read this. To see how to obtain team_id read this.

FCM JSON file can be generated by Firebase console (https://console.firebase.google.com). Go to your project -> Project Settings -> Service accounts -> Generate new private key.

TOML config file is optional. It allows to fully configure the service but basic configuration can be achieved via environmental variables only.

Assuming that you have the priv directory with all certificates and fcm token in current directory and var directory with a config file, then you may start MongoosePush with the following command:

docker run -v `pwd`/priv:/opt/app/priv \
  -v `pwd`/var:/opt/app/var \
  -e PUSH_HTTPS_CERTFILE="/opt/app/priv/ssl/rest_cert.pem" \
  -e PUSH_HTTPS_KEYFILE="/opt/app/priv/ssl/rest_key.pem" \
  -it --rm mongooseim/mongoose-push:latest

Local build prerequisites