-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of baltig.sandia.gov:scot/SCOT
- Loading branch information
Showing
104 changed files
with
196,424 additions
and
3,164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ package-lock.json | |
#compiled scot.js | ||
#scot.js | ||
scot-debug.js | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,8 @@ RUN cpanm --force IO::AIO AnyEvent::AIO Array::Split Data::Dumper Data::Dumper:: | |
MIME::Base64 IPC::Run IO::Prompt Log::Log4perl Mail::IMAPClient Mail::IMAPClient::BodyStructure [email protected] MongoDB::[email protected] \ | ||
MongoDB::GridFS::[email protected] MongoDB::[email protected] Meerkat Mojo MojoX::Log::Log4perl Mojolicious::Plugin::WithCSRFProtection \ | ||
Mojolicious::Plugin::TagHelpers XML::Smart Config::Auto Data::GUID File::LibMagic List::Uniq Domain::PublicSuffix Mozilla::PublicSuffix \ | ||
Crypt::PBKDF2 Config::Crontab Test::JSON Math::Int128 GeoIP2 Search::Elasticsearch Term::ANSIColor Courriel Statistics::Descriptive Net::SSH::Perl Net::SFTP Lingua::EN::StopWords Data::Clone XML::Twig | ||
Crypt::PBKDF2 Config::Crontab Test::JSON Math::Int128 GeoIP2 Search::Elasticsearch Term::ANSIColor Courriel Statistics::Descriptive Net::SSH::Perl \ | ||
Net::SFTP Lingua::EN::StopWords Data::Clone XML::Twig Mail::Send SVG::Sparkline | ||
|
||
#Mongo stuff | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,237 @@ | ||
#!/usr/bin/env perl | ||
|
||
use v5.18; | ||
|
||
use lib '../lib'; | ||
use Scot::Env; | ||
use Try::Tiny; | ||
use Data::Compare; | ||
use Data::Dumper; | ||
|
||
|
||
|
||
my @required = ( | ||
{ | ||
config_file => "/opt/scot/etc/scot.cfg.pl", | ||
install_ver => "../install/src/scot/scot.cfg.pl", | ||
attributes => [ | ||
"location", | ||
"site_identifier", | ||
"default_share_policy", | ||
"log_config", | ||
"modules", | ||
"get_method", | ||
"default_groups", | ||
"group_mode", | ||
"mode", | ||
"default_groups", | ||
"federation", | ||
"row_limit", | ||
"session_expiration", | ||
"admin_group", | ||
"file_store_root", | ||
"epoch_cols", | ||
"int_cols", | ||
"mojo_defaults", | ||
"entry_actions", | ||
"forms" | ||
], | ||
}, | ||
{ | ||
config_file => "/opt/scot/etc/alert.cfg.pl", | ||
install_ver => "../install/src/scot/scot.cfg.pl", | ||
attributes => [ | ||
"location", | ||
"site_identifier", | ||
"default_share_policy", | ||
"time_zone", | ||
"log_config", | ||
"modules", | ||
"leave_unseen", | ||
"verbose", | ||
"max_processes", | ||
"fetch_mode", | ||
"since", | ||
"approved_alert_domains", | ||
"approved_accounts", | ||
"parser_dir", | ||
"default_groups", | ||
"default_owner", | ||
], | ||
}, | ||
{ | ||
config_file => "/opt/scot/etc/flair.cfg.pl", | ||
install_ver => "../install/src/scot/flair.cfg.pl", | ||
attributes => [ | ||
"location", | ||
"site_identifier", | ||
"default_share_policy", | ||
"time_zone", | ||
"servername", | ||
"username", | ||
"password", | ||
"authtype", | ||
"log_config", | ||
"modules", | ||
"stomp_host", | ||
"stomp_port", | ||
"topic", | ||
"max_workers", | ||
"default_owner", | ||
], | ||
}, | ||
{ | ||
config_file => "/opt/scot/etc/reflair.cfg.pl", | ||
install_ver => "../install/src/scot/reflair.cfg.pl", | ||
attributes => [ | ||
"location", | ||
"site_identifier", | ||
"time_zone", | ||
"servername", | ||
"username", | ||
"password", | ||
"authtype", | ||
"log_config", | ||
"modules", | ||
"stomp_host", | ||
"stomp_port", | ||
"topic", | ||
"max_workers", | ||
], | ||
}, | ||
{ | ||
config_file => "/opt/scot/etc/backup.cfg.pl", | ||
install_ver => "../install/src/scot/backup.cfg.pl", | ||
attributes => [ | ||
"location", | ||
"log_config", | ||
"dbname", | ||
"pidfile", | ||
"bkuplocation", | ||
"cacheimg", | ||
"tarloc", | ||
"cleanup", | ||
"es_server", | ||
"es_backup_location", | ||
], | ||
}, | ||
{ | ||
config_file => "/opt/scot/etc/restore.cfg.pl", | ||
install_ver => "../install/src/scot/restore.cfg.pl", | ||
attributes => [ | ||
"location", | ||
"log_config", | ||
"dbname", | ||
"pidfile", | ||
"bkuplocation", | ||
"cacheimg", | ||
"tarloc", | ||
"cleanup", | ||
"es_server", | ||
"es_backup_location", | ||
], | ||
}, | ||
{ | ||
config_file => "/opt/scot/etc/game.cfg.pl", | ||
install_ver => "../install/src/scot/game.cfg.pl", | ||
attributes => [ | ||
"location", | ||
"log_config", | ||
"days_ago", | ||
"modules", | ||
], | ||
}, | ||
{ | ||
config_file => "/opt/scot/etc/metrics.cfg.pl", | ||
install_ver => "../install/src/scot/metrics.cfg.pl", | ||
attributes => [ | ||
"time_zone", | ||
"log_config", | ||
"modules", | ||
], | ||
}, | ||
{ | ||
config_file => "/opt/scot/etc/stretch.cfg.pl", | ||
install_ver => "../install/src/scot/stretch.cfg.pl", | ||
attributes => [ | ||
"location", | ||
"time_zone", | ||
"log_config", | ||
"max_workers", | ||
"stomp_host", | ||
"stomp_port", | ||
"topic", | ||
"default_owner", | ||
"modules", | ||
], | ||
}, | ||
); | ||
|
||
my @attrs_needed = (); | ||
|
||
foreach my $req (@required) { | ||
|
||
my $default = load_config($req->{install_ver}); | ||
my $actual = load_config($req->{config_file}); | ||
|
||
foreach my $attr (@{$req->{attributes}}) { | ||
|
||
|
||
say "\nAttribute: ".$attr; | ||
say "------------------------------\n"; | ||
|
||
try { | ||
|
||
my $value = $actual->{$attr}; | ||
my $default = $default->{$attr}; | ||
|
||
if ( defined $value ) { | ||
say " attribute exists."; | ||
} | ||
else { | ||
push @attrs_needed, { | ||
config => $req->{config_file}, | ||
attribute => $attr, | ||
}; | ||
} | ||
|
||
if ( examine($default, $value) ) { | ||
say " attribute has default value"; | ||
} | ||
else { | ||
say " attribure has changed value"; | ||
} | ||
} | ||
catch { | ||
say " ERROR: attribute does not exist in ". | ||
$req->{config_file}; | ||
}; | ||
} | ||
} | ||
|
||
say "________________________________________________"; | ||
say "Missing Attributes in configs"; | ||
say "________________________________________________"; | ||
say Dumper(\@attrs_needed); | ||
|
||
sub examine { | ||
my $def = shift; | ||
my $val = shift; | ||
return Compare($def, $val); | ||
} | ||
|
||
sub load_config { | ||
my $file = shift; | ||
unless ( -r $file ) { | ||
die "Config file not readable!\n"; | ||
}; | ||
no strict 'refs'; | ||
my $cont = new Safe 'MCONFIG'; | ||
my $result = $cont->rdo($file); | ||
my $hname = 'MCONFIG::environment'; | ||
my %copy = %$hname; | ||
my $href = \%copy; | ||
return $href; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env perl | ||
|
||
use strict; | ||
use warnings; | ||
use lib '../lib'; | ||
use lib '../../lib'; | ||
use lib '../../Scot-Internal-Modules/lib'; | ||
use lib '/opt/scot/lib'; | ||
use v5.18; | ||
use Scot::App::FedRec; | ||
use Data::Dumper; | ||
|
||
my $config_file = $ENV{'scot_app_flair_config_file'} // | ||
'/opt/scot/etc/fedrec.cfg.pl'; | ||
my $env = Scot::Env->new( | ||
config_file => $config_file, | ||
); | ||
|
||
$SIG{__DIE__} = sub { our @reason = @_ }; | ||
|
||
END { | ||
our @reason; | ||
if (@reason) { | ||
say "$0 died because: @reason"; | ||
$env->log->error("$0 died because: ",{filter=>\&Dumper, value=>\@reason}); | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
my $loop = Scot::App::FedRec->new({ | ||
env => $env, | ||
}); | ||
$loop->run(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env perl | ||
|
||
use strict; | ||
use warnings; | ||
use lib '../lib'; | ||
use lib '../../lib'; | ||
use lib '../../Scot-Internal-Modules/lib'; | ||
use lib '/opt/scot/lib'; | ||
use v5.18; | ||
use Scot::App::Responder::FederateUp; | ||
use Data::Dumper; | ||
|
||
my $config_file = $ENV{'scot_app_flair_config_file'} // | ||
'/opt/scot/etc/fedup.cfg.pl'; | ||
my $env = Scot::Env->new( | ||
config_file => $config_file, | ||
); | ||
|
||
$SIG{__DIE__} = sub { our @reason = @_ }; | ||
|
||
END { | ||
our @reason; | ||
if (@reason) { | ||
say "$0 died because: @reason"; | ||
$env->log->error("$0 died because: ",{filter=>\&Dumper, value=>\@reason}); | ||
} | ||
} | ||
|
||
|
||
|
||
|
||
my $loop = Scot::App::Responder::FederateUp->new({ | ||
env => $env, | ||
}); | ||
$loop->run(); | ||
|
Oops, something went wrong.