From 92a95518b6649a7ed427d486a41935fbd041a9c2 Mon Sep 17 00:00:00 2001 From: Jieiku Date: Tue, 31 May 2022 01:06:59 -0700 Subject: Security Headers --- config.toml | 17 +++++++++++++---- templates/base.html | 6 +++--- templates/macros/head.html | 8 ++++++++ 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/config.toml b/config.toml index 8aeb578..14f8700 100644 --- a/config.toml +++ b/config.toml @@ -37,7 +37,12 @@ readtime_string = "min" # read time indication eg "min": - 1 min "min read": - recent = true recent_items = 9 footer_credit = true -#footer_credit_override = '
' +#footer_credit_override = '' # + +# Security Headers should preferably be set by your webserver (Nginx, Apache) https://observatory.mozilla.org +# Set this to true if you are unable to load your security headers with your webserver, this will load a couple of them as meta tags. +# There are many other security related headers most of which can only be set by the webserver method. +security_headers = false textlogo = 'Abridge' sitedesc = false # enables or disables the display of the site description below the logo. @@ -67,9 +72,13 @@ js_search_index ="search_index.en.js" js_search = "search.min.js" rss_atom_feed = "atom.xml" stylesheet = "abridge.css" # location and file to use for stylesheet: -# abridge.css - Automatic Dark/Light Theme based on browser/system preference. -# abridge-dark.css - Dark Theme -# abridge-light.css - Light Theme +# abridge.css - Orange Automatic Dark/Light Theme based on browser/system preference. +# abridge-dark.css - Orange Dark Theme +# abridge-light.css - Orange Light Theme +# abridge-blue.scss - Blue Automatic Night/Light Theme based on browser/system preference. +# abridge-bluelight.scss - Blue Light Theme +# abridge-bluenight.scss - Blue Dark Theme + # For externally loaded fonts make sure the include the FULL url including the http/https prefix fonts_load = false diff --git a/templates/base.html b/templates/base.html index 1b396cb..f056486 100644 --- a/templates/base.html +++ b/templates/base.html @@ -18,7 +18,7 @@ {%- endif %} {%- endblock seo %} {{- macros_head::favicons() }} - + {{- macros_head::security() }} @@ -46,9 +46,9 @@ diff --git a/templates/macros/head.html b/templates/macros/head.html index 0107b83..3ea785a 100644 --- a/templates/macros/head.html +++ b/templates/macros/head.html @@ -194,6 +194,14 @@ {#- Extra SEO END #} {%- endmacro %} +{%- macro security() %} + {%- if config.extra.security_headers %} + {#- options: no-referrer, same-origin, strict-origin, strict-origin-when-cross-origin #} + + {%- endif %} +{%- endmacro %} + + {%- macro math() %} {%- if config.extra.katex_enabled %} -- cgit v1.3.1