domma-cms 1.66.5 → 1.66.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.66.6] - 2026-11-14
4
+
5
+ - Pictures in Media now show in emails read in webmail. They are sent with `Cross-Origin-Resource-Policy: cross-origin`, so a campaign's or survey's banner and footer no longer arrive as alt text only. Every other response keeps `same-origin`.
6
+
3
7
  ## [1.66.5] - 2026-11-13
4
8
 
5
9
  - Contacts related records and the shared Tool styles come from Domma Mail 0.92.0 (shared mail core 0.29.0). Nothing changes on a site.
@@ -2537,6 +2537,8 @@ Measurement and automation: a Performance screen per campaign - reached, opened
2537
2537
 
2538
2538
  **Pictures and files from Media and the File Store (unreleased, 2026-11-13).** Insert picture in the campaign editor takes a picture from Media or the File Store as well as an upload, and Link a file (body, header, footer) links to a document in either - a link, never an attachment, so the email stays small and the click is counted. A File Store file goes into an email only as its public link (`/_f/<code>`, `?inline=1` for a picture): a private one is made public when chosen, after a confirm, and needs to be the person's own file plus the File Store's "Public links" permission. Making it private again or trashing it stops the link in emails already sent. The File Store is optional - without it only Media is offered. Every field of the editor now carries a full help popover.
2539
2539
 
2540
+ **Blocks and tags in campaign emails (unreleased, 2026-11-13).** Insert block or tag in the campaign editor (body, header, footer) writes a page tag into the message: a site block, or one of the static tags (button, link, card, box, banner, badge, grid, row, spacer, center, text, hero, table, listgroup). At send time, in Preview email and in a test send, each tag is rendered by the engine's own renderer and then turned into email HTML: styles inlined from a small email stylesheet plus the block's own CSS, theme tokens resolved against the site's light theme, grids and flex rows made into tables, icons, scripts and forms removed. Interactive tags (tabs, carousels, forms, collections, embeds, effects) are never rendered - typed by hand they stay as text. Merge fields work inside tags (`[button href="{{link}}" … /]`). The email sanitiser still runs per recipient. Also: right-click or double-click a picture in the message to edit or remove it.
2541
+
2540
2542
  **Where:** Admin sidebar "Campaigns Pro" (`#/plugins/campaigns-pro`); Performance per campaign at `#/plugins/campaigns-pro/performance/:slug`; the audience screen is shared with Surveys.
2541
2543
 
2542
2544
  ### Onboard Pro (`onboard-pro`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "domma-cms",
3
- "version": "1.66.5",
3
+ "version": "1.66.6",
4
4
  "description": "File-based CMS powered by Domma and Fastify. Run npx domma-cms my-site to create a new project.",
5
5
  "type": "module",
6
6
  "main": "server/server.js",
package/server/server.js CHANGED
@@ -35,7 +35,7 @@ import {requestSerializer} from './services/request-log.js';
35
35
  import {rateLimitOptions} from './services/rate-limit.js';
36
36
  import {registerAdminAssets} from './services/adminAssets.js';
37
37
  import {registerPublicAssets} from './services/publicAssets.js';
38
- import {isActiveType, servedType} from './services/mediaTypes.js';
38
+ import {mediaHeaders} from './services/mediaTypes.js';
39
39
  import {connectSources, frameSources, imageSources} from './services/embedCsp.js';
40
40
  import {cspSources as gaSources} from './services/googleAnalytics.js';
41
41
 
@@ -433,14 +433,8 @@ await app.register(staticPlugin, {
433
433
  root: mediaDir,
434
434
  prefix: '/media/',
435
435
  decorateReply: false,
436
- setHeaders: (reply, filePath) => {
437
- reply.header('X-Content-Type-Options', 'nosniff');
438
- // A file a browser would run as a document (HTML, any XML, SVG, script) is
439
- // served sandboxed: shown, never able to script this site's address.
440
- if (isActiveType(servedType(filePath))) {
441
- reply.header('Content-Security-Policy', "sandbox; default-src 'none'; img-src 'self' data:; style-src 'unsafe-inline'");
442
- }
443
- }
436
+ // nosniff, sandboxed documents, and pictures other sites' pages (webmail) may show - services/mediaTypes.js.
437
+ setHeaders: (reply, filePath) => reply.headers(mediaHeaders(filePath))
444
438
  });
445
439
 
446
440
  // Fingerprinted public assets are cached for good, and the site's custom CSS is
@@ -42,3 +42,18 @@ export function formMayCollect(type) {
42
42
  export function refusedExtensions() {
43
43
  return Object.entries(mime._types).filter(([, type]) => !formMayCollect(type)).map(([ext]) => ext).sort();
44
44
  }
45
+
46
+ /**
47
+ * The headers /media/ adds to a file it serves. nosniff always; a file a browser would run as a document (HTML, any
48
+ * XML, SVG, script) is sandboxed - shown, never able to script this site's address. A picture may be shown from
49
+ * another site's page: Media is public, and an email is read on someone else's page (webmail), where helmet's
50
+ * same-origin left a campaign's banner and footer as alt text. Everything else keeps helmet's same-origin.
51
+ */
52
+ export function mediaHeaders(filePath) {
53
+ const type = servedType(filePath);
54
+ return {
55
+ 'X-Content-Type-Options': 'nosniff',
56
+ ...(isActiveType(type) ? {'Content-Security-Policy': "sandbox; default-src 'none'; img-src 'self' data:; style-src 'unsafe-inline'"} : {}),
57
+ ...(/^image\//.test(type) ? {'Cross-Origin-Resource-Policy': 'cross-origin'} : {})
58
+ };
59
+ }