3a6be219ec8fe3f4a5a53a714247e9a8dbdcfa22
6 use Plack
::App
::Gruntmaster
;
11 sub CONTENT_SECURITY_POLICY
() {
16 frame-ancestors 'none'
18 referrer origin-when-cross-origin
31 Gruntmaster
::Data
::init
$ENV{GRUNTMASTER_DSN
} // 'dbi:Pg:' unless $dbinit;
40 my $resp = $app->($_[0]);
41 my $hdrs = Plack
::Util
::headers
($resp->[1]);
42 $hdrs->set('Content-Security-Policy', CONTENT_SECURITY_POLICY
);
43 $hdrs->set('Cache-Control', 'public, max-age=604800') if $_[0]->{PATH_INFO
} =~ qr
,^/static/,;
44 $resp->[1] = $hdrs->headers;
49 Log
::Log4perl
->init_once('log.conf');
50 $ENV{DBIC_NULLABLE_KEY_NOWARN
} = 1;
53 enable_if
{ $_[0]->{PATH_INFO
} eq '/ok' } sub { sub{ [200, [], []] }};
54 enable
'ContentLength';
56 enable
'Static', path
=> qr
,^/static/,;
57 enable
'Log4perl', category
=> 'plack';
58 enable \
&add_database
;
59 enable
'+Plack::App::Gruntmaster::Auth',
60 dbi_connect
=> [$ENV{GRUNTMASTER_DSN
} // 'dbi:Pg:', '', ''],
61 realm
=> 'Gruntmaster 6000',
62 mail_from
=> $ENV{GRUNTMASTER_RESET_FROM
};
63 Plack
::App
::Gruntmaster
->run_if_script
This page took 0.026058 seconds and 3 git commands to generate.