openvibers/openvibe.network Commits
Home CSP: let the Community screenshot pastes through (#578)
Changes
@@@ -123,7 +123,9 @@ app.use(helmet({scriptSrc: ["'self'", "'unsafe-inline'", "https://openvibe.network", "https://openvibe.live", "cdn.jsdelivr.net", "fonts.googleapis.com", "https://static.cloudflareinsights.com"],styleSrc: ["'self'", "'unsafe-inline'", "fonts.googleapis.com", "fonts.gstatic.com"],fontSrc: ["'self'", "fonts.gstatic.com"],-- imgSrc: ["'self'", "data:", "blob:", "https://openvibe.media", "https://openvibe.live"], // avatars and media live on openvibe.media; live-stream thumbnails on the home page come from openvibe.live++ // Avatars and media live on openvibe.media; the home page's live-stream thumbnails come from openvibe.live and++ // its "Right now" screenshot pastes from openvibe.community (blocked until 2026-11-06: the card showed nothing).++ imgSrc: ["'self'", "data:", "blob:", "https://openvibe.media", "https://openvibe.live", "https://openvibe.community"],connectSrc: ["'self'","https://openvibe.network",nnew file mode 100644@@@ -0,0 +1,23 @@++'use strict';++// The home page's pictures come from three places, and the CSP must let each one through: avatars and media from++// openvibe.media, live thumbnails from openvibe.live, and the "Right now" screenshot pastes from openvibe.community++// (blocked until 2026-11-06: a screenshot card showed nothing, and the browser logged a CSP refusal).++const assert = require('assert');++const { bootServer } = require('./helpers/boot-server');++++(async () => {++ const srv = await bootServer();++ try {++ const r = await fetch(srv.base + '/');++ const csp = r.headers.get('content-security-policy') || '';++ const img = (csp.split(';').map((d) => d.trim()).find((d) => d.startsWith('img-src')) || '').split(/\s+/);++ for (const origin of ['https://openvibe.media', 'https://openvibe.live', 'https://openvibe.community']) {++ assert.ok(img.includes(origin), `img-src lets ${origin} through: ${img.join(' ')}`);++ }++ console.log('home image CSP: media, live and community pictures allowed');++ await srv.stop();++ process.exit(0);++ } finally {++ await srv.stop();++ }++})().catch((e) => { console.error(e); process.exit(1); });
@@ -123,7 +123,9 @@ app.use(helmet({
@@ -123,7 +123,9 @@ app.use(helmet({
scriptSrc: ["'self'", "'unsafe-inline'", "https://openvibe.network", "https://openvibe.live", "cdn.jsdelivr.net", "fonts.googleapis.com", "https://static.cloudflareinsights.com"],
scriptSrc: ["'self'", "'unsafe-inline'", "https://openvibe.network", "https://openvibe.live", "cdn.jsdelivr.net", "fonts.googleapis.com", "https://static.cloudflareinsights.com"],
styleSrc: ["'self'", "'unsafe-inline'", "fonts.googleapis.com", "fonts.gstatic.com"],
styleSrc: ["'self'", "'unsafe-inline'", "fonts.googleapis.com", "fonts.gstatic.com"],
fontSrc: ["'self'", "fonts.gstatic.com"],
fontSrc: ["'self'", "fonts.gstatic.com"],
- imgSrc: ["'self'", "data:", "blob:", "https://openvibe.media", "https://openvibe.live"], // avatars and media live on openvibe.media; live-stream thumbnails on the home page come from openvibe.live
+ // Avatars and media live on openvibe.media; the home page's live-stream thumbnails come from openvibe.live and
+ // its "Right now" screenshot pastes from openvibe.community (blocked until 2026-11-06: the card showed nothing).
+ imgSrc: ["'self'", "data:", "blob:", "https://openvibe.media", "https://openvibe.live", "https://openvibe.community"],
connectSrc: [
connectSrc: [
"'self'",
"'self'",
"https://openvibe.network",
"https://openvibe.network",
new file mode 100644
new file mode 100644
@@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
+'use strict';
+// The home page's pictures come from three places, and the CSP must let each one through: avatars and media from
+// openvibe.media, live thumbnails from openvibe.live, and the "Right now" screenshot pastes from openvibe.community
+// (blocked until 2026-11-06: a screenshot card showed nothing, and the browser logged a CSP refusal).
+const assert = require('assert');
+const { bootServer } = require('./helpers/boot-server');
+
+(async () => {
+ const srv = await bootServer();
+ try {
+ const r = await fetch(srv.base + '/');
+ const csp = r.headers.get('content-security-policy') || '';
+ const img = (csp.split(';').map((d) => d.trim()).find((d) => d.startsWith('img-src')) || '').split(/\s+/);
+ for (const origin of ['https://openvibe.media', 'https://openvibe.live', 'https://openvibe.community']) {
+ assert.ok(img.includes(origin), `img-src lets ${origin} through: ${img.join(' ')}`);
+ }
+ console.log('home image CSP: media, live and community pictures allowed');
+ await srv.stop();
+ process.exit(0);
+ } finally {
+ await srv.stop();
+ }
+})().catch((e) => { console.error(e); process.exit(1); });