Skip to content

Commit

Permalink
Add flightaware environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
YourFin committed Jan 9, 2020
1 parent b11118a commit dde3893
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
SEND_REAL_MESSAGES="false"
USE_REAL_FLIGHTAWARE_API="false"
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
SEND_REAL_MESSAGES="true"
USE_REAL_FLIGHTAWARE_API="true"
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
SEND_REAL_MESSAGES="false"
USE_REAL_FLIGHTAWARE_API="false"
10 changes: 10 additions & 0 deletions config/initializers/dotenv.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# SMS api keys

Dotenv.require_keys('SEND_REAL_MESSAGES')
ENV['SEND_REAL_MESSAGES'] = ENV['SEND_REAL_MESSAGES'].downcase

if ENV['SEND_REAL_MESSAGES'] == "true"
Dotenv.require_keys('AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY', 'AWS_REGION','MAILGUN_API_KEY', 'MAILGUN_DOMAIN')
end

# Flightaware API
Dotenv.require_keys('USE_REAL_FLIGHTAWARE_API')
ENV['USE_REAL_FLIGHTAWARE_API'] = ENV['USE_REAL_FLIGHTAWARE_API'].downcase

if ENV['USE_REAL_FLIGHTAWARE_API'] == "true"
Dotenv.require_keys('FLIGHTAWARE_API_USERNAME', 'FLIGHTAWARE_API_KEY')
end

0 comments on commit dde3893

Please sign in to comment.