Skip to content

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 26 Nov 18:59
· 155 commits to main since this release
7f5af61

Initial release: the cherrypi-fetch library and CLI, moved out of CherryPi's
crates/servo-fetch into their own crate.

Added

  • cherrypi-fetch as a library and as a cherrypi-fetch command. The API is
    render_page, with a process-wide configure for the User-Agent and a
    shutdown_renderer for a clean exit.
  • The renderer behaviour that lived in CherryPi:
    • same-origin GET requests from scripts (XHR and fetch) are proxied
      through reqwest with an 8-second timeout; other requests are left to
      Servo. A render that still stalls ends at its timeout: it is returned as
      incomplete if it captured some text, or fails (ok:false, exit 1) if it
      captured none;
    • cookies, local and session storage and the HTTP cache are cleared before
      every render, so one bot block cannot poison the next;
    • a configurable User-Agent, defaulting to Windows Firefox, because some
      sites never answer a desktop Linux user agent;
    • snapshots that are discarded when a navigation starts, so text from an
      earlier document does not leak through;
    • one Servo instance per process, on its own thread, ended by
      shutdown_renderer;
    • timeouts bounded to 1–600 seconds; --max-chars truncates text on
      request.
  • Page titles and text are stripped of C0 and C1 control characters other
    than newline and tab, and of the bidi overrides and isolates, so a page
    cannot inject terminal escapes or reorder a caller's output.
  • CLI --json records and exit codes: 0 when every page rendered fully, 1
    when at least one failed (even if others were incomplete) or the arguments
    were bad, 2 when at least one was incomplete and none failed.