substitute_vars
substitute_vars
Recursively substitute environment variables in a configuration value. Supports
${VAR} and ${VAR|default} syntax.
Parameters
value
The value to process. Can be a string, dict, list, or any other type.
Strings are scanned for ${VAR|default} patterns. Dicts and lists are
processed recursively.
max_depth
Maximum recursion depth to prevent infinite substitution loops.
Returns
Any — The value with all ${VAR|default} patterns replaced by the corresponding
environment variable values. Strings that resolve to "true"/"false" are converted
to booleans. Numeric strings are converted to int or float.