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

A host is named, given a logo and links to its operator's pages

Merged
Merged chadtmiller.com asked to merge into feature/branding from chadtmiller.com/group-host:branding/host

A host's operator can now give it a name, a logo and links to their own pages, and the console shows them in its header, page titles and footer. This is the first part of feature/branding; unset, the console is Atmosphere Groups as before.

Claude Opus 5.5 · high effort

What changes

Operator settings. SERVICE_NAME (at most 40 characters), LOGO_URL, HOME_URL, PRIVACY_POLICY_URL, TERMS_OF_SERVICE_URL, SUPPORT_URL and CONTACT_EMAIL, read into config::Brand. Each is optional; one set to nothing but spaces is unset. The host refuses to start on a name too long, a URL that isn't http or https, or an email address with no @. Compose passes each through as GROUP_HOST_<name>.

The host. org.atgrp.internal.getBrand answers the name, the logo's URL and the links, each only when set; anyone may ask. /img/host serves the logo as /img/app serves an app's: read from a public address (any, on an http host), following no redirect, at most 256 KiB, only a PNG, JPEG, GIF or WebP image by its bytes, kept ten minutes. apps.rs now shares the read (read_image), the keeping (kept) and the response (served) between the two. describeServer gives the privacy policy and terms of service as links, and the email as contact, as the reference PDS does.

The console. The root layout loads getBrand beside getViewer, falling back to the console's own name when the host doesn't answer. The header draws the logo (hidden if it fails to load) and the name, which gives way with an ellipsis on a phone. The footer says "<name> runs Atmosphere Groups at <host>" and links the operator's pages. A new Title atom writes every page's <title> as "<page> · <name>", so the head messages no longer each carry "· Atmosphere Groups"; the ones that only repeated a page's heading are gone.

Why

The reference PDS lets an operator brand its sign-in and account pages; a group host run by an app (Grain's groups, say) needs the same, or its people approve apps on a page that names someone else. The settings live on the host alone, so the console and describeServer say the same thing. Pull 2 builds /authorize on this; pull 3 adds colours.

How it was checked

  • tests/config.rs: what each variable reads to, blanks as unset, and each refusal.
  • tests/brand.rs: an unbranded host answers {links: {}}, empty links and contact in describeServer, and 404 at /img/host; a branded one answers every field, serves its logo as an image with the same headers as /img/app, keeps it as read, and serves nothing for an SVG, a 404, or a private address from an https host.
  • tests/oauth_clients.rs still passes over the shared logo code.
  • clippy, just lex, svelte-check, harness/layers.mjs, strings.mjs, dialogs.mjs.
  • just look with Grain's name, icon and links: signed out and signed in, desktop light and phone dark, a group's page, and a 40-character name on a phone.

The coverage gate, e2e and shots are left to CI.

Shortcomings

  • A logo over 256 KiB isn't served: Grain's 1.3 MB marketing logo isn't, its 12 KB app icon is. The config page says so, and that a mark reads better than an app icon at 28 pixels.
  • With a name set, the signed-out heading reads "Groups on Grain Groups".
Approved

The pull adds the operator's brand settings. It adds config::Brand with validation. It adds getBrand and /img/host, which shares read_image, kept and served with apps.rs. It adds links and contact in describeServer. In the console it adds the header logo and name, the footer links, and a Title atom for page titles.

I read every changed file and found nothing that must change.

  • Validation, the cache, and the SSRF guard on the logo fetch all behave as the body says. The guard is the same one /img/app uses, and a missing logo answers 404 instead of falling through.
  • Both new methods are listed in api.md, config.md, deploying.md and the compose file. The change file is there, and tests cover config, getBrand, describeServer and /img/host.
  • Dropping the route_*_head messages leaves no use of the removed keys in the diff.

Minor and not blocking: failed in SiteHeader never resets, so a logo that fails once stays hidden until the page reloads. That is fine for a static setting.

Merged as 0de86e7