[Proposal] Make application configuration easier

Jon Buckley jon at mozillafoundation.org
Mon Jun 2 14:38:09 PDT 2014

Here’s something that really gets my goat: app configuration

1) When you install an application initially, you need to copy the config file from the defaults to one that you can use with `cp env.dist .env`.
2) When you pull down updates from git, and something doesn’t work, you need to copy the config file from defaults again which blows away your changes, or you need to pick through the change log and apply the changes manually.
3) Configuration only via process env (e.g. heroku) is tedious because there are so many env variables.
4) When you make a change to the staging or production configs, there is absolutely no visibility into who changed what, when, or why. This has broken services for us more than once.
5) If you’re doing a deploy that requires a config change at the same time as a code change, you’ll need JP or I to co-ordinate that.

Therefore a better application configuration solution should:
1) Work out of the box
2) Work when pulling down updates
3) Work with process.env
4) Be version controlled, preferably using git
5) Doesn’t require devops to co-ordinate a simultaneous code + config deploy

My preferred solution is the following:
- Modify habitat to support loading multiple environment files in a specific order: https://github.com/brianloveswords/habitat/pull/11
- Add multiple configuration files to each applications repository - staging.env, production.env, defaults.env
- Code application to support loading from these new locations in order:
  - process environment
  - .env
  - NODE_ENV.env (so staging.env or production.env)
  - defaults.env
- Document this workflow in each app as “MAINTENANCE.md” or something similar.

The new workflow when landing a ticket that changes the application configuration somehow would be to also make changes to staging.env and production.env in the same patch. For secrets that cannot be made public we will continue our current process of putting secrets into a config file on S3.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.mozilla.org/pipermail/webmaker-dev/attachments/20140602/40a81cf3/attachment.sig>

More information about the Webmaker-dev mailing list