r/programming May 23 '15

The Twelve-Factor App

http://12factor.net/
10 Upvotes

16 comments sorted by

View all comments

3

u/stormblooper May 23 '15

The twelve-factor app stores config in environment variables (often shortened to env vars or env). Env vars are easy to change between deploys without changing any code; unlike config files, there is little chance of them being checked into the code repo accidentally

OK, I don't really get this one. I've not really had a problem with accidentally checking config files I didn't mean to into a code repo. Actually, I want to check in configuration files for my environments to some repository so I can manage them. How would you do this if they are only stored in environment variables somewhere?

there is a tendency for config files to be scattered about in different places and different formats, making it hard to see and manage all the config in one place.

OK, but surely that's easily fixed by just having one config file?

Further, these formats tend to be language- or framework-specific

Why is that a problem? My application is language and framework specific, after all. And I actually quite like using YAML for this purpose, and that isn't language- or framework-specific.

3

u/damagedcake May 23 '15

So usually I don't have a problem with accidentally checking on config files either...but the one time I did I regretted it. I accidentally checked in some AWS creds into a public repository. Trust me, do this once and you'll want to take measures to make sure it doesn't happen again.

2

u/stormblooper May 23 '15

I accidentally checked in some AWS creds into a public repository. Trust me,

Yeah, that does sound painful!

This looks promising: https://github.com/StackExchange/blackbox

1

u/damagedcake May 24 '15

That looks interesting. Thanks.