diff options
author | Zaq? Wiedmann <zaquestion@gmail.com> | 2020-02-26 15:06:34 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-26 16:06:34 -0700 |
commit | 063ed1e7f91b578c705147cb411d076865195174 (patch) | |
tree | 743a2a04eb7bd40360522783a4da717a3b92cfb6 | |
parent | 2de0acc11fcaaed9e4b3561d9a2d1457f015e9e3 (diff) |
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
-rwxr-xr-x | caddyconfig/caddyfile/parse.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/caddyconfig/caddyfile/parse.go b/caddyconfig/caddyfile/parse.go index f376033..cdcac26 100755 --- a/caddyconfig/caddyfile/parse.go +++ b/caddyconfig/caddyfile/parse.go @@ -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], |