From NSHipster:
We’ve touched on
.env
files in past articles about xcconfig files and secret management on iOS. But this week on NSHipster we’re taking a deeper look, exploring how the lesser-known 1Password CLI (op
) can solve some problems many of us face managing secrets day-to-day.
In case you’re not familiar with Twelve-Factor Apps:
Around 2011, Adam Wiggins published “The Twelve-Factor App”, a methodology for building modern web applications that has since become canon in our industry.
The third of those twelve factors, “Config”, prescribes storing configuration in environment variables:
“Apps sometimes store config as constants in the code. This is a violation of twelve-factor, which requires strict separation of config from code. Config varies substantially across deploys, code does not.”
This core insight — that configuration should be separate from code — led to the widespread adoption of
.env
files.
Leave a Reply