I would like to be able to specify a default/fallback value for when
an environment variable is not defined while loading the
configuration, like the ${SOME_VAR-default} form in bash/shells.
In docker (mainly docker-compose) where quite some settings are passed
to the container through env vars, this would be really useful for an
httpd.conf "template" with default values for undefined vars.
I first thought of "<IfEnv [!]blah>" or alike, but it quickly becomes
hard to read/follow, while e.g:
LogLevel "${LOG_LEVEL-info}"
would be lovely :)
So would a patch like the attached be acceptable?
It uses '-' as separator but any other char would do (if the minus
sign is likely to break configuration where it shouldn't be
interpreted), though that would look less like a shell expansion..
Regards,
Yann.
an environment variable is not defined while loading the
configuration, like the ${SOME_VAR-default} form in bash/shells.
In docker (mainly docker-compose) where quite some settings are passed
to the container through env vars, this would be really useful for an
httpd.conf "template" with default values for undefined vars.
I first thought of "<IfEnv [!]blah>" or alike, but it quickly becomes
hard to read/follow, while e.g:
LogLevel "${LOG_LEVEL-info}"
would be lovely :)
So would a patch like the attached be acceptable?
It uses '-' as separator but any other char would do (if the minus
sign is likely to break configuration where it shouldn't be
interpreted), though that would look less like a shell expansion..
Regards,
Yann.