mirror of https://github.com/buster-so/buster.git
Update content security policy to allow post hog
This commit is contained in:
parent
0ef86fbe30
commit
251e34824d
|
@ -16,11 +16,14 @@ const createCspHeader = (isEmbed = false) => {
|
|||
.replace('http', 'ws')
|
||||
: '';
|
||||
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
const localDomains = isDev ? 'http://127.0.0.1:* ws://127.0.0.1:*' : '';
|
||||
|
||||
return [
|
||||
// Default directives
|
||||
"default-src 'self'",
|
||||
// Scripts
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://vercel.live https://*.vercel.app https://cdn.jsdelivr.net https://*.cloudflareinsights.com",
|
||||
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://vercel.live https://*.vercel.app https://cdn.jsdelivr.net https://*.cloudflareinsights.com https://*.posthog.com",
|
||||
// Styles
|
||||
"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://cdn.jsdelivr.net",
|
||||
// Images
|
||||
|
@ -32,7 +35,7 @@ const createCspHeader = (isEmbed = false) => {
|
|||
// Frame sources
|
||||
"frame-src 'self' https://vercel.live",
|
||||
// Connect sources for API calls
|
||||
`connect-src 'self' http://127.0.0.1:* ws://127.0.0.1:* https://*.vercel.app https://*.supabase.co wss://*.supabase.co ${apiUrl} ${wsUrl}`.trim(),
|
||||
`connect-src 'self' ${localDomains} https://*.vercel.app https://*.supabase.co wss://*.supabase.co https://*.posthog.com ${apiUrl} ${wsUrl}`.trim(),
|
||||
// Media
|
||||
"media-src 'self'",
|
||||
// Object
|
||||
|
|
|
@ -264,8 +264,6 @@ const DropdownMenuLink: React.FC<{
|
|||
</div>
|
||||
);
|
||||
|
||||
console.log(link, isExternal, linkTarget);
|
||||
|
||||
return (
|
||||
<span className={className} onClick={(e) => e.stopPropagation()}>
|
||||
<Link href={link} target={linkTarget || isExternal ? '_blank' : '_self'} className="">
|
||||
|
|
|
@ -26,7 +26,11 @@ const options: Partial<PostHogConfig> = {
|
|||
recordBody: true
|
||||
},
|
||||
loaded: (x) => {
|
||||
console.log('Posthog loaded', x);
|
||||
console.log(
|
||||
'%c🎉 Posthog loaded! 🚀',
|
||||
'background: linear-gradient(to right, #ff6b6b, #4ecdc4); color: white; font-size: 20px; font-weight: bold; padding: 10px; border-radius: 5px;',
|
||||
x
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -37,12 +41,6 @@ const PosthogWrapper: React.FC<PropsWithChildren<{}>> = ({ children }) => {
|
|||
const team = userTeams[0];
|
||||
|
||||
useEffect(() => {
|
||||
console.log('user', user);
|
||||
console.log('team', team);
|
||||
console.log(POSTHOG_KEY);
|
||||
console.log(isServer);
|
||||
console.log(posthog);
|
||||
|
||||
if (POSTHOG_KEY && !isServer && user && posthog && team) {
|
||||
posthog.init(POSTHOG_KEY, options);
|
||||
|
||||
|
|
Loading…
Reference in New Issue