Environment Variables - PurposeOpen/Platform GitHub Wiki

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

DEVISE_MAIL_SENDER_ADDRESS

  • The 'from address' used by devise mailers.

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

NO_REPLY_ADDRESS=[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. This address is also used for sending emails to users that have just joined the movement.

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.

READONLY_DATABASE_URL

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

S3_BUCKET_NAME=(name of S3 bucket)

  • Specifies S3 bucket to use for images and assets uploaded by admins.

CDN_HOST=(e.g. 'cdnxyz.cloudfront.net')

  • Specifies CDN host to use for links to images and assets uploaded by admins. If unspecified, links will be to S3 directly.

Donations

ENABLE_501C3_DONATIONS=(true/false)

  • Feature toggle for 501C3 donations.

ENABLE_DONATION_TYPES=(true/false)

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

MOVEMENT-SLUG_CONTACT_EMAIL=(email address)

  • Email address users should contact for recurring donations support. Appears in email to donor.

MOVEMENT-SLUG_PAYPALERROR_EMAIL_RECIPIENTS=(comma-separated list of email addresses)

  • Email addresses that get sent notification of transaction errors.

MOVEMENT-SLUG_501C3_RECURLY_KEY=(key)

  • Key for recurly account used for 501C3 donations.

MOVEMENT-SLUG_501C4_RECURLY_KEY=(key)

  • Key for recurly account used for 501C4 donations.

Mapping

GOOGLE_API_KEY

  • API key used to sign Google Maps javascript url (KEYED_GOOGLE_MAPS_JS_URL). This is not required, and if not set, the Platform will use a url that doesn't require an API key (GOOGLE_MAPS_JS_URL).

GOOGLE_MAPS_JS_URL

KEYED_GOOGLE_MAPS_JS_URL

Movement app

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

ENABLE_ACTIVITY_FEED=(true/false)

  • Feature toggle for activity feed.

MOVEMENT_BASIC_AUTH_PASSWORD

  • Password for basic authentication of API calls.

Donations

PAYPAL_501C3_API_LOGIN
PAYPAL_501C3_API_PASSWORD
PAYPAL_501C3_API_SIGNATURE
PAYPAL_501C4_API_LOGIN
PAYPAL_501C4_API_PASSWORD
PAYPAL_501C4_API_SIGNATURE

501C3 and 501C4 are two types of non-profit organizations in the US that have different tax requirements. When creating a donation page in the Purpose Platform, you can select whether the donation goes toward 501C3 or 501C4 activity. The environment variables above allow you to specify an account that will receive each type of donation.

Create a sandbox account at developer.paypal.com to test donations.