Commit Graph
89 Commits
Author SHA1 Message Date
Linus Rath 7443654459 Merge branch 'feat/do-package-fixes' into feat/desktop-offline 2026-11-04 03:43:04 +01:00
Linus Rath 1c201b0772 fix: stop private files with odd casing and links reaching Docker builds 2026-11-04 03:04:12 +01:00
Linus Rath ab21bf2df3 fix: keep a desktop sign-in in the browser's page until the user says yes
The hand-off parked a password before its question, for up to five
minutes, and on a shared computer another local user could ask for
someone's sign-in with a link of their own. Now nothing leaves the page
before the yes, and the instance has a switch for such machines.

- `/check` tests a password and keeps nothing, `/park` runs on the yes and
  hands over tokens wherever the server allows, a password as a last
  resort
- `/discard` and a timer take out what SSO has to park first, and a no
  revokes the refresh token, and the shared store's TTL is the real expiry
- `DESKTOP_BROWSER_SIGN_IN`, default on, closes the routes, the page's
  hand-off and the app's button; the question says which device asked
- tokens from a typed password stay a password account under the name
  typed (#1432)
- redeem refuses a server of the user's own when the device's rule says
  no
- the park budget is reserved before going upstream, and only failures
  count
- "Not now" ends the flow in the app at once, and the question names the
  account

`desktop-handoff-routes.test.ts` now tests the two-step flow against the
real budgets. `sso-start-route.test.ts`'s config mock answers the new
setting, and the SSO test's expected answer has the account in it.
2026-11-04 02:40:37 +01:00
Linus Rath c8c98e79d4 feat: sign in to the desktop app in your browser, with your password manager
The desktop login page gets "Sign in with your browser…" as its main
button. On an instance it opens the instance's real login page in the
system browser, with a PKCE challenge. The page checks the password or
runs SSO, parks the sign-in under a one-time code, asks once, and sends
the code to the app's loopback listener. This browser gets no session
out of it, and the app's own page redeems the code, so SameSite=Strict
is fine. Standalone runs the mail server's OAuth against the listener,
with a page from main for a server with no OAuth at all.

- `/api/auth/desktop-handoff/park` and `redeem`, and `sso/complete` parks
  tokens the same way for a loopback target
- `auth.claim()`: the calls are taken once per document, in the first
  render, in `WindowControlsHost`
- `BrowserSignIn` policy, default on, with its ADMX and samples
- strings in all 30 languages, and the old button's are gone

`runDesktopBrowserSignIn`'s tests changed because the code no longer goes
through the callback page's address: it's redeemed where it arrives.
2026-11-04 01:09:12 +01:00
Linus Rath d651ae857c Merge remote-tracking branch 'origin/main' into feat/do-perf-guard 2026-11-03 21:34:59 +01:00
Linus Rath a89cae5f28 fix: show the page skeleton from the first frame again, with or without an app lock 2026-11-03 21:33:51 +01:00
Linus Rath 5467f5db93 fix: let the Lite host scan know the desktop app's dictionary host 2026-11-03 19:49:55 +01:00
Linus Rath 71bd7af93d Merge branch 'feat/do-remote-wipe' into feat/desktop-offline 2026-11-03 16:20:09 +01:00
Linus Rath 8523289a4b feat: let an admin wipe a lost device, and clear an account the server refuses for good
Until now a lost laptop kept its offline mail for as long as anyone could
open it, and an account whose login the server had ended kept its copy too.

- `lib/devices`, `app/api/devices`: browsers with offline on and desktop
  apps register, in a durable collection with no expiry. A check-in goes
  by a per-device secret, so a revoked device still hears its wipe.
- `app/api/admin/devices` and the org devices page: wipe one device or all
  of a user's, with audit entries for each request and each confirmation.
- `lib/offline/device-wipe.ts`: a start finishes any wipe cut short, then
  waits up to a second for the instance before showing the local copy. A
  wipe takes the store, keys, plugin databases and handoffs, signs out,
  and reports back, again at the next contact if the report failed.
- `lib/jmap/client.ts`, `stores/auth-store.ts`: only `invalid_grant`, the
  session limit, or a 401 lasting past a re-auth count as refused. A 500,
  a proxy page or an outage never do.
- Settings: "Remove everything from this device", with a confirmation.

`lib/shared-store/__tests__/import-data.test.ts` changes its assertion
because it lists every collection the import copies, and `devices` is new.
2026-11-03 13:19:44 +01:00
Linus Rath fb6ff162ff Merge branch 'feat/desktop-offline' into feat/do-policies 2026-11-03 11:40:53 +01:00
Linus Rath 6e262bf1c5 feat: move offline mode onto the encrypted store, with a merged outbox and conflicts
# Conflicts:
#	app/api/auth/token/route.ts
#	lib/offline/offline-mode.ts
#	stores/account-store.ts
#	stores/auth-store.ts
2026-11-03 10:21:34 +01:00
Linus Rath a2740fa9e9 feat: generate the desktop app's policy templates from one schema 2026-11-03 09:56:09 +01:00
Linus Rath 2b48047bcc feat: merge the webmail side of the desktop app
# Conflicts:
#	lib/desktop/types.ts
#	locales/ar/common.json
#	locales/ca/common.json
#	locales/cs/common.json
#	locales/da/common.json
#	locales/de/common.json
#	locales/en/common.json
#	locales/es/common.json
#	locales/et/common.json
#	locales/fa/common.json
#	locales/fr/common.json
#	locales/he/common.json
#	locales/hu/common.json
#	locales/it/common.json
#	locales/ja/common.json
#	locales/ko/common.json
#	locales/lv/common.json
#	locales/mn/common.json
#	locales/nb/common.json
#	locales/nl/common.json
#	locales/pl/common.json
#	locales/pt/common.json
#	locales/ro/common.json
#	locales/ru/common.json
#	locales/sk/common.json
#	locales/th/common.json
#	locales/tr/common.json
#	locales/uk/common.json
#	locales/vi/common.json
#	locales/zh-TW/common.json
#	locales/zh/common.json
#	stores/account-store.ts
2026-11-03 08:48:10 +01:00
Linus Rath 46766ac8aa fix: let a server build pass its guard, and let the desktop app save drafts and forget a server on sign-out 2026-11-03 07:57:35 +01:00
Linus Rath dccf4e8b9f chore: merge feat/desktop-offline into the windows branch 2026-11-03 07:31:32 +01:00
Linus Rath 7ac582f803 fix: compile the desktop trust path out of every other build, and fail a build that keeps it 2026-11-03 06:55:22 +01:00
Linus Rath bb2393cf04 feat: open messages and drafts in their own windows and save all attachments to a folder
An installed app had no title bar of its own, no way to save attachments
except a zip, and "pop out" stayed inside the page. A new window was a
second copy of the app that had to restore the session itself, and on
start-up that evicts any login made without "Remember me" from the list
every window shares.

- Title bar: `display_override` with `window-controls-overlay`, one
  `--titlebar-inset` variable at the page roots and skeletons, and a drag
  strip with the window title. 0 without an overlay, so nothing moves.
- Save all to a folder: `showDirectoryPicker`, asking the device policy
  before the picker and before each file, with the zip as the fallback.
- Pop-out routes `/popout/message/<id>` and `/popout/compose`, on offer in
  an installed app or when the desktop bridge has windows. Hidden in Lite.
- A pop-out borrows the main window's session and never evicts or starts a
  token timer. Every renewal now takes a Web Lock, so two windows can't
  send the same refresh token, which Stalwart 1.0 may treat as a replay.
- A draft moves to its window under the same id. A closing window hands
  unsaved text to the main window to save, since its own request wouldn't
  survive the close.
- Read state, drafts, theme and language follow across windows, and
  `html[data-desktop]` gates the app-like behaviour in `app/desktop.css`.
2026-11-03 06:50:21 +01:00
Linus Rath a30f989c57 feat: add a desktop build of the webmail that no server build can switch on 2026-11-03 06:32:27 +01:00
Linus Rath 7aa12d19b5 chore: fail a Lite build that ships the local store's engine 2026-11-03 05:54:37 +01:00
Linus Rath 6da9a6a6f5 feat: add an encrypted local mail store that syncs in a worker 2026-11-03 04:57:20 +01:00
Linus Rath 1dfe09d321 fix: keep private files and secrets out of standalone builds 2026-11-03 04:14:47 +01:00
Linus Rath a2adddb4b7 ci: retry a failed source map upload before failing the build 2026-11-03 03:06:13 +01:00
Linus Rath cb8aaa4031 test: check each page's first screen without scripts and its layout shift 2026-11-01 19:04:47 +01:00
Linus Rath 42a09f573d fix: let the Lite host scan accept the licence links in the PST worker 2026-11-01 17:26:31 +01:00
Linus Rath 52188f54d6 Merge branch 'feat/enterprise-pack' into feat/enterprise-pack-f 2026-11-01 13:50:22 +01:00
Linus Rath e9b235bab2 Merge branch 'main' into feat/enterprise-pack
# Conflicts:
#	components/admin/admin-shell.tsx
#	lib/admin/outgoing-hosts-registry.ts
#	lib/admin/reachable-hosts.ts
#	scripts/lite/build.mjs
#	stores/policy-store.ts
2026-11-01 13:46:59 +01:00
Linus Rath 2f8cbaa92e fix: let the Lite build pass with the offline and version endpoints it never calls #523 2026-11-01 13:13:18 +01:00
Linus Rath a06281f23f feat: import Outlook PST files into their folders 2026-11-01 05:13:02 +01:00
Linus Rath b92717921e fix: upload each source map with the chunk that names it when the build path is relative 2026-11-01 03:57:47 +01:00
Linus Rath 83a19f3329 docs: point code comments at the monitoring guide where the website has it 2026-11-01 03:49:54 +01:00
Linus Rath 00e67de047 ci: mark the source map upload script executable 2026-11-01 03:38:30 +01:00
Linus Rath be5a5e88ec ci: upload browser source maps to Bugsink and keep every map out of what ships
Every image, the standalone tarballs and the Lite zips are built with
source maps (`BULWARK_SOURCE_MAPS=1`). Turbopack builds give each chunk
a debug ID themselves; the webpack build in the Docker image gets them
from `sentry-cli sourcemaps inject`. `scripts/sourcemaps.mjs collect`
then moves every map out of the build before anything is packed, and
`scripts/sourcemaps.mjs check` fails the build when a `.map` file, an
inline map or a `sourceMappingURL` to a missing file would ship.

- Docker images: a `sourcemaps` stage holds only the maps; the amd64
  job exports it (a cache hit) and uploads it, since both platforms
  build identical chunks
- standalone tarballs, the Lite zips and the Lite image upload their
  own maps and check what they ship
- `scripts/upload-sourcemaps.sh` uploads to `bulwark-instances` and
  `bulwark-telemetry` (Bugsink keeps maps per project) and skips with a
  notice when the `BUGSINK_AUTH_TOKEN` secret is missing
2026-11-01 03:31:48 +01:00
Linus Rath 481c4b6030 feat: serve Prometheus metrics and split health into live and ready
- `/api/metrics` in Prometheus text format, off until `METRICS_TOKEN`
  or `METRICS_TOKEN_FILE` is set (404 before, 401 without the bearer
  token): requests per route group with status class and latency,
  sign-in outcomes, calls to Stalwart, WOPI, translation, the plugin
  proxy and OAuth, browser errors, errors today, process memory,
  event-loop lag, uptime and build info. Labels come from fixed lists.
  Each replica serves its own.
- `/api/health/live` answers while the process runs;
  `/api/health/ready` checks the config, the shared store, writable
  data dirs and Stalwart's session resource. `/api/health` and
  `/api/ready` are unchanged.
- the Docker image gets a HEALTHCHECK on the live endpoint
- adds prom-client, and the OpenTelemetry packages the tracing step
  loads on demand
2026-11-01 02:59:40 +01:00
Linus Rath 9f0413d50b docs: say in the Lite readme that sign-in with SSO works when Stalwart serves Lite 2026-10-31 18:04:57 +01:00
Linus Rath fb3ba0275a feat: hand the mobile app a one-time code instead of the sign-in in its link 2026-10-31 14:06:44 +01:00
Linus Rath 1706f951bb fix: open menus in place with reduced motion instead of flashing in the corner first 2026-10-31 02:00:15 +01:00
Linus Rath 76b0c2fba2 feat: read schema.org booking markup from mail bodies 2026-10-30 04:27:25 +01:00
Linus Rath a529e6e57c feat: add an airport time zone table for flight cards 2026-10-30 04:18:53 +01:00
Linus Rath a80083abd6 fix: let the lite build through with the gated bimi logo endpoint 2026-10-30 01:02:09 +01:00
Linus Rath 2c34afce2d fix: listen on the HOSTNAME and PORT from .env.local with npm start #1441 2026-10-30 00:01:29 +01:00
Linus Rath 50b3ddccec feat: let admins keep the refresh token valid on sign-out so Stalwart keeps the consent #1388 2026-10-29 20:47:18 +01:00
Linus Rath 47bfd754f7 ci: check the main screens for accessibility regressions on every push
A Playwright job on the perf guard's production build runs axe-core's
WCAG 2.2 A/AA rules on the mail list, reading pane, composer, calendar,
contacts and Settings > Accessibility, and fails when a screen has more
serious or critical violations than scripts/a11y-guard/budget.json
allows (all zero today). Two more checks cover what axe can't see: the
keyboard focus outline stays visible in Windows contrast themes, and
single-key shortcuts don't act on the mail behind an open dialog.

axe-core is vendored next to the spec (MPL-2.0, see NOTICE), so the
check adds no dependency. `A11Y_GUARD_UPDATE=1 npm run test:a11y-guard`
rewrites the budget.
2026-10-29 20:02:10 +01:00
Linus Rath ed3f7fabba test: count the reader's accessibility controls in the render budget 2026-10-29 19:09:12 +01:00
Linus Rath f24c481839 fix: accept the SVG namespace of the large mouse pointer in the Lite bundle scan 2026-10-29 18:58:12 +01:00
Linus Rath 5a8810b007 fix: let the Lite build reference the document template endpoint 2026-10-29 00:12:35 +01:00
Linus Rath 96797597c5 Merge branch 'main' into feat/org-features 2026-10-28 15:14:34 +01:00
Linus Rath 0c5ed0c606 fix: show the lite 404 page in the language of its address, right to left for arabic, hebrew and persian 2026-10-28 13:09:30 +01:00
Linus Rath 36ec531fb8 fix: account for the pdf.js namespaces in the Lite bundle host scan #903 2026-10-28 05:22:37 +01:00
Linus Rath 010e9fb6d9 feat: fence a Lite build made with no third-party traffic to its own hosts #903 2026-10-28 04:30:42 +01:00
Linus Rath 031d94635c refactor: keep the outgoing host descriptions out of the browser bundle and scan every URL form #903 2026-10-28 04:30:23 +01:00