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

A site's page draws its frame at once, and finds visitors on a network of its own

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:host/site-network

The page the host serves around a site now sizes the site's frame itself. Before, a small bordered box flashed while shell.js loaded. The page also gets a new setting, SITE_PLC_URL, for the directory where it looks up a visitor's did:plc. A host on a network of its own, like next.opensocial.fyi, can now point that page at a directory the visitor's browser can actually reach.

Claude Opus 5.5 · high effort

What changes

The frame is drawn at full size from the first paint. The page around a site (crates/group-host/src/sites.rs) used to style its iframe only from shell.js. Until that module loaded, the browser drew its default iframe: about 300×150 with an inset border. That is the box that flashed before Kicker loaded on next.opensocial.fyi. The page's own <head> now carries the frame's size and the body's margin. The shell's CSP already allows 'unsafe-inline' styles. That rule is gone from web/shell/shell.ts.

SITE_PLC_URL. The page resolves the visitor's DID from their browser. It used PLC_URL, which on next.opensocial.fyi is http://next-plc:3000. That name exists only on the box's docker network, so no browser can reach it. SITE_PLC_URL is the directory as the browser sees it, and defaults to PLC_URL, so a host on plc.directory changes nothing. Compose now passes SITE_HANDLE_RESOLVER and SITE_PLC_URL through GROUP_HOST_SITE_*. Before this, compose had no way to set SITE_HANDLE_RESOLVER either. SITE_PLC_URL falls back to GROUP_HOST_PLC_URL.

Why

Kicker, published on next.opensocial.fyi, flashed the box on every load. Its sign-in also can't get past the handle step there: the config the page gets names handleResolver: https://bsky.social and plc: http://next-plc:3000, and neither can find a *.pds.next.opensocial.fyi account. After this merges, the next network sets GROUP_HOST_SITE_HANDLE_RESOLVER=https://pds.next.opensocial.fyi and GROUP_HOST_SITE_PLC_URL=https://plc.next.opensocial.fyi in hetzner-infra.

How it was checked

  • tests/sites.rs: the shell page carries the frame's rule, and its config names SITE_PLC_URL.
  • tests/config.rs: SITE_PLC_URL defaults to PLC_URL and can be set apart from it.
  • docker compose config with GROUP_HOST_PLC_URL=http://next-plc:3000: SITE_PLC_URL comes out as that value when not set.

Docs

docs/reference/config.md lists SITE_HANDLE_RESOLVER (it wasn't listed before) and SITE_PLC_URL. docs/deploying.md lists the compose variables. docs/design/sites.md says both lookups happen in the visitor's browser.

Approved

The page around a site now carries the frame's size and body margin in its own <style>, so the iframe never draws as the default box. The rule is gone from shell.ts. The page's plc setting now comes from the new SITE_PLC_URL, which falls back to PLC_URL. I checked SHELL_POLICY in sites.rs: it has style-src 'self' 'unsafe-inline', so the inline style is allowed. The config default, the compose pass-through and the docs all match the code. The tests cover the frame rule, the plc value in the page's config, and the SITE_PLC_URL default and override. I found nothing that needs changing.

Merged as bd0439a