Skip to content

prerender-v0.8.0 — @harperfast/prerender

Choose a tag to compare

@harper-joseph harper-joseph released this 27 Jul 18:47
8ad4cf2

Management API + UI, and cluster-wide render-queue control (PR #31).

Management UI — /prerender_admin

A single self-contained page (no build step, no external requests) plus the JSON API behind it. Authenticated with Harper users via context.login(); every data/action route requires super_user. No new secret to configure.

  • Overview — per-node queue status with staleness, table counts, due-now backlog, and a next-24h nextRenderTime histogram (flat = jitter working, one tall bar = render herd).
  • URL explainer — matched ingress route, selected query allowlist, canonical URL, cache key, and the live RenderTarget/RenderSchedule/PrerenderedPage/NonIndexable rows under it. Flags when the key differs from the one the global url.queryParams would produce — the fingerprint of a permanent cache miss from a missing/misordered route — and surfaces a NonIndexable suppression, which otherwise drops a URL from rotation silently.
  • Config — effective merge with secrets reduced to a presence marker, plus the risky-config warnings that previously existed only as startup log lines.

Requires authentication.enableSessions: true (Harper default). Note authorizeLocal: true (also default) auto-authorizes localhost as super-user. Disable with management.enabled: false.

Cluster-wide queue control

New replicated QueueControl table holds the desired pause state; QueueStatus remains the observed status.

  • Scope all = cluster default; scope <hostname> = per-node override, winning in both directions (paused: false keeps one node running through a cluster-wide pause; delete the row to inherit again).
  • claim reads a node-local, non-replicated flag, so each node resolves the intent on its own tick: a change converges within one queue.statusSyncInterval (default 1m), not instantly.
  • POST /render_queue/pause stays deliberately node-scoped — it enforces no auth of its own, so it must not be able to stop the whole fleet.

Notes

  • Overview counts are capped/estimated by design (management.scanCap, default 20 000; getRecordCount's estimatedRange) — an exact range count over 1M+ targets is not a page-load query.
  • The admin path is excluded from bot routing, so a broad forwarded-mode prefix route can't shadow the UI.
  • New config block: management: { enabled, scanCap }.

Compatible with any @harperfast/prerender-browser; nothing in the render protocol changed.