Class: Repositories::CommitsUploader

Inherits:
GitlabUploader
  • Object
show all
Includes:
ObjectStorage::Concern
Defined in:
app/uploaders/repositories/commits_uploader.rb

Constant Summary collapse

DEFAULT_MAX_REQUEST_SIZE =
300.megabytes
MAX_RATE_LIMITED_REQUEST_SIZE =
20.megabytes

Constants inherited from GitlabUploader

GitlabUploader::ObjectNotReadyError, GitlabUploader::PROTECTED_METHODS

Class Method Summary collapse

Methods included from ObjectStorage::Concern

#cache!, #delete_migrated_file, #delete_tmp_file_after_storage, #direct_download_enabled?, #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?, #proxy_download_enabled?, #retrieve_from_store!, #store!, #store_dir, #store_dirs, #store_path, #upload_paths, #use_file, #use_open_file

Methods included from Gitlab::Utils::Override

#extended, extensions, #included, #method_added, #override, #prepended, #queue_verification, verify!

Methods inherited from GitlabUploader

absolute_path, base_dir, #cache_dir, #cached_size, #check_remote_file_existence_on_upload?, #empty_size?, #exists?, #file_cache_storage?, file_storage?, #filename, #initialize, #local_url, #model_valid?, #move_to_cache, #move_to_store, #multi_read, #open, #options, options, #relative_path, #replace_file_without_saving!, root, storage_location, #sync_model_object_store?, #url_or_file_path, version, #work_dir

Constructor Details

This class inherits a constructor from GitlabUploader

Class Method Details

.direct_upload_enabled?Boolean



17
18
19
# File 'app/uploaders/repositories/commits_uploader.rb', line 17

def self.direct_upload_enabled?
  false
end

.max_request_sizeObject



25
26
27
# File 'app/uploaders/repositories/commits_uploader.rb', line 25

def self.max_request_size
  ENV.fetch('GITLAB_COMMITS_MAX_REQUEST_SIZE_BYTES', DEFAULT_MAX_REQUEST_SIZE).to_i
end

.workhorse_authorize(has_length: true, maximum_size: max_request_size, **kwargs) ⇒ Object



21
22
23
# File 'app/uploaders/repositories/commits_uploader.rb', line 21

def self.workhorse_authorize(has_length: true, maximum_size: max_request_size, **kwargs)
  super
end

.workhorse_local_upload_pathObject

On Cloud Native GitLab, /srv/gitlab/public/uploads/tmp is a shared mount. Use a subpath from that directory to ensure the gitlab-workhorse and webservice containers can both access this directory.



13
14
15
# File 'app/uploaders/repositories/commits_uploader.rb', line 13

def self.workhorse_local_upload_path
  Rails.root.join('public/uploads/tmp/commits').to_s
end