fix(tradein): camoufox fetch under app-user so runtime finds Firefox (#884) #899

Merged
lekss361 merged 1 commit from fix/884-camoufox-cache-path into main 2026-05-31 13:46:08 +00:00

1 commit

Author SHA1 Message Date
751059cb01 fix(tradein): camoufox fetch under app-user so runtime finds Firefox (#884)
Build-verify on the deploy host (2026-05-31) showed the camoufox Firefox build
landed in /root/.cache/camoufox (RUN python -m camoufox fetch ran as root), but
the runtime app user (uid 1000) resolves the cache to /home/app/.cache/camoufox
→ 'browser not found' the moment scraper_fetch_mode flips to browser.

Fix: run the fetch AFTER USER app + set explicit ENV HOME=/home/app (Docker does
not auto-set HOME from USER, and camoufox/platformdirs keys the cache off $HOME).
Now build-time fetch and runtime both use /home/app/.cache/camoufox.

Verified: A) 'camoufox path' as app = /home/app/.cache/camoufox; B) that dir was
empty pre-fix while /root/.cache was root-only (Permission denied to app).
Dormant change — scraper_fetch_mode default stays curl_cffi (no runtime behavior
change), unblocks Phase 1 (#883).

Refs #884, #883
2026-05-31 16:44:27 +03:00