How to best utilize different environment configs

Have a quick question about configuration by environment. I am curious how other people decide when to put values in config.exs vs environment specific config files (e.g. dev.exs, test.exs, etc.). In particular, I need to provide a JWT signing key via configuration. In all environments other than prod I don’t really care what the value is (could be something silly like “super_secret”), nor do I care if it is hardcoded in version control (as opposed to being provided via an environment variable).

Would you put the dummy value in the config.exs, and then define the override for prod? Or would you leave the value undefined in config.exs and define the dummy values in all of the environment files, even if they are the same dummy value?

I keep it all in config.exs and just override what I need to in environment configs.

3 Likes