diff --git a/docs/upgrades/upgrade_6.8.7-6.99.0.pl b/docs/upgrades/upgrade_6.8.7-6.99.0.pl index 761b67847..057851ea6 100644 --- a/docs/upgrades/upgrade_6.8.7-6.99.0.pl +++ b/docs/upgrades/upgrade_6.8.7-6.99.0.pl @@ -151,7 +151,6 @@ sub addWorkflow { $session->config->set("spectreIp","127.0.0.1"); $session->config->set("spectrePort",32133); $session->config->set("spectreSubnets",["127.0.0.1/32"]); - $session->config->set("spectreCryptoKey","123qwe"); $session->config->set("workflowActivities", { None=>["WebGUI::Workflow::Activity::DecayKarma", "WebGUI::Workflow::Activity::TrashClipboard", "WebGUI::Workflow::Activity::CleanTempStorage", "WebGUI::Workflow::Activity::CleanFileCache", "WebGUI::Workflow::Activity::CleanLoginHistory", "WebGUI::Workflow::Activity::ArchiveOldThreads", diff --git a/etc/WebGUI.conf.original b/etc/WebGUI.conf.original index 22f063cf4..2c0f334fd 100644 --- a/etc/WebGUI.conf.original +++ b/etc/WebGUI.conf.original @@ -292,12 +292,6 @@ "spectrePort" : 32133, -# Define the key that will be used to encrypt communcation -# between Spectre and WebGUI. Note that this must match the -# cryptoKey in the Spectre config file. - -"spectreCryptoKey" : "123qwe", - # Define the workflow activities that are available in the editing # process and what object types they support. diff --git a/etc/spectre.conf.original b/etc/spectre.conf.original index 3957f2d43..2af93f819 100644 --- a/etc/spectre.conf.original +++ b/etc/spectre.conf.original @@ -2,12 +2,6 @@ { -# Define a key that will be used between Spectre and WebGUI to encrypt -# communication. Note that this key must match the "spectreCryptoKey" -# directive in your WebGUI config files. - -"cryptoKey" : "123qwe", - # Define a port for Spectre to run on between 1024 and 65000. "port" : 32133, diff --git a/lib/Spectre/Workflow.pm b/lib/Spectre/Workflow.pm index ebc82c2eb..dfac9e0c2 100644 --- a/lib/Spectre/Workflow.pm +++ b/lib/Spectre/Workflow.pm @@ -36,7 +36,7 @@ sub _start { $self->debug("Reading workflow configs."); my $configs = WebGUI::Config->readAllConfigs($self->config->getWebguiRoot); foreach my $config (keys %{$configs}) { - $kernel->yield("loadWorkflows", $config); + $kernel->yield("loadWorkflows", $configs->{$config}); } $kernel->yield("checkJobs"); } @@ -75,11 +75,12 @@ A hash reference containing a row of data from the WorkflowInstance table. sub addJob { my ($self, $config, $job) = @_[OBJECT, ARG0, ARG1]; - $self->debug("Adding workflow instance ".$job->{instanceId}." from ".$config." to job queue at priority ".$job->{priority}."."); + $self->debug("Adding workflow instance ".$job->{instanceId}." from ".$config->getFilename." to job queue at priority ".$job->{priority}."."); # job list + my $sitename = $config->get("sitename"); $self->{_jobs}{$job->{instanceId}} = { + sitename=>$sitename->[0], instanceId=>$job->{instanceId}, - config=>$config, status=>"waiting", priority=>$job->{priority} }; @@ -208,8 +209,8 @@ sub getNextJob { sub loadWorkflows { my ($kernel, $self, $config) = @_[KERNEL, OBJECT, ARG0]; - $self->debug("Loading workflows for ".$config."."); - my $session = WebGUI::Session->open($self->config->getWebguiRoot, $config); + $self->debug("Loading workflows for ".$config->getFilename."."); + my $session = WebGUI::Session->open($config->getWebguiRoot, $config->getFilename); my $result = $session->db->read("select * from WorkflowInstance"); while (my $data = $result->hashRef) { $kernel->yield("addJob", $config, $data); @@ -258,15 +259,13 @@ sub runWorker { my ($kernel, $self, $job, $session) = @_[KERNEL, OBJECT, ARG0, SESSION]; $self->debug("Preparing to run workflow instance ".$job->{instanceId}."."); POE::Component::Client::UserAgent->new; - my $url = $job->{sitename}.'/'.$job->{gateway}; - $url =~ s/\/\//\//g; - $url = "http://".$url."?op=spectre;instanceId=".$job->{instanceId}; + my $url = "http://".$job->{sitename}.'/'; my $request = POST $url, [op=>"runWorkflow", instanceId=>$job->{instanceId}]; my $cookie = $self->{_cookies}{$job->{sitename}}; $request->header("Cookie","wgSession=".$cookie) if (defined $cookie); $request->header("User-Agent","Spectre"); $request->header("X-JobId",$job->{instanceId}); - $self->debug("Posting workflow instance ".$job->{instanceId}."."); + $self->debug("Posting workflow instance ".$job->{instanceId}." to $url."); $kernel->post( useragent => 'request', { request => $request, response => $session->postback('workerResponse') }); $self->debug("Workflow instance ".$job->{instanceId}." posted."); } diff --git a/lib/WebGUI/Operation/Workflow.pm b/lib/WebGUI/Operation/Workflow.pm index 7a5d62416..cf3c5c097 100644 --- a/lib/WebGUI/Operation/Workflow.pm +++ b/lib/WebGUI/Operation/Workflow.pm @@ -309,15 +309,21 @@ Checks to ensure the requestor is who we think it is, and then executes a workfl sub www_runWorkflow { my $session = shift; +$session->errorHandler->warn("A"); $session->http->setMimeType("text/plain"); +$session->errorHandler->warn("b"); return "error" unless (isInSubnet($session->env->get("REMOTE_ADDR"), $session->config->get("spectreSubnets"))); +$session->errorHandler->warn("c"); my $instanceId = $session->form->param("instanceId"); if ($instanceId) { +$session->errorHandler->warn("d"); my $instance = WebGUI::Workflow::Instance->new($session, $instanceId); if (defined $instance) { +$session->errorHandler->warn("e"); return $instance->run; } } +$session->errorHandler->warn("f"); return "error"; }