Skip to content

Ship python3 for PDF import; build public URLs from the site URL - #10

Merged
ralyodio merged 1 commit into
mainfrom
fix/python3-and-site-url
Oct 2, 2026
Merged

ralyodio merged 1 commit into
mainfrom
fix/python3-and-site-url

Conversation

@ralyodio

@ralyodio ralyodio commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Two bugs.

PDF import needs python3, which the image never had. lib/recipe/store.ts converts a PDF on first request via python3 scripts/pdf-to-markdown.py (imports only stdlib + pypdf). The runtime stage now installs python3 + python3-pypdf from Debian with --no-install-recommends (one apt layer, no pip/compiler) and copies the script explicitly.

Proved in the built image: mounted a real PDF (Bacon Pasta Recipe.pdf) as RECIPE_PDF_DIR, GET /api/v1/recipes/bacon-pasta/markdown converted it fresh (new -md/*.md on disk) and returned parsed ingredients. python 3.13.5, pypdf 5.4.0.

Public URLs came from the request host. robots.txt, llms.txt, /pricing, /api/v1/recipes and the purchase/upload/logout redirects used request.url, which behind the standalone server is http://0.0.0.0:8080. New lib/site-url.ts reads SITE_URL / NEXT_PUBLIC_SITE_URL (already used by the crawl gateway) then APP_URL / NEXT_PUBLIC_APP_URL (set on dev2), default https://recipepdfs.com, via a non-literal key so Next does not inline it. Test in tests/contract/site-url.test.ts.

🤖 Generated with Claude Code

PDF conversion runs scripts/pdf-to-markdown.py with python3 + pypdf, and the
runtime image never had either, so every first request for a recipe failed.
Install python3 and Debian's python3-pypdf (no pip, no compiler) and copy the
script into the image explicitly.

robots.txt, llms.txt, /pricing, the recipes index and the purchase, upload
and logout redirects built absolute URLs from request.url, which behind the
standalone server is the bind address (http://0.0.0.0:8080). They now use
lib/site-url.ts: SITE_URL, NEXT_PUBLIC_SITE_URL, APP_URL, NEXT_PUBLIC_APP_URL,
default https://recipepdfs.com.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

ThreatCrush Security Scan

0 finding(s)

No findings.

@ralyodio
ralyodio merged commit 6027431 into main Oct 2, 2026
5 checks passed
@ralyodio
ralyodio deleted the fix/python3-and-site-url branch October 2, 2026 06: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.

1 participant