Self-hosting
Environment
Every environment variable an instance reads, grouped by what it configures.
Secrets
You'll need to generate a secret key (e.g. openssl rand -base65 45)
Environment
Basics
NOTE: NEVER run with DEBUG=True on prod. The settings explicitly forbid
this configuration.
DEBUG=False
ENV=prod
SERVICE_DOMAIN=app.rr.example.com
HTTPS=False
SECRET_KEY=$(openssl rand -base64 45)
PORT=51473
Google Maps Geocoding
GEOCODING_API_KEY=AIxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Postgres and Redis
DATABASE_URL=postgres://username:[email protected]:5432/db_name
REDIS_URL=redis://redis.host:6379/1
If running in docker:
DATABASE_URL=postgres://postgres:postgres@postgres:5432/postgres
REDIS_URL=redis://redis:6379/1
auth 0
AUTH0_DOMAIN=xxxxxxxxxx.auth0.com
AUTH0_CLIENT_ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
AUTH0_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
S3 Bucket (or compatible storage)
AWS_ACCESS_KEY_ID=Axxxxxxxxxxxxxxxxxxx
AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
AWS_S3_BUCKET_NAME=xxxxx-xxxxxx-xxxxxxxx
If you're using comaptible storage (e.g. wasabi, minio):
AWS_S3_ENDPOINT_URL="https://storage.example.com"
email configurations
[email protected]
EMAIL_HOST=smtp.mail.example.com
EMAIL_HOST_USER=username
EMAIL_HOST_PASSWORD=SG.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
EMAIL_PORT=587
EMAIL_USE_TLS=True
Twilio
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWILIO_AUTH_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWILIO_NOTIFY_SERVICE_SID=ISxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx TWILIO_DEBUG=True
Webhook signature validation defaults to log outside development: Twilio's
X-Twilio-Signature is verified and counted but a failure is still served. Once
the /d/admin/twilio/ checks are green, turn rejection on:
TWILIO_SIGNATURE_VALIDATION=enforce
To enable debug logs in the Twilio Python SDK:
TWILIO_DEBUG="True"
Pusher
PUSHER_APP_ID=xxxxxx
PUSHER_KEY=xxxxxxxxxxxxxxxxxxxx
PUSHER_SECRET=xxxxxxxxxxxxxxxxxxxx
PUSHER_CLUSTER=us2
Feature Flags
ALERTS_ENABLED=True
ALERTS_LABEL="Attorney Alerts"
ALERTS_DEFAULT_GROUP=Attorneys
INBOUND_SMS_ALERTS_ENABLED=True
TEAM_ALERTS_ENABLED=True
TEAM_ALERTS_LABEL="Team Alerts"
TEAM_ALERTS_LABEL names the Team Alerts feature in the subject line of the
emails recipients receive; it defaults to Team Alerts. TEAM_ALERTS_ENABLED
defaults to False and controls only the banners offering to migrate legacy
alerts — the Team Alerts screens themselves are always reachable. See
Team Alerts.
Static files and TLS termination
The standard deployment puts nginx in front of Django, and it serves /static.
These are only for deployments where that is not true — where TLS terminates at
a load balancer and nothing fronts /static (DigitalOcean App Platform, for
example). All three default to preserving the nginx-fronted behavior, so leave
them unset unless you know you need them.
# serve the collectstatic bundle from Django itself, via WhiteNoise
USE_WHITENOISE=True
# the LB already redirects http->https at the edge; don't redirect twice, or
# plain-HTTP health probes break
SECURE_SSL_REDIRECT=False
# extra origins allowed to POST (scheme required). The service's own domain is
# always trusted; this only adds to it.
CSRF_TRUSTED_ORIGINS=https://app.rr.example.com
USE_WHITENOISE needs an image with whitenoise in the main dependency group —
Dockerfile.code installs with --no-dev.
Optional
You can set up sentry to catch errors, if you do, you can add the following:
SENTRY_DSN=https://[email protected]/xxxxxxx
Dev Only
If you are working on RR see the dev docs in the repo.
NGROK_SUBDOMAIN=xxxxxxxx
Internal Only
These are present in the code but you won't need them
SENTRY_AUTH_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CODECOV_TOKEN=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx