debian-mirror-gitlab/app/uploaders/import_export_uploader.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
662 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
2018-11-08 19:23:39 +05:30
class ImportExportUploader < AttachmentUploader
2021-12-11 22:18:48 +05:30
EXTENSION_ALLOWLIST = %w[tar.gz gz].freeze
2018-11-08 19:23:39 +05:30
2020-03-13 15:44:24 +05:30
def self.workhorse_local_upload_path
File.join(options.storage_path, 'uploads', TMP_UPLOAD_PATH)
end
2018-11-08 19:23:39 +05:30
def extension_whitelist
2021-12-11 22:18:48 +05:30
EXTENSION_ALLOWLIST
2018-11-08 19:23:39 +05:30
end
def move_to_cache
2022-04-04 11:22:00 +05:30
# Exports create temporary files that we can safely move.
# Imports may be from project templates that we want to copy.
return super if mounted_as == :export_file
2018-11-08 19:23:39 +05:30
false
end
2020-04-22 19:07:51 +05:30
def work_dir
File.join(Settings.shared['path'], 'tmp', 'work')
end
def cache_dir
File.join(Settings.shared['path'], 'tmp', 'cache')
end
2018-11-08 19:23:39 +05:30
end