Skip to content

fix: stop contacting Google Fonts when opening the dashboard - #790

Open
viberaven wants to merge 1 commit into
apotdevin:masterfrom
viberaven:fix/serve-bundled-fonts
Open

viberaven wants to merge 1 commit into
apotdevin:masterfrom
viberaven:fix/serve-bundled-fonts

Conversation

@viberaven

Copy link
Copy Markdown

ThunderHub already bundles Noto Sans Variable and JetBrains Mono Variable through Fontsource. Opening the dashboard still asks fonts.googleapis.com for an extra stylesheet. That request comes from the operator’s browser and can disclose their IP to Google even when they reach the node through an SSH tunnel.

Remove the Google stylesheet and both preconnect hints. Helmet now restricts stylesheet and font downloads to ThunderHub’s own origin. Inline styles and the font data embedded by Vite are still allowed.

Verification

  • Compared the production dashboard before and after the patch in fresh Chromium profiles with external DNS blocked. On v0.19.1, Chromium attempted one Google Fonts stylesheet request. With the patch, it made zero.
  • Used document.fonts.load() to exercise both families. ThunderHub returned HTTP 200 for both Latin WOFF2 files under /assets/ and, with BASE_PATH=/thub, under /thub/assets/.
  • On Node 24.22.1, npm run lint:check, all 167 Jest tests, and npm run build passed.

Original bitcoinix patch

Remove the Google Fonts stylesheet and its preconnect hints. Vite
already bundles Noto Sans and JetBrains Mono through Fontsource, so
opening the dashboard can load both families from the node.

Limit stylesheet and font sources to the dashboard origin, allowing
inline styles and embedded font data.

Assisted-by: OpenAI Codex (GPT-6.2 Astra)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant