refactor: move config to application.rb

This commit is contained in:
Shivam Mishra
2026-03-26 10:00:45 +05:30
parent a0abd167dc
commit 805ee8403c
2 changed files with 6 additions and 15 deletions
+6
View File
@@ -69,6 +69,12 @@ module Chatwoot
# Disable PDF/video preview generation as we don't use them
config.active_storage.previewers = []
# Restrict content types served inline to prevent XSS via uploaded files (e.g. PDFs with embedded JavaScript).
config.active_storage.content_types_allowed_inline = %w[
image/png image/gif image/jpeg image/tiff image/vnd.adobe.photoshop
image/vnd.microsoft.icon image/webp image/avif image/heic image/heif
]
# Active Record Encryption configuration
# Required for MFA/2FA features - skip if not using encryption
if ENV['ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY'].present?
-15
View File
@@ -1,15 +0,0 @@
# Restrict content types served inline to prevent XSS via uploaded files.
# PDFs with embedded JavaScript can execute in-browser when served with
# Content-Disposition: inline. Force them to download instead.
Rails.application.config.active_storage.content_types_allowed_inline = %w[
image/png
image/gif
image/jpeg
image/tiff
image/vnd.adobe.photoshop
image/vnd.microsoft.icon
image/webp
image/avif
image/heic
image/heif
]