| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Tapper::Reports::Web; |
|
2
|
|
|
|
|
|
|
# git description: v5.0.14-4-g27494f9 |
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TAPPER'; |
|
5
|
|
|
|
|
|
|
# ABSTRACT: Tapper - Frontend web application based on Catalyst |
|
6
|
|
|
|
|
|
|
$Tapper::Reports::Web::VERSION = '5.0.15'; |
|
7
|
11
|
|
|
11
|
|
35686744
|
use 5.010; |
|
|
11
|
|
|
|
|
120
|
|
|
8
|
11
|
|
|
11
|
|
61
|
use strict; |
|
|
11
|
|
|
|
|
23
|
|
|
|
11
|
|
|
|
|
256
|
|
|
9
|
11
|
|
|
11
|
|
72
|
use warnings; |
|
|
11
|
|
|
|
|
25
|
|
|
|
11
|
|
|
|
|
310
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
11
|
|
|
11
|
|
654
|
use Moose; |
|
|
11
|
|
|
|
|
525053
|
|
|
|
11
|
|
|
|
|
95
|
|
|
12
|
11
|
|
|
11
|
|
79964
|
use Catalyst::Runtime; |
|
|
11
|
|
|
|
|
1807
|
|
|
|
11
|
|
|
|
|
482
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
extends 'Catalyst'; |
|
15
|
|
|
|
|
|
|
with 'Tapper::Reports::Web::Role::BehaviourModifications::Path'; |
|
16
|
|
|
|
|
|
|
|
|
17
|
11
|
|
|
11
|
|
2437
|
use File::ShareDir ':ALL'; |
|
|
11
|
|
|
|
|
100332
|
|
|
|
11
|
|
|
|
|
1637
|
|
|
18
|
11
|
|
|
11
|
|
89
|
use Cwd; |
|
|
11
|
|
|
|
|
21
|
|
|
|
11
|
|
|
|
|
551
|
|
|
19
|
11
|
|
|
11
|
|
2431
|
use Tapper::Config; |
|
|
11
|
|
|
|
|
101857
|
|
|
|
11
|
|
|
|
|
371
|
|
|
20
|
11
|
|
|
11
|
|
5091
|
use Log::Log4perl::Catalyst; |
|
|
11
|
|
|
|
|
492597
|
|
|
|
11
|
|
|
|
|
1653
|
|
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my $hr_subconfig; |
|
23
|
|
|
|
|
|
|
my $s_log4perl_config; |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
BEGIN { |
|
26
|
|
|
|
|
|
|
|
|
27
|
11
|
|
|
11
|
|
1491
|
$hr_subconfig = Tapper::Config->subconfig; |
|
28
|
|
|
|
|
|
|
|
|
29
|
11
|
50
|
|
|
|
631
|
open my $fh_log4perl_config, '<', $hr_subconfig->{files}{log4perl_webgui_cfg} or die "Unable to open log4perl configuration '$hr_subconfig->{files}{log4perl_webgui_cfg}': $!"; |
|
30
|
11
|
|
|
|
|
35
|
$s_log4perl_config = do { local $/; <$fh_log4perl_config> }; |
|
|
11
|
|
|
|
|
67
|
|
|
|
11
|
|
|
|
|
886
|
|
|
31
|
11
|
50
|
|
|
|
169
|
close $fh_log4perl_config or die "Unable to close log4perl configuration: $!"; |
|
32
|
|
|
|
|
|
|
|
|
33
|
11
|
|
|
|
|
135
|
my ( $s_error_log_file ) = $s_log4perl_config =~ /^log4perl.appender.AppError.filename\s*=\s*(.+)$/m; |
|
34
|
|
|
|
|
|
|
|
|
35
|
11
|
|
|
11
|
|
5880
|
use CGI::Carp qw( carpout ); |
|
|
11
|
|
|
|
|
28836
|
|
|
|
11
|
|
|
|
|
65
|
|
|
36
|
11
|
50
|
|
|
|
589
|
open( my $fh_log, '>>', $s_error_log_file ) or die ( "Unable to open log file while compiling: $!\n" ); |
|
37
|
11
|
|
|
|
|
61
|
carpout($fh_log); |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
} |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
my $root_dir = eval { dist_dir("Tapper-Reports-Web") } || getcwd."/root"; |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
# Configure the application |
|
44
|
|
|
|
|
|
|
__PACKAGE__->config( name => 'Tapper::Reports::Web' ); |
|
45
|
|
|
|
|
|
|
__PACKAGE__->config->{tapper_config} = $hr_subconfig; |
|
46
|
|
|
|
|
|
|
__PACKAGE__->log(Log::Log4perl::Catalyst->new( \$s_log4perl_config )); |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
# send all "die" and "warn" to Log4perl |
|
49
|
|
|
|
|
|
|
$SIG{__DIE__} = sub { |
|
50
|
|
|
|
|
|
|
if($^S) { |
|
51
|
|
|
|
|
|
|
# We're in an eval {} and don't want log |
|
52
|
|
|
|
|
|
|
# this message but catch it later |
|
53
|
|
|
|
|
|
|
return; |
|
54
|
|
|
|
|
|
|
} |
|
55
|
|
|
|
|
|
|
local $Log::Log4perl::caller_depth = $Log::Log4perl::caller_depth + 1; |
|
56
|
|
|
|
|
|
|
__PACKAGE__->log->error( @_ ); |
|
57
|
|
|
|
|
|
|
}; |
|
58
|
|
|
|
|
|
|
$SIG{__WARN__} = sub { |
|
59
|
|
|
|
|
|
|
local $Log::Log4perl::caller_depth = $Log::Log4perl::caller_depth + 1; |
|
60
|
|
|
|
|
|
|
__PACKAGE__->log->warn( @_ ); |
|
61
|
|
|
|
|
|
|
}; |
|
62
|
|
|
|
|
|
|
|
|
63
|
11
|
|
|
11
|
|
8251
|
use Catalyst::Engine; |
|
|
11
|
|
|
|
|
1266160
|
|
|
|
11
|
|
|
|
|
439
|
|
|
64
|
11
|
|
|
11
|
|
5388
|
use Catalyst::DispatchType::Regex; |
|
|
11
|
|
|
|
|
763291
|
|
|
|
11
|
|
|
|
|
2353
|
|
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
# Configure plugins |
|
67
|
|
|
|
|
|
|
__PACKAGE__->config( |
|
68
|
|
|
|
|
|
|
"Plugin::Static::Simple" => { |
|
69
|
|
|
|
|
|
|
dirs => [ 'tapper/static' ], |
|
70
|
|
|
|
|
|
|
include_path => [ $root_dir ], |
|
71
|
|
|
|
|
|
|
} |
|
72
|
|
|
|
|
|
|
); |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
if ( __PACKAGE__->config->{tapper_config}{web}{use_authentication} ) { |
|
75
|
|
|
|
|
|
|
__PACKAGE__->config( |
|
76
|
|
|
|
|
|
|
"Plugin::Authentication" => { |
|
77
|
|
|
|
|
|
|
realms => { |
|
78
|
|
|
|
|
|
|
default => { |
|
79
|
|
|
|
|
|
|
credential => { |
|
80
|
|
|
|
|
|
|
class => 'Authen::Simple', |
|
81
|
|
|
|
|
|
|
authen => [{ |
|
82
|
|
|
|
|
|
|
class => 'PAM', |
|
83
|
|
|
|
|
|
|
args => { |
|
84
|
|
|
|
|
|
|
service => 'login' |
|
85
|
|
|
|
|
|
|
} |
|
86
|
|
|
|
|
|
|
}] |
|
87
|
|
|
|
|
|
|
} |
|
88
|
|
|
|
|
|
|
} |
|
89
|
|
|
|
|
|
|
} |
|
90
|
|
|
|
|
|
|
} |
|
91
|
|
|
|
|
|
|
); |
|
92
|
|
|
|
|
|
|
} |
|
93
|
|
|
|
|
|
|
__PACKAGE__->config( 'Controller::HTML::FormFu' => { |
|
94
|
|
|
|
|
|
|
constructor => { |
|
95
|
|
|
|
|
|
|
config_file_path => [ "$root_dir/forms", 'root/forms/' ], |
|
96
|
|
|
|
|
|
|
}, |
|
97
|
|
|
|
|
|
|
}); |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
my @plugins = qw( |
|
100
|
|
|
|
|
|
|
Redirect |
|
101
|
|
|
|
|
|
|
ConfigLoader |
|
102
|
|
|
|
|
|
|
Static::Simple Session |
|
103
|
|
|
|
|
|
|
Session::State::Cookie |
|
104
|
|
|
|
|
|
|
Session::Store::File |
|
105
|
|
|
|
|
|
|
); |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
if ( __PACKAGE__->config->{use_authentication} ) { |
|
108
|
|
|
|
|
|
|
push @plugins, "Authentication"; |
|
109
|
|
|
|
|
|
|
} |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
# Start the application |
|
112
|
|
|
|
|
|
|
__PACKAGE__->setup(@plugins); |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
1; |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
__END__ |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=pod |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=encoding UTF-8 |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head1 NAME |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Tapper::Reports::Web - Tapper - Frontend web application based on Catalyst |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head1 AUTHORS |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=over 4 |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=item * |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
AMD OSRC Tapper Team <tapper@amd64.org> |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=item * |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
Tapper Team <tapper-ops@amazon.com> |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=back |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
This software is Copyright (c) 2020 by Advanced Micro Devices, Inc.. |
|
143
|
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
This is free software, licensed under: |
|
145
|
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
The (two-clause) FreeBSD License |
|
147
|
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=cut |