Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e8d4dbd
Apply security policy in Caddy
joostfarla Apr 30, 2025
77a50b1
Remove inline styles
joostfarla Apr 30, 2025
9e59474
Allow data URLs for images
joostfarla Apr 30, 2025
166e77e
Minor CSP improvements
joostfarla Apr 30, 2025
bf4fe42
Add style hashes for rijkshuisstijl
joostfarla Apr 30, 2025
25b404b
Merge branch 'main' of github.com:developer-overheid-nl/don-site into…
joostfarla Apr 30, 2025
7381119
Update style hashes
joostfarla Apr 30, 2025
250d7e8
Generate static assets for Mermaid diagrams
joostfarla May 1, 2025
f326440
Merge branch 'main' of github.com:developer-overheid-nl/don-site into…
joostfarla May 1, 2025
0eeaf1b
Separate CSS components
joostfarla May 1, 2025
f793aea
Fix CSS
joostfarla May 1, 2025
9da5dfb
SiteLogo component
joostfarla May 1, 2025
524999f
Cleanup + media queries
joostfarla May 1, 2025
a9817ac
Caddyfile formatting
joostfarla May 1, 2025
24dd8b3
Docfix
joostfarla May 1, 2025
7d822b0
Readme + dependency check
joostfarla May 7, 2025
9479c2a
Move mermaid folder
joostfarla May 7, 2025
b39e13b
Merge branch 'main' of github.com:developer-overheid-nl/don-site into…
joostfarla May 7, 2025
67bd551
Merge branch 'main' into csp
Jul 2, 2025
6600378
Merge branch 'main' into csp
Jul 2, 2025
b1c5a0c
Moar shas and goatcounter in csp
Jul 3, 2025
f110edd
patched docusaurus for csp fix
Jul 3, 2025
bd82dab
Merge branch 'main' into csp
Jul 10, 2025
38d9f9f
Added url and changed some urls to relative urls
Jul 10, 2025
589450f
Added search url to connect-src
Jul 10, 2025
b052132
Test if `<BrowserOnly>` code blocks fix CSP issues
Jul 10, 2025
2fd5d94
fix: remove inline styling for Grid component
tomootes Jul 15, 2025
e5cb49c
config: add youtube as allowed frame source
tomootes Sep 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 30 additions & 13 deletions Caddyfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,35 @@

{
auto_https off
auto_https off
}

:3000 {
root * /var/docusaurus
encode gzip
try_files {path} {path}/index.html
handle_errors 404 {
rewrite * /404.html
file_server
}
file_server
header -Server
header /blog/feed.json Cache-Control "no-cache"
header /agenda/events.json Cache-Control "no-cache"
root * /var/docusaurus
encode gzip
try_files {path} {path}/index.html
handle_errors 404 {
rewrite * /404.html
file_server
}
file_server
header -Server

# Caching policy
header /blog/feed.json Cache-Control "no-cache"
header /agenda/events.json Cache-Control "no-cache"

# Security policy
header {
Content-Security-Policy "
default-src 'self';
script-src 'self' 'sha256-B3XU3apKRxGUkcZIC2hb7S3n+DLs/vKwgVEnWv1EzR0=' 'sha256-pBkmluod9Ko4GzDfbWgKM/wxzujFXUdGVOePkwOQT+c=' https://gc.zgo.at/count.js;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wellicht is het nuttig om de count.js zelf te hosten? Dan wel gebruik te maken van de rijksoverheid piwik? Zelfde geld natuurlijk voor de connect-src stanza hieronder en in het algemeen voor goatcounter ipv piwik.

connect-src 'self' https://search.developer.overheid.nl https://donv1.goatcounter.com;
img-src 'self' data: https://www.geonovum.nl https://social.overheid.nl https://github.com https://avatars.githubusercontent.com https://hostux.social https://i.vimeocdn.com https://www.toegankelijkheidsverklaring.nl;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Door github.com in je CSP te zetten verzwak je de sterke ervan, gezien github best 'world-writable' is. Al is dat voor afbeeldingen minder spannend dan voor andere zaken.

style-src 'self' 'sha256-biLFinpqYMtWHmXfkA1BPeCY0/fNt46SAZ+BBk5YUog=' 'sha256-DPptftRbDC0ow/ZdJW8fpmEcrpsn75dOuGlyzJJwTgc=' 'sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=';
frame-src https://player.vimeo.com youtube.com www.youtube.com;"
Cross-Origin-Opener-Policy: "same-origin"
Cross-Origin-Resource-Policy: "same-site"
Referrer-Policy: "strict-origin-when-cross-origin"
X-Content-Type-Options: "nosniff"
X-Frame-Options: "DENY"
}
}
11 changes: 10 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
FROM node:lts AS base
## Disable colour output from yarn to make logs easier to read.
ENV FORCE_COLOR=0
## Install Chromium for Puppeteer
RUN apt-get update && apt-get install -y --no-install-recommends \
chromium \
&& rm -rf /var/lib/apt/lists/*
# Puppeteer settings
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
## Update Corepack
RUN npm install -g corepack@latest
## Enable corepack.
Expand Down Expand Up @@ -40,7 +47,9 @@ EXPOSE 3000
CMD ["pnpm", "serve", "--host", "0.0.0.0", "--no-open"]

# Stage 3b: Serve with Caddy.
FROM caddy:2.9.1-alpine AS caddy
FROM caddy:2.10.0-alpine AS caddy
## Expose the port that Caddy will run on.
EXPOSE 3000
## Copy the Caddyfile.
COPY --from=prod /opt/docusaurus/Caddyfile /etc/caddy/Caddyfile
## Copy the Docusaurus build output.
Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Wil je bijdragen aan onze kennisbank, blog en of website. Op de pagina [Bijdrage

### Contact

Neem contact op met ons via een bericht op ons [Slack kanaal](https://codefornl.slack.com/archives/CFV4B3XE2) of stuur een e-mail naar developer.overheid@geonovum.nl. Dan kijken we samen hoe we je bijdrage kunnen vormgeven.
Neem contact op met ons via een bericht op ons [Slack kanaal](https://codefornl.slack.com/archives/CFV4B3XE2) of stuur een e-mail naar <developer.overheid@geonovum.nl>. Dan kijken we samen hoe we je bijdrage kunnen vormgeven.

## Lokaal draaien van de website

Expand All @@ -19,14 +19,19 @@ Daarna kan je de website lokaal draaien.
1. Draai `pnpm install` om te zorgen dat alle afhankelijkheden die Docusaurus nodig heeft beschikbaar zijn
1. Draai `pnpm run start` om te builden en Docusaurus te starten.

Daarna kan je de lokale versie van de site bekijken op `http://localhost:3000/`.
Daarna kan je de lokale versie van de site bekijken op `http://localhost:3000/`.
Maak je aanpassingen aan de design tokens, draai `pnpm run build` om de CSS te builden.

Werk je op Windows (WSL) en wil je Mermaid-diagrammen lokaal laten renderen, dan dien je de volgende instructies te volgen:
<https://pptr.dev/troubleshooting#running-puppeteer-on-wsl-windows-subsystem-for-linux>

## WCAG pnpm script

Het `pnpm run lint:wcag` script vereist extra dependencies die niet in de `package.json` staan om het aantal dependencies beperkt te houden.

### Installatie dependencies

Voer eerst de stappen uit zoals beschreven in `.github/workflows/check-wcag.yml`. Draai daarna:

``` bash
pnpm run lint:wcag
pnpm run lint:wcag
10 changes: 5 additions & 5 deletions blog/authors.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
joost-farla:
name: Joost Farla
title: Implementatie ondersteuner - developer.overheid.nl
image_url: https://developer.overheid.nl/img/team/joost-farla.jpg
image_url: /img/team/joost-farla.jpg
page: true
socials:
linkedin: joostfarla
Expand Down Expand Up @@ -30,7 +30,7 @@ matthijs-hovestad:
tom-ootes:
name: Tom Ootes
title: Developer Advocate - developer.overheid.nl
image_url: https://developer.overheid.nl/img/team/tom-ootes.png
image_url: /img/team/tom-ootes.png
page: true
socials:
linkedin: tootes
Expand All @@ -49,7 +49,7 @@ martin-van-der-plas:
frank-terpstra:
name: Frank Terpstra
title: Implementatie ondersteuner - developer.overheid.nl
image_url: https://developer.overheid.nl/img/team/frank-terpstra.jpg
image_url: /img/team/frank-terpstra.jpg
page: true
socials:
linkedin: frank-terpstra-1bb5096
Expand All @@ -58,7 +58,7 @@ frank-terpstra:
jaap-hein-wester:
name: Jaap-Hein Wester
title: Senior Frontend Developer - developer.overheid.nl
image_url: https://developer.overheid.nl/img/team/jaap-hein-wester.jpg
image_url: /img/team/jaap-hein-wester.jpg
page: true
socials:
linkedin: jaapheinwester
Expand All @@ -78,7 +78,7 @@ digilab:
kennisplatform-apis:
name: Kennisplatform API's
title: Strategische en tactische vraagstukken rond het ontwikkelen van API's
image_url: https://developer.overheid.nl/static/images/logo_icon_kpa.1787d5b5302a.png
image_url: /img/logo_icon_kpa.1787d5b5302a.png
page: true
socials:
apigov: https://apigov.nl
Expand Down
45 changes: 15 additions & 30 deletions docusaurus.config.ts

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "npm-run-all start:*",
"start:docusaurus": "docusaurus start",
"build": "npm-run-all build:*",
"build:docusaurus": "docusaurus build",
"build:docusaurus": "docusaurus build && cp -rf .docusaurus/mermaid/* build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
Expand All @@ -31,17 +31,22 @@
"clsx": "^2.1.1",
"docusaurus-theme-search-typesense": "0.24.0",
"focus-trap-react": "^11.0.4",
"mermaid": "^11.6.0",
"prism-react-renderer": "^2.4.1",
"puppeteer": "^24.7.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"remark-directive-sugar": "^1.0.0",
"typesense-instantsearch-adapter": "^2.9.0"
"typesense-instantsearch-adapter": "^2.9.0",
"unified": "^11.0.5",
"unist-util-visit": "^5.0.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.8.0",
"@docusaurus/tsconfig": "3.8.0",
"@docusaurus/types": "3.8.0",
"@rijkshuisstijl-community/design-tokens": "1.2.0",
"@types/hast": "^3.0.4",
"npm-run-all": "^4.1.5",
"typescript": "~5.8.3"
},
Expand All @@ -63,7 +68,8 @@
"packageManager": "pnpm@9.15.0+sha512.76e2379760a4328ec4415815bcd6628dee727af3779aaa4c914e3944156c4299921a89f976381ee107d41f12cfa4b66681ca9c718f0668fa0831ed4c6d8ba56c",
"pnpm": {
"patchedDependencies": {
"@rijkshuisstijl-community/components-react@1.1.0": "patches/@rijkshuisstijl-community__components-react@1.1.0.patch"
"@rijkshuisstijl-community/components-react@1.1.0": "patches/@rijkshuisstijl-community__components-react@1.1.0.patch",
"@docusaurus/theme-classic": "patches/@docusaurus__theme-classic.patch"
}
}
}
13 changes: 13 additions & 0 deletions patches/@docusaurus__theme-classic.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/lib/index.js b/lib/index.js
index 5aecec76fc6f8f1e9b433c31d6b690da706b6abc..82c9294f808e7277a6717cec86ad1b3f6766ab1c 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -90,7 +90,7 @@ function themeClassic(context, options) {
tagName: 'svg',
attributes: {
xmlns: 'http://www.w3.org/2000/svg',
- style: 'display: none;',
+ class: 'hidden',
},
innerHTML: inlineSvgSprites_1.SvgSpriteDefs,
},
Loading