rapidpro / mailroom

Backend services for the RapidPro platform.
Other
25 stars 28 forks source link

RapidPro Mailroom

Build Status codecov

Service for RapidPro which does the heavy lifting of running flow starts, campaigns etc. It interacts directly with the database and sends and receives messages with Courier for handling via Redis.

Deploying

As a Go application, it compiles to a binary and that binary along with the config file is all you need to run it on your server. You can find bundles for each platform in the releases directory. We recommend running it behind a reverse proxy such as nginx or Elastic Load Balancer that provides HTTPs encryption.

Configuration

The service uses a tiered configuration system, each option takes precendence over the ones above it:

  1. The configuration file
  2. Environment variables starting with MAILROOM_
  3. Command line parameters

We recommend running it with no changes to the configuration and no parameters, using only environment variables to configure it. You can use % mailroom --help to see a list of the environment variables and parameters and for more details on each option.

For use with RapidPro, you will need to configure these settings:

For writing of message attachments, you need an S3 compatible service which you configure with:

You can optionally use the S3 service for session out storage as well with:

Flow engine configuration:

Recommended settings for error and performance monitoring:

Development

Once you've checked out the code, you can build the service with:

go build github.com/rapidpro/mailroom/cmd/mailroom

This will create a new executable in $GOPATH/bin called mailroom.

To run the tests you need to create the test database:

$ createdb mailroom_test
$ createuser -P -E -s mailroom_test (set no password)

To run all of the tests:

go test -p=1 ./...