ex_conf alternatives and similar packages
Based on the "Configuration" category.
Alternatively, view ex_conf alternatives based on common mentions on social networks and blogs.
-
conform
Easy, powerful, and extendable configuration tooling for releases. -
confex
Useful helper to read and use application configuration from environment variables. -
Skogsrå
Library to manage OS environment variables and application configuration options with ease -
weave
JIT configuration loader that works with Kubernetes and Docker Swarm. -
Flasked
Injecting ENV vars into application configuration at runtime (12factor app for Elixir) -
configparser_ex
A simple Elixir parser for the same kind of files that Python's configparser library handles -
hush_aws_secrets_manager
An AWS Secrets Manager Provider for Hush -
hush_gcp_secret_manager
A Google Secret Manager Provider for Hush -
mahaul
Supercharge your environment variables in Elixir. Parse and validate with compile time access guarantees, defaults, fallbacks and app pre-boot validations. -
figaro_elixir
Environmental variables manager based on Figaro for Elixir projects -
Enux
utility package for loading, validating and documenting your app's configuration variables from env, json, jsonc and toml files at runtime and injecting them into your environment -
CFEnv
Environmental helpers for cloudfoundry, parsing and returning values off VCAP_SERVICES and VCAP_APPLICATON
Elixir and Phoenix Application Security Platform
Do you think we are missing an alternative of ex_conf or a related project?
Popular Comparisons
README
ExConf
Simple Elixir Configuration Management
Deprecated
ExConf has been replaced by Mix Configuration. See the Phoenix README for new configuration instructions.
Features
- Configuration definitions are evaluated at runtime, but merged/defaulted at compile time, allowing runtime dependent lookups. (i.e.
System.get_env
) - Configuration modules can extend other configurations for overrides and defaults
- Evironment based lookup for settings based on provided
env_var
Simple Example
defmodule MyApp.Config do
use ExConf.Config
config :router, ssl: true,
domain: "example.dev",
port: System.get_env("PORT")
config :session, secret: "secret"
end
iex> MyApp.Config.router[:domain]
"example.dev"
defmodule MyApp.OtherConfig do
use MyApp.Config
config :session, secret: "123password"
end
iex> MyApp.OtherConfig.session[:secret]
"123password"
iex> MyApp.OtherConfig.router[:ssl]
true
Environment Based Configuration
First, establish a base configuration module that uses ExConf.Config
and
provide an env_var
option for System.get_env
lookup at runtime of the current
application environment.
defmodule MyApp.Config do
use ExConf.Config, env_var: "MIX_ENV"
config :router, ssl: true
config :twitter, api_token: System.get_env("API_TOKEN")
end
Next, define "submodules" for each environment you need overrides or additional settings for.
The base config module will look for a "submodule" whos name is the value of
:env_var
fetched from System.get_env
in capitalized form.
This allows environment specific lookup at runtime via the env/0
function on the base module.
If the environment specific config module does not exist, it falls back to the base module.
Here's what a Dev enviroment config module would look like for System.get_env("MIX_ENV") == "dev"
:
defmodule MyApp.Config.Dev do
use MyApp.Config
config :router, ssl: false
config :twitter, api_token: "ABC"
end
iex> System.get_env("MIX_ENV")
"dev"
iex> MyApp.Config.env
MyApp.Config.Dev
iex> MyApp.Config.env.router[:ssl]
false