Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions config/initializers/content_security_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,23 @@
#
# :unsafe_eval, allows execution of eval statements
# :unsafe_inline, allows inline resources usage
FRONTEND_URL = 'http://localhost:4200'

policy.default_src :none unless Rails.env.development?
policy.font_src :self, "http://localhost:4200/text-security-disc-compat.eot?#iefix",
"http://localhost:4200/text-security-disc.woff2",
"http://localhost:4200/text-security-disc-compat.ttf"

policy.img_src :self
policy.connect_src :self, 'https://sentry.puzzle.ch'

policy.font_src :self
policy.font_src :self, :https, "#{FRONTEND_URL}/text-security-disc-compat.eot?#iefix",
"#{FRONTEND_URL}/text-security-disc.woff2",
"#{FRONTEND_URL}/text-security-disc-compat.ttf" if Rails.env.development?

policy.script_src :self
policy.script_src :self, :unsafe_eval, "http://localhost:4200" if Rails.env.development?
policy.script_src :self, :unsafe_eval, FRONTEND_URL if Rails.env.development?

policy.style_src :self, :unsafe_inline
policy.style_src :self, :unsafe_inline, "http://localhost:4200" if Rails.env.development?
policy.style_src :self, :unsafe_inline, FRONTEND_URL if Rails.env.development?

# If you are using webpack-dev-server then specify webpack-dev-server host
policy.connect_src :self, "http://localhost:3035", "ws://localhost:4200" if Rails.env.development?
Expand Down
8 changes: 4 additions & 4 deletions frontend/app/styles/secret-input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

@font-face {
font-family: "text-security-disc";
src: url("/text-security-disc-compat.eot");
src: url("/text-security-disc-compat.eot?#iefix") format("embedded-opentype"),
url("/text-security-disc.woff2") format("woff2"),
url("/text-security-disc-compat.ttf") format("truetype");
src: url("http://localhost:3000/text-security-disc-compat.eot");
Comment thread
kcinay055679 marked this conversation as resolved.
Outdated
src: url("http://localhost:3000/text-security-disc-compat.eot?#iefix") format("embedded-opentype"),
url("http://localhost:3000/text-security-disc.woff2") format("woff2"),
url("http://localhost:3000/text-security-disc-compat.ttf") format("truetype");
}

input.secret {
Expand Down