Skip to content

POC: Use ENV variables for configuration to allow for upgradability (and heroku support) #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

davidjrice
Copy link
Owner

So, I'm aware there's another issue open SquareSquash#33 however, I think the point has been lost amongst using jruby etc. None of that is required to get it running on heroku.

The few changes made have allowed me to

Using the following process to create the app.

heroku create
heroku labs:enable user-env-compile

heroku config:add SQUASH_SECRET_TOKEN="xxx"
heroku config:add SQUASH_AUTHENTICATION_PASSWORD_SALT="xxx"
git push heroku master

I'm not happy with where the hacks are to use ENV variables at present. There are more configurations set during setup.rb to be extracted and perhaps modifying the setup itself. However, this approach:

  • encourages passwords / secret tokens etc. not to be included in the source repository
  • allows easy upgradability (as no files are modified this would be as simple as a git pull && git push heroku)
  • allows configuration changes without requiring deployments

I would use this in conjunction with a .env file (added to .gitignore) and instantiating those ENV variables before running the server with

export $(cat .env)

or using the dot_env gem.

I would continue further here but the heroku File System concerns I've outlaid in SquareSquash#35 have pretty much stopped my progress. I'm not sure running on heroku will be possible without drastic changes to git repository integration.

Therefore, this is more a proof of concept but I thought I would document here as

a) using ENV variables would still be preferable, regardless of Heroku
b) if this information helps or inspires anyone else to get this running on Heroku 😃

@davidjrice davidjrice closed this Feb 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant