Skip to content

Commit

Permalink
syncing up for test
Browse files Browse the repository at this point in the history
  • Loading branch information
Todd Bruner committed May 14, 2021
1 parent 57a147e commit 1ade231
Show file tree
Hide file tree
Showing 512 changed files with 288 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bin/enricher.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use lib '../lib';
use lib '../../lib';
use lib '../../Scot-Internal-Modules/lib';
# use lib '/opt/scot/lib';
use lib '/opt/scot/lib';
use Scot::Enricher::Worker;
use Data::Dumper;
use utf8::all;
Expand Down
2 changes: 1 addition & 1 deletion bin/flairer2.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use lib '../lib';
use lib '../../lib';
use lib '../../Scot-Internal-Modules/lib';
# use lib '/opt/scot/lib';
use lib '/opt/scot/lib';
use Scot::Flair::Worker;
use Data::Dumper;
use utf8::all;
Expand Down
6 changes: 3 additions & 3 deletions install/install_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function start_services {
wait_for_mongo
systemctl --no-pager restart scot.service
systemctl --no-pager restart apache2.service
systemctl --no-pager restart scfd.service
systemctl --no-pager restart scf2d.service
systemctl --no-pager restart scrfd.service
systemctl --no-pager restart scepd.service
systemctl --no-pager restart recfpd.service
Expand All @@ -176,7 +176,7 @@ function start_services {
wait_for_mongo
systemctl --no-pager restart scot.service
systemctl --no-pager restart apache2.service
systemctl --no-pager restart scfd.service
systemctl --no-pager restart scf2d.service
systemctl --no-pager restart scrfd.service
systemctl --no-pager restart scepd.service
systemctl --no-pager restart recfpd.service
Expand All @@ -185,7 +185,7 @@ function start_services {
wait_for_mongo
service scot restart
service apache2 restart
service scfd restart
service scf2d restart
service scrfd restart
service scepd restart
service restart recfpd.service
Expand Down
2 changes: 1 addition & 1 deletion install/install_scot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function configure_startup {
echo "--"
echo "-- configuring SCOT startup"
echo "--"
SCOTSERVICES='scot scfd scrfd scepd recfpd sc_em_dispatchd sc_em_alertd sc_emaild sc_aepd sc_em_eventd'
SCOTSERVICES='scot scf2d scend scrfd scepd recfpd'
SRCDIR="$SCOT_CONFIG_SRC/scot"

for service in $SCOTSERVICES; do
Expand Down
2 changes: 1 addition & 1 deletion lib/Scot/App/Responder/Reflair.pm
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ sub send_message {
};

$log->debug("Sending Notification: ", {filter=>\&Dumper, value=>$msg});
$mq->send("/topic/scot", $msg);
$mq->send("/queue/flair", $msg);

# TODO: SEND HREF to sharing queue
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Scot/Controller/Api.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1359,14 +1359,14 @@ sub post_update_process {
$env->mq->send("/topic/scot", $mq_msg);

if ( ref($object) eq "Scot::Model::Entry" ) {
$env->mq->send("/queue/flair", $mq_msg);
$mq_msg->{data} = {
who => $self->session('user'),
target => { type => $object->target->{type},
id => $object->target->{id}, },
what => "Entry update",
};
$env->mq->send("/topic/scot", $mq_msg);
$env->mq->sent("/queue/flair", $mq_msg);
$self->add_history("updated entry ".$object->id, $object);
# need to update target's updated time
my $target = $env->mongo->collection(ucfirst($object->target->{type}))
Expand Down
224 changes: 224 additions & 0 deletions lib/Scot/Controller/Api2.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
package Scot::Controller::Api2;

use strict;
use warnings;
use utf8;
use Try::Tiny;
use Carp qw(longmess);

use Mojo::Base 'Mojolicious::Controller', -signatures;

sub create ($self) {
my $log = $self->env->log;
try {
my $request = $self->get_api_request;
my $domain = $self->get_domain($request);
my $result = $domain->create($request);
$self->perform_render($result);
}
catch {
$self->render_error(400, "API Create Error: $_");
};
}

sub list ($self) {
my $log = $self->env->log;
try {
my $request = $self->get_api_request;
my $domain = $self->get_domain($request);
my $result = $domain->list($request);
$self->perform_render($result);
}
catch {
$self->render_error(400, "API List Error: $_");
};
}

sub get_one ($self) {
my $log = $self->env->log;
try {
my $request = $self->get_api_request;
my $domain = $self->get_domain($request);
my $result = $domain->get_one($request);
$self->perform_render($result);
}
catch {
$self->render_error(400, "API Get_One Error: $_");
};
}

sub get_related ($self) {
my $log = $self->env->log;
try {
my $request = $self->get_api_request;
my $domain = $self->get_domain($request);
my $result = $domain->get_related($request);
$self->perform_render($result);
}
catch {
$self->render_error(400, "API Get_Related Error: $_");
};
}

sub update ($self) {
my $log = $self->env->log;
try {
my $request = $self->get_api_request;
my $domain = $self->get_domain($request);
my $result = $domain->update($request);
$self->perform_render($result);
}
catch {
$self->render_error(400, "API Update Error: $_");
};

}

sub delete ($self) {
my $log = $self->env->log;
try {
my $request = $self->get_api_request;
my $domain = $self->get_domain($request);
my $result = $domain->delete($request);
$self->perform_render($result);
}
catch {
$self->render_error(400, "API List Error: $_");
};
}

sub undelete ($self) {
my $log = $self->env->log;
try {
my $request = $self->get_api_request;
my $domain = $self->get_domain($request);
my $result = $domain->undelete($request);
$self->perform_render($result);
}
catch {
$self->render_error(400, "API Undelete Error: $_");
};
}

sub promote ($self) {
my $log = $self->env->log;
try {
my $request = $self->get_api_request;
my $domain = $self->get_domain($request);
my $result = $domain->promote($request);
$self->perform_render($result);
}
catch {
$self->render_error(400, "API Promote Error: $_");
};

}

sub unpromote ($self) {
my $log = $self->env->log;
try {
my $request = $self->get_api_request;
my $domain = $self->get_domain($request);
my $result = $domain->unpromote($request);
$self->perform_render($result);
}
catch {
$self->render_error(400, "API Promote Error: $_");
};
}

sub link ($self) {
my $log = $self->env->log;
try {
my $request = $self->get_api_request;
my $domain = $self->get_domain($request);
my $result = $domain->link($request);
$self->perform_render($result);
}
catch {
$self->render_error(400, "API Link Error: $_");
};
}

sub move ($self) {
my $log = $self->env->log;
try {
my $request = $self->get_api_request;
my $domain = $self->get_domain($request);
my $result = $domain->move($request);
$self->perform_render($result);
}
catch {
$self->render_error(400, "API Move Error: $_");
};
}

sub wall ($self) {
my $log = $self->env->log;
try {
my $request = $self->get_api_request;
my $domain = $self->get_domain($request);
my $result = $domain->wall($request);
$self->perform_render($result);
}
catch {
$self->render_error(400, "API Wall Error: $_");
};

}

sub whoami ($self) {
return $self->status;
}

sub status ($self) {
my $log = $self->env->log;
try {
my $request = $self->get_api_request;
my $domain = $self->get_domain($request);
my $result = $domain->status($request);
$self->perform_render($result);
}
catch {
$self->render_error(400, "API Status Error: $_");
};
}

sub export ($self) {
my $log = $self->env->log;
try {
my $request = $self->get_api_request;
my $domain = $self->get_domain($request);
my $result = $domain->export($request);
$self->perform_render($result);
}
catch {
$self->render_error(400, "API Status Error: $_");
};
}

sub render_error ($self, $code, $errormsg) {
my $log = $self->env->log;
$log->error('--------------------');
$log->error($errormsg);
$log->error(longmess);
$log->error('--------------------');
$self->perform_render({
error => $errormsg,
code => $code,
});
}

sub get_api_request ($self) {

}

sub get_domain ($self, $request) {

}

sub perform_render ($self, $result) {

}

1;
36 changes: 36 additions & 0 deletions lib/Scot/Controller/Proxy.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package Scot::Controller::Proxy;

use strict;
use warnings;
use utf8;
use Try::Tiny;
use Carp qw(longmess);

use Mojo::Base 'Mojolicious::Controller', -signatures;

=head1 Scot::Controller::Proxy
contain the controllers for the various Proxy services API provides,
like RecFuture, etc.
=cut

sub recfuture ($self) {
# receives an ID for an entity
# places a request on /queue/recfuture to be handled
}


sub lri ($self) {
# receives and ID for an entity
# places request on /queue/lriproxy

}

sub remoteflair ($self) {
# scot browser extension will send in html
# this will place request on /queue/remoteflair
# after creating a remote flair object
}

1;
3 changes: 3 additions & 0 deletions lib/Scot/Flair/Io.pm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ sub get_from_mongo {
my $self = shift;
my $colname = shift;
my $id = shift;
my $log = $self->env->log;

$log->debug("get_from_mongo $colname $id");

my $mongo = $self->env->mongo;
my $col = $mongo->collection(ucfirst($colname));
Expand Down
19 changes: 16 additions & 3 deletions lib/Scot/Flair/Processor.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package Scot::Flair::Processor;

use Data::Dumper;
use Moose;

has env => (
Expand Down Expand Up @@ -31,12 +32,24 @@ sub flair {
my $data = shift;
my $timer = $self->env->get_timer("flair_time");
my $object = $self->retrieve($data);
my $results = $self->flair_object($object);
$self->send_notifications($object, $results);
$self->update_stats($results);
if ( defined $object ) {
my $results = $self->flair_object($object);
$self->send_notifications($object, $results);
$self->update_stats($results);
}
else {
$self->env->log->error("Unable to retrieve object ",
{filter=>\&Dumper, value => $data});
}
&$timer;
}

sub update_stats {
my $self = shift;
my $results = shift;

}

sub send_notifications {
my $self = shift;
my $object = shift;
Expand Down
2 changes: 1 addition & 1 deletion lib/Scot/Flair/Processor/Entry.pm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sub flair_object {
my $self = shift;
my $entry = shift;
my $log = $self->env->log;

$log->debug("[$$] flairing Entry ".$entry->id);

my $body = $self->preprocess_body($entry);
Expand Down
Binary file added pkgs/perl-5.30.3.tar.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added vendor/cache/authors/id/J/JM/JMM/Heap-0.80.tar.gz
Binary file not shown.
Binary file added vendor/cache/authors/id/J/JR/JRM/UUID-0.28.tar.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 1ade231

Please sign in to comment.