Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/object_storage/config.rb')
-rw-r--r--lib/object_storage/config.rb24
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/object_storage/config.rb b/lib/object_storage/config.rb
index 056e22278dd..8a2044a8cba 100644
--- a/lib/object_storage/config.rb
+++ b/lib/object_storage/config.rb
@@ -6,6 +6,18 @@ module ObjectStorage
AZURE_PROVIDER = 'AzureRM'
GOOGLE_PROVIDER = 'Google'
+ LOCATIONS = {
+ artifacts: Gitlab.config.artifacts,
+ ci_secure_files: Gitlab.config.ci_secure_files,
+ dependency_proxy: Gitlab.config.dependency_proxy,
+ external_diffs: Gitlab.config.external_diffs,
+ lfs: Gitlab.config.lfs,
+ packages: Gitlab.config.packages,
+ pages: Gitlab.config.pages,
+ terraform_state: Gitlab.config.terraform_state,
+ uploads: Gitlab.config.uploads
+ }.freeze
+
attr_reader :options
def initialize(options)
@@ -13,7 +25,7 @@ module ObjectStorage
end
def credentials
- @credentials ||= options[:connection] || {}
+ @credentials ||= connection_params
end
def storage_options
@@ -86,6 +98,16 @@ module ObjectStorage
private
+ def connection_params
+ base_params = options[:connection] || {}
+
+ return base_params unless base_params[:provider].to_s == AWS_PROVIDER
+ return base_params unless ::Gitlab::FIPS.enabled?
+
+ # In fog-aws, this disables the use of Content-Md5: https://github.com/fog/fog-aws/pull/668
+ base_params.merge({ disable_content_md5_validation: true })
+ end
+
# This returns a Hash of HTTP encryption headers to send along to S3.
#
# They can also be passed in as Fog::AWS::Storage::File attributes, since there