Messaging gateway service for RapidPro and TextIt.
It compiles to a binary and can find bundles for each platform in the releases directory.
The service uses a tiered configuration system, each option takes precendence over the ones above it:
- The configuration file
- Environment variables starting with
COURIER_
- 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 (extextit.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
COURIER_AWS_ACCESS_KEY_ID
: AWS access key id used to authenticate to AWSCOURIER_AWS_SECRET_ACCESS_KEY
: AWS secret access key used to authenticate to AWSCOURIER_AWS_REGION
: AWS region (ex:eu-west-1
)COURIER_S3_ATTACHMENTS_BUCKET
: name of your S3 bucket (ex:rp-attachments
)
COURIER_DEPLOYMENT_ID
: used for metrics reportingCOURIER_SENTRY_DSN
: DSN to use when logging errors to SentryCOURIER_LOG_LEVEL
: logging level to use (default iswarn
)
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=.