-$Apache2::AuthzCaps::rootdir = $Apache2::Authen::Passphrase::rootdir;
-my $word = qr,(\w+),a;
-my $db = Gruntmaster::Data->connect('dbi:Pg:');
-
-sub debug {
- local $Log::Log4perl::caller_depth = $Log::Log4perl::caller_depth + 1;
- $_[0]->{'psgix.logger'}->({qw/level debug message/ => $_[1]})
-}
-
-sub some_auth_required {
- my $r = Plack::Request->new($_[0]);
- return 1 if $_[0]->{'gruntmaster.reqadmin'} || $r->path eq '/action/passwd' || $r->path eq '/submit';
- return 1 if $r->path =~ m,^/ct/$word/pb/$word, && time < $db->contest($1)->stop;
- ''
+sub CONTENT_SECURITY_POLICY () {
+ my $csp = <<CSP;
+default-src 'none'
+connect-src 'self'
+form-action 'self'
+frame-ancestors 'none'
+img-src 'self' https://static.mindcoding.ro https://www.google-analytics.com/collect
+referrer origin-when-cross-origin
+script-src https://static.mindcoding.ro/static/js.js https://www.google-analytics.com/analytics.js
+style-src https://static.mindcoding.ro/static/css/
+CSP
+ chomp $csp;
+ $csp =~ s/\n/; /gr;