Skip to content

Render service, from #777's review: RENDER_FILES checked, contained and keyed - #778

Merged
adamjohnwright merged 1 commit into
mainfrom
render/local-files-2
Nov 2, 2026
Merged

adamjohnwright merged 1 commit into
mainfrom
render/local-files-2

Conversation

@adamjohnwright

Copy link
Copy Markdown
Contributor

Follow-up to #777 (RENDER_FILES), from its review; all of its points were low.

  • Startup check: the service refuses to start (exit 2) when RENDER_FILES is not a directory, rather than failing every render after the full timeout while /health says the files are local. Checked by hand.
  • Links: a link inside the folder is followed only if it stays inside it (realpath).
  • Cache key: includes whether RENDER_FILES is set, so a figure drawn from the download site is never served as one drawn from a release's files, nor the reverse. Keys are unchanged when it is unset.
  • Tests:
    • The route test now runs the predicate and the handler: a download URL matches and a site URL doesn't; a file is fulfilled with its bytes; a missing one is a 404.
    • New escape cases: a sibling folder (98x beside 98) and a link out of the folder.
    • Each was seen failing: the link check removed; the handler continuing instead of fulfilling; the predicate matching everything; both containment checks loosened to the bare prefix.
  • Smaller: an unreachable branch removed. The service's header now lists RENDER_FILES and RENDER_TIMEOUT. The README says what is and is not redirected.

🤖 Generated with Claude Code

…nd keyed

- The service refuses to start when RENDER_FILES is not a directory, rather
  than failing every render after the full timeout.
- A link inside the folder is followed only if it stays inside it (realpath).
- The cache key notes when RENDER_FILES is set, so a figure drawn from the
  download site is never served as one drawn from a release's files.
- The route handler no longer has an unreachable branch, and its test now runs
  the handler and the predicate: a file is fulfilled, a missing one is a 404, a
  site URL is not matched. Escapes to a sibling folder and through a link are
  tested.
- The service's header lists RENDER_FILES and RENDER_TIMEOUT; the README says
  what is and is not redirected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamjohnwright
adamjohnwright merged commit 1c9802f into main Nov 2, 2026
14 of 15 checks passed
@adamjohnwright
adamjohnwright deleted the render/local-files-2 branch November 2, 2026 21:13
adamjohnwright added a commit that referenced this pull request Nov 2, 2026
Render service, from #778's review: RENDER_FILES checked only when started
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