Skip to content

Environment Variables

ZacharyMcCann edited this page Jul 28, 2022 · 3 revisions

Environment variables are accessed via the ENV hash that is built-in to Ruby. The necessary environment variables for deployment are stored in the Gemfile located both on production and dev, but are not tracked on GitHub for security purposes. The Gemfiles on both servers are the same Gemfile located in the root directory of this repo, except they also include the environment variables that we want to keep secret. One example of environment variables we want kept secret are for emailing from the [email protected] account for account confirmations and password resets. These are accessed in the mailer configuration file using the GMAIL_USERNAME and GMAIL_PASSWORD environment variables. Values are assigned to those variables in the Gemfiles on the live servers, but the values are not assigned in the Gemfile tracked on GitHub so as to keep our account secure.

2FA was enabled on the [email protected] account due to Google not allowing less secure apps anymore. We generated an app-specific password (talk to a senior developer for it), and use that to login to the account for the mailer.