From e0990d99cb63130b2edb6798ed3a571339d2896e Mon Sep 17 00:00:00 2001 From: Tobias Kussel Date: Mon, 23 Oct 2023 11:06:59 +0000 Subject: [PATCH] Comment out HTTP proxy parsing --- lib/functions.sh | 25 ++++++++++++++----------- lib/update-bridgehead.sh | 4 ++-- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/lib/functions.sh b/lib/functions.sh index 1dce2c6..1dec95b 100644 --- a/lib/functions.sh +++ b/lib/functions.sh @@ -10,18 +10,21 @@ detectCompose() { } setupProxy() { + ### Note: As the current data protection concepts do not allow communication via HTTP, this + ### handling of a proxy for HTTP requests is commented out and will not be used + # http="no" - if [ $HTTP_PROXY_URL ]; then - if [[ ! -z "$HTTP_PROXY_USERNAME" && ! -z "$HTTP_PROXY_PASSWORD" ]]; then - proto="$(echo $HTTP_PROXY_URL | grep :// | sed -e's,^\(.*://\).*,\1,g')" - fqdn="$(echo ${HTTP_PROXY_URL/$proto/})" - HTTP_PROXY_FULL_URL="$(echo $proto$HTTP_PROXY_USERNAME:$HTTP_PROXY_PASSWORD@$fqdn)" - http="authenticated" - else - HTTP_PROXY_FULL_URL=$HTTP_PROXY_URL - http="unauthenticated" - fi - fi + # if [ $HTTP_PROXY_URL ]; then + # if [[ ! -z "$HTTP_PROXY_USERNAME" && ! -z "$HTTP_PROXY_PASSWORD" ]]; then + # proto="$(echo $HTTP_PROXY_URL | grep :// | sed -e's,^\(.*://\).*,\1,g')" + # fqdn="$(echo ${HTTP_PROXY_URL/$proto/})" + # HTTP_PROXY_FULL_URL="$(echo $proto$HTTP_PROXY_USERNAME:$HTTP_PROXY_PASSWORD@$fqdn)" + # http="authenticated" + # else + # HTTP_PROXY_FULL_URL=$HTTP_PROXY_URL + # http="unauthenticated" + # fi + # fi https="no" if [ $HTTPS_PROXY_URL ]; then diff --git a/lib/update-bridgehead.sh b/lib/update-bridgehead.sh index 1f311c2..6c84960 100755 --- a/lib/update-bridgehead.sh +++ b/lib/update-bridgehead.sh @@ -54,8 +54,8 @@ for DIR in /etc/bridgehead $(pwd); do log "INFO" "Git is using no proxy!" OUT=$(retry 5 git -C $DIR fetch 2>&1 && retry 5 git -C $DIR pull 2>&1) else - log "INFO" "Git is using proxy ${HTTP_PROXY_URL} from ${CONFFILE}" - OUT=$(retry 5 git -c http.proxy=$HTTP_PROXY_FULL_URL -c https.proxy=$HTTPS_PROXY_FULL_URL -C $DIR fetch 2>&1 && retry 5 git -c http.proxy=$HTTP_PROXY_FULL_URL -c https.proxy=$HTTPS_PROXY_FULL_URL -C $DIR pull 2>&1) + log "INFO" "Git is using proxy ${HTTPS_PROXY_URL} from ${CONFFILE}" + OUT=$(retry 5 git -c https.proxy=$HTTPS_PROXY_FULL_URL -C $DIR fetch 2>&1 && retry 5 git-c https.proxy=$HTTPS_PROXY_FULL_URL -C $DIR pull 2>&1) fi if [ $? -ne 0 ]; then report_error log "Unable to update git $DIR: $OUT"