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

A host's operator names it and gives the console their own look

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

What changes

feature/branding comes to main: a host's operator names it and gives the console their own look.

A host is named, with a logo and links. SERVICE_NAME, LOGO_URL, HOME_URL, PRIVACY_POLICY_URL, TERMS_OF_SERVICE_URL, SUPPORT_URL and CONTACT_EMAIL say how the console shows the host and whose pages it links to; getBrand answers them.

The colour that acts, and a palette. PRIMARY_COLOR and PRIMARY_COLOR_DARK make the console's buttons, links and marks the operator's colour. PALETTE (paper, slate, neutral, sage, mauve) sets its paper, cards, lines and ink, set on the page from its first byte. The console's colours are each written once, as light-dark(), over one ladder of lightness.

Light or dark, as the reader chooses. A reader picks light, dark or their system's, and the console keeps it.

Approving an app is a page of its own. One card without the console's header and footer, naming the host by its logo and name, over the operator's background (BACKGROUND_LIGHT_URL, BACKGROUND_DARK_URL).

deploy/docker-compose.yml passes each of these as GROUP_HOST_<NAME>, empty by default, so a host that sets none looks as it did.

Why

Each part landed in feature/branding by its own pull, and groups.grain.social has run a build of that branch as a trial. It goes to main so that it is released, and the host runs a release again rather than a branch build.

This merges main (0.7.0) into the branch first. The one conflict was docs/design/signing-in.md, rewritten on main: the branch's paragraph on the approval page is carried onto the new page, shortened to its design.

How it was checked

Each part's pull ran the checks into feature/branding. On the merge: just docs and oxfmt's check pass here. The rest, the tests under the gate, svelte-check, e2e and its guide pictures, is left to CI.

Shortcomings

Each part's change file comes with it (host-branding, host-colours, appearance-choice, authorize-alone), so the next release is a minor one.

Approved

This pull merges feature/branding (and main 0.7.0) into main. It adds the operator's brand and colour config, getBrand, served host images, a palette and light/dark choice set from the first byte, and a standalone approval page.

I read the Rust (config, brand, apps, api, lib) and the web pieces that carry the logic: hooks.server, brand.ts, appearance.ts, the root layout and its server load, authorize, Alone, Appearance and AuthorizeRequest. I did not read the CSS and token rewrites, the message strings, the docs, the shot images or the e2e/test files. Those are visual, prose or check-enforced, and just docs and the other checks cover them.

I found nothing that must change.

  • Config input: each value is validated when the config loads. URLs must be http or https, colours must be hex, the palette must be one of the five, and the name has a length cap. The client re-checks colours before it writes them into a <style> block, so {@html} there is safe.
  • Host images: they go through the same SSRF-guarded fetch as app logos, with a size cap and a check of the image's first bytes. They are served with the same headers as app logos.
  • Cookie and palette: the cookie value is allow-listed before it reaches data-theme. The palette is also allow-listed before it reaches data-palette. The hook builds the palette attribute lazily, after the layout load has set it.
  • describeServer: the new links and contact fields match what atproto's own server description uses.

The pull body says the Rust tests, svelte-check and e2e are left to CI, so those checks need to be green before this merges.

Merged as c2005b3