Commit graph

12 commits

Author SHA1 Message Date
Théo Lebrun
a776fff7ae static/style.css: update normalize.css from v7.0.0 to v8.0.1
Project homepage:
https://necolas.github.io/normalize.css/

Changelog:
https://github.com/necolas/normalize.css/blob/master/CHANGELOG.md

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2024-11-06 15:33:13 +01:00
Théo Lebrun
6356cdc3c7 static: embed all CSS files into /static/style.css
Avoid many tiny requests. The issue is that browsers have a limited
amount of concurrent requests they can make. We do 19 for
loading /linux/v6.11.6/source. Reduce that to 14.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
2024-11-06 15:00:41 +01:00
Franciszek Stachura
4779965e0f Fix styles for latest version of Pygments
Pygments 2.12.0 slightly changed the order of HTML elements which
makes line numbers look weird with current CSS styles.

Quoting changelog:
> When linenos=table is used, the <table> itself is now wrapped
> with a <div class="highlight"> tag instead of placing it
> inside the <td class="code"> cell (#632.) With this change,
> the output matches the documented behavior.

https://pygments.org/docs/changelog/#version-2-12-0
Related issue: https://github.com/pygments/pygments/issues/632

This commit aims to fix this by further restricting CSS selectors
that selected everything under .highlight to only select source code
related elements - descendants of .code in the new layout.

This was also tested on Pygemnts 2.14.0, version currently packaged
for Debian Bookworm
https://packages.debian.org/bookworm/armel/python3-pygments
2024-11-05 23:20:51 +01:00
Franciszek Stachura
46254c4a90 web: Add error details for bug reports 2024-09-30 12:00:53 +02:00
Franciszek Stachura
5aca2d51e5 web: Improve error page
Add some useful links, including a link to a pre-filled bug report form
2024-09-30 12:00:53 +02:00
Franciszek Stachura
c8d088834d web: Make mobile sidebar state separate
...from desktop sidebar state.

Fixes #331
2024-09-20 14:33:01 +02:00
Franciszek Stachura
30933fea6a web: Highlight whole lines of code 2024-09-11 11:48:27 +02:00
Franciszek Stachura
3b4bcd852a web: Add javascript based range links
Click line anchor and another line anchor holding shift to
make a link to a range.
2024-09-11 11:48:27 +02:00
Franciszek Stachura
0e9ff63c15 web: Save sidebar state in local storage 2024-09-11 11:13:16 +02:00
Franciszek Stachura
ec37680f04 web: Add ability to hide sidebar on desktop layout
The sidebar is hidden by default
2024-09-11 11:13:13 +02:00
Franciszek Stachura
8c5e12fffd Add support for 'raw' parameter for source files
This parameter makes the server return a response with raw file
contents and headers that cause the browser to show a 'save as' dialog.

Regarding Content-Security-Policy:

https://www.w3.org/TR/CSP2/#sandbox-usage

> For example, a message board or email system might provide downloads of
> arbitrary attachments provided by other users. Attacks that rely on tricking
> a client into rendering one of these attachments could be mitigated by
> requesting that resources only be rendered in a very restrictive sandbox.
> Sending the sandbox directive with an empty value establishes such an
> environment:
>
> Content-Security-Policy: sandbox

https://www.w3.org/TR/CSP2/#directive-default-src

> Given this behavior, one good way of building a policy for a site would be to
> begin with a default-src of 'none', and to build up a policy from there that
> contains only those resource types which are actually in use for the page
> you’d like to protect. If you don’t use webfonts, for instance, there’s no
> reason to specify a source list for font-src; specifying only those resource
> types a page uses ensures that the possible attack surface for that page
> remains as small as possible.

https://cheatsheetseries.owasp.org/cheatsheets/Content_Security_Policy_Cheat_Sheet.html#defense-in-depth

> A strong CSP provides an effective second layer of protection against various
> types of vulnerabilities, especially XSS. Although CSP doesn't prevent web
> applications from containing vulnerabilities, it can make those
> vulnerabilities significantly more difficult for an attacker to exploit.

The idea is to prevent the browser from loading any external resources, if it
turned out it's possible to trick it into interpreting a file as HTML.
2024-09-05 14:12:53 +02:00
Franciszek Stachura
9e18f26aeb Restructure Elixir to avoid Python path hacks
* Move static files from http to a new directory
2024-08-27 11:33:18 +02:00
Renamed from http/style.css (Browse further)