What is a simple way to pass env config into a system? I'm thinking, EDN that doesn't have to be commited to my repo (sensitive) coupled with ENV vars can overwrite the EDN when the app is launched?
@josh.freckleton We have a component that represents the configuration. Its start
lifecycle loads the config from EDN/environment variables, and we also implement a few arities of IFn
so you can "call" it to extract (nested) config values (so we can "ignore" the config
record key where the configuration is stored).
There are plenty of options for reading configuration in (from EDN/environment variables/etc). We wrote our own because we wanted some fairly specific behavior with an EDN file of defaults inside the app that would be overridden by an external EDN file (so we only need to list what is non-default on each system -- but we have the option to control lots of configuration).
That sounds awesome, thanks, I'll create something like that 🙂
I'm thinking to use profiles.clj
, is it pretty standard to use something like environ
to get values out from it?
There are so many options out there for configuration libraries... pick whatever makes you happiest.
This is quite nice: https://github.com/sonian/carica (ours is similar to that)
Here's an article discussing some options http://realworldclojure.com/application-configuration/ (including environ
and carica
).