Skip to content

Commit

Permalink
Merge pull request #224 from InseeFrLab/add-proxy-in-environment-file
Browse files Browse the repository at this point in the history
Update onyxia-init.sh - add proxy
  • Loading branch information
fcomte authored Sep 12, 2024
2 parents 2c4c686 + 6b5f651 commit e3068b3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions scripts/onyxia-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,21 @@ if [[ "$DARK_MODE" == "true" ]]; then
fi
fi

# inject proxy variables
env_vars=("NO_PROXY" "no_proxy" "HTTP_PROXY" "http_proxy" "HTTPS_PROXY" "https_proxy")

if [[ $SUDO -eq 0 ]]; then
for var in "${env_vars[@]}"; do
if [[ -n "${!var}" ]]; then
sudo sh -c "printf '%s=\"%s\"\n' $var \"${!var}\" >> /etc/environment"
if command -v R; then
sudo sh -c "printf '%s=\"%s\"\n' $var \"${!var}\" >> ${R_HOME}/etc/Renviron.site"
fi
fi
done
fi


# Configure duckdb CLI
if [[ -n $AWS_S3_ENDPOINT ]] && command -v duckdb ; then
cat <<EOF > ${HOME}/.duckdbrc
Expand Down

0 comments on commit e3068b3

Please sign in to comment.