2

I recently ran into a snag - I have confidential data stored in a .config file in my project directory. My gitignore has .config in it to keep this confidential data private. However, when I try to push my project to Heroku, the .config file is ignored - my app can't run without getting the key data from it! Is there an efficient way to handle this problem? I've looked into heroku:config and tinkered with it but couldn't get anything working. As of now, I've been manually updating .gitignore in between pushes, but this is very cumbersome. Unfortunately, heroku run bash won't let me manually create a .config file with a text editor, though I suppose some bash commands could do the trick. All help is appreciated.

Kevin Busch
  • 712
  • 1
  • 6
  • 8
  • The best way to do this would be with [Heroku’s config vars](https://devcenter.heroku.com/articles/config-vars). What type of data is in your file, and how and where do you read it in your app? – matt Dec 17 '13 at 02:44
  • simple csv - extremely primitive data. I tried the config vars for a bit, but it didn't quite seem to fit. I basically use python to extract some important csv data in a particular script - I couldn't figure out how to incorporate the config vars, but I am a Heroku noob. – Kevin Busch Dec 17 '13 at 02:46

1 Answers1

1

Regarding a pure-git solution, you could:

  • version the config file (so that it will be pushed)
  • used a content filter driver in order to automatically change its content:
    • on checkout (smudge script), where you replace the heroku value by the private value
    • on commit (clean script), where you replace the private value by the heroku pulic value

content filter

But maybe an Heroky config var based solution would be more efficient (I don't know Heroku well enough)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250