Fork me on GitHub
#component
<
2018-10-01
>
josh.freckleton20:10:45

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?

seancorfield21:10:31

@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).

seancorfield21:10:11

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).

josh.freckleton21:10:47

That sounds awesome, thanks, I'll create something like that 🙂

josh.freckleton21:10:38

I'm thinking to use profiles.clj, is it pretty standard to use something like environ to get values out from it?

seancorfield21:10:10

There are so many options out there for configuration libraries... pick whatever makes you happiest.

seancorfield21:10:01

This is quite nice: https://github.com/sonian/carica (ours is similar to that)

seancorfield21:10:28

Here's an article discussing some options http://realworldclojure.com/application-configuration/ (including environ and carica).