I'm having problems with my company proxy in DevContainers. I'm creating some internal documentation on best practices, mask credentials, etc.
We currently use a Username:Password environment variable in base64 to set the things, but the proxy needs the decoded one to work properly.
Doing like this the the variables are set, but with the base64 encode. I couldn't figure out a way to convert it on the fly.
"remoteEnv": {
"MY_USER_HASH": "${localEnv:MY_USER_HASH}",
"http_proxy": "http://${localEnv:MY_USER_HASH}@companyproxy:3128",
"https_proxy": "http://${localEnv:MY_USER_HASH}@companyproxy:3128"
},
I tried with a .sh script called on the postCreateCommand. The variables are created correctly, but they don't persist. I tried save them in the /etc/environment file, but without success either.
"postCreateCommand": "./.devcontainer/postCreateCommand.sh"
#/bin/sh
export NEXUS_CREDENTIALS=$(echo $MY_USER_HASH | openssl enc -d -base64)
export http_proxy=http://$NEXUS_CREDENTIALS@companyproxy:3128
Anyone has some tip on how I can do this?