This PR adds a new config placeholder syntax, {env_split:VAR_NAME}, alongside the existing {env:VAR_NAME}
{env:VAR_NAME}: Substitutes the value of the environment variable VAR_NAME as is, preserving its format, including any commas.
{env_split:VAR_NAME}: Substitutes the value of the environment variable VAR_NAME, converting any commas in the value into spaces. This is particularly useful for configurations that expect space-separated lists but are populated from environment variables that naturally format such lists as comma-separated strings.
The use case of $(local_domains) = $(primary_domain) example.com multiple domains in Docker can now use this feature by setting an environment variable with a value like domain1.com,domain2.com. Using {env_split:OTHER_DOMAINS} will automatically convert this to domain1.com domain2.com, fitting into configurations that require space-separated values.
I have also added test cases for splitting, not split and mixing both.
This PR adds a new config placeholder syntax,
{env_split:VAR_NAME}
, alongside the existing{env:VAR_NAME}
{env:VAR_NAME}
: Substitutes the value of the environment variableVAR_NAME
as is, preserving its format, including any commas.{env_split:VAR_NAME}
: Substitutes the value of the environment variableVAR_NAME
, converting any commas in the value into spaces. This is particularly useful for configurations that expect space-separated lists but are populated from environment variables that naturally format such lists as comma-separated strings.The use case of
$(local_domains) = $(primary_domain) example.com
multiple domains in Docker can now use this feature by setting an environment variable with a value likedomain1.com,domain2.com
. Using{env_split:OTHER_DOMAINS}
will automatically convert this todomain1.com domain2.com
, fitting into configurations that require space-separated values.I have also added test cases for splitting, not split and mixing both.