line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tapper::Reports::Web; |
2
|
|
|
|
|
|
|
# git description: v5.0.12-7-g5c32af8 |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TAPPER'; |
5
|
|
|
|
|
|
|
# ABSTRACT: Tapper - Frontend web application based on Catalyst |
6
|
|
|
|
|
|
|
$Tapper::Reports::Web::VERSION = '5.0.13'; |
7
|
10
|
|
|
10
|
|
28896411
|
use 5.010; |
|
10
|
|
|
|
|
24
|
|
8
|
10
|
|
|
10
|
|
41
|
use strict; |
|
10
|
|
|
|
|
12
|
|
|
10
|
|
|
|
|
314
|
|
9
|
10
|
|
|
10
|
|
38
|
use warnings; |
|
10
|
|
|
|
|
13
|
|
|
10
|
|
|
|
|
272
|
|
10
|
|
|
|
|
|
|
|
11
|
10
|
|
|
10
|
|
708
|
use Moose; |
|
10
|
|
|
|
|
356527
|
|
|
10
|
|
|
|
|
80
|
|
12
|
10
|
|
|
10
|
|
53097
|
use Catalyst::Runtime; |
|
10
|
|
|
|
|
1431
|
|
|
10
|
|
|
|
|
361
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
extends 'Catalyst'; |
15
|
|
|
|
|
|
|
with 'Tapper::Reports::Web::Role::BehaviourModifications::Path'; |
16
|
|
|
|
|
|
|
|
17
|
10
|
|
|
10
|
|
1960
|
use File::ShareDir ':ALL'; |
|
10
|
|
|
|
|
22952
|
|
|
10
|
|
|
|
|
1570
|
|
18
|
10
|
|
|
10
|
|
54
|
use Cwd; |
|
10
|
|
|
|
|
12
|
|
|
10
|
|
|
|
|
473
|
|
19
|
10
|
|
|
10
|
|
2111
|
use Tapper::Config; |
|
10
|
|
|
|
|
93112
|
|
|
10
|
|
|
|
|
271
|
|
20
|
10
|
|
|
10
|
|
4311
|
use Log::Log4perl::Catalyst; |
|
10
|
|
|
|
|
365078
|
|
|
10
|
|
|
|
|
1323
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my $hr_subconfig; |
23
|
|
|
|
|
|
|
my $s_log4perl_config; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
BEGIN { |
26
|
|
|
|
|
|
|
|
27
|
10
|
|
|
10
|
|
1262
|
$hr_subconfig = Tapper::Config->subconfig; |
28
|
|
|
|
|
|
|
|
29
|
10
|
50
|
|
|
|
427
|
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
|
|
|
|
|
11
|
$s_log4perl_config = do { local $/; <$fh_log4perl_config> }; |
|
10
|
|
|
|
|
39
|
|
|
10
|
|
|
|
|
185
|
|
31
|
10
|
50
|
|
|
|
72
|
close $fh_log4perl_config or die "Unable to close log4perl configuration: $!"; |
32
|
|
|
|
|
|
|
|
33
|
10
|
|
|
|
|
102
|
my ( $s_error_log_file ) = $s_log4perl_config =~ /^log4perl.appender.AppError.filename\s*=\s*(.+)$/m; |
34
|
|
|
|
|
|
|
|
35
|
10
|
|
|
10
|
|
5407
|
use CGI::Carp qw( carpout ); |
|
10
|
|
|
|
|
21376
|
|
|
10
|
|
|
|
|
47
|
|
36
|
10
|
50
|
|
|
|
447
|
open( my $fh_log, '>>', $s_error_log_file ) or die ( "Unable to open log file while compiling: $!\n" ); |
37
|
10
|
|
|
|
|
32
|
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
|
|
6595
|
use Catalyst::Engine; |
|
10
|
|
|
|
|
950456
|
|
|
10
|
|
|
|
|
370
|
|
64
|
10
|
|
|
10
|
|
5630
|
use Catalyst::DispatchType::Regex; |
|
10
|
|
|
|
|
525969
|
|
|
10
|
|
|
|
|
2192
|
|
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) 2017 by Advanced Micro Devices, Inc.. |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
This is free software, licensed under: |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
The (two-clause) FreeBSD License |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=cut |