<commit_before>#!/bin/bash
if [ -z "$PROXY_HOST" ]
then
    echo "No proxy configured, using direct internet access."
    exit 0
fi
if [ -z "$PROXY_PORT" ]
then
    echo "PROXY_PORT not set."
    exit 1
fi
echo "Starting to setup proxy configuration, PROXY_HOST=$PROXY_HOST, PROXY_PORT=$PROXY_PORT."
echo "Setting up proxy configuration in /etc/dnf/dnf.conf"
cat > /etc/dnf/dnf.conf <<EOF
[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=false
proxy=http://$PROXY_HOST:$PROXY_PORT
sslverify=false
EOF
echo "Final Configuration /etc/dnf/dnf.conf:"
cat /etc/dnf/dnf.conf
echo "Setting up proxy configuration in /etc/wgetrc"
cat > /etc/wgetrc <<EOF
use_proxy=on
http_proxy=http://$PROXY_HOST:$PROXY_PORT/
https_proxy=http://$PROXY_HOST:$PROXY_PORT/
ftp_proxy=http://$PROXY_HOST:$PROXY_PORT/
check_certificate=off
EOF
echo "Final Configuration /etc/wgetrc:"
cat /etc/wgetrc
echo "Setting up insecure curl configuration in /etc/.curlrc"
cat > /etc/.curlrc << EOF
insecure
EOF
echo "Setting up proxy configuration in /etc/profile.d/use-my-proxy.sh"
cat > /etc/profile.d/use-my-proxy.sh <<EOF
echo "use-my-proxy.sh started"
PROXY_HOST=$PROXY_HOST
PROXY_PORT=$PROXY_PORT
http_proxy="http://$PROXY_HOST:$PROXY_PORT/"
https_proxy="http://$PROXY_HOST:$PROXY_PORT/"
ftp_proxy="http://$PROXY_HOST:$PROXY_PORT/"
HTTP_PROXY="http://$PROXY_HOST:$PROXY_PORT/"
HTTPS_PROXY="http://$PROXY_HOST:$PROXY_PORT/"
FTP_PROXY=http://$PROXY_HOST:$PROXY_PORT/
export PROXY_HOST
export PROXY_PORT
export http_proxy
export https_proxy
export ftp_proxy
export HTTP_PROXY
export HTTPS_PROXY
export FTP_PROXY
CURL_HOME=/etc
export CURL_HOME
echo "use-my-proxy.sh finished"
EOF
echo "Proxy configuration finished."
exit 0<commit_msg>[Build] Adapted setup-proxy.sh to support company proxy<commit_after>#!/bin/bash
if [ -z "$PROXY_HOST" ]
then
    echo "No proxy configured, using direct internet access."
    exit 0
fi
if [ -z "$PROXY_PORT" ]
then
    echo "PROXY_PORT not set."
    exit 1
fi
echo "Starting to setup proxy configuration, PROXY_HOST=$PROXY_HOST, PROXY_PORT=$PROXY_PORT."
echo "Setting up proxy configuration in /etc/dnf/dnf.conf"
cat > /etc/dnf/dnf.conf <<EOF
[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=false
proxy=http://$PROXY_HOST:$PROXY_PORT
sslverify=false
EOF
echo "Final Configuration /etc/dnf/dnf.conf:"
cat /etc/dnf/dnf.conf
echo "Setting up proxy configuration in /etc/wgetrc"
cat > /etc/wgetrc <<EOF
use_proxy=on
http_proxy=http://$PROXY_HOST:$PROXY_PORT/
https_proxy=http://$PROXY_HOST:$PROXY_PORT/
ftp_proxy=http://$PROXY_HOST:$PROXY_PORT/
check_certificate=off
EOF
echo "Final Configuration /etc/wgetrc:"
cat /etc/wgetrc
echo "Setting up insecure curl configuration in /etc/.curlrc"
cat > /etc/.curlrc << EOF
insecure
EOF
echo "Setting up proxy configuration in /etc/profile.d/use-my-proxy.sh"
cat > /etc/profile.d/use-my-proxy.sh <<EOF
echo "use-my-proxy.sh started"
PROXY_HOST=$PROXY_HOST
PROXY_PORT=$PROXY_PORT
http_proxy="http://$PROXY_HOST:$PROXY_PORT/"
https_proxy="http://$PROXY_HOST:$PROXY_PORT/"
ftp_proxy="http://$PROXY_HOST:$PROXY_PORT/"
HTTP_PROXY="http://$PROXY_HOST:$PROXY_PORT/"
HTTPS_PROXY="http://$PROXY_HOST:$PROXY_PORT/"
FTP_PROXY=http://$PROXY_HOST:$PROXY_PORT/
export PROXY_HOST
export PROXY_PORT
export http_proxy
export https_proxy
export ftp_proxy
export HTTP_PROXY
export HTTPS_PROXY
export FTP_PROXY
CURL_HOME=/etc
export CURL_HOME
echo "Setting up npm configuration in \$HOME/.npmrc"
cat > \$HOME/.npmrc << EOF2
strict-ssl=false
registry=http://registry.npmjs.org/
EOF2
MAVEN_OPTS="-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true -Xms2048m -Xmx2048m"
export MAVEN_OPTS
echo "use-my-proxy.sh finished"
EOF
echo "Proxy configuration finished."
exit 0
{'fraction_non_alphanumeric': 0.13014783526927137, 'fraction_numerical': 0.005279831045406547, 'mean_word_length': 5.624125874125874, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5615670', 'n_tokens_mistral': 1468, 'n_tokens_neox': 1482, 'n_words': 311}