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

A group's site moves to its own domain once that domain reaches the host

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

A group with a handle on its own domain can now move its site there: a steward presses "Move" on the Site page's Domain card (or opensocial site domain <group>, or the site_domain tool), the host checks the domain answers as this host, and from then on riders.org serves the site while the address and www.riders.org redirect to it. Fixes at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3n25k5ew55umt.

Claude Opus 5.5

What changes

The switch. fyi.opensocial.putSiteDomain and deleteSiteDomain, both for group.configure. Put is refused with NoOwnDomain while the handle is the address, and with NotReaching unless https://<domain>/xrpc/com.atproto.server.describeServer answers this host's DID (or SITE_CHECK_AT, asked with the domain as Host, for a host that can't reach its own public addresses). A site_domain row holds the domain. It counts only while the group's handle is still that domain, updateGroupHandle clears it, and deleting the group deletes it.

Serving. sites::site_of now finds a site by its own domain too. On the domain the site is served as at the address, keeping /.well-known/ and /xrpc/ for the host, and a site that signs visitors in gets its OAuth client named for the domain, as the live-data pull already does by Host/X-Forwarded-Host. The address and www.<domain> answer 301 to the same path and query at the domain, but the address keeps the host's own paths.

Certificates. GET /tls/ask?domain= answers 200 for a group's own domain, or www. under it, while the group is on (switched on or not, so the check above can connect), else 404. It's for Caddy's on_demand_tls; docs/deploying.md has the Caddyfile.

Where it shows. The group views carry siteDomain, putSite answers its url there, the group page's Website link and the Site page use it, and the Site page has a Domain card. With no domain of its own, the card says so and links to the handle. Otherwise it shows the domain and either "Move" (a dialog saying which DNS records to add first, with a refusal in plain words) or "Move back", both quiet.

Command and tool. opensocial site domain <group> [--undo] and site_domain, from one TOOLS entry.

Why

Taking a handle on riders.org proves the group controls the domain, not that the domain's web traffic reaches this host: its A record may still name the old site the group is leaving. So the move is a switch a steward presses once DNS is ready, checked by asking the domain who it is. Turning it off, or changing the handle, puts the site back at its address, which never stops being the group's. The issue's first draft redirected automatically on the handle check alone; that's the gap this closes.

How it was checked

  • tests/sites.rs: no own domain (NoOwnDomain, no certificate); a domain the proxy may certify (and www., case-insensitive) and one it may not; a plain member refused; the domain serving nothing until moved; once moved, the domain serving the site and its atproto-did, the address and www. redirecting with path and query; siteDomain in the view and putSite's url; moved back; and a new handle through updateGroupHandle ending it for good. A host asking the domain itself, under .example, which never answers, gets NotReaching.
  • tests/commands.rs: site domain refused with NoOwnDomain, and --undo answering.
  • The MCP protocol test lists site_domain.
  • just look of the card with no domain, with one not moved, the dialog, and moved (pictures attached), the last two drawn by renaming Riders' handle and adding the row in a throwaway world's database. A reviewer agent critiqued them against the ui skill; its findings are applied, except that the button says its verb alone ("Move") as rows do, and a host name with a hyphen may still wrap at it on a phone.
  • All e2e flows pass locally. No flow moves a site, as no test world can make a domain reach the host.

Shortcomings

  • The proxy half is untried: on_demand_tls and the catch-all block are written in docs/deploying.md but have not run, as nothing deploys to next.opensocial.fyi yet (at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3n25dojefqsn2).
  • The check runs only when moving. If the domain later points elsewhere, the address still redirects there until a steward moves the site back.
  • The dialog names the console's host name as what to point DNS at, which is the host's own name in the deployed setup but not in every setup.
  • Visitors signed in on a live site at the address sign in again at the domain.

Review

sites::site_of and the redirect in serve (where each name goes), site_domain.rs (the check and the certificate answer), and the site_domain queries in store.rs (a row counts only while the handle is its domain).

off-alice-desktop-light.png

dialog-alice-phone-dark.png

none-alice-desktop-light.png

on-alice-desktop-light.png

Approved

This adds a steward-controlled switch that moves a group's site to its own handle domain, once describeServer at that domain answers with this host's DID. The address and www. then redirect there. I read the Rust core: site_domain.rs, sites.rs, the store.rs queries and migration, group_handle.rs, group_api.rs, config.rs and the routes. I found nothing that must change.

  • Stale rows: site_domain and sited join on a.handle = s.domain, so a row stops counting the moment the handle changes. updateGroupHandle also deletes it, and the forget-account list covers group deletion.
  • Routing: site_of sends the address to the domain only while a row counts. The domain and www. serve and redirect as described, and /xrpc/ and /.well-known/ stay the host's own.
  • Certificates: tls_ask checks the group is active and that the name is its own domain or www. under it. That is tight enough to stop strangers spending certificate limits.
  • Minor edge, no change needed: a group whose handle itself starts with www. can never get a certificate from tls_ask, because the prefix is stripped before the lookup. The check also runs only when moving, as the body says.

I did not read the web components, the lexicons, the docs, the tests or the CLI and MCP changes. CI covers them (the 100% coverage gate, the lexicon lint and the docs links).

Approved

The only change since my approval is making the site_domain migration CREATE TABLE IF NOT EXISTS. That is harmless: it is idempotent, and the schema is the same. My earlier approval stands.

Approved

The only change since my approval is in one test. The NotReaching test no longer sets SITE_CHECK_AT. It now relies on the https check against a .example domain, which can't answer, so it exercises the real path, and the test is renamed to match. Nothing I approved is touched, so my earlier approval stands.

Merged as dcbc3e4
Merging this pull closed these issues