diff options
| -rw-r--r-- | config.toml | 15 | ||||
| -rw-r--r-- | templates/macros/head.html | 8 |
2 files changed, 15 insertions, 8 deletions
diff --git a/config.toml b/config.toml index 4aa6e1c..7b29142 100644 --- a/config.toml +++ b/config.toml @@ -39,11 +39,6 @@ recent_items = 9 footer_credit = true #footer_credit_override = '<p>Powered by <a href="https://www.getzola.org/">Zola</a> & <a href="https://github.com/Jieiku/abridge/">Abridge</a></p>' # <i class="fa-solid fa-heart"></i> -# 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 = '<font color="#f90">A</font>bridge' sitedesc = false # enables or disables the display of the site description below the logo. #copyright_start_year = 2019 # optional @@ -63,6 +58,16 @@ menu_footer = [ {url = "/sitemap.xml", name = "Sitemap", slash = false}, ] +# Security Headers should preferably be set by your webserver (Nginx, Apache) https://observatory.mozilla.org +# 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. +# Comment out either of these meta headers and they wont be used. + +security_header_referrer = "strict-origin-when-cross-origin" + +security_header_csp = "default-src 'none'; frame-ancestors 'none'; base-uri 'self'; manifest-src 'self'; connect-src 'self'; form-action 'self'; font-src 'self' cdn.jsdelivr.net fonts.gstatic.com; style-src 'self' cdn.jsdelivr.net fonts.googleapis.com; object-src 'self'; frame-src 'self' *.youtube.com; img-src 'self' data: cdn.cloudflare.com; script-src 'self' 'unsafe-inline' *.youtube.com maps.gstatic.com *.googleapis.com *.google-analytics.com cdnjs.cloudflare.com" + + ################# # Resource Files diff --git a/templates/macros/head.html b/templates/macros/head.html index 2c18807..6736cd9 100644 --- a/templates/macros/head.html +++ b/templates/macros/head.html @@ -195,9 +195,11 @@ {%- endmacro %} {%- macro security() %} - {%- if config.extra.security_headers %} - <meta name="referrer" content="strict-origin-when-cross-origin">{#- options: no-referrer, same-origin, strict-origin, strict-origin-when-cross-origin #} - <meta http-equiv="Content-Security-Policy" content="default-src 'none'; frame-ancestors 'none'; base-uri 'self'; manifest-src 'self'; connect-src 'self'; form-action 'self'; font-src 'self' cdn.jsdelivr.net fonts.gstatic.com; style-src 'self' cdn.jsdelivr.net fonts.googleapis.com; object-src 'self'; frame-src 'self' *.youtube.com; img-src 'self' data: cdn.cloudflare.com; script-src 'self' 'unsafe-inline' *.youtube.com maps.gstatic.com *.googleapis.com *.google-analytics.com cdnjs.cloudflare.com"> + {%- if config.extra.security_header_referrer %} + <meta name="referrer" content="{{ config.extra.security_header_referrer | safe }}"> + {%- endif %} + {%- if config.extra.security_header_csp %} + <meta http-equiv="Content-Security-Policy" content="{{ config.extra.security_header_csp | safe }}"> {%- endif %} {%- endmacro %} |
