Locale/localeapp

API key is written to initializer

mcfiredrill opened this issue · 2 comments

When running the install command, the localeapp.rb initilaizer is created and my API key is also written to it.

Its generally not a good idea to save secrets like your API key in your repository.
It would be nice if there should at least be a recommendation in the README for people to put the API key into an environment variable or something similar, use dotenv, etc.

Hi @mcfiredrill,

Thanks for mentioning this, that's absolutely true: API keys should not be checked-in to the git repository.

I see 2 useful things that can be done here:

  1. if a .env file is detected (used by dotenv, foreman, forego, etc...), add the API key as an environment variable to .env and use this environment variable in the initializer
  2. otherwise, keep adding the API key to the initializer but add a warning output message (and maybe even a comment in the initializer)

We'll add this to our todo-list. Pull Requests are always welcome ❤️

Fixed by #228
Thank you for your feedback !