[lxc-devel] [lxc/master] gpg: use proxy, if http_proxy is set

misterunknown on Github lxc-bot at linuxcontainers.org
Wed Feb 27 10:16:56 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 914 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190227/fe3436c1/attachment.bin>
-------------- next part --------------
From 89e781d463cfb08c48611be133d657f562606cc1 Mon Sep 17 00:00:00 2001
From: Marco Dickert <marco at misterunknown.de>
Date: Wed, 27 Feb 2019 10:58:54 +0100
Subject: [PATCH 1/2] gpg: use proxy, if proxy is set

---
 templates/lxc-download.in | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/templates/lxc-download.in b/templates/lxc-download.in
index 973783ba0a..413b85f35b 100644
--- a/templates/lxc-download.in
+++ b/templates/lxc-download.in
@@ -60,6 +60,7 @@ if [ -z "${DOWNLOAD_KEYSERVER:-}" ]; then
   # Deal with GPG over http proxy
   if [ -n "${http_proxy:-}" ]; then
     DOWNLOAD_KEYSERVER="hkp://p80.pool.sks-keyservers.net:80"
+    DOWNLOAD_GPG_PROXY="--keyserver-options http-proxy=\"${http_proxy}\""
   fi
 fi
 
@@ -133,8 +134,8 @@ gpg_setup() {
 
   success=
   for _ in $(seq 3); do
-    if gpg --keyserver "${DOWNLOAD_KEYSERVER}" \
-      --recv-keys "${DOWNLOAD_KEYID}" >/dev/null 2>&1; then
+    if $(gpg --keyserver "${DOWNLOAD_KEYSERVER}" ${DOWNLOAD_GPG_PROXY:-} \
+      --recv-keys "${DOWNLOAD_KEYID}" >/dev/null 2>&1); then
       success=1
       break
     fi

From 429a63f17191b9b00e38a7b7ff14de28393c62ef Mon Sep 17 00:00:00 2001
From: Marco Dickert <marco at misterunknown.de>
Date: Wed, 27 Feb 2019 10:58:54 +0100
Subject: [PATCH 2/2] gpg: use proxy, if proxy is set

Signed-off-by: Marco Dickert <marco at misterunknown.de>
---
 templates/lxc-download.in | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/templates/lxc-download.in b/templates/lxc-download.in
index 973783ba0a..413b85f35b 100644
--- a/templates/lxc-download.in
+++ b/templates/lxc-download.in
@@ -60,6 +60,7 @@ if [ -z "${DOWNLOAD_KEYSERVER:-}" ]; then
   # Deal with GPG over http proxy
   if [ -n "${http_proxy:-}" ]; then
     DOWNLOAD_KEYSERVER="hkp://p80.pool.sks-keyservers.net:80"
+    DOWNLOAD_GPG_PROXY="--keyserver-options http-proxy=\"${http_proxy}\""
   fi
 fi
 
@@ -133,8 +134,8 @@ gpg_setup() {
 
   success=
   for _ in $(seq 3); do
-    if gpg --keyserver "${DOWNLOAD_KEYSERVER}" \
-      --recv-keys "${DOWNLOAD_KEYID}" >/dev/null 2>&1; then
+    if $(gpg --keyserver "${DOWNLOAD_KEYSERVER}" ${DOWNLOAD_GPG_PROXY:-} \
+      --recv-keys "${DOWNLOAD_KEYID}" >/dev/null 2>&1); then
       success=1
       break
     fi


More information about the lxc-devel mailing list