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 +13 -17
- package/client/wiki-ux.js +23 -1754
- package/client/wiki-ux.js.map +7 -0
- package/package.json +8 -7
- package/pages/about-hitchhiker-plugin +16 -0
- package/server/server.js +45 -222
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/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|