Class: ImportExportUploader

Inherits:
AttachmentUploader show all
Defined in:
app/uploaders/import_export_uploader.rb

Constant Summary collapse

EXTENSION_WHITELIST =
%w[tar.gz gz].freeze

Constants included from Gitlab::FileTypeDetection

Gitlab::FileTypeDetection::DANGEROUS_AUDIO_EXT, Gitlab::FileTypeDetection::DANGEROUS_IMAGE_EXT, Gitlab::FileTypeDetection::DANGEROUS_VIDEO_EXT, Gitlab::FileTypeDetection::PDF_EXT, Gitlab::FileTypeDetection::SAFE_AUDIO_EXT, Gitlab::FileTypeDetection::SAFE_IMAGE_EXT, Gitlab::FileTypeDetection::SAFE_IMAGE_FOR_SCALING_EXT, Gitlab::FileTypeDetection::SAFE_VIDEO_EXT

Instance Attribute Summary

Attributes included from RecordsUploads::Concern

#upload

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Gitlab::FileMarkdownLinkBuilder

#markdown_link, #markdown_name

Methods included from Gitlab::FileTypeDetection

#audio?, #dangerous_audio?, #dangerous_embeddable?, #dangerous_image?, #dangerous_video?, #embeddable?, extension_match?, #image?, #image_safe_for_scaling?, #pdf?, #video?

Methods included from ObjectStorage::Concern

#cache!, #delete_migrated_file, #exclusive_lease_key, #exists?, #file_cache_storage?, #file_storage?, #filename, #filename=, #fog_attributes, #fog_credentials, #fog_directory, #fog_public, #migrate!, #object_store, #object_store=, #persist_object_store!, #persist_object_store?, #schedule_background_upload, #store!, #store_dir, #store_dirs, #upload_paths, #use_file

Methods included from RecordsUploads::Concern

#filename, #readd_upload, #record_upload, #upload_path

Methods inherited from GitlabUploader

absolute_path, base_dir, #cached_size, #exists?, #file_cache_storage?, file_storage?, #filename, #initialize, #local_url, #model_valid?, #move_to_store, #open, #relative_path, #replace_file_without_saving!, root, storage_options

Constructor Details

This class inherits a constructor from GitlabUploader

Class Method Details

.workhorse_local_upload_pathObject


6
7
8
# File 'app/uploaders/import_export_uploader.rb', line 6

def self.workhorse_local_upload_path
  File.join(options.storage_path, 'uploads', TMP_UPLOAD_PATH)
end

Instance Method Details

#cache_dirObject


22
23
24
# File 'app/uploaders/import_export_uploader.rb', line 22

def cache_dir
  File.join(Settings.shared['path'], 'tmp', 'cache')
end

#extension_whitelistObject


10
11
12
# File 'app/uploaders/import_export_uploader.rb', line 10

def extension_whitelist
  EXTENSION_WHITELIST
end

#move_to_cacheObject


14
15
16
# File 'app/uploaders/import_export_uploader.rb', line 14

def move_to_cache
  false
end

#work_dirObject


18
19
20
# File 'app/uploaders/import_export_uploader.rb', line 18

def work_dir
  File.join(Settings.shared['path'], 'tmp', 'work')
end