My website is not loading after turning on the CSP settings

AI-generated summary

A user, Avinash_Kumar, encountered an issue where their Discourse forum (https://speakpress.com) stopped loading after enabling Content Security Policy (CSP) settings for Adsense integration. To resolve the issue, xrav3nz suggested using SSH to access the site and resetting the CSP setup to default via the Rails console with the command SiteSetting.content_security_policy_script_src = "".

Hi Team,

I have launched a discourse forum 1 month back and I was trying to enable Adsense.

I have used the below link to fix my CSP related erros and added following whitelisting parameters

1. 'self'
2. 'unsafe-inline'
3. 'unsafe-eval'
4.  'none'

Content-Security-Policy: script-src directive - HTTP | MDN

Now, my website is not loading.

Please help me bringing back my website, so that I can reset my CSP settings.
Below is my forum url
https://speakpress.com

You will need SSH access to your site, and open the Rails console with:

cd /var/discourse
./launcher enter app
rails c

Then,

SiteSetting.content_security_policy_script_src = ""

This will reset your CSP setup back to default, and you should be able to get back to your site.