From f52ff611c55a4e0708edd9c93076603b2704e581 Mon Sep 17 00:00:00 2001 From: Felix Altenberg Date: Fri, 28 Apr 2023 21:38:25 +0100 Subject: Adds httpProxy option to Python Feature (#532) * Adds httpProxy option to Python Feature This option allows GPG to use a HTTP proxy to fetch keys from remote keyservers * Updating minor version Co-authored-by: Samruddhi Khandale * Fixes minor formatting error --------- Co-authored-by: Samruddhi Khandale --- src/python/devcontainer-feature.json | 7 ++++++- src/python/install.sh | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'src/python') diff --git a/src/python/devcontainer-feature.json b/src/python/devcontainer-feature.json index a954c35..b4aa21e 100644 --- a/src/python/devcontainer-feature.json +++ b/src/python/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "python", - "version": "1.0.22", + "version": "1.1.0", "name": "Python", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/python", "description": "Installs the provided version of Python, as well as PIPX, and other common Python utilities. JupyterLab is conditionally installed with the python feature. Note: May require source code compilation.", @@ -45,6 +45,11 @@ "type": "string", "default": "", "description": "Configure JupyterLab to accept HTTP requests from the specified origin" + }, + "httpProxy": { + "type": "string", + "default": "", + "description": "Connect to GPG keyservers using a proxy for fetching source code signatures by configuring this option" } }, "containerEnv": { diff --git a/src/python/install.sh b/src/python/install.sh index 053a72a..0e2b125 100755 --- a/src/python/install.sh +++ b/src/python/install.sh @@ -32,6 +32,8 @@ GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com keyserver hkps://keys.openpgp.org keyserver hkp://keyserver.pgp.com" +KEYSERVER_PROXY="${HTTPPROXY:-"${HTTP_PROXY:-""}"}" + set -e # Clean up @@ -84,6 +86,9 @@ receive_gpg_keys() { mkdir -p "$(dirname \"$2\")" keyring_args="--no-default-keyring --keyring $2" fi + if [ ! -z "${KEYSERVER_PROXY}" ]; then + keyring_args="${keyring_args} --keyserver-options http-proxy=${KEYSERVER_PROXY}" + fi # Use a temporary location for gpg keys to avoid polluting image export GNUPGHOME="/tmp/tmp-gnupg" -- cgit v1.2.3