From 8733353ac01a3b678dc32fcea296ec2cb2671991 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 11 Aug 2021 14:35:45 +0200 Subject: [redsocks] Upper- and lowercase proxy env This is badly standardized, declare both to be extra safe --- .../redsocks/data/opt/openslx/scripts/systemd-setup_proxy | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'core/modules/redsocks') diff --git a/core/modules/redsocks/data/opt/openslx/scripts/systemd-setup_proxy b/core/modules/redsocks/data/opt/openslx/scripts/systemd-setup_proxy index 54c81bfd..7cf9cb8c 100755 --- a/core/modules/redsocks/data/opt/openslx/scripts/systemd-setup_proxy +++ b/core/modules/redsocks/data/opt/openslx/scripts/systemd-setup_proxy @@ -29,14 +29,6 @@ fi [ "$PROXY" == "off" ] && echo "Proxy mode not required." && exit 0 echo "Setting up transparent proxying via $SLX_PROXY_IP" -## Do this in addition so proxy-aware programs can use it directly -#mkdir -p /etc/profile.d -#if [ "${SLX_PROXY_TYPE:0:5}" = "http-" ]; then -# echo "export http_proxy=http://${SLX_PROXY_IP}:${SLX_PROXY_PORT}/" > "/etc/profile.d/system-proxy.sh" -#elif [ "${SLX_PROXY_TYPE:0:5}" = "socks" ]; then -# echo "export ALL_PROXY=${SLX_PROXY_TYPE}://${SLX_PROXY_IP}:${SLX_PROXY_PORT}/" > "/etc/profile.d/system-proxy.sh" -#fi - sed -i "s/%%PROXY_IP%%/$SLX_PROXY_IP/g;s/%%PROXY_PORT%%/$SLX_PROXY_PORT/g;s/%%PROXY_TYPE%%/$SLX_PROXY_TYPE/g" /etc/redsocks.conf mkdir -p /run/redsocks @@ -77,12 +69,19 @@ if [ "${SLX_PROXY_TYPE:0:5}" = "http-" ]; then #echo "iptables -t nat -A REDSOCKS -p tcp --dport 80 -j DNAT --to-destination ${SLX_PROXY_IP}:${SLX_PROXY_PORT}" >> "$tfile" mkdir -p "/etc/profile.d" &> /dev/null echo "export http_proxy='http://${SLX_PROXY_IP}:${SLX_PROXY_PORT}/'" + echo "export HTTP_PROXY='http://${SLX_PROXY_IP}:${SLX_PROXY_PORT}/'" echo "export all_proxy='http://${SLX_PROXY_IP}:${SLX_PROXY_PORT}/'" + echo "export ALL_PROXY='http://${SLX_PROXY_IP}:${SLX_PROXY_PORT}/'" echo -n "export no_proxy='${SLX_PXE_SERVER_IP}" for ADDR in $SLX_PROXY_BLACKLIST; do echo -n ", $ADDR" done echo "'" + echo -n "export NO_PROXY='${SLX_PXE_SERVER_IP}" + for ADDR in $SLX_PROXY_BLACKLIST; do + echo -n ", $ADDR" + done + echo "'" fi > "/etc/profile.d/99-proxy.sh" cat >> "$tfile" <