Commit Graph
131 Commits
Author SHA1 Message Date
Linus Rath 795faceee7 Merge branch 'feat/org-thirdparty' into feat/org-features 2026-10-28 05:51:22 +01:00
Linus Rath 687cd89346 Merge branch 'feat/org-external' into feat/org-features
# Conflicts:
#	lib/outgoing/quick-reply.ts
#	lib/outgoing/send-pipeline.ts
2026-10-28 05:46:11 +01:00
Linus Rath 9e809a31db Merge branch 'feat/org-features' into feat/org-thirdparty 2026-10-28 05:27:58 +01:00
Linus Rath 1a747ac9dd feat: limit the page's CSP to the configured hosts with no third-party traffic #903 2026-10-28 04:30:41 +01:00
Linus Rath a9c89ae7a2 fix: fail closed while the third-party switch is unknown or set as a string #903 2026-10-28 04:30:32 +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
Linus Rath b945a789f9 fix: match internationalised domains in either form and name the domains an admin typed wrong 2026-10-28 04:05:46 +01:00
Linus Rath 92c9110f3c feat: show the third-party traffic switch and what stays reachable in Organisation > Security #903 2026-10-28 02:24:13 +01:00
Linus Rath 65e3d0d2d4 feat: let admins set an organisation signature with user details per domain or group #908
Admins write an HTML and a plain-text signature with placeholders on
Organisation > Signatures, per scope. Users fill in the details it asks
for once, under Settings > Account. Without a lock it is the default for
addresses without a signature of their own; locked or hidden, it
replaces every signature.

- `lib/org-signature.ts` fills the templates: values escaped, lines whose
  placeholders are all empty dropped
- the composer applies it right before the plugin signature, so new mail,
  replies, forwards, re-opened drafts, plain text and identity swaps all
  take it the way they take an identity signature; quick reply too
- a send finaliser puts a locked signature back once when it was deleted
- the identity editor shows the filled-in signature read-only with "Set
  by your organisation" when locked, and no editor when hidden
- `signatureDetails` is a synced setting
2026-10-28 02:23:55 +01:00
Linus Rath 553f1e9149 feat: add a switch that stops all third-party traffic #903 2026-10-28 02:19:06 +01:00
Linus Rath b504e39b63 feat: label mail from outside the organisation 2026-10-28 01:53:39 +01:00
Linus Rath 084cf3cf3a fix: fetch the policy again only for an account of a domain it doesn't cover 2026-10-28 01:08:56 +01:00
Linus Rath 4004b9be7c feat: let admins export and import the whole user policy as one file 2026-10-28 00:44:31 +01:00
Linus Rath e76490580d feat: add an Organisation area to the admin panel with domain and group scopes 2026-10-28 00:40:56 +01:00
Linus Rath d19095fafe feat: fetch the policy again when an account from another domain is added 2026-10-28 00:35:00 +01:00
Linus Rath 0738f6f999 feat: say "Set by your organisation" next to settings an admin locked 2026-10-28 00:29:03 +01:00
Linus Rath 4b69f1307f feat: let admins scope the user policy per domain or group 2026-10-28 00:29:02 +01:00
Linus Rath eb2787bcc9 fix: end admin sessions on sign-out and when the admin password changes 2026-10-26 14:52:04 +01:00
Linus Rath 863aa81d1c fix: stop a synced settings file from passing as an admin session 2026-10-26 11:48:39 +01:00
Linus Rath 30cb676fad fix: write the admin config, password hash and setup token readable only by the app's own user 2026-10-26 11:48:38 +01:00
Linus Rath 0f0ebc906b fix: stop trusting the unprefixed sidebar-app frame cookie when COOKIE_SECURE=true (GHSA-cjm9-m826-mh78) 2026-10-26 11:48:38 +01:00
Linus Rath ec0fed19cc fix: stop reading a marketplace bundle download once it passes the package size limit 2026-10-26 11:29:37 +01:00
Linus Rath 8e66c9f6ad fix: keep plugin approval requests that several users send at once 2026-10-26 11:29:37 +01:00
Jacob ZeitzandClaude Opus 5.5 96526c1b41 feat: admin policy gate to list the Tags above the shared mailboxes
A new feature gate, tagsAboveSharedEnabled (default off, so the sidebar
keeps its order), lists the Tags section above the shared mailboxes
instead of below them. With many shared mailboxes expanded, the tags
otherwise end up out of sight. In Mountain View the tags then follow the
Labels list directly, also when More is open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 08:54:23 +02:00
Linus Rath 10b4d2a9db feat: rework the admin panel around a settings-style sidebar and one URL per page
The old panel kept its active tab in a store, so every page sat at
/admin, the sidebar duplicated the webmail rail by hand, and each page
was a stack of boxed cards with their own save buttons. Plugin settings
were only reachable through a gear icon in a row of five.

- one catch-all route for the whole panel; pages switch through
  history.pushState, so `/admin/plugins/<id>`, the back button, bookmarks
  and connector links all work without a route transition
- sidebar laid out like the user settings: back to mail, search over
  pages and their sections, two group headings, change password and
  sign out at the bottom; the phone shows a list, then the page
- pages use SettingsSection rows instead of nested cards, with one page
  header, one flash message and one save bar at the bottom (Discard,
  Save, Ctrl+S); the unsaved-changes prompt still guards leaving
- plugins and themes are lists of rows with a toggle each; a row opens
  the extension's own page with its settings, force-on, permissions,
  kept versions and removal
- overview shows stat tiles, server facts and recent activity
- old `/admin?tab=x` links redirect; the tab store is gone and the
  connector registry resolves admin links to the page URL
- `NEXT_TURBOPACK_ROOT` overrides the Turbopack root so `next dev` runs
  from a worktree with a junctioned node_modules
2026-10-20 15:16:05 +02:00
Linus Rath 391ed6c018 Merge branch 'fix/security-audit-2026-10' 2026-10-19 12:58:50 +02:00
Linus Rath 703a15663f fix: keep the extension directory URL off private addresses 2026-10-19 01:32:25 +02:00
Linus Rath 735b37b812 fix: refuse an extension directory keyring older than the newest one seen 2026-10-19 01:32:25 +02:00
Linus Rath e6064f3476 fix: only connect and proxy plugin credentials that a plugin known to the server declares 2026-10-19 01:07:50 +02:00
Linus Rath 31326c7daf fix: keep OAuth client secrets and the session secret out of the admin audit log, config API and dashboard writes 2026-10-19 00:50:16 +02:00
Linus Rath 8da659fd8c feat: install any version from the marketplace and show updates, withdrawn versions and advisories
The marketplace now talks to the extension directory's v2 API only. The
detail page lists every version, previews the one picked, installs it,
and refuses a version the publisher withdrew unless the admin confirms,
or one outside the Bulwark range it supports. The listing gains sort, an
Installed view and an updates strip fed by the directory's updates check,
with notices for advisories, deprecations and suspensions.

A self-hosted directory older than 2026-10-14 has no v2 API and no
longer works with the marketplace.
2026-10-19 00:09:39 +02:00
Linus Rath dd0da783c6 feat: keep replaced plugin and theme versions and roll back to them 2026-10-19 00:08:10 +02:00
Linus Rath 100da43991 Merge pull request #1247 from lucamzanon/feat/account-archive-passwords
feat: optionally keep mailbox passwords in the account list backup
2026-10-18 14:34:31 +02:00
Linus Rath 58eff0e879 Merge pull request #1258 from HOLOEYE-JZ/feat/archive-feature-gate
feat: admin policy gate to turn off archiving #1257
2026-10-18 14:29:27 +02:00
Linus Rath 8e7245b26c feat: let the theme policy set and lock the color mode #1280 2026-10-18 13:46:49 +02:00
Linus Rath 4adbad25f6 feat: end the provider session through a configured logout URL #1279 2026-10-18 13:46:48 +02:00
Linus Rath deb106736e fix: load the admin panel when the config is read-only #1249 2026-10-17 19:17:48 +02:00
Linus Rath a854447346 fix: apply admin policy defaults to user settings #1248 2026-10-17 19:17:46 +02:00
Jacob ZeitzandClaude Opus 5.5 99b0bced3b feat: admin policy gate to turn off archiving #1257
A new feature gate, archiveActionEnabled (default on), lets the admin turn the
Archive action off for installations that archive mail elsewhere, such as a
mail gateway. With it off, Bulwark offers no Archive anywhere: the viewer's
button and its overflow entry, the context menu for one or several messages,
Mountain View's selection bar, the hover and swipe actions, the E shortcut and
its help row, archiving after an export, and the archive mode setting (also in
the settings search). With it off nothing creates an Archive folder:
ensureArchiveMailbox returns null. Existing Archive folders stay ordinary
folders, moving mail into them by hand still works, and the plugin API is
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 20:48:28 +02:00
lucamzanon db38ad320e feat: optionally keep mailbox passwords in the account list backup
Part 2 of 3 of the account archive agreed in #1198. When the admin turns on
"Account List Backup: Passwords" (off by default), saving the list offers to
include the passwords of the accounts signed in here with a plain password.
They are encrypted in the browser together with the list. On restore, those
accounts are signed in to in the background, one by one, without leaving the
active account; a refused password leaves the account waiting for a sign-in by
hand, as before. OAuth and TOTP accounts are saved without a password.
2026-10-16 05:46:46 +02:00
Linus Rath a852001d4f feat: let admins turn off the custom From address in the composer 2026-10-15 14:43:07 +02:00
Linus Rath 15edc5943b feat: check the extension directory's signature before installing from the marketplace 2026-10-14 21:36:50 +02:00
Linus Rath fce19d802b fix: stop concurrent plugin and theme installs from failing or dropping each other 2026-10-14 09:02:51 +02:00
Linus Rath 022b83c005 feat: let plugins use accounts and API keys through the server without seeing them
Plugins that talk to Nextcloud, Paperless or an AI provider used to need
the password or key in their own settings, readable by the plugin and
stored in the browser. A plugin can now declare credentials in its
manifest and send requests "with credential X" through the server:

- `credentials` in the manifest: admin scope (secret and server from the
  admin config) or user scope (the user connects an account; the server
  address is fixed or chosen by the user)
- `/api/plugin-secrets`: the user's connected accounts, encrypted per
  mail account under `PLUGIN_SECRETS_DIR`; listing never returns secrets
- `/api/plugin-proxy`: adds the secret and forwards only to the
  credential's own origin, through the SSRF guard unless the admin set
  the server up or listed it in `PLUGIN_PROXY_PRIVATE_ORIGINS`; no
  redirects or WebDAV moves to other servers, streamed bodies capped at
  512 MB up and 2 GB down, 300 requests a minute per plugin, 8 at once
  per user, and one audit line per request without paths or bodies
- a capture mode that stores a secret from a sign-in response (Nextcloud
  Login Flow v2) and removes it from what the plugin gets back
2026-10-14 04:00:36 +02:00
Linus Rath c4853a4bba fix: check dev-directory plugins like uploads and keep their files inside the plugin folder 2026-10-14 02:26:56 +02:00
Linus Rath 9408daaf5e fix: keep an extension's admin state on re-upload and remove its config when it is deleted 2026-10-14 02:25:45 +02:00
Linus Rath 592db209db fix: sign plugin bundles when they are installed and require the signature for privileged plugins 2026-10-14 02:05:47 +02:00
Linus Rath e720be7e17 feat: let users install their own plugins, with admin review of the actual code
The admin page offered "User Plugin Uploads" and "Require Admin
Approval", but nothing in Settings used them: there was no upload, no
uninstall and no way to ask for approval, and the admin had no list of
requests. The approval code that existed pinned a hash of the code only
and showed the admin a manifest the browser sent, never the code.

Now:
- Settings > Plugins has an install button (when uploads are allowed),
  a remove button for the user's own plugins, and lists in plain
  language what each plugin may do, high-risk items first
- an install sends the ZIP to the server, which reads the manifest and
  code itself and pins the request to a hash of both
- the admin Plugins tab lists requests with the code and approves or
  denies them; a user may have 10 open requests
- a user plugin is checked again on every start, so a revoked approval
  or turning user plugins off takes effect
- the consent dialog and the plugin settings are translated, use the
  theme colours, and show the sites a plugin may send data to
2026-10-14 02:03:26 +02:00
Linus Rath e9f87c7970 fix: install Theme API v2 themes and their skins from the admin page and the marketplace 2026-10-14 01:47:58 +02:00
Linus Rath e57b7a2c18 fix: check plugin and theme packages the same way on every install path
The Settings upload, the admin upload, the marketplace install and the
marketplace preview each parsed the ZIP and manifest with their own copy
of the code, and the copies had drifted. A `permissions` string skipped
validation and was then matched by substring, a small ZIP could inflate
to hundreds of megabytes on the server, the Settings upload dropped
`locales` and took origin lists unchecked, and settings schemas were
never checked at all.

All of them now go through `lib/extension-package.ts`:
- every file is inflated through a byte cap, with a limit on entries
- one manifest check: types, permissions, entrypoint, version,
  minAppVersion, settingsSchema, configSchema, locales and origin lists
- only checked fields are stored
2026-10-14 01:43:43 +02:00