]>
iEval git - gruntmaster-page.git/blob - app.psgi
6 use Plack
::App
::Gruntmaster
;
11 sub CONTENT_SECURITY_POLICY
() {
16 frame-ancestors 'none'
18 referrer origin-when-cross-origin
32 $db //= Gruntmaster
::Data
->connect($ENV{GRUNTMASTER_DSN
} // 'dbi:Pg:');
33 $env->{'gruntmaster.dbic'} = $db;
41 my $resp = $app->($_[0]);
42 my $hdrs = Plack
::Util
::headers
($resp->[1]);
43 $hdrs->set('Content-Security-Policy', CONTENT_SECURITY_POLICY
);
44 $hdrs->set('Link', '</static/cyborg.css>; rel=stylesheet') if $hdrs->get('Content-Type') =~ m
,^text
/html
,;
45 $hdrs->set('Cache-Control', 'public, max-age=604800') if $_[0]->{PATH_INFO
} =~ qr
,^/static/,;
46 $resp->[1] = $hdrs->headers;
51 Log
::Log4perl
->init_once('log.conf');
52 $ENV{DBIC_NULLABLE_KEY_NOWARN
} = 1;
55 enable_if
{ $_[0]->{PATH_INFO
} eq '/ok' } sub { sub{ [200, [], []] }};
56 enable
'ContentLength';
58 enable
'Static', path
=> qr
,^/static/,;
59 enable
'Log4perl', category
=> 'plack';
60 enable \
&add_database
;
61 enable
'+Plack::App::Gruntmaster::Auth',
62 dbi_connect
=> [$ENV{GRUNTMASTER_DSN
} // 'dbi:Pg:', '', ''],
63 realm
=> 'Gruntmaster 6000',
64 mail_from
=> $ENV{GRUNTMASTER_RESET_FROM
};
65 Plack
::App
::Gruntmaster
->run_if_script
This page took 0.059607 seconds and 4 git commands to generate.