Unverified Commit f52ff611 authored by Felix Altenberg's avatar Felix Altenberg Committed by GitHub

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: 's avatarSamruddhi Khandale <samruddhikhandale@github.com>

* Fixes minor formatting error

---------
Co-authored-by: 's avatarSamruddhi Khandale <samruddhikhandale@github.com>
parent fad03b19
{ {
"id": "python", "id": "python",
"version": "1.0.22", "version": "1.1.0",
"name": "Python", "name": "Python",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/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.", "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 @@ ...@@ -45,6 +45,11 @@
"type": "string", "type": "string",
"default": "", "default": "",
"description": "Configure JupyterLab to accept HTTP requests from the specified origin" "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": { "containerEnv": {
......
...@@ -32,6 +32,8 @@ GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com ...@@ -32,6 +32,8 @@ GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com
keyserver hkps://keys.openpgp.org keyserver hkps://keys.openpgp.org
keyserver hkp://keyserver.pgp.com" keyserver hkp://keyserver.pgp.com"
KEYSERVER_PROXY="${HTTPPROXY:-"${HTTP_PROXY:-""}"}"
set -e set -e
# Clean up # Clean up
...@@ -84,6 +86,9 @@ receive_gpg_keys() { ...@@ -84,6 +86,9 @@ receive_gpg_keys() {
mkdir -p "$(dirname \"$2\")" mkdir -p "$(dirname \"$2\")"
keyring_args="--no-default-keyring --keyring $2" keyring_args="--no-default-keyring --keyring $2"
fi 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 # Use a temporary location for gpg keys to avoid polluting image
export GNUPGHOME="/tmp/tmp-gnupg" export GNUPGHOME="/tmp/tmp-gnupg"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment