mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-04 03:27:23 -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
					
				@ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user