Customer branding: CI colour frame and logo in every web frontend, derived from the signup domain #155

Open
opened 2026-11-30 22:04:28 +00:00 by sharang · 0 comments
Owner

Sharang's decision (30.11.): every workspace shows the customer's main CI colour as a frame around every page ("Rahmen rundum") and their logo in the sidebar, in all Breakpilot web frontends a workspace uses: the portal, Prüfwerk, Werkmeister, Firmwerk, Reisekosten and any later one. Our own Breakpilot CI (indigo buttons, links, menu) never changes; severity and status colours keep their meaning.

The branding is derived automatically and deterministically in the registry, from the website of the domain the customer signed up with: at trial start for new workspaces, and once for all existing customers. Mockup (approved: "Rahmen rundum", same frame in the portal): https://claude.ai/artifact/N2mSgu4GaJ4CuRHPfzm9Bh

Who sees what

  • Everyone in the workspace: the frame (6 px, the CI colour exactly as derived) and the logo.
  • Workspace admins only, once: a notice "Logo und Farbe von <domain> übernommen" with Passt (acknowledges) and Ändern (opens the portal's Erscheinungsbild page). Nobody else gets a notice. Existing customers get it applied the same way.
  • No colour found: no frame, the product looks as today. The workspace works either way.

Derivation (registry)

1. Domain

  • tenants.admin_email's domain.
  • Empty (sales-led) or a free-mail domain: the most frequent non-free-mail domain among the org's members; a tie goes to the alphabetically first.
  • None: no branding.
  • Free-mail domains are a fixed list in the code (gmail.com, googlemail.com, gmx.de/.net/.at/.ch, web.de, t-online.de, outlook., hotmail., live., yahoo., icloud.com, me.com, mail.de, posteo.de, mailbox.org, protonmail., proton.me, freenet.de, aol., …).
  • Demo tenants are skipped.

2. Fetch

  • https://<domain>/, else https://www.<domain>/.
  • Rules:
    • home page only, no JavaScript, no cookies, at most 5 redirects;
    • redirects only within the same registrable domain;
    • only public IP addresses, checked after DNS on every hop (no private, loopback or link-local ranges);
    • 10 s timeout, HTML at most 2 MB, images at most 1 MB;
    • a neutral User-Agent (BreakpilotBranding/1.0) and no customer data in the request.

3. Colour, the first that yields a usable colour:

  1. <meta name="theme-color">, the first one without a media query.
  2. theme_color from the web manifest (<link rel="manifest">).
  3. The dominant brand colour of the logo picked in step 4:
    • scale it to 64×64;
    • drop pixels with alpha < 128, saturation < 0.25, lightness < 0.12 or lightness > 0.92;
    • quantise to 5 bits per channel and take the most frequent bucket (a tie goes to the lowest packed value);
    • the colour is that bucket's mean, rounded.

A candidate from 1 or 2 that is white, black or grey (the same saturation/lightness bounds) is skipped.

4. Logo, the first that exists:

  1. The largest PNG icon of the manifest, at least 128 px.
  2. apple-touch-icon.
  3. The largest <link rel="icon"> in PNG, ICO or JPEG.
  4. /favicon.ico.

It is stored as a 256×256 PNG. An SVG-only site gets no logo (the product shows the initials), so no SVG is ever served.

5. Determinism and provenance. The same fetched bytes always give the same result. Store:

  • domain;
  • color_source (theme-color | manifest | logo | manual);
  • logo_source (URL);
  • derived_at;
  • the sha256 of the HTML and of the logo.

6. Never overwrite a manual choice. An admin's change in the portal sets manual = true; derivation never runs over it again. "Neu ermitteln" in the portal re-runs it on request.

Data and API (registry)

  • Tenant branding: color (#RRGGBB or null), logo (PNG bytes, or null), logo_etag, the provenance fields above, manual, notice_ack_at.
  • Entitlements check: POST /v1/internal/entitlements/check adds branding: {color, logo_etag, notice: bool}. notice is true while the branding is derived, not manual and not acknowledged. Every product already calls and caches this, so no new call per page.
  • Logo: GET /v1/tenants/{id}/branding/logo serves image/png with ETag, under a new AUTHZ group branding.read for every product's service client (portal-svc-*, pruefwerk-svc-*, werkmeister-svc-*, firmwerk-svc-*, and Reisekosten's). Products proxy and cache it on their own origin.
  • Portal (admins):
    • PUT /v1/tenants/{id}/branding sets the colour and/or logo, or removes them (manual = true);
    • POST /v1/tenants/{id}/branding/derive re-runs the derivation;
    • POST /v1/tenants/{id}/branding/ack records "Passt".
  • When it runs:
    • a trial request (/v1/catalog/trial-request) and tenant creation enqueue the derivation in the background; signup never waits on it;
    • a one-off backfill command covers all customer tenants without branding.
  • Audit: each derivation records branding.derived (source and domain; no page content) and each failure branding.failed.

Products

  • Portal: the frame and logo; the "Erscheinungsbild" page as in the mockup's board 2, plus the provenance line and "Neu ermitteln"; the admin notice.
  • Werkmeister, Firmwerk, Reisekosten and every later frontend: the same three pieces (frame, logo, admin notice) from the entitlements answer. One issue per repo, linked here.
  • Prüfwerk: the frame (a --brand-frame CSS variable), the logo in the sidebar via a cached /api/v1/branding/logo, and the admin notice. A separate Prüfwerk issue tracks it.

Open

  • Privacy: a sole trader's own domain may count as personal data. We only read that public home page, but the privacy notice should name it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9

Sharang's decision (30.11.): every workspace shows the customer's **main CI colour as a frame around every page** ("Rahmen rundum") and their **logo in the sidebar**, in **all Breakpilot web frontends** a workspace uses: the portal, Prüfwerk, Werkmeister, Firmwerk, Reisekosten and any later one. Our own Breakpilot CI (indigo buttons, links, menu) never changes; severity and status colours keep their meaning. The branding is derived **automatically and deterministically** in the **registry**, from the website of the domain the customer signed up with: at trial start for new workspaces, and once for all existing customers. Mockup (approved: "Rahmen rundum", same frame in the portal): https://claude.ai/artifact/N2mSgu4GaJ4CuRHPfzm9Bh ## Who sees what - Everyone in the workspace: the frame (6 px, the CI colour exactly as derived) and the logo. - **Workspace admins only**, once: a notice "Logo und Farbe von `<domain>` übernommen" with **Passt** (acknowledges) and **Ändern** (opens the portal's Erscheinungsbild page). Nobody else gets a notice. Existing customers get it applied the same way. - No colour found: no frame, the product looks as today. The workspace works either way. ## Derivation (registry) **1. Domain** - `tenants.admin_email`'s domain. - Empty (sales-led) or a free-mail domain: the most frequent non-free-mail domain among the org's members; a tie goes to the alphabetically first. - None: no branding. - Free-mail domains are a fixed list in the code (gmail.com, googlemail.com, gmx.de/.net/.at/.ch, web.de, t-online.de, outlook.*, hotmail.*, live.*, yahoo.*, icloud.com, me.com, mail.de, posteo.de, mailbox.org, protonmail.*, proton.me, freenet.de, aol.*, …). - Demo tenants are skipped. **2. Fetch** - `https://<domain>/`, else `https://www.<domain>/`. - Rules: - home page only, no JavaScript, no cookies, at most 5 redirects; - redirects only within the same registrable domain; - only public IP addresses, checked after DNS on every hop (no private, loopback or link-local ranges); - 10 s timeout, HTML at most 2 MB, images at most 1 MB; - a neutral User-Agent (`BreakpilotBranding/1.0`) and no customer data in the request. **3. Colour**, the first that yields a usable colour: 1. `<meta name="theme-color">`, the first one without a media query. 2. `theme_color` from the web manifest (`<link rel="manifest">`). 3. The dominant brand colour of the logo picked in step 4: - scale it to 64×64; - drop pixels with alpha < 128, saturation < 0.25, lightness < 0.12 or lightness > 0.92; - quantise to 5 bits per channel and take the most frequent bucket (a tie goes to the lowest packed value); - the colour is that bucket's mean, rounded. A candidate from 1 or 2 that is white, black or grey (the same saturation/lightness bounds) is skipped. **4. Logo**, the first that exists: 1. The largest PNG icon of the manifest, at least 128 px. 2. `apple-touch-icon`. 3. The largest `<link rel="icon">` in PNG, ICO or JPEG. 4. `/favicon.ico`. It is stored as a 256×256 PNG. An SVG-only site gets no logo (the product shows the initials), so no SVG is ever served. **5. Determinism and provenance.** The same fetched bytes always give the same result. Store: - `domain`; - `color_source` (`theme-color` | `manifest` | `logo` | `manual`); - `logo_source` (URL); - `derived_at`; - the sha256 of the HTML and of the logo. **6. Never overwrite a manual choice.** An admin's change in the portal sets `manual = true`; derivation never runs over it again. "Neu ermitteln" in the portal re-runs it on request. ## Data and API (registry) - **Tenant branding:** `color` (`#RRGGBB` or null), `logo` (PNG bytes, or null), `logo_etag`, the provenance fields above, `manual`, `notice_ack_at`. - **Entitlements check:** `POST /v1/internal/entitlements/check` adds `branding: {color, logo_etag, notice: bool}`. `notice` is true while the branding is derived, not manual and not acknowledged. Every product already calls and caches this, so no new call per page. - **Logo:** `GET /v1/tenants/{id}/branding/logo` serves `image/png` with ETag, under a new AUTHZ group `branding.read` for every product's service client (`portal-svc-*`, `pruefwerk-svc-*`, `werkmeister-svc-*`, `firmwerk-svc-*`, and Reisekosten's). Products proxy and cache it on their own origin. - **Portal (admins):** - `PUT /v1/tenants/{id}/branding` sets the colour and/or logo, or removes them (`manual = true`); - `POST /v1/tenants/{id}/branding/derive` re-runs the derivation; - `POST /v1/tenants/{id}/branding/ack` records "Passt". - **When it runs:** - a trial request (`/v1/catalog/trial-request`) and tenant creation enqueue the derivation in the background; signup never waits on it; - a one-off backfill command covers all customer tenants without branding. - **Audit:** each derivation records `branding.derived` (source and domain; no page content) and each failure `branding.failed`. ## Products - **Portal:** the frame and logo; the "Erscheinungsbild" page as in the mockup's board 2, plus the provenance line and "Neu ermitteln"; the admin notice. - **Werkmeister, Firmwerk, Reisekosten and every later frontend:** the same three pieces (frame, logo, admin notice) from the entitlements answer. One issue per repo, linked here. - **Prüfwerk:** the frame (a `--brand-frame` CSS variable), the logo in the sidebar via a cached `/api/v1/branding/logo`, and the admin notice. A separate Prüfwerk issue tracks it. ## Open - Privacy: a sole trader's own domain may count as personal data. We only read that public home page, but the privacy notice should name it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: platform/tenant-registry#155