From c4ac66ce0913c248cc73419723f9ba50b23c4913 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 22 May 2007 19:23:35 +0000 Subject: [PATCH] fix: spectre fails on Admin.pm because of env_proxy --- docs/changelog/7.x.x.txt | 2 ++ etc/spectre.conf.original | 10 +++++++++- lib/Spectre/Admin.pm | 8 ++++++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 1483ee162..c0f5c86f7 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -24,6 +24,8 @@ http://www.plainblack.com/bugs/tracker/new-second-inactive-version-tag-when-duplicating-thread - fix: Make WebGUI error out if there is a permissions problem while creating tar files http://www.plainblack.com/bugs/tracker/webgui-hangs-on-package-export + - fix: spectre fails on Admin.pm because of env_proxy + http://www.plainblack.com/bugs/tracker/spectre-fails-on-admin.pm-because-of-env_proxy 7.3.17 diff --git a/etc/spectre.conf.original b/etc/spectre.conf.original index 3fea68de8..91275c33f 100644 --- a/etc/spectre.conf.original +++ b/etc/spectre.conf.original @@ -38,7 +38,15 @@ # the WebGUI Runtime Environment, 81 might be a better choice to go # directly at the mod_perl server. -"webguiPort" : 80 +"webguiPort" : 80, + +# Should we ignore the proxy environment variables? If your server +# uses a proxy to connect to the internet and you are running +# Spectre on the same server as WebGUI, you should set this to 1. +# It should be safe to set this to 1 any time spectre and WebGUI +# are running on the same server. + +"ignoreEnvProxy" : 0 } diff --git a/lib/Spectre/Admin.pm b/lib/Spectre/Admin.pm index 0152f503b..ea0d26264 100644 --- a/lib/Spectre/Admin.pm +++ b/lib/Spectre/Admin.pm @@ -139,7 +139,9 @@ sub loadSiteData { next if $key =~ m/^demo/; $self->debug("Fetching site data for $key"); my $userAgent = new LWP::UserAgent; - $userAgent->env_proxy; + if (!$self->config->get('ignoreEnvProxy')) { + $userAgent->env_proxy; + } $userAgent->agent("Spectre"); $userAgent->timeout(30); my $url = "http://".$configs->{$key}->get("sitename")->[0].":".$self->{_config}->get("webguiPort").$configs->{$key}->get("gateway")."?op=spectreGetSiteData"; @@ -244,7 +246,9 @@ sub runTests { next if $key =~ m/^demo/; print "Testing $key\n"; my $userAgent = new LWP::UserAgent; - $userAgent->env_proxy; + if (!$config->get('ignoreEnvProxy')) { + $userAgent->env_proxy; + } $userAgent->agent("Spectre"); $userAgent->timeout(30); my $url = "http://".$configs->{$key}->get("sitename")->[0].":".$config->get("webguiPort").$configs->{$key}->get("gateway")."?op=spectreTest";