• Stars
    star
    114
  • Rank 308,031 (Top 7 %)
  • Language
    Go
  • License
    Other
  • Created over 7 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Messaging gateway for RapidPro/TextIt.

Courier

Build Status codecov Go Report Card

Courier is a messaging gateway for text-based messaging channels. It abstracts out various different texting mediums and providers, allowing applications to focus on the creation and processing of those messages.

Currently it supports over 50 different channel types, ranging for SMS aggregators like Twilio to IP channels like Facebook and Telegram messenger. The goal is for Courier to support all popular messaging channels and aggregators and we are happy to accept pull requests to help accomplish that.

Courier is currently used to power RapidPro and TextIt but the backend is pluggable, so you can add your own backend to read and write messages.

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 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.

RapidPro

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

  • 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_REDIS: Details parameters to use to connect to Redis RapidPro database (ex: redis://redis-internal.courier.io:6379/13)

For writing of message attachments, Courier needs access to an S3 bucket, you can configure access to your bucket via:

  • COURIER_S3_REGION: The region for your S3 bucket (ex: ew-west-1)
  • COURIER_S3_MEDIA_BUCKET: The name of your S3 bucket (ex: dl-courier)
  • COURIER_S3_MEDIA_PREFIX: The prefix to use for filenames of attachments added to your bucket (ex: attachments)
  • COURIER_AWS_ACCESS_KEY_ID: The AWS access key id used to authenticate to AWS
  • COURIER_AWS_SECRET_ACCESS_KEY The AWS secret access key used to authenticate to AWS

Recommended settings for error and performance monitoring:

  • COURIER_LIBRATO_USERNAME: The username to use for logging of events to Librato
  • COURIER_LIBRATO_TOKEN: The token to use for logging of events to Librato
  • COURIER_SENTRY_DSN: The DSN to use when logging errors to Sentry

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=.

More Repositories

1

phonenumbers

GoLang port of Google's libphonenumber library
Go
1,180
star
2

smartmin

Django Smartmin - An admin-like utility for users
Python
207
star
3

android-sms-relay

Simple Android application that provides reliable relaying of SMS messages to and from a server through HTTP.
Java
87
star
4

floweditor

Graphical flow editor for the TextIt platform.
JavaScript
70
star
5

goflow

Flow engine for RapidPro/TextIt.
Go
43
star
6

rapidsms-httprouter

Implements a router in the HTTP thread, one message per call.
Python
40
star
7

klab

The official repository for the klab.rw website which can be found at http://klab.rw/
Python
12
star
8

django-quickblocks

Easy, fast, and useful content snippets for your Django site.
JavaScript
9
star
9

ezconf

Easy configuration by convention from TOML, environment variables and command line arguments
Go
8
star
10

gocommon

Common utility library for the TextIt platform.
Go
7
star
11

nsms

Provides a base package and install for building RapidSMS apps.
Python
6
star
12

jangod

Fork of jangod project on Google Code
Java
6
star
13

pysmsrouter

Very simple framework for handling disparate SMS backends and routing them to an HTTP endpoint. So far this is only useful for RapidSMS
Python
5
star
14

jukebox

Django project to manage the kLab jukebox.
JavaScript
5
star
15

rp-indexer

Content indexing service for RapidPro/TextIt.
Go
5
star
16

temba-components

General web components for site building
TypeScript
4
star
17

rapidsms-polls

The 'P' in CPBL, a rapid app
JavaScript
4
star
18

nyaruka-sms

Android based SMS platform.
Java
3
star
19

null

golang library for nullable types
Go
3
star
20

redisx

library of Go utilities for Redis
Go
3
star
21

xlsxlite

Lightweight XLSX writer with emphasis on minimizing memory usage.
Python
3
star
22

libphonenumber

Fork of http://code.google.com/p/libphonenumber/
C++
3
star
23

elasticsearch-action

GitHub Action to setup an Elasticsearch instance
Shell
3
star
24

gojunebug

Go
2
star
25

posm-extracts

Current version of OSM extracts based on POSM tool
2
star
26

rp-archiver

Content archival service for RapidPro/TextIt.
Go
2
star
27

rp-clover

Router for incoming messages to RapidPro, takes care of changing contact affinity based on keywords and routing incoming messages based on that affinity.
Go
2
star
28

nsms-plus

Includes additional super secret magic sauce Nyaruka uses to make kick ass products.
JavaScript
1
star
29

posm

Extract tools for OSM data
Python
1
star
30

kannel

Kannel
C
1
star
31

canary

Simple golang tool to check health of openswan tunnel and restart if down
Go
1
star
32

sigtrac

measuring stuff
Python
1
star
33

django-mosquare

Mobile Monday Site for Kigali
Python
1
star
34

sawanet-django-who

A sample Django application that will work using AppFog.com and Sawanet.com.
Python
1
star
35

librato

Basic Librato client library with batching of events
Go
1
star
36

go-locales

Library to make GNU C Library Locales accessible in go.
Go
1
star