line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tapper::Reports::Web; |
2
|
|
|
|
|
|
|
# git description: v5.0.13-29-g8e7d44c |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TAPPER'; |
5
|
|
|
|
|
|
|
# ABSTRACT: Tapper - Frontend web application based on Catalyst |
6
|
|
|
|
|
|
|
$Tapper::Reports::Web::VERSION = '5.0.14'; |
7
|
10
|
|
|
10
|
|
35875291
|
use 5.010; |
|
10
|
|
|
|
|
116
|
|
8
|
10
|
|
|
10
|
|
67
|
use strict; |
|
10
|
|
|
|
|
21
|
|
|
10
|
|
|
|
|
253
|
|
9
|
10
|
|
|
10
|
|
54
|
use warnings; |
|
10
|
|
|
|
|
24
|
|
|
10
|
|
|
|
|
334
|
|
10
|
|
|
|
|
|
|
|
11
|
10
|
|
|
10
|
|
616
|
use Moose; |
|
10
|
|
|
|
|
525195
|
|
|
10
|
|
|
|
|
108
|
|
12
|
10
|
|
|
10
|
|
79095
|
use Catalyst::Runtime; |
|
10
|
|
|
|
|
1802
|
|
|
10
|
|
|
|
|
469
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
extends 'Catalyst'; |
15
|
|
|
|
|
|
|
with 'Tapper::Reports::Web::Role::BehaviourModifications::Path'; |
16
|
|
|
|
|
|
|
|
17
|
10
|
|
|
10
|
|
2537
|
use File::ShareDir ':ALL'; |
|
10
|
|
|
|
|
103600
|
|
|
10
|
|
|
|
|
1742
|
|
18
|
10
|
|
|
10
|
|
93
|
use Cwd; |
|
10
|
|
|
|
|
23
|
|
|
10
|
|
|
|
|
687
|
|
19
|
10
|
|
|
10
|
|
2363
|
use Tapper::Config; |
|
10
|
|
|
|
|
108205
|
|
|
10
|
|
|
|
|
369
|
|
20
|
10
|
|
|
10
|
|
4848
|
use Log::Log4perl::Catalyst; |
|
10
|
|
|
|
|
509347
|
|
|
10
|
|
|
|
|
1761
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my $hr_subconfig; |
23
|
|
|
|
|
|
|
my $s_log4perl_config; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
BEGIN { |
26
|
|
|
|
|
|
|
|
27
|
10
|
|
|
10
|
|
1528
|
$hr_subconfig = Tapper::Config->subconfig; |
28
|
|
|
|
|
|
|
|
29
|
10
|
50
|
|
|
|
580
|
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
|
10
|
|
|
|
|
38
|
$s_log4perl_config = do { local $/; <$fh_log4perl_config> }; |
|
10
|
|
|
|
|
67
|
|
|
10
|
|
|
|
|
876
|
|
31
|
10
|
50
|
|
|
|
180
|
close $fh_log4perl_config or die "Unable to close log4perl configuration: $!"; |
32
|
|
|
|
|
|
|
|
33
|
10
|
|
|
|
|
143
|
my ( $s_error_log_file ) = $s_log4perl_config =~ /^log4perl.appender.AppError.filename\s*=\s*(.+)$/m; |
34
|
|
|
|
|
|
|
|
35
|
10
|
|
|
10
|
|
5643
|
use CGI::Carp qw( carpout ); |
|
10
|
|
|
|
|
28756
|
|
|
10
|
|
|
|
|
66
|
|
36
|
10
|
50
|
|
|
|
600
|
open( my $fh_log, '>>', $s_error_log_file ) or die ( "Unable to open log file while compiling: $!\n" ); |
37
|
10
|
|
|
|
|
69
|
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
|
10
|
|
|
10
|
|
8466
|
use Catalyst::Engine; |
|
10
|
|
|
|
|
1176697
|
|
|
10
|
|
|
|
|
471
|
|
64
|
10
|
|
|
10
|
|
5703
|
use Catalyst::DispatchType::Regex; |
|
10
|
|
|
|
|
758647
|
|
|
10
|
|
|
|
|
2506
|
|
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) 2019 by Advanced Micro Devices, Inc.. |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
This is free software, licensed under: |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
The (two-clause) FreeBSD License |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=cut |