diff --git a/etc/spectre.conf.original b/etc/spectre.conf.original index 072f13149..00b02a045 100644 --- a/etc/spectre.conf.original +++ b/etc/spectre.conf.original @@ -26,7 +26,14 @@ # it gets suspended. It can get suspended if it's waiting for # external input, or if it errors for any reason. -"suspensionDelay" : 60 +"suspensionDelay" : 60, + +# What port should we connect to WebGUI on? If you've configured +# WebGUI yourself, then this should probably be 80. If you're using +# the WebGUI Runtime Environment, 81 might be a better choice to go +# directly at the mod_perl server. + +"webguiPort" : 80 } diff --git a/lib/Spectre/Cron.pm b/lib/Spectre/Cron.pm index e3d2bd416..45feb8a0f 100644 --- a/lib/Spectre/Cron.pm +++ b/lib/Spectre/Cron.pm @@ -184,7 +184,7 @@ sub checkSchedule { }); if (defined $instance) { $self->debug("Created workflow instance ".$instance->getId."."); - $kernel->post($self->workflowSession, "addInstance", {instanceId=>$instance->getId, priority=>$job->{priority}, sitename=>}); + $kernel->post($self->workflowSession, "addInstance", {instanceId=>$instance->getId, priority=>$job->{priority}, sitename=>$job->{sitename}}); } else { $self->debug("Something bad happened. Couldn't create workflow instance for schedule ".$job->{taskId}." for ".$job->{config}."."); } diff --git a/lib/Spectre/Workflow.pm b/lib/Spectre/Workflow.pm index 1013bbdb5..f3dfc93f2 100644 --- a/lib/Spectre/Workflow.pm +++ b/lib/Spectre/Workflow.pm @@ -295,7 +295,7 @@ sub runWorker { my ($kernel, $self, $instance, $session) = @_[KERNEL, OBJECT, ARG0, SESSION]; $self->debug("Preparing to run workflow instance ".$instance->{instanceId}."."); POE::Component::Client::UserAgent->new; - my $url = "http://".$instance->{sitename}.'/'; + my $url = "http://".$instance->{sitename}.':'.$self->config->get("webguiPort").'/'; my $request = POST $url, [op=>"runWorkflow", instanceId=>$instance->{instanceId}]; my $cookie = $self->{_cookies}{$instance->{sitename}}; $request->header("Cookie","wgSession=".$cookie) if (defined $cookie); diff --git a/lib/WebGUI/Mail/Send.pm b/lib/WebGUI/Mail/Send.pm index d3ccf4318..a45ee713b 100644 --- a/lib/WebGUI/Mail/Send.pm +++ b/lib/WebGUI/Mail/Send.pm @@ -274,6 +274,7 @@ sub retrieve { return undef unless $data->{messageId}; $session->db->deleteRow("mailQueue","messageId", $messageId); my $parser = MIME::Parser->new; + $parser->output_to_core(1); bless {_session=>$session, _message=>$parser->parse_data($data->{messageId}), _toGroup=>$data->{toGroup}}, $class; } diff --git a/lib/WebGUI/Operation/Workflow.pm b/lib/WebGUI/Operation/Workflow.pm index ad2fd820d..ce8107cc3 100644 --- a/lib/WebGUI/Operation/Workflow.pm +++ b/lib/WebGUI/Operation/Workflow.pm @@ -356,7 +356,11 @@ Checks to ensure the requestor is who we think it is, and then executes a workfl sub www_runWorkflow { my $session = shift; $session->http->setMimeType("text/plain"); - return "error" unless (isInSubnet($session->env->get("REMOTE_ADDR"), $session->config->get("spectreSubnets"))); + unless (isInSubnet($session->env->get("REMOTE_ADDR"), $session->config->get("spectreSubnets"))) { + $session->errorHandler->security("make a Spectre workflow runner request, but we're only allowed to + accept requests from ".join(",",@{$session->config->get("spectreSubnets")})."."); + return "error"; + } my $instanceId = $session->form->param("instanceId"); if ($instanceId) { my $instance = WebGUI::Workflow::Instance->new($session, $instanceId); @@ -365,6 +369,7 @@ sub www_runWorkflow { } return "complete"; } + $session->errorHandler->warn("No instance ID passed to workflow runner."); return "error"; } diff --git a/lib/WebGUI/Workflow/Activity/NotifyAboutVersionTag.pm b/lib/WebGUI/Workflow/Activity/NotifyAboutVersionTag.pm index 327bffde4..9077b29c9 100644 --- a/lib/WebGUI/Workflow/Activity/NotifyAboutVersionTag.pm +++ b/lib/WebGUI/Workflow/Activity/NotifyAboutVersionTag.pm @@ -93,7 +93,7 @@ sub execute { if ($versionTag->getAssetCount) { # if there's only one asset in the tag, we might as well give them a direct link to it my $asset = $versionTag->getAssets->[0]; - $urlOfSingleAsset = "\n\n".$self->session->getSiteURL().$asset->getUrl("func=view;revision=".$asset->get("revisionDate")); + $urlOfSingleAsset = "\n\n".$self->session->url->getSiteURL().$asset->getUrl("func=view;revision=".$asset->get("revisionDate")); } my $properties = { status=>"completed",