use Gruntmaster::Data;
use Plack::App::Gruntmaster;
use Plack::Builder;
- use Plack::Request;
use Plack::Util;
- use Digest::SHA qw/sha256/;
use Log::Log4perl;
- use Tie::Hash::Expire;
use constant AUTH_TIMEOUT => 5 * 60;
-use constant ACCESSLOG_FORMAT => 'combined';
+use constant ACCESSLOG_FORMAT => '%{X-Forwarded-For}i %l %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i"';
sub CONTENT_SECURITY_POLICY () {
my $csp = <<CSP;
connect-src 'self'
form-action 'self'
frame-ancestors 'none'
-img-src 'self'
+img-src 'self' https://static.mindcoding.ro https://www.google-analytics.com/collect
referrer origin-when-cross-origin
- script-src https://static.mindcoding.ro/js.js https://www.google-analytics.com/analytics.js
- style-src https://static.mindcoding.ro/css/
-script-src 'self'
-style-src 'self'
++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;
(function(){
'use strict';
function set_style(name){
- $('#stylesheet').attr("href", "https://static.mindcoding.ro/css/" + name + ".css");
- $('#stylesheet').attr("href", "/static/css/" + name + ".css");
++ $('#stylesheet').attr("href", "https://static.mindcoding.ro/static/css/" + name + ".css");
localStorage.setItem("theme", name);
+ $(document).ready(function() {
+ if(name == 'slate' || name == 'cyborg')
+ $('.logo').removeClass('logo-light');
+ else
+ $('.logo').addClass('logo-light');
+ });
}
$( document ).ready(function() {
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" href="https://static.mindcoding.ro/css/slate.css" id="stylesheet">
- <script src="https://static.mindcoding.ro/js.js" type="text/javascript" async defer></script>
-<link rel="stylesheet" href="/static/css/cyborg.css" id="stylesheet">
-<script src="/static/js.js" type="text/javascript" async defer></script>
++<link rel="stylesheet" href="https://static.mindcoding.ro/static/css/cyborg.css" id="stylesheet">
++<script src="https://static.mindcoding.ro/static/js.js" type="text/javascript" async defer></script>
<body>
<nav role="navigation">