Configuration sources and types
Modern web applications rely on dozens of configuration parameters. The more your application grows and matures, the harder it is to deal with API keys, encryption secrets, and other settings. Instead, you need to think about where to store them securely, how to share them with the team, how to rotate values, and last but not least, how to inject them into the application and access them throughout the code base. The code aspects of managing configuration are what we talk about in this chapter.
Let’s start with an overview of the configuration providers available in Ruby on Rails.
Files, secrets, credentials, and more
Every Rails application comes with a config/
folder. What can you find there? The actual contents depend on the chosen Rails components and third-party libraries, but the following three are likely to present:
- Ruby configuration files (
application.rb
andenvironment/*.rb
) - A database configuration file (
database...