~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

No way for a group to publish a website

Closed
Closed chadtmiller.com opened this issue 0 comments

What happened

A group has no way to put up a website. Its handle's address, https://<handle>/, answers only /.well-known/atproto-did, and there is no record, command or MCP tool for publishing pages. Groups want at least a front page that says who they are, and an AI connected over MCP should be able to write and publish it.

The plan

A static site: files, published whole, served as they are. No templates, build step or server-side rendering; a page that wants live data asks the host's public XRPC from the browser.

Record: fyi.opensocial.site, key literal:self, in the group's public repo. Each publish replaces it; deleting it takes the site down.

  • files[] (1-2000): {path, blob, contentType?}, one blob per file (the host is the group's PDS, so no splitting into parts); the blob's CID is its hash, so a republish reuses blobs whose CID matches.
  • notFound?: a path in files served with 404 where no file matches.
  • fallback?: a path in files served with 200 for a page no file has (single-page apps); taken before notFound.
  • createdAt.

Served at the group's handle address, https://<handle>/, where the host keeps only /.well-known for itself. Routing: a path's file, then x/ as x/index.html, then fallback, then notFound, then a plain 404. GET and HEAD only.

Sandboxed by the host, not by what publishes it. A group's handle is a subdomain of the host's domain, so the browser counts its pages as the same site as the console. Every file is served with

Content-Security-Policy: sandbox allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox
Access-Control-Allow-Origin: *
X-Content-Type-Options: nosniff

The sandbox gives each page an opaque origin: it cannot read or set cookies or storage, and what it sends to the host goes cross-site, without the console's SameSite=Lax session. CORS keeps its own module scripts, fonts and fetches working from that opaque origin. Checks in the MCP tool guard against mistakes; the header is what guards against a hostile page, since anyone with the role can write the record through XRPC.

Publishing: opensocial site publish <group> <dir> [--fallback <path>] [--not-found <path>], --undo to take it down, and its MCP tool site_publish taking the files inline. Only a role allowed to configure the group may publish.

Tests: routing and headers; publish and take down; reuse of blobs; and in e2e, a site page posting to the console carries no session.

Hardening, alongside: the console's sign-in cookie as __Host-, and an Origin check on every POST a cookie authenticates.

Moving the prototype's public pages: five groups had public pages (Rainshadow Riders' / and /rides; opensocial's /, /feed, /tangled, /standard-site-publications; the front pages of Mole People, Portland Cycling Club and Club Penguin). They were rendered from templates, not files, so they are snapshotted as rendered HTML before cutover and published as each group's site, or dropped where they would go stale.

Where

The host; the opensocial command; MCP.