Repository navigation
Ship python3 for PDF import; build public URLs from the site URL - #10
Merged
Merged
Conversation
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>
ThreatCrush Security Scan0 finding(s) No findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two bugs.
PDF import needs python3, which the image never had.
lib/recipe/store.tsconverts a PDF on first request viapython3 scripts/pdf-to-markdown.py(imports only stdlib + pypdf). The runtime stage now installspython3+python3-pypdffrom 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) asRECIPE_PDF_DIR,GET /api/v1/recipes/bacon-pasta/markdownconverted it fresh (new-md/*.mdon 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/recipesand the purchase/upload/logout redirects usedrequest.url, which behind the standalone server ishttp://0.0.0.0:8080. Newlib/site-url.tsreadsSITE_URL/NEXT_PUBLIC_SITE_URL(already used by the crawl gateway) thenAPP_URL/NEXT_PUBLIC_APP_URL(set on dev2), defaulthttps://recipepdfs.com, via a non-literal key so Next does not inline it. Test intests/contract/site-url.test.ts.🤖 Generated with Claude Code