diff options
Diffstat (limited to 'app/uploaders')
-rw-r--r-- | app/uploaders/bulk_imports/export_uploader.rb | 2 | ||||
-rw-r--r-- | app/uploaders/file_uploader.rb | 9 | ||||
-rw-r--r-- | app/uploaders/import_export_uploader.rb | 4 |
3 files changed, 11 insertions, 4 deletions
diff --git a/app/uploaders/bulk_imports/export_uploader.rb b/app/uploaders/bulk_imports/export_uploader.rb index 356e5ce028e..cd6e599054b 100644 --- a/app/uploaders/bulk_imports/export_uploader.rb +++ b/app/uploaders/bulk_imports/export_uploader.rb @@ -2,6 +2,6 @@ module BulkImports class ExportUploader < ImportExportUploader - EXTENSION_WHITELIST = %w[ndjson.gz].freeze + EXTENSION_ALLOWLIST = %w[ndjson.gz].freeze end end diff --git a/app/uploaders/file_uploader.rb b/app/uploaders/file_uploader.rb index 20aab58243a..bd959b14648 100644 --- a/app/uploaders/file_uploader.rb +++ b/app/uploaders/file_uploader.rb @@ -32,7 +32,14 @@ class FileUploader < GitlabUploader def self.absolute_path(upload) File.join( - absolute_base_dir(upload.model), + root, + relative_path(upload) + ) + end + + def self.relative_path(upload) + File.join( + base_dir(upload.model), upload.path # already contain the dynamic_segment, see #upload_path ) end diff --git a/app/uploaders/import_export_uploader.rb b/app/uploaders/import_export_uploader.rb index 369afba2bae..7b161d72efb 100644 --- a/app/uploaders/import_export_uploader.rb +++ b/app/uploaders/import_export_uploader.rb @@ -1,14 +1,14 @@ # frozen_string_literal: true class ImportExportUploader < AttachmentUploader - EXTENSION_WHITELIST = %w[tar.gz gz].freeze + EXTENSION_ALLOWLIST = %w[tar.gz gz].freeze def self.workhorse_local_upload_path File.join(options.storage_path, 'uploads', TMP_UPLOAD_PATH) end def extension_whitelist - EXTENSION_WHITELIST + EXTENSION_ALLOWLIST end def move_to_cache |