redpanthers / starter

New rails project startup template to speed up project start time.
3 stars 3 forks source link

figaro for app configuration #10

Open tony-rp opened 6 years ago

tony-rp commented 6 years ago

https://github.com/laserlemon/figaro

coderhs commented 6 years ago

Figaro added 747281d

redtachyons commented 6 years ago

No updates in Figaro gem for last one year. I think it is better to go with dotenv. An advantage of dotenv is we can commit development/test credentials in the repo and gitignore production credentials

coderhs commented 6 years ago

@redtachyons can you elaborate on the .gitignore production credentials part, with an example? I am not familiar with that.

I will reopen this issue.

coderhs commented 6 years ago

When I install foreman it adds dotenv as well so once you give the example here we can move to dotenv.

redtachyons commented 6 years ago

Quoted from https://github.com/bkeepers/dotenv

Can I use dotenv in production?

dotenv was originally created to load configuration variables into ENV in development. There are typically better ways to manage configuration in production environments - such as /etc/environment managed by Puppet or Chef, heroku config, etc.

However, some find dotenv to be a convenient way to configure Rails applications in staging and production environments, and you can do that by defining environment-specific files like .env.production or .env.test.

If you use this gem to handle env vars for multiple Rails environments (development, test, production, etc.), please note that env vars that are general to all environments should be stored in .env. Then, environment specific env vars should be stored in .env.<that environment's name>.

redtachyons commented 6 years ago

Ie we can keep .env.development safely in repo and gitignore .env.production

coderhs commented 6 years ago

@redtachyons Thanks for that information, definitely make sense to change to dotenv. My reason for choosing Figaro was to split it up based on environments. But seeing writing something as .env.test and .env.development will isolate the credentials based on the environment then I would definitely prefer that as multiple files are better than multiple sections in a single file.