Skip to content

Environment Variables

John edited this page May 21, 2013 · 30 revisions

Minimum Requirements

The environment variables below are required in order to run the movement on Purpose Platform locally. A common practice is to put them in a .env file with 'export' commands, such as export MOVEMENT_ID=movement-name. Source the .env file before starting the server, or just start the server with foreman which loads .env by default.

Purpose Platform

PLATFORM_BASE_URI=http://localhost:5000/api

  • Used to spin up a movement server from a cucumber scenario.

Movement app

PLATFORM_BASE_URI=http://localhost:5000/api

  • api endpoint

MOVEMENT_ID=movement-name
MOVEMENT_NAME=Movement Name

Sending Emails

Purpose Platform

SENDGRID_PASSWORD
SENDGRID_USERNAME

  • Credentials for sendgrid account used for sending platform admin administration emails (admin creation/password change).

[MOVEMENT-SLUG]_BLAST_EMAIL_DOMAIN
[MOVEMENT-SLUG]_BLAST_EMAIL_PASSWORD
[MOVEMENT-SLUG]_BLAST_EMAIL_USERNAME

  • Sendgrid credentials for account used for blasting.
  • [MOVEMENT-SLUG] is the name of the movement in uppercase with all spaces removed.

[MOVEMENT-SLUG]_TARGET_EMAIL_DOMAIN
[MOVEMENT-SLUG]_TARGET_EMAIL_PASSWORD
[MOVEMENT-SLUG]_TARGET_EMAIL_USERNAME

  • Sendgrid credentials for account used for 'target decision-maker' petition emails.
  • [MOVEMENT-SLUG] is the name of the movement in uppercase with all spaces removed.

JOIN_EMAIL_TO=[email protected]

  • email address to send the api request to sendgrid with. It does not matter what you put here, it is only used to make the request to sendgrid. The recipient of the email is the user's email address.

ENABLE_UNFILTERED_BLASTING=(true/false)

  • Toggles whether blasting to users with any email domain is enabled. If unset or set to false, blasts only go to emails with domains specified in the WHITELISTED_EMAIL_TEST_DOMAINS environment variable.

WHITELISTED_EMAIL_TEST_DOMAINS=(example.com,sample.com)

  • Email domains that can be blasted in a non-production environment. Used to ensure that only members of the dev team are included in blasts in the staging environment.

DISABLE_SENDGRID_INTERACTION=(true/false)

  • When true, doesn't send request to Sendgrid to send emails (useful for debugging blasts).

Required Environment Variables for Running on a Remote Server

Purpose Platform

SECRET_TOKEN

  • In environments other than development and test, the session secret is read from the env.

Optional Environment Variables for Running Locally and on a Remote Server

Purpose Platform

If you are using asset_sync, there are several env variables that need to be set up.

AUTHENTICATE_API_CALLS=(true/false)

  • Turns on/off basic authentication of API requests.

ACTIVITY_FEED_REFRESH_FREQ=(number of seconds)

  • Cache duration for activity feed.

DISABLE_MOVEMENT-SLUG_ACTIVITY_FEED=(true/false)

  • Disable activity feed for a specific movement.

DISABLE_QUICK_GO=(true/false)

  • Feature toggle for 'quick-go' search bar.

ENABLE_501C3_DONATIONS=(true/false)

  • Feature toggle for 501C3 donations.

ENABLE_DONATION_TYPES=(true/false)

  • Feature toggle for creating 501C3 and 501C4 donations.

READONLY_DATABASE_URL

  • Database url to use for list cutting and blasting, in order to move the query load off of the main database.

Movement app

If you are using asset_sync, there are several env variables that need to be set up.

ENABLE_ACTIVITY_FEED=(true/false)

  • Feature toggle for activity feed.

MOVEMENT_BASIC_AUTH_PASSWORD

  • Password for basic authentication of API calls.