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

A group's site stays at its address when it takes a domain of its own

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:sites/address

A group's site is now served at its address, not its handle, so taking a handle on a domain of its own no longer takes the site down. It is the first step of at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzysqoksvx7f.

Claude Opus 5.5

What changes

Serving. sites::site_of finds the group by the request's Host in the address table (Store::addressed), not by the account's handle. A group's site answers at https://<address>/ whatever its handle is. An own-domain handle such as riders.org is the group's name, not where its site is: a request there is no longer answered from the site and falls through to the host's own routes, as any other name does.

putSite answers url as the address, over the host's scheme, instead of the handle.

Words. The sites.rs module doc, the site_publish tool's description, and the descriptions in fyi.opensocial.site, putSite's url and the group view's url (in defs) say "address". So do docs/design/sites.md (the opening, Serving, The sandbox), groups.md (Its address), the design README, the API reference's site route, and the CLI reference's site publish.

Why

Until now site_of served a site only when account.handle was the request's name. updateGroupHandle changes the handle, so once a group took riders.org, its address matched nothing and its site answered 404 there. It would have answered at riders.org, but the deployment routes and certifies only *.<HANDLE_DOMAIN> (docs/deploying.md), so in practice the site was gone with nothing to say so.

The address never changes and is reserved for the group until it is deleted, so it is the stable home for the site. Serving at the group's own domain as well is the rest of the issue: a site domain the group sets, certificates issued on demand, and a redirect from the address. That waits for the console to publish sites and for a way to set a handle outside raw XRPC.

How it was checked

  • New a_site_stays_at_the_address_when_the_handle_moves_to_a_domain_of_its_own in tests/sites.rs. It publishes a site, sets an own-domain handle as updateGroupHandle does, and checks that the address still serves the site, sandboxed; that the domain does not serve it; and that putSite answers the address. On main's site_of it failed with 404 at the address.
  • Locally, just t -p group-host --test sites --test group_handle passes, and clippy passes for group-host and group-host-mcp. The full suite, its coverage gate, just lex and just docs are left to CI.

Shortcomings

  • A group whose own-domain handle pointed at the host, with the proxy configured by hand to route it, served its site there; it no longer does. Nothing in the documented deployment did that.
  • With no site, / at the address still redirects to /g/<handle> in the console, which resolves an own-domain handle as before.
Approved

This serves a group's site by the request's Host through the address table (Store::addressed) instead of the account's handle. An own-domain handle no longer takes the site down. putSite now answers the address as url. The docs, lexicon descriptions and the site_publish tool text all say "address" to match. The lookup is a case-insensitive match on the address table, and the host's own name is still excluded first. The new test covers the address serving the site sandboxed, the own-domain name not serving it, and putSite's url.

I read the whole diff but did not run it. I did not check that every existing group has an address row, for example groups made before the table existed. If any lack one, their sites would stop being served. The expect("a group has an address") in put_site would also panic for such a group.

Merged as b6734bc