mozilla/openbadges — pull request #409 by davelester (2012-10-11 09:20:13+00:00)
Title: 12factor compliance and Heroku-ready

This pull request adds a Procfile for running on Heroku, updates configuration and package.json to use habitat to help manage and access env vars, and removes separate config files for each environment in favor of managing application configuration with env vars in compliance with the 12factor app guidelines.

You can create a free MySQL database on Heroku using the ClearDB addon: ```heroku addons:add cleardb:ignite``` Once you've created the database, its info can be retrieved by calling the Heroku config ```heroku config:get CLEARDB_DATABASE_URL```

After creating a new Heroku app using ```heroku create``` and pushing your code, several env vars will need to be set. The following are less likely to change from instance to instance, but may need to be tweaked on a particular server:

```
heroku config:add NODE_ENV=production
heroku config:add OPENBADGER_PROTOCOL=http
heroku config:add OPENBADGES_IDENTITY_PATH=/verify
heroku config:add OPENBADGES_IDENTITY_PROTOCOL=https
heroku config:add OPENBADGES_IDENTITY_SERVER=verifier.login.persona.org
heroku config:add OPENBADGES_DB_DRIVER=mysql
```

While the following configurations will need to be set based upon a particular install:
```
heroku config:add OPENBADGES_HOSTNAME=http://yoururl.com/
heroku config:add OPENBADGES_ADMINS=[example@example.com]
heroku config:add OPENBADGES_DB_HOST=
heroku config:add OPENBADGES_DB_NAME=
heroku config:add OPENBADGES_DB_USER=
heroku config:add OPENBADGES_DB_PASS=
```