wiki-plugin-hitchhiker 0.3.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -39,24 +39,20 @@ surface. It installs:
39
39
  - **Page-flag drop target** — drop a URL / link / page-flag onto a flag: the favicon shows
40
40
  a loud pulsing highlight; on drop it opens a ghost **preview card** (see the server below).
41
41
 
42
- ## 3. Server component (`server/server.js`, ESM)
43
- `GET /system/unfurl.json?url=…` → a normalized **static** link-preview card.
44
- Since 0.3.0 the two extractor libraries are **imported on first request, not at
45
- start-up** — they cost about 14 MB of heap together, and a host that never
46
- unfurls should never pay it. Start-up cost of this server is now under 1 MB.
47
- `{ url, title, description, provider, author, type, image, favicon, source }`.
48
- - oEmbed metadata first (`@extractus/oembed-extractor`), OpenGraph/Twitter/JSON-LD fallback
49
- (`open-graph-scraper`). Metadata only — never the oEmbed HTML embed (no live third-party
50
- iframes/scripts).
51
- - The thumbnail is fetched **server-side and inlined as a `data:` URI**, so the card makes
52
- zero client→provider requests.
53
- - **SSRF-guarded**: public `http`/`https` only; private/loopback/link-local ranges and
54
- `*.localhost`/`.local`/`.internal` refused before any fetch. 30-min in-memory cache.
55
- Never throws — returns a minimal fallback card offline/on error.
42
+ ## 3. Server component (`server/server.js`, ESM) — two tiny routes, no dependencies
43
+ - `GET /system/farm-domains.json` → `{ local: [...], public: [...] }` — which domains this farm serves.
44
+ - `GET /system/outposts.json` → `{ unfurl: ["http://mini.private.fish", …] }` — which **Outposts** the
45
+ browser may ask for link previews. Read from `{status}/outpost.json` per site (wins), else the
46
+ `OUTPOST_URL` env (comma-separated), else `[]`. Cached by mtime; no restart to change.
56
47
 
57
- > ⚠️ **Private-farm only for now.** Before any public-farm deployment, harden the SSRF guard
58
- > against redirect-following (the extractor libs do their own fetch and may follow redirects
59
- > to internal hosts) and tighten image caps.
48
+ **Since 0.4.0 this plugin does no unfurling.** The link-preview builder — the two heavy extractor
49
+ libraries, ~14 MB of heap — is `wiki-plugin-unfurl`, installed on one well-resourced host (an
50
+ Outpost). `wiki-ux.js` calls that host **directly from the browser** (its route sets
51
+ `Access-Control-Allow-Origin: *`; a plain GET is a simple request, no preflight), shuffling the
52
+ list and trying each with a 2 s timeout. No Outpost, or none answering, means the drop report
53
+ renders without a card. Nothing logs. Absence is a normal state.
54
+
55
+ The list shape is deliberate: swapping the source for a DNS-SD SRV lookup later is one function.
60
56
 
61
57
  ## Install / build
62
58
  ```sh