Merge pull request #2090 from bdcorps/master

Allow embedding of "Share" dashboard as iframe
This commit is contained in:
Mike Cao 2023-06-29 17:06:46 -07:00 committed by GitHub
commit b8ef385dc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,13 +2,18 @@
require('dotenv').config();
const pkg = require('./package.json');
const CLOUD_URL = 'https://cloud.umami.is';
// Space-separated list of URLs that can load the "Share" dashboard, i.e. http://app.localhost:7000 https://*.vercel.app
const EMBED_HOSTED_URL = process.env.EMBED_HOSTED_URL;
const contentSecurityPolicy = `
default-src 'self';
img-src *;
script-src 'self' 'unsafe-eval';
style-src 'self' 'unsafe-inline';
connect-src 'self' api.umami.is;
frame-ancestors 'self';
frame-ancestors `self ${EMBED_HOSTED_URL}`;
`;
const headers = [