Languages

Envlet for Elixir

Envlet.inject! sets the process environment from one token. Nothing outside OTP.

Inject
Envlet.inject!()

stripe_key = System.fetch_env!("STRIPE_KEY")
Load
values = Envlet.load!()

database_url = values["DATABASE_URL"]
Get
stripe_key = Envlet.get!("STRIPE_KEY")
Install
def deps do
  [
    {:envlet, "~> 0.1.0"}
  ]
end

Set up

  1. 01

    Install

    Add {:envlet, "~> 0.1.0"} to deps in mix.exs.

  2. 02

    Set one secret

    ENVLET_TOKEN in the release environment.

  3. 03

    Inject at boot

    Call Envlet.inject! in your release config provider or at the top of the application start.

Questions

Will my app start if Envlet is down?
No, and that is the point. The SDK retries for a few seconds, then fails so you notice. It never starts your app with half an environment.
What does the host need?
One variable, ENVLET_TOKEN. Everything else arrives at boot.
Can I still set some values on the Elixir host?
Yes. A value the host already set wins. Pass override if you want Envlet to win instead.

Stop pasting .env files.

One command. The right values for whoever runs it.