yogthos/yuggoth — pull request #8 by alexdforeman (2014-01-15 13:40:55+00:00)
Title: Heroku addition to preserve data that is normally stored in blog.properties.

Have had to change the init part of config in my fork to ensure yuggoth works on heroku correctly.

The problem is that on initialize yuggoth creates a blog.properties file which is read to store the configuration. This is fine on servers that you control the file system. However everything on heroku needs to be available from the git repo and file system is effectly read only. You can store files on it however they get wiped. Any data must be stored in the database.

This causes a problem as the entire point of this blog.properties file is to store where the database is, and we don't want to store confidential information and secrets in github as its a major security issue.

Googling around and asking Heroku what the the best way around this is I have decided that config variables are the way forward.

So I have modified the 'init []' method in config.clj and used the https://github.com/weavejester/environ project which I have added as a dependency to read them in if they are set, and if not to fall back onto the old blog.properties mechanism.

This does require that you set all the varibles on heroku using:
heroku config:set YUG_HOST=
and all the rest of them as well.

However it removes any security issues and also makes sure it works nicely with heroku.

There might be a nicer way to do this but none come to mind and this was the quickest and easist way to solve my problem with my limited clojure exposure.

Im hoping you can mainline this and let me know if there is a nicer way than this.

Many thanks