From 3306ffa792701ed35065b64d35a3c1b53bf9780b Mon Sep 17 00:00:00 2001 From: William Wernert Date: Thu, 11 Mar 2021 16:03:43 -0500 Subject: [PATCH] Only collect proxy once, include manager in no_proxy value on minions --- setup/so-functions | 3 +++ setup/so-setup | 16 +++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/setup/so-functions b/setup/so-functions index 0b97098cc..4d7019ab1 100755 --- a/setup/so-functions +++ b/setup/so-functions @@ -2282,6 +2282,9 @@ set_proxy() { # Don't proxy localhost, local ip, and management ip no_proxy_string="localhost, 127.0.0.1, ${MAINIP}, ${HOSTNAME}" + if [[ -n $MSRV ]] && [[ -n $MSRVIP ]];then + no_proxy_string="${no_proxy_string}, ${MSRVIP}, ${MSRV}" + fi # Set proxy environment variables used by curl, wget, docker, and others { diff --git a/setup/so-setup b/setup/so-setup index e098e4f89..eaac276b8 100755 --- a/setup/so-setup +++ b/setup/so-setup @@ -271,9 +271,15 @@ if [[ ( $is_manager || $is_import ) && $is_iso ]]; then fi fi -if [[ $is_airgap != true ]]; then - collect_proxy +if [[ $is_minion ]]; then + collect_mngr_hostname fi + +if ! [[ -f $install_opt_file ]] && [[ -z $is_airgap ]]; then + collect_proxy_details + [[ -n "$so_proxy" ]] && set_proxy >> $setup_log 2>&1 +fi + percentage=0 { installer_progress_loop & # Run progress bar to 100 in ~8 minutes @@ -311,10 +317,6 @@ if ! [[ -f $install_opt_file ]]; then source "$net_init_file" fi - if [[ $is_minion ]]; then - collect_mngr_hostname - fi - if [[ $is_minion ]] || [[ $reinit_networking ]] || [[ $is_iso ]] && ! [[ -f $net_init_file ]]; then whiptail_management_interface_setup fi @@ -343,6 +345,7 @@ if ! [[ -f $install_opt_file ]]; then "HOSTNAME=$HOSTNAME" \ "MSRV=$MSRV" \ "MSRVIP=$MSRVIP" > "$install_opt_file" + [[ -n $so_proxy ]] && echo "so_proxy=$so_proxy" >> "$install_opt_file" download_repo_tarball exec bash /root/manager_setup/securityonion/setup/so-setup "${original_args[@]}" fi @@ -564,7 +567,6 @@ echo "1" > /root/accept_changes set_main_ip >> $setup_log 2>&1 compare_main_nic_ip set_redirect >> $setup_log 2>&1 -[[ -n "$so_proxy" ]] && set_proxy >> $setup_log 2>&1 # Begin install