Skip to content

Commit bd8fbf9

Browse files
authored
fix(wal2json): Respect http_proxy/https_proxy/no_proxy when installing (#1026)
`http_proxy`, `https_proxy` and `no_proxy` environment variables should be forwarded to the curl container.
1 parent d24a7b3 commit bd8fbf9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

install/install-wal2json.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ FILE_TO_USE="../postgres/wal2json/wal2json.so"
44
ARCH=$(uname -m)
55
FILE_NAME="wal2json-Linux-$ARCH-glibc.so"
66

7-
DOCKER_CURL="docker run --rm curlimages/curl"
7+
docker_curl() {
8+
# The environment variables can be specified in lower case or upper case.
9+
# The lower case version has precedence. http_proxy is an exception as it is only available in lower case.
10+
docker run --rm -e http_proxy -e https_proxy -e HTTPS_PROXY -e no_proxy -e NO_PROXY curlimages/curl "$@"
11+
}
812

913
if [[ $WAL2JSON_VERSION == "latest" ]]; then
1014
VERSION=$(
11-
$DOCKER_CURL https://api.github.com/repos/getsentry/wal2json/releases/latest |
15+
docker_curl https://api.github.com/repos/getsentry/wal2json/releases/latest |
1216
grep '"tag_name":' |
1317
sed -E 's/.*"([^"]+)".*/\1/'
1418
)
@@ -24,7 +28,7 @@ fi
2428
mkdir -p ../postgres/wal2json
2529
if [ ! -f "../postgres/wal2json/$VERSION/$FILE_NAME" ]; then
2630
mkdir -p "../postgres/wal2json/$VERSION"
27-
$DOCKER_CURL -L \
31+
docker_curl -L \
2832
"https://github.com/getsentry/wal2json/releases/download/$VERSION/$FILE_NAME" \
2933
> "../postgres/wal2json/$VERSION/$FILE_NAME"
3034
fi

0 commit comments

Comments
 (0)