My .env is in the gitignore, but now I’m on a different computer and I don’t have my keys

Hello everyone!

This may be a stupid question, but I have a project on github that I'm trying to update, I put all of my api keys inside the .env file for security purposes, but I forgot that now that I'm not on a different laptop, I can't run my application because all of the keys are in a different computer. What is the best practice for this? Do I just make a new .env file on every computer?

Thanks for any help!

3 thoughts on “My .env is in the gitignore, but now I’m on a different computer and I don’t have my keys”

  1. Or if using the new credential engine, you’d carry a copy of your master.key on a usb stick or something (not git it at all) This means you commit your credentials.yml.enc and have different secrets seperated in that one encrypted file. Your config/environment.rb and config/environments/* would also be git committed as usual.

    Reply
  2. I keep a `dot-files` repo on github for this very reason. If you move computers you can just pull down those files (or copy/paste) and you’re back in action

    Edit – For credentials, those are all in environment variables, and stored in Bitwarden 😛

    Reply

Leave a Comment