mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
Change back to validating proxy, show user error message from curl
This commit is contained in:
@@ -568,13 +568,7 @@ collect_proxy_details() {
|
||||
|
||||
if whiptail_proxy_auth_ask; then
|
||||
whiptail_proxy_auth_user "$proxy_user"
|
||||
|
||||
local proxy_pass_match=no
|
||||
while [[ $proxy_pass_match != yes ]]; do
|
||||
whiptail_proxy_auth_pass # Don't pass in existing pass since it's obfuscated
|
||||
whiptail_proxy_auth_pass confirm
|
||||
check_pass_match "$proxy_pass" "$proxy_pass_confirm" "proxy_pass_match"
|
||||
done
|
||||
whiptail_proxy_auth_pass "$proxy_pass"
|
||||
|
||||
local url_prefixes=( 'http://' 'https://' )
|
||||
for prefix in "${url_prefixes[@]}"; do
|
||||
@@ -1827,11 +1821,12 @@ print_salt_state_apply() {
|
||||
|
||||
proxy_validate() {
|
||||
local test_url="https://raw.githubusercontent.com/Security-Onion-Solutions/securityonion/master/KEYS"
|
||||
curl "$test_url" --proxy "$so_proxy" &> /dev/null
|
||||
proxy_test_err=$(curl -s "$test_url" --proxy "$so_proxy" 2>&1)
|
||||
local ret=$?
|
||||
|
||||
if [[ $ret != 0 ]]; then
|
||||
error "Could not reach $test_url using proxy $so_proxy"
|
||||
error "Received error: $proxy_test_err"
|
||||
if [[ -n $TESTING ]]; then
|
||||
error "Exiting setup"
|
||||
kill -SIGINT "$(ps --pid $$ -oppid=)"; exit 1
|
||||
|
||||
@@ -213,7 +213,7 @@ if ! [[ -f $install_opt_file ]]; then
|
||||
"HOSTNAME=$HOSTNAME" > "$net_init_file"
|
||||
set_main_ip >> $setup_log 2>&1
|
||||
compare_main_nic_ip
|
||||
reset_prpxy >> $setup_log 2>&1
|
||||
reset_proxy >> $setup_log 2>&1
|
||||
collect_proxy
|
||||
[[ -n "$so_proxy" ]] && set_proxy >> $setup_log 2>&1
|
||||
whiptail_net_setup_complete
|
||||
@@ -311,9 +311,9 @@ if ! [[ -f $install_opt_file ]]; then
|
||||
collect_mngr_hostname
|
||||
fi
|
||||
|
||||
reset_prpxy >> $setup_log 2>&1
|
||||
reset_proxy >> $setup_log 2>&1
|
||||
if [[ -z $is_airgap ]]; then
|
||||
collect_proxy_details
|
||||
collect_proxy
|
||||
[[ -n "$so_proxy" ]] && set_proxy >> $setup_log 2>&1
|
||||
fi
|
||||
|
||||
|
||||
@@ -595,7 +595,8 @@ whiptail_invalid_proxy() {
|
||||
read -r -d '' message <<- EOM
|
||||
Could not reach test url using proxy ${proxy_addr}.
|
||||
|
||||
Check log (${setup_log}) for details.
|
||||
Error was:
|
||||
$proxy_test_err
|
||||
EOM
|
||||
|
||||
whiptail --title "Security Onion Setup" --yesno "$message" --yes-button "Enter Again" --no-button "Skip" 10 60
|
||||
|
||||
Reference in New Issue
Block a user