Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSP prevents loading of all images #2479

Closed
sgrigson opened this issue Nov 20, 2023 · 4 comments · Fixed by #2480
Closed

CSP prevents loading of all images #2479

sgrigson opened this issue Nov 20, 2023 · 4 comments · Fixed by #2480
Labels

Comments

@sgrigson
Copy link

Steps to reproduce the problem

  1. Update to latest Glitch-Soc
  2. All images are broken
    ...

Refused to load the image '<URL>' because it violates the following Content Security Policy directive: "img-src 'self' data: blob: <URL>".

Expected behaviour

Images should load

Actual behaviour

CSP blocks loading of all images

Detailed description

No response

Mastodon instance

oliphant.social

Mastodon version

v4.3.0-alpha.0+glitch

Technical details

If this is happening on your own Mastodon server, please fill out those:

  • Ruby version: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
  • Node.js version: v20.9.0
@sgrigson sgrigson added the bug label Nov 20, 2023
@sgrigson sgrigson changed the title CSP prevents loading of local images CSP prevents loading of all images Nov 20, 2023
@sgrigson
Copy link
Author

Fix:

mastodon@oliphant:~/live$ git checkout glitch-soc/main~2
Previous HEAD position was 769ab0ce47 Merge pull request #2475 from ClearlyClaire/glitch-soc/cleanup
HEAD is now at c34a3a83e1 Merge pull request #2471 from ClearlyClaire/glitch-soc/cleanup

Once I did that and did another bundle install && yarn install as well as precompile and restart, everything was golden again.

@Plastikmensch
Copy link

Are you using external media storage by chance?

I just loaded the new policy and it is working fine for me.
I'm not familiar enough with CSP to really pinpoint the issue or suggest a fix.

@eallion
Copy link

eallion commented Nov 21, 2023

I use Docker and host media files on Cloudflare R2. I have watchtower set up to automatically update the Docker images nightly. This was working fine yesterday, but today I started getting CSP errors.

@Plastikmensch
Copy link

Ugh, Cloudflare...

Seems that the new CSP doesn't properly allow external media storage then :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants