Preview Issues. (CSP related) [Directus Cloud]

For me, the live editing and previews are not working, seemingly because the directus professtional CSP is setting the following Content Security Policy directive: “frame-src https://*”.

Refused to frame ‘http://localhost:3000/’ because it violates the following Content Security Policy directive: “frame-src https://*”.

Any advice would be great!

Seems to be confirmed, hacking the CSP out of the headers using a browser plugin fixes the issue

3 Answers

3

Try setting it here

`CONTENT_SECURITY_POLICY_DIRECTIVES__IMG_SRC`

This is not possible in the cloud version is it?

https://directus.io/docs/cloud/configuration/environment-variables

I’m copying this over from the docs:

Usage with Directus Cloud and local development Connecting your local development environment to a Directus Cloud Starter or Professional instance must be done by exposing your localhost to the web through an SSL secured connection. There are multiple ways to achieve this:

Source: https://directus.io/docs/guides/content/visual-editor/frontend-library

I tried this, but the rule https://* only allows servers on the default port 443, which is already in use by my machine and is also requiring sudo access and is not reccomended

Refused to frame 'https://dev:3000/' because it violates the following Content Security Policy directive: "frame-src https://*".

Does the same concept works for the self hosting as well? because I'm having similar case, I want to trigger a sign process from the USB Token on the client machine.

Added a feature request.