Skip to content

fix(image): keep spoofed OS fonts behind a build arg - #108

Merged
germondai merged 2 commits into
devfrom
fix/pr-101-spoofed-fonts-both-images
Sep 3, 2026
Merged

fix(image): keep spoofed OS fonts behind a build arg#108
germondai merged 2 commits into
devfrom
fix/pr-101-spoofed-fonts-both-images

Conversation

@germondai

Copy link
Copy Markdown
Owner

Summary

Replacement for #101 because the maintainer adaptation could not be pushed to the contributor fork.

  • preserves the original contributor commit and authorship
  • adds the same KEEP_SPOOFED_OS_FONTS behavior to apps/api/Dockerfile.baseline
  • keeps the current default image size and behavior unchanged
  • allows both image variants to retain macOS/Windows font bundles with --build-arg KEEP_SPOOFED_OS_FONTS=1

Closes #97.

Verification

  • docker buildx build --check --file apps/api/Dockerfile .
  • docker buildx build --check --file apps/api/Dockerfile.baseline .
  • bun run verify (271 tests)

emandel2630 and others added 2 commits September 1, 2026 08:59
The pool assigns each browser a fingerprint and maps it to Camoufox's os token
(pool.ts: Win32 -> windows, MacIntel -> macos), and Camoufox spoofs that OS's
font list along with it. The image then deleted /opt/camoufox/fonts/{macos,windows},
so any browser that is not spoofing Linux advertises fonts whose files are gone and
renders every glyph as a tofu box. FINGERPRINT_POOL is indexed by browser number, so
browser 0 is always Win32 and browser 1 MacIntel: with a small pool, every screenshot
is affected.

It is invisible from inside the container — the system Liberation fonts are present
and fc-match resolves — so only a rendered pixel shows it. Verified by re-rendering
the same URL with the windows bundle restored: tofu becomes readable text.

Deleting them also leaves the fingerprint self-inconsistent (a Windows UA with no
Windows fonts), which anti-bot vendors grade on.

Default is unchanged, so the published image keeps its current size; build with
--build-arg KEEP_SPOOFED_OS_FONTS=1 (+891MB) when rendered output matters.
@germondai
germondai merged commit ffafc9f into dev Sep 3, 2026
1 check passed
@germondai
germondai deleted the fix/pr-101-spoofed-fonts-both-images branch September 3, 2026 12:46
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.

Dockerfile deletes fonts for the OSes FINGERPRINT_POOL spoofs (tofu rendering + fingerprint inconsistency)

2 participants