diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index f6472d8..e8498c6 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -31,7 +31,18 @@ maskAllText: true, blockAllMedia: true, }), + Sentry.feedbackIntegration({ + colorScheme: "system", + }), ], + + beforeSend(event, hint) { + // Check if it is an exception, and if so, show the report dialog + if (event.exception && event.event_id) { + Sentry.showReportDialog({ eventId: event.event_id }); + } + return event; + }, }); <% end %> <% end %> diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb index 799d020..e4923d0 100644 --- a/config/initializers/content_security_policy.rb +++ b/config/initializers/content_security_policy.rb @@ -6,15 +6,17 @@ Rails.application.configure do config.content_security_policy do |policy| - policy.default_src :none + policy.default_src :none policy.connect_src :self, "https://rebound.postmarkapp.com/check", "https://*.sentry.io/" policy.font_src :self, :data policy.img_src :self, :data policy.object_src :none - policy.script_src :self, "'strict-dynamic'", "https://code.ionicframework.com", "https://cdn.jsdelivr.net/npm/toastify-js", "https://ga.jspm.io/npm:@sentry/", "https://ga.jspm.io/npm:@sentry-internal/", "https://rebound.postmarkapp.com/", "https://esm.sh/v135/selectlist-polyfill@0.3.0/", "https://ga.jspm.io/npm:local-time@3.0.2/", "https://esm.sh/selectlist-polyfill@0.3.0/" + policy.script_src :self, "'strict-dynamic'", "/assets/application-fc375a13c2567d620a5507305e2b53993b07847f.js" "https://code.ionicframework.com", "https://cdn.jsdelivr.net/npm/toastify-js", "https://ga.jspm.io/npm:@sentry/", "https://ga.jspm.io/npm:@sentry-internal/", "https://rebound.postmarkapp.com/", "https://esm.sh/v135/selectlist-polyfill@0.3.0/", "https://ga.jspm.io/npm:local-time@3.0.2/", "https://esm.sh/selectlist-polyfill@0.3.0/" policy.style_src :self, "https://unpkg.com/cursor-chat/dist/style.css", "https://code.ionicframework.com", "https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css" policy.style_src_attr :self, "'unsafe-inline'" policy.script_src_attr :self, "'unsafe-inline'" + policy.style_src_elem :self, "'unsafe-inline'", "https://unpkg.com/cursor-chat/dist/style.css", "https://code.ionicframework.com", "https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css" + policy.frame_ancestors :self policy.base_uri :self policy.form_action :self