Skip to content

Environment variables

James Jefferies edited this page Jun 11, 2020 · 1 revision

Environment Variables

For development, you might need some environment variable setting locally. The main ones are outlined here:

Create environment variables

The .env file in the energy-sparks directory contains environment variables used to config the application. It is never added to source control. To run the basic application, no variables are required. For some functionality though, you will want to set the relevant variables

AWS environment variables

To access the AWS S3 buckets, either for downloading data or for using ActiveStorage, the following variables need to be set

### Required for importing data
AWS_S3_AMR_DATA_FEEDS_BUCKET

### AWS SDK picks these up for authentication
### As does storage.yml
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION

### Default bucket
### Referenced in storage.yml
AWS_S3_ACTIVE_STORAGE_BUCKET

B&NES FTP variables

The application gets the Bath & North East Somerset data via SFTP and uses the following variables

BANES_SFTP_USER
BANES_SFTP_SERVER
BANES_SFTP_PASSWORD

Twilo variables

The application can post SMS messages, if you were working on this part of the application, then you would need to set

### Essential to do the twilio SMS sending
TWILIO_ACCOUNT_SID
TWILIO_AUTH_TOKEN
#TWILIO_PHONE_NUMBER

Analytics variables

The analytics code does some variable lookups, namely for authentication

Any Low Carbon hub data imports require these being set too


### Essential to do anything with analytics
ENERGYSPARKSDARKSKYHISTORICAPIKEY
ENERGYSPARKSDARKSKYFORECASTAPIKEY
ENERGYSPARKSMETOFFICEDATAPOINTAPIKEY

### Low carbon hub - on analytics - required to get data
ENERGYSPARKSRBEEPASSWORD
ENERGYSPARKSRBEEUSERNAME

### Debug for analytics
AWESOMEPRINT=on

Mailchimp

The application uses a Mailchimp form for registering users. You will need to set this if you want to do any local development on that form.

### Required for Mailchimp form only
MAILCHIMP_ENDPOINT
Clone this wiki locally