Merge branch 'master' into dev

This commit is contained in:
Eugene Burmakin 2025-12-08 19:52:05 +01:00
commit 6cc8ba0fbd
5 changed files with 18 additions and 7 deletions

View file

@ -87,7 +87,13 @@ class Users::ImportData
Rails.logger.debug "Extracting #{entry.name} to #{extraction_path}"
FileUtils.mkdir_p(File.dirname(extraction_path))
entry.extract(sanitized_name, destination_directory: @import_directory)
# Manual extraction to bypass size validation for large files
entry.get_input_stream do |input|
File.open(extraction_path, 'wb') do |output|
IO.copy_stream(input, output)
end
end
end
end
end

View file

@ -37,6 +37,6 @@ module Dawarich
config.active_job.queue_adapter = :sidekiq
config.action_mailer.preview_paths << "#{Rails.root}/spec/mailers/previews"
config.action_mailer.preview_paths << "#{Rails.root.join('spec/mailers/previews')}"
end
end

View file

@ -103,7 +103,7 @@ Rails.application.configure do
# /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
# ]
# Skip DNS rebinding protection for the health check endpoint.
config.host_authorization = { exclude: ->(request) { request.path == "/api/v1/health" } }
config.host_authorization = { exclude: ->(request) { request.path == '/api/v1/health' } }
hosts = ENV.fetch('APPLICATION_HOSTS', 'localhost').split(',').map(&:strip)
config.action_mailer.default_url_options = { host: ENV['DOMAIN'] }

View file

@ -2,14 +2,17 @@
require 'aws-sdk-core'
# Support both AWS_ENDPOINT and AWS_ENDPOINT_URL for backwards compatibility
endpoint_url = ENV['AWS_ENDPOINT_URL'] || ENV['AWS_ENDPOINT']
if ENV['AWS_ACCESS_KEY_ID'] &&
ENV['AWS_SECRET_ACCESS_KEY'] &&
ENV['AWS_REGION'] &&
ENV['AWS_ENDPOINT']
endpoint_url
Aws.config.update(
{
region: ENV['AWS_REGION'],
endpoint: ENV['AWS_ENDPOINT'],
endpoint: endpoint_url,
credentials: Aws::Credentials.new(ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY'])
}
)

View file

@ -7,14 +7,16 @@ local:
root: <%= Rails.root.join("storage") %>
# Only load S3 config if not in test environment
<% if !Rails.env.test? && ENV['AWS_ACCESS_KEY_ID'] && ENV['AWS_SECRET_ACCESS_KEY'] && ENV['AWS_REGION'] && ENV['AWS_BUCKET'] && ENV['AWS_ENDPOINT_URL'] %>
# Support both AWS_ENDPOINT and AWS_ENDPOINT_URL for backwards compatibility
<% endpoint_url = ENV['AWS_ENDPOINT_URL'] || ENV['AWS_ENDPOINT'] %>
<% if !Rails.env.test? && ENV['AWS_ACCESS_KEY_ID'] && ENV['AWS_SECRET_ACCESS_KEY'] && ENV['AWS_REGION'] && ENV['AWS_BUCKET'] && endpoint_url %>
s3:
service: S3
access_key_id: <%= ENV.fetch("AWS_ACCESS_KEY_ID") %>
secret_access_key: <%= ENV.fetch("AWS_SECRET_ACCESS_KEY") %>
region: <%= ENV.fetch("AWS_REGION") %>
bucket: <%= ENV.fetch("AWS_BUCKET") %>
endpoint: <%= ENV.fetch("AWS_ENDPOINT_URL") %>
endpoint: <%= endpoint_url %>
<% end %>
# Remember not to checkin your GCS keyfile to a repository