Skip to content

Environment Variable Overrides

Environment Variable Overrides

ConfigurationManager automatically reads ADBLOCK_CONFIG_* environment variables and merges them as a layer above any file or object source. This allows CI/CD pipelines and Docker deployments to override scalar fields without modifying config files.

Note: Only scalar fields are overridable via environment variables. Array fields (sources, transformations, exclusions, …) must be set via config files or the --override flag.


Variable reference

VariableMaps to fieldExample value
ADBLOCK_CONFIG_NAMEname"Nightly Block List"
ADBLOCK_CONFIG_DESCRIPTIONdescription"Auto-built from CI"
ADBLOCK_CONFIG_HOMEPAGEhomepage"https://example.com/lists"
ADBLOCK_CONFIG_LICENSElicense"MIT"
ADBLOCK_CONFIG_VERSIONversion"1.2.3"

Precedence

Env overrides are applied after file/object sources but before any explicit --override / OverrideConfigurationSource:

file / object → ADBLOCK_CONFIG_* → --override → Zod validation

Opting out

CLI

Terminal window
bloqr-compiler --config ./blocklist.json --no-env-overrides

Programmatic

const mgr = ConfigurationManager.fromFile('./blocklist.json', undefined, {
applyEnvOverrides: false,
});

Docker / CI example

ENV ADBLOCK_CONFIG_NAME="My Custom List"
ENV ADBLOCK_CONFIG_VERSION="2.0.0"
# GitHub Actions
env:
ADBLOCK_CONFIG_NAME: "Nightly CI Build"
ADBLOCK_CONFIG_VERSION: ${{ github.run_number }}