List for cgit developers and users
 help / color / mirror / Atom feed
From: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
To: Mateja Maric <mail@matejamaric.com>
Cc: cgit@lists.zx2c4.com
Subject: Re: Syntax highlighting issue
Date: Wed, 26 Aug 2020 12:11:14 -0400
Message-ID: <20200826161114.p5acwu6ttjhxf6qq@chatter.i7.local> (raw)
In-Reply-To: <12e76570-2455-37c7-2df1-fabb61206afc@matejamaric.com>

On Wed, Aug 26, 2020 at 05:59:06PM +0200, Mateja Maric wrote:
> I use cgit on my server (https://git.matejamaric.com) and syntax
> highlighting doesn't work for some reason.
> 
> My config file is fine (I think) and python-pygments package is installed.
> 
> The weirdest thing is that when I view page source, styling and html span
> tags are there, but code is still not colored for some reason.

If you look at the dev console, you will see the reason:

Refused to apply inline style because it violates the following Content 
Security Policy directive: "default-src 'self'". Either the 
'unsafe-inline' keyword, a hash 
('sha256-icLlI0jX3/L5wqZp69+gNqGNNMcU6bh4T+qqxWv/2as='), or a nonce 
('nonce-...') is required to enable inline execution. Note also that 
'style-src' was not explicitly set, so 'default-src' is used as a 
fallback.

You need to change the Content-Security-Policy header to set style-src 
to allow inline styles. E.g. this is on git.kernel.org:

Content-Security-Policy: default-src 'self'; style-src 'self' 'unsafe-inline'; img-src https:

-K

  reply	other threads:[~2020-08-26 16:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-26 15:59 Mateja Maric
2020-08-26 16:11 ` Konstantin Ryabitsev [this message]
2020-08-26 16:24   ` Mateja Maric

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200826161114.p5acwu6ttjhxf6qq@chatter.i7.local \
    --to=konstantin@linuxfoundation.org \
    --cc=cgit@lists.zx2c4.com \
    --cc=mail@matejamaric.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

List for cgit developers and users

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/cgit

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 cgit cgit/ http://inbox.vuxu.org/cgit \
		cgit@lists.zx2c4.com
	public-inbox-index cgit

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.cgit


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git