Skip to content

nyaruka/courier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛫 Courier

tag Build Status codecov Go Report Card

Messaging gateway service for RapidPro and TextIt.

Deploying

It compiles to a binary and can find bundles for each platform in the releases directory.

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 COURIER_
  3. Command line parameters

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

  • COURIER_DOMAIN: The root domain which courier is exposed as (ex textit.in)
  • COURIER_SPOOL_DIR: A local path where courier can spool files if the database is down, should be writable. (ex: /home/courier/spool)
  • COURIER_DB: Details parameters used to connect to the Postgres RapidPro database (ex: postgres://textit:[email protected]/5432/textit)
  • COURIER_VALKEY: Details parameters to use to connect to Valkey RapidPro database (ex: valkey://valkey.courier.io:6379/13)
  • COURIER_AUTH_TOKEN: authentication token to require for requests from Mailroom

AWS services:

  • COURIER_AWS_ACCESS_KEY_ID: AWS access key id used to authenticate to AWS
  • COURIER_AWS_SECRET_ACCESS_KEY: AWS secret access key used to authenticate to AWS
  • COURIER_AWS_REGION: AWS region (ex: eu-west-1)
  • COURIER_S3_ATTACHMENTS_BUCKET: name of your S3 bucket (ex: rp-attachments)

Logging and error reporting:

  • COURIER_DEPLOYMENT_ID: used for metrics reporting
  • COURIER_SENTRY_DSN: DSN to use when logging errors to Sentry
  • COURIER_LOG_LEVEL: logging level to use (default is warn)

Development

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

go install github.com/nyaruka/courier/cmd/courier

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

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

$ createdb courier_test
$ createuser -P -E courier_test
$ psql -d courier_test -f backends/rapidpro/schema.sql
$ psql -d courier_test -c "GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO courier;"
$ psql -d courier_test -c "GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO courier;"

To run all of the tests including benchmarks:

go test ./... -p=1 -bench=.

About

Messaging gateway for RapidPro/TextIt.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 30

Languages