The sign-in page and the top bar show the mail server's branding logo, falling back to the built-in one when the server has none. The dark theme asks for the logo set for dark mode (inbuxa/inbuxa-server#410), which the server falls back from to the ordinary one.
New GET /api/logo?domain=&theme=dark (server/src/logo.ts): asks the mail server's /logo for the reader's domain (or the default before sign-in), never follows a redirect, keeps answers 5 minutes (so page loads don't spend the server's anonymous-request limit, which sees this process as one address), limited to 120/min per client address.
An image is passed on with nosniff, and a sandbox CSP for SVG. A URL logo becomes a redirect to the image proxy, only for an image load, because the app's CSP loads images from its own origin. The proxy needs a session, so before sign-in a URL logo leaves the built-in image; a logo stored as an image shows everywhere.
The built-in image is held, hidden, until the server answers, so it doesn't flash first. In the top bar a custom logo takes the inbuxa wordmark's place; an APP_NAME name stays.
Checks run locally: typecheck, npm test (web 1602, server 306, all passing; new tests for /api/logo and the client probe), release-version test, build, i18n:check (no new strings).
Fixes #101 (from community t/304).
The sign-in page and the top bar show the mail server's branding logo, falling back to the built-in one when the server has none. The dark theme asks for the logo set for dark mode (inbuxa/inbuxa-server#410), which the server falls back from to the ordinary one.
- New `GET /api/logo?domain=&theme=dark` (server/src/logo.ts): asks the mail server's `/logo` for the reader's domain (or the default before sign-in), never follows a redirect, keeps answers 5 minutes (so page loads don't spend the server's anonymous-request limit, which sees this process as one address), limited to 120/min per client address.
- An image is passed on with nosniff, and a sandbox CSP for SVG. A URL logo becomes a redirect to the image proxy, only for an image load, because the app's CSP loads images from its own origin. The proxy needs a session, so before sign-in a URL logo leaves the built-in image; a logo stored as an image shows everywhere.
- The built-in image is held, hidden, until the server answers, so it doesn't flash first. In the top bar a custom logo takes the inbuxa wordmark's place; an APP_NAME name stays.
Checks run locally: typecheck, `npm test` (web 1602, server 306, all passing; new tests for /api/logo and the client probe), release-version test, build, i18n:check (no new strings).
The logo an administrator sets on the mail server (Settings › System ›
Branding, or a domain's or tenant's logo) changed the server's sign-in page
and the console, but never the webmail, which always showed its own image.
The sign-in page and the top bar now show the server's logo, falling back to
the built-in one when the server has none. The browser asks /api/logo, which
asks the mail server's GET /logo on its behalf, for the signed-in reader's
domain, or the server's default before sign-in. The dark theme asks for the
logo set for dark mode (?theme=dark, inbuxa-server#410), which the server
falls back from to the ordinary one.
/api/logo hands the server's answer on as the server would: an image with
nosniff and, for SVG, a sandboxing Content-Security-Policy; a logo set as an
https URL becomes a redirect to the image proxy, since the page loads images
from its own origin only, and only for an image load; anything else is a
404. It never follows a redirect itself, keeps each answer five minutes, and
is limited per address, so readers' page loads don't spend the server's
anonymous-request limit, which counts this process as one address. The
image proxy needs a signed-in reader, so a URL logo shows in the top bar,
and the sign-in page keeps the built-in logo for it; a logo stored as an
image shows on both.
The built-in image is held in place, unseen, until the server has answered,
so it doesn't flash before a custom logo. In the top bar a custom logo takes
the inbuxa wordmark's place; a name set with APP_NAME stays beside it.
Fixes#101
Test: /api/logo passes an image on with its headers, asks the server for
theme=dark and keeps that apart from the light answer, asks the server once
for repeated loads, sends a URL logo to the image proxy only for an image
load, and answers 404 for no logo, an http: URL or a non-image. The client
builds the URL from the reader's domain and the theme, and probes each URL
once, as an image.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes #101 (from community t/304).
The sign-in page and the top bar show the mail server's branding logo, falling back to the built-in one when the server has none. The dark theme asks for the logo set for dark mode (inbuxa/inbuxa-server#410), which the server falls back from to the ordinary one.
GET /api/logo?domain=&theme=dark(server/src/logo.ts): asks the mail server's/logofor the reader's domain (or the default before sign-in), never follows a redirect, keeps answers 5 minutes (so page loads don't spend the server's anonymous-request limit, which sees this process as one address), limited to 120/min per client address.Checks run locally: typecheck,
npm test(web 1602, server 306, all passing; new tests for /api/logo and the client probe), release-version test, build, i18n:check (no new strings).