]>
iEval git - gruntmaster-page.git/blob - app.psgi
3 no if $] >= 5.017011, warnings
=> 'experimental::smartmatch';
6 use Plack
::App
::Gruntmaster
;
11 use constant AUTH_TIMEOUT
=> 5 * 60;
13 sub CONTENT_SECURITY_POLICY
() {
18 frame-ancestors 'none'
20 referrer origin-when-cross-origin
34 $db //= Gruntmaster
::Data
->connect($ENV{GRUNTMASTER_DSN
} // 'dbi:Pg:');
35 $env->{'gruntmaster.dbic'} = $db;
43 my $resp = $app->($_[0]);
44 my $hdrs = Plack
::Util
::headers
($resp->[1]);
45 $hdrs->set('Content-Security-Policy', CONTENT_SECURITY_POLICY
);
46 $hdrs->set('Link', '</static/cyborg.css>; rel=stylesheet') if $hdrs->get('Content-Type') =~ m
,^text
/html
,;
47 $hdrs->set('Cache-Control', 'public, max-age=604800') if $_[0]->{PATH_INFO
} =~ qr
,^/static/,;
48 $resp->[1] = $hdrs->headers;
53 Log
::Log4perl
->init_once('log.conf');
54 $ENV{DBIC_NULLABLE_KEY_NOWARN
} = 1;
57 enable_if
{ $_[0]->{PATH_INFO
} eq '/ok' } sub { sub{ [200, [], []] }};
58 enable
'ContentLength';
60 enable
'Static', path
=> qr
,^/static/,;
61 enable
'Log4perl', category
=> 'plack';
62 enable \
&add_database
;
63 enable
'+Plack::App::Gruntmaster::Auth',
64 dbi_connect
=> [$ENV{GRUNTMASTER_DSN
} // 'dbi:Pg:', '', ''],
65 realm
=> 'Gruntmaster 6000',
66 mail_from
=> $ENV{GRUNTMASTER_RESET_FROM
};
67 Plack
::App
::Gruntmaster
->run_if_script
This page took 0.05542 seconds and 4 git commands to generate.