Let Sentry DSN through CSP

This commit is contained in:
Alex Gleason 2023-10-05 17:47:03 -05:00
parent a110a395c1
commit 5cd3711e2f
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -91,6 +91,7 @@ defp csp_string do
static_url = Pleroma.Web.Endpoint.static_url()
websocket_url = Pleroma.Web.Endpoint.websocket_url()
report_uri = Config.get([:http_security, :report_uri])
sentry_dsn = Config.get([:frontend_configurations, :soapbox_fe, "sentryDsn"])
img_src = "img-src 'self' data: blob:"
media_src = "media-src 'self'"
@ -122,6 +123,13 @@ defp csp_string do
connect_src
end
connect_src =
if sentry_dsn do
[connect_src, " ", build_csp_param(sentry_dsn)]
else
connect_src
end
script_src =
if Config.get(:env) == :dev do
"script-src 'self' 'unsafe-eval'"