mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-16 21:56:40 -05:00
caddyfile: expand environment variables within caddy files (#3082)
Small expansion to the work done in https://github.com/caddyserver/caddy/pull/2963 which simply calls `os.ExpandEnv` so env vars like `{$URL}` where `$URL=$SCHEME://$HOST:$PORT` (contrived) get the expanded $SCHEME, $HOST, and $PORT variables included
This commit is contained in:
parent
2de0acc11f
commit
063ed1e7f9
1 changed files with 1 additions and 1 deletions
|
@ -64,7 +64,7 @@ func replaceEnvVars(input []byte) ([]byte, error) {
|
|||
}
|
||||
|
||||
// get the value of the environment variable
|
||||
envVarValue := []byte(os.Getenv(string(envVarName)))
|
||||
envVarValue := []byte(os.ExpandEnv(os.Getenv(string(envVarName))))
|
||||
|
||||
// splice in the value
|
||||
input = append(input[:begin],
|
||||
|
|
Loading…
Reference in a new issue