fix: self-host fonts (no Google Fonts request) and crates at 0.4.3 #430

Merged
sharang merged 4 commits from fix/self-host-fonts into main 2026-09-30 20:48:02 +00:00
Owner

Privacy fix for v0.4.3: no page, docs page or report makes a request to Google Fonts any more. The platform privacy notice promises no transfer of personal data outside the EU; loading fonts.googleapis.com / fonts.gstatic.com sent every visitor's IP to Google in the US, even before login. Refs platform/portal#65 (privacy release gate 4).

Changes

  • Dashboard: assets/main.css no longer @imports Google Fonts. Geist and Geist Mono (variable woff2, weights 100–900, SIL OFL 1.1 from the npm geist package 1.7.2, license in assets/fonts/OFL-Geist.txt) are embedded in the server and served at /fonts/geist.woff2 and /fonts/geist-mono.woff2 (font/woff2, cached for a week), the same way as the favicon (#429). @font-face rules keep the family names, so no other CSS changes. The paths are outside /api/, so they load before login.
  • Pentest report: the preconnects and the Google Fonts stylesheet are removed. The report now uses a system font stack; the named faces stay first in the stack and are used only where they are installed locally. I chose this over embedding base64 fonts, which would add several hundred KB per report for three families. The PDF render (headless Chrome) also no longer contacts Google. A new test checks that the rendered report has no <link>, @import or external url()/src.
  • Docs site (/docs/ on the dashboard host): the Google Fonts <link>s in config.mts are removed. The same woff2 files are in docs/.vitepress/theme/fonts and are declared in custom.css, and Vite serves them as /docs/assets/Geist-Variable.<hash>.woff2.
  • Version: all crates are at 0.4.3, so /api/v1/platform/version reports 0.4.3.

Verification

  • git grep -nE "googleapis|gstatic": the only matches are the test needles that assert these hosts are absent.
  • No other third-party CDN (jsdelivr, unpkg, cdnjs, etc.) is referenced in anything that reaches a browser.
  • cargo fmt --all --check; clippy -D warnings for compliance-dashboard (server) and compliance-agent; cargo test -p compliance-dashboard --features server (78 passed, including the new the_fonts_are_self_hosted_woff2); cargo test -p compliance-agent --lib pentest::report (44 passed, including the new report_loads_nothing_from_a_third_party).
  • npm run build for the docs: dist/ contains no googleapis/gstatic, and the Geist url()s resolve to /docs/assets/…woff2.

No configuration, secrets or migrations change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB

Privacy fix for v0.4.3: no page, docs page or report makes a request to Google Fonts any more. The platform privacy notice promises no transfer of personal data outside the EU; loading fonts.googleapis.com / fonts.gstatic.com sent every visitor's IP to Google in the US, even before login. Refs platform/portal#65 (privacy release gate 4). ## Changes - **Dashboard**: `assets/main.css` no longer `@import`s Google Fonts. Geist and Geist Mono (variable woff2, weights 100–900, SIL OFL 1.1 from the npm `geist` package 1.7.2, license in `assets/fonts/OFL-Geist.txt`) are embedded in the server and served at `/fonts/geist.woff2` and `/fonts/geist-mono.woff2` (`font/woff2`, cached for a week), the same way as the favicon (#429). `@font-face` rules keep the family names, so no other CSS changes. The paths are outside `/api/`, so they load before login. - **Pentest report**: the preconnects and the Google Fonts stylesheet are removed. The report now uses a **system font stack**; the named faces stay first in the stack and are used only where they are installed locally. I chose this over embedding base64 fonts, which would add several hundred KB per report for three families. The PDF render (headless Chrome) also no longer contacts Google. A new test checks that the rendered report has no `<link>`, `@import` or external `url()`/`src`. - **Docs site** (`/docs/` on the dashboard host): the Google Fonts `<link>`s in `config.mts` are removed. The same woff2 files are in `docs/.vitepress/theme/fonts` and are declared in `custom.css`, and Vite serves them as `/docs/assets/Geist-Variable.<hash>.woff2`. - **Version**: all crates are at 0.4.3, so `/api/v1/platform/version` reports 0.4.3. ## Verification - `git grep -nE "googleapis|gstatic"`: the only matches are the test needles that assert these hosts are absent. - No other third-party CDN (jsdelivr, unpkg, cdnjs, etc.) is referenced in anything that reaches a browser. - `cargo fmt --all --check`; clippy `-D warnings` for compliance-dashboard (server) and compliance-agent; `cargo test -p compliance-dashboard --features server` (78 passed, including the new `the_fonts_are_self_hosted_woff2`); `cargo test -p compliance-agent --lib pentest::report` (44 passed, including the new `report_loads_nothing_from_a_third_party`). - `npm run build` for the docs: `dist/` contains no googleapis/gstatic, and the Geist `url()`s resolve to `/docs/assets/…woff2`. No configuration, secrets or migrations change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
sharang added 4 commits 2026-09-30 20:39:57 +00:00
main.css imported Geist and Geist Mono from fonts.googleapis.com, so
every visitor's browser sent its IP to Google before login. The two
variable woff2 files (SIL OFL 1.1, from the npm `geist` package 1.7.2)
now ship in assets/fonts and the server answers /fonts/geist.woff2 and
/fonts/geist-mono.woff2 like the favicon; main.css declares them with
@font-face (weights 100-900, font-display: swap) under the same family
names, so no other CSS changes.

Refs platform/portal#65 (privacy release gate 4).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
The HTML pentest report linked a Google Fonts stylesheet (Libre
Baskerville, Source Sans 3, JetBrains Mono) plus preconnects, so opening
the report, and rendering it to PDF, contacted Google. The links are
gone; the font variables keep the named faces first (used where
installed) followed by system fallbacks. A test asserts the rendered
report references no external resource.

Refs platform/portal#65 (privacy release gate 4).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
The VitePress config loaded Geist from fonts.googleapis.com on every
docs page (/docs/ on the dashboard host). The woff2 files (OFL 1.1) now
live in the theme and custom.css declares them with @font-face; Vite
fingerprints and serves them under /docs/assets/.

Refs platform/portal#65 (privacy release gate 4).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
chore: crates at version 0.4.3
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 7m30s
6ed7998491
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
sharang merged commit 77164c2050 into main 2026-09-30 20:48:02 +00:00
sharang deleted branch fix/self-host-fonts 2026-09-30 20:48:03 +00:00
Sign in to join this conversation.