Description
We have a Google Maps API key that's used for juggercouncil.org - but because that key is publicly available in the JavaScript source code, we have to restrict it to just that domain. That means we can't currently test the map in local development!
This task aims to fix that by making this configurable.
Acceptance Criteria
[ ] in Travis CI, define a new environment variable GOOGLE_API_KEY, and set its value to our current Google API key;
[ ] generate a new Google API key for local development, and leave it unrestricted;
[ ] make a new file src/_data/env.js (or similar) that loads GOOGLE_API_KEY from environment variables;
[ ] ensure that this receives a default value (e.g. a blank value) when the environment variable is not present;
[ ] in base.njk, add a new meta tag with this API key;
[ ] in map.js, load the API key from this meta tag;
[ ] update developer documentation (e.g. in README.md) to note:
[ ] the process for getting our local development Google API key;
[ ] how to set this key in the GOOGLE_API_KEY environment variable when running the site locally;
[ ] that this key should never be committed into the repo (and what to do if it is committed!)
Description We have a Google Maps API key that's used for juggercouncil.org - but because that key is publicly available in the JavaScript source code, we have to restrict it to just that domain. That means we can't currently test the map in local development!
This task aims to fix that by making this configurable.
Acceptance Criteria
GOOGLE_API_KEY
, and set its value to our current Google API key;src/_data/env.js
(or similar) that loadsGOOGLE_API_KEY
from environment variables;base.njk
, add a newmeta
tag with this API key;map.js
, load the API key from thismeta
tag;README.md
) to note:GOOGLE_API_KEY
environment variable when running the site locally;