in the env: stanza in my yml for a fairly standard multisite configuration. All of the CDN urls get rejected by the browser as a CSP error.
content security policy script src claims “Additional whitelisted script sources. The current host and CDN are included by default. See Mitigate XSS Attacks with Content Security Policy.”, but when I define it (or add/remove it to discourse.conf and sv restart unicorn), I get this:
even with content security policy report only set to true, the site still won’t load.
Turning off content_security_policy or adding the CDN URL to content security policy script src seems to be required to get the browser to load the assets.
CDN URLs should be computed and included in the CSP by default. Could you also provide (or try comparing) the actual CSP served in the header and the source of the blocked assets?
And here is the URL for one of the assets that won’t load: https://lcsupport-92e2.kxcdn.com/brotli_asset/preload-store-d32dcf974dddcac742f8a7a6aa7fcd686185920b201029d0ecb2b85527ef9034.js
We prioritize using DISCOURSE_S3_CDN_URL for assets when available. This aligns with the CDN asset URL generation.
@pfaffman Does GlobalSetting.use_s3? return true for your site?
I wonder if we need an additional GlobalSetting.use_s3? check here. Does having GlobalSetting.s3_cdn_url necessarily imply GlobalSetting.use_s3?? I’m a bit hazy with asset genereation / S3 CDN now could someone more familiar with it also take a look? Thanks!