]>
iEval git - gruntmaster-page.git/blob - app.psgi
20c8cb56f57a73f3c17f44ce03535e6aff9267bb
6 use Plack
::App
::Gruntmaster
;
11 sub CONTENT_SECURITY_POLICY
() {
16 frame-ancestors 'none'
17 img-src 'self' https://static.mindcoding.ro
18 referrer origin-when-cross-origin
29 dbinit
$ENV{GRUNTMASTER_DSN
} // 'dbi:Pg:' unless db
;
37 my $resp = $app->($_[0]);
38 my $hdrs = Plack
::Util
::headers
($resp->[1]);
39 $hdrs->set('Content-Security-Policy', CONTENT_SECURITY_POLICY
);
40 $hdrs->set('Cache-Control', 'public, max-age=604800') if $_[0]->{PATH_INFO
} =~ qr
,^/static/,;
41 $resp->[1] = $hdrs->headers;
46 Log
::Log4perl
->init_once('log.conf');
47 $ENV{DBIC_NULLABLE_KEY_NOWARN
} = 1;
50 enable_if
{ $_[0]->{PATH_INFO
} eq '/ok' } sub { sub{ [200, [], []] }};
51 enable
'ContentLength';
53 enable
'Static', path
=> qr
,^/static/,;
54 enable
'Log4perl', category
=> 'plack';
55 enable \
&add_database
;
56 enable
'+Plack::App::Gruntmaster::Auth',
57 dbi_connect
=> [$ENV{GRUNTMASTER_DSN
} // 'dbi:Pg:', '', ''],
58 realm
=> 'Gruntmaster 6000',
59 mail_from
=> $ENV{GRUNTMASTER_RESET_FROM
};
60 Plack
::App
::Gruntmaster
->run_if_script
This page took 0.050223 seconds and 4 git commands to generate.