diff --git a/config/puma.rb b/config/puma.rb index d4a3e97417..9ba804fbd1 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -3,13 +3,13 @@ # Any libraries that use thread pools should be configured to match # the maximum value specified for Puma. # -threads_min_count = ENV.fetch("RAILS_MIN_THREADS") { 4 } -threads_max_count = ENV.fetch("RAILS_MAX_THREADS") { 16 } +threads_min_count = ENV.fetch("RAILS_MIN_THREADS") { 4 }.to_i +threads_max_count = ENV.fetch("RAILS_MAX_THREADS") { 16 }.to_i threads threads_min_count, [threads_min_count, threads_max_count].max # Specifies the `port` that Puma will listen on to receive requests; default is 3000. # -port ENV.fetch("PORT") { 3000 } +port ENV.fetch("PORT") { 3000 }.to_i # Specifies the `environment` that Puma will run in. # @@ -21,7 +21,7 @@ environment ENV.fetch("RAILS_ENV") { "development" } # Workers do not work on JRuby or Windows (both of which do not support # processes). # -workers ENV.fetch("OPENPROJECT_WEB_WORKERS") { 1 } +workers ENV.fetch("OPENPROJECT_WEB_WORKERS") { 1 }.to_i # Use the `preload_app!` method when specifying a `workers` number. # This directive tells Puma to first boot the application and load code diff --git a/modules/bim/lib/open_project/bim/engine.rb b/modules/bim/lib/open_project/bim/engine.rb index a1d6f4fd5e..cd928704c8 100644 --- a/modules/bim/lib/open_project/bim/engine.rb +++ b/modules/bim/lib/open_project/bim/engine.rb @@ -95,7 +95,7 @@ module OpenProject::Bim assets %w(bim/logo_openproject_bim_big.png) - patches %i[WorkPackage Type Journal RootSeeder Project] + patches %i[WorkPackage Type Journal RootSeeder Project FogFileUploader] patch_with_namespace :OpenProject, :CustomStyles, :ColorThemes patch_with_namespace :API, :V3, :Activities, :ActivityRepresenter diff --git a/modules/bim/lib/open_project/bim/patches/fog_file_uploader_patch.rb b/modules/bim/lib/open_project/bim/patches/fog_file_uploader_patch.rb new file mode 100644 index 0000000000..9c4348e932 --- /dev/null +++ b/modules/bim/lib/open_project/bim/patches/fog_file_uploader_patch.rb @@ -0,0 +1,15 @@ +module OpenProject::Bim::Patches::FogFileUploaderPatch + def self.included(base) # :nodoc: + base.prepend InstanceMethods + end + + module InstanceMethods + def fog_attributes + return super unless path.ends_with?(".bcf") + + { + "Content-Type" => "application/octet-stream" + } + end + end +end