wiki-plugin-shortlink
v0.1.0
Published
Federated Wiki - Shortlink Plugin — mint memorable three-word short URLs for wiki lineups, with expiry, single-use, and revocation
Maintainers
Readme
wiki-plugin-shortlink
Memorable short URLs for Federated Wiki lineups — three words drawn from Hitchhiker's Guide lore, in the style of what3words:
http://localhost/plugin/shortlink/towel-frood-zarquon
→ 302 → http://localhost/view/welcome-visitors/plan.localhost/roadmapLinks carry a per-link TTL (1d, 1w, 1m, never), may be single-use
(burned before the redirect is sent), and are revocable from the visible
register — a wiki page carrying the shortlink item, which renders live from
the store and offers copy/revoke/mint buttons.
Shape
- Farm-mounted API (declared via
fedwiki.api, mounted by wiki-plugin-farm):/system/api/shortlink/list.json,expand.json,words.json, and the owner-gatedmint.json/revoke.json. - Plugin server (
server/server.js, CommonJS): the one route the farm mount can't host because it must not end in an extension —GET /plugin/shortlink/{key}. - Client item: the register table.
Store
One machine-global JSON file, ~/.wiki-shortlinks/links.json
(SHORTLINK_STORE overrides; deliberately not per-site — a lineup spans
sites, and with WIKI_EXTRA_FARMS a farm-root-derived path would split the
store). External writers are first-class: edit the file (atomic rename,
please) and the server picks it up by mtime with no restart — this is how the
shortlink-mint skill mints AI-chosen keys.
Words and entropy
server/lore.txt (~230 HHGG words) feeds memorable keys; server/wordlist.txt
(~1700 merged words) feeds uniqueness checks and the uniform random suffix.
Three lore words are memorability, not security (~24 bits). A link minted with
capability=true gets two uniform random words appended (~45 bits total),
and every lookup sits behind a per-IP token bucket plus a global
failed-lookup circuit breaker. Failure responses are identical for
unknown/expired/revoked/used keys.
Test
npm testruns the state logic against a temp store: mint, collision, TTLs, expiry, single-use burn, revoke, mtime re-read, purge.
