diff options
author | Felix Altenberg <felix@altenberg.dev> | 2023-04-28 23:38:25 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-28 23:38:25 +0300 |
commit | f52ff611c55a4e0708edd9c93076603b2704e581 (patch) | |
tree | f4677b98cf0164468c48e23f0a55aa30f6a21024 | |
parent | fad03b19d48466bb0eec41ccbf4cc456a5c4dea7 (diff) |
Adds httpProxy option to Python Feature (#532)feature_python_1.1.0
* 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 <samruddhikhandale@github.com>
* Fixes minor formatting error
---------
Co-authored-by: Samruddhi Khandale <samruddhikhandale@github.com>
-rw-r--r-- | src/python/devcontainer-feature.json | 7 | ||||
-rwxr-xr-x | src/python/install.sh | 5 |
2 files changed, 11 insertions, 1 deletions
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" |