openvibers/openvibe.host Commits
Host: the CSP allows Cloudflare Web Analytics (the injected beacon was blocked on every page) (#107)
Changes
@@@ -34,11 +34,12 @@ const SPACE_URL = 'https://openvibe.space';const MOVED = 'Static hosting moved to OpenVibe.Space.';const DASHBOARD_CSP_HEADER = Object.entries({'default-src': ["'self'"],-- 'script-src': ["'self'", "'unsafe-inline'", 'https://openvibe.network'],++ // Cloudflare Web Analytics: the edge injects its beacon into every page (as on Wiki and Live).++ 'script-src': ["'self'", "'unsafe-inline'", 'https://openvibe.network', 'https://static.cloudflareinsights.com'],'style-src': ["'self'", "'unsafe-inline'", 'https://openvibe.network', 'https://fonts.googleapis.com', 'https://cdnjs.cloudflare.com'],'font-src': ["'self'", 'data:', 'https://fonts.gstatic.com', 'https://cdnjs.cloudflare.com'],'img-src': ["'self'", 'data:', 'https:'],-- 'connect-src': ["'self'", 'https://openvibe.network', 'https://openvibe.events'],++ 'connect-src': ["'self'", 'https://openvibe.network', 'https://openvibe.events', 'https://cloudflareinsights.com'],'frame-src': ["'self'", 'https://openvibe.network'],'frame-ancestors': ["'none'"], 'object-src': ["'none'"], 'base-uri': ["'self'"],'form-action': ["'self'", 'https://openvibe.network'],nnew file mode 100644@@@ -0,0 +1,14 @@++'use strict';++// The page CSP lets Cloudflare Web Analytics run: the edge injects its beacon (static.cloudflareinsights.com) into every++// page and it reports to cloudflareinsights.com. Without them every visitor's console showed a CSP violation and no++// analytics came from this site (a signed-in browser pass of every site, 2026-10-15). Wiki and Live allow the same.++const assert = require('assert');++const fs = require('fs');++const path = require('path');++++const app = fs.readFileSync(path.join(__dirname, '..', 'server', 'app.js'), 'utf8');++const script = /(scriptSrc|'script-src'|"script-src)[^\n]*/.exec(app);++const connect = /(connectSrc|'connect-src'|"connect-src)[^\n]*/.exec(app);++assert.ok(script && script[0].includes('https://static.cloudflareinsights.com'), 'script-src allows the beacon');++assert.ok(connect && connect[0].includes('https://cloudflareinsights.com'), 'connect-src allows its reports');++console.log('csp: Cloudflare Web Analytics is allowed');
@@ -34,11 +34,12 @@ const SPACE_URL = 'https://openvibe.space';
@@ -34,11 +34,12 @@ const SPACE_URL = 'https://openvibe.space';
const MOVED = 'Static hosting moved to OpenVibe.Space.';
const MOVED = 'Static hosting moved to OpenVibe.Space.';
const DASHBOARD_CSP_HEADER = Object.entries({
const DASHBOARD_CSP_HEADER = Object.entries({
'default-src': ["'self'"],
'default-src': ["'self'"],
- 'script-src': ["'self'", "'unsafe-inline'", 'https://openvibe.network'],
+ // Cloudflare Web Analytics: the edge injects its beacon into every page (as on Wiki and Live).
+ 'script-src': ["'self'", "'unsafe-inline'", 'https://openvibe.network', 'https://static.cloudflareinsights.com'],
'style-src': ["'self'", "'unsafe-inline'", 'https://openvibe.network', 'https://fonts.googleapis.com', 'https://cdnjs.cloudflare.com'],
'style-src': ["'self'", "'unsafe-inline'", 'https://openvibe.network', 'https://fonts.googleapis.com', 'https://cdnjs.cloudflare.com'],
'font-src': ["'self'", 'data:', 'https://fonts.gstatic.com', 'https://cdnjs.cloudflare.com'],
'font-src': ["'self'", 'data:', 'https://fonts.gstatic.com', 'https://cdnjs.cloudflare.com'],
'img-src': ["'self'", 'data:', 'https:'],
'img-src': ["'self'", 'data:', 'https:'],
- 'connect-src': ["'self'", 'https://openvibe.network', 'https://openvibe.events'],
+ 'connect-src': ["'self'", 'https://openvibe.network', 'https://openvibe.events', 'https://cloudflareinsights.com'],
'frame-src': ["'self'", 'https://openvibe.network'],
'frame-src': ["'self'", 'https://openvibe.network'],
'frame-ancestors': ["'none'"], 'object-src': ["'none'"], 'base-uri': ["'self'"],
'frame-ancestors': ["'none'"], 'object-src': ["'none'"], 'base-uri': ["'self'"],
'form-action': ["'self'", 'https://openvibe.network'],
'form-action': ["'self'", 'https://openvibe.network'],
new file mode 100644
new file mode 100644
@@ -0,0 +1,14 @@
@@ -0,0 +1,14 @@
+'use strict';
+// The page CSP lets Cloudflare Web Analytics run: the edge injects its beacon (static.cloudflareinsights.com) into every
+// page and it reports to cloudflareinsights.com. Without them every visitor's console showed a CSP violation and no
+// analytics came from this site (a signed-in browser pass of every site, 2026-10-15). Wiki and Live allow the same.
+const assert = require('assert');
+const fs = require('fs');
+const path = require('path');
+
+const app = fs.readFileSync(path.join(__dirname, '..', 'server', 'app.js'), 'utf8');
+const script = /(scriptSrc|'script-src'|"script-src)[^\n]*/.exec(app);
+const connect = /(connectSrc|'connect-src'|"connect-src)[^\n]*/.exec(app);
+assert.ok(script && script[0].includes('https://static.cloudflareinsights.com'), 'script-src allows the beacon');
+assert.ok(connect && connect[0].includes('https://cloudflareinsights.com'), 'connect-src allows its reports');
+console.log('csp: Cloudflare Web Analytics is allowed');