Skip to content

Commit

Permalink
move s3 session config error to a warning for the time being since no…
Browse files Browse the repository at this point in the history
…t strictly required yet
  • Loading branch information
nicpottier committed Jul 6, 2021
1 parent a4da43b commit 7cd93ef
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 26 deletions.
56 changes: 31 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# mailroom
# mailroom

[![Build Status](https://github.com/nyaruka/mailroom/workflows/CI/badge.svg)](https://github.com/nyaruka/mailroom/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/nyaruka/mailroom/branch/main/graph/badge.svg)](https://codecov.io/gh/nyaruka/mailroom)
[![Build Status](https://github.com/nyaruka/mailroom/workflows/CI/badge.svg)](https://github.com/nyaruka/mailroom/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/nyaruka/mailroom/branch/main/graph/badge.svg)](https://codecov.io/gh/nyaruka/mailroom)

# About
# About

Mailroom is the [RapidPro](https://github.com/rapidpro/rapidpro) component responsible for the execution of
flows. It interacts directly with the RapidPro database and sends and receives messages with [Courier](https://github.com/nyaruka/courier) for handling via Redis.
Expand All @@ -18,9 +18,10 @@ behind a reverse proxy such as nginx or Elastic Load Balancer that provides HTTP
# Configuration

Mailroom 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

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

We recommend running Mailroom 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
Expand All @@ -30,29 +31,34 @@ environment variables and parameters and for more details on each option.

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

* `MAILROOM_ADDRESS`: the address to bind our web server to (default "localhost")
* `MAILROOM_DOMAIN`: the domain that mailroom is listening on
* `MAILROOM_AUTH_TOKEN`: the token clients will need to authenticate web requests (should match setting in RapidPro)
* `MAILROOM_ATTACHMENT_DOMAIN`: the domain that will be used for relative attachments in flows
* `MAILROOM_DB`: URL describing how to connect to the RapidPro database (default "postgres://temba:temba@localhost/temba?sslmode=disable")
* `MAILROOM_REDIS`: URL describing how to connect to Redis (default "redis://localhost:6379/15")
* `MAILROOM_ELASTIC`: URL describing how to connect to ElasticSearch (default "http://localhost:9200")
* `MAILROOM_SMTP_SERVER`: the smtp configuration for sending emails ex: smtp://user%40password@server:port/?from=foo%40gmail.com
- `MAILROOM_ADDRESS`: the address to bind our web server to (default "localhost")
- `MAILROOM_DOMAIN`: the domain that mailroom is listening on
- `MAILROOM_AUTH_TOKEN`: the token clients will need to authenticate web requests (should match setting in RapidPro)
- `MAILROOM_ATTACHMENT_DOMAIN`: the domain that will be used for relative attachments in flows
- `MAILROOM_DB`: URL describing how to connect to the RapidPro database (default "postgres://temba:temba@localhost/temba?sslmode=disable")
- `MAILROOM_REDIS`: URL describing how to connect to Redis (default "redis://localhost:6379/15")
- `MAILROOM_ELASTIC`: URL describing how to connect to ElasticSearch (default "http://localhost:9200")
- `MAILROOM_SMTP_SERVER`: the smtp configuration for sending emails ex: smtp://user%40password@server:port/?from=foo%40gmail.com

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

* `MAILROOM_S3_REGION`: The region for your S3 bucket (ex: `eu-west-1`)
* `MAILROOM_S3_MEDIA_BUCKET`: The name of your S3 bucket (ex: `dl-mailroom`)
* `MAILROOM_S3_MEDIA_PREFIX`: The prefix to use for filenames of attachments added to your bucket (ex: `attachments`)
* `MAILROOM_AWS_ACCESS_KEY_ID`: The AWS access key id used to authenticate to AWS
* `MAILROOM_AWS_SECRET_ACCESS_KEY` The AWS secret access key used to authenticate to AWS
- `MAILROOM_S3_REGION`: The region for your S3 bucket (ex: `eu-west-1`)
- `MAILROOM_S3_MEDIA_BUCKET`: The name of your S3 bucket (ex: `dl-mailroom`)
- `MAILROOM_S3_MEDIA_PREFIX`: The prefix to use for filenames of attachments added to your bucket (ex: `attachments`)
- `MAILROOM_AWS_ACCESS_KEY_ID`: The AWS access key id used to authenticate to AWS
- `MAILROOM_AWS_SECRET_ACCESS_KEY` The AWS secret access key used to authenticate to AWS

While still in beta, Mailroom will move to writing session data to S3 in 6.6, you can configure those buckets using:

- `MAILROOM_S3_SESSION_BUCKET`: The name of your S3 bucket (ex: `rp-sessions`)
- `MAILROOM_S3_SESSION_PREFIX`: The prefix to use for filenames of sessions added to your bucket (ex: ``)

Recommended settings for error and performance monitoring:

* `MAILROOM_LIBRATO_USERNAME`: The username to use for logging of events to Librato
* `MAILROOM_LIBRATO_TOKEN`: The token to use for logging of events to Librato
* `MAILROOM_SENTRY_DSN`: The DSN to use when logging errors to Sentry
* `MAILROOM_LOG_LEVEL`: the logging level mailroom should use (default "error", use "debug" for more)
- `MAILROOM_LIBRATO_USERNAME`: The username to use for logging of events to Librato
- `MAILROOM_LIBRATO_TOKEN`: The token to use for logging of events to Librato
- `MAILROOM_SENTRY_DSN`: The DSN to use when logging errors to Sentry
- `MAILROOM_LOG_LEVEL`: the logging level mailroom should use (default "error", use "debug" for more)

# Development

Expand Down
2 changes: 1 addition & 1 deletion mailroom.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ func (mr *Mailroom) Start() error {
cancel()

if err != nil {
log.WithError(err).Error(mr.rt.SessionStorage.Name() + " session storage not available")
log.WithError(err).Warn(mr.rt.SessionStorage.Name() + " session storage not available")
} else {
log.Info(mr.rt.SessionStorage.Name() + " session storage ok")
}
Expand Down

0 comments on commit 7cd93ef

Please sign in to comment.