Configuration
Conduit accepts CLI flags, environment variables and a configuration file to configure its behavior. Each CLI flag has a corresponding environment variable and a corresponding field in the configuration file. Conduit uses the value for each configuration option based on the following priorities:
-
CLI flags (highest priority) - if a CLI flag is provided it will always be respected, regardless of the environment variable or configuration file. To see a full list of available flags run
conduit --help
. -
Environment variables (lower priority) - an environment variable is only used if no CLI flag is provided for the same option. Environment variables have the prefix
CONDUIT
and contain underscores instead of dots and hyphens (e.g. the flag-db.postgres.connection-string
corresponds toCONDUIT_DB_POSTGRES_CONNECTION_STRING
). -
Configuration file (lowest priority) - Conduit by default loads the file
conduit.yaml
placed in the same folder as Conduit. The path to the file can be customized using the CLI flag-config
. It is not required to provide a configuration file and any value in the configuration file can be overridden by an environment variable or a flag. The file content should be a YAML document where keys can be hierarchically split on.
. For example:db:
type: postgres # corresponds to flag -db.type and env variable CONDUIT_DB_TYPE
postgres:
connection-string: postgres://localhost:5432/conduitdb # -db.postgres.connection-string or CONDUIT_DB_POSTGRES_CONNECTION_STRING