diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 11:43:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 11:43:02 +0300 |
commit | d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb (patch) | |
tree | 2341ef426af70ad1e289c38036737e04b0aa5007 /app/models/instance_configuration.rb | |
parent | d6e514dd13db8947884cd58fe2a9c2a063400a9b (diff) |
Add latest changes from gitlab-org/gitlab@14-4-stable-eev14.4.0-rc42
Diffstat (limited to 'app/models/instance_configuration.rb')
-rw-r--r-- | app/models/instance_configuration.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/app/models/instance_configuration.rb b/app/models/instance_configuration.rb index 9565dae08b5..0bf9e805aa8 100644 --- a/app/models/instance_configuration.rb +++ b/app/models/instance_configuration.rb @@ -22,7 +22,12 @@ class InstanceConfiguration private def ssh_algorithms_hashes - SSH_ALGORITHMS.map { |algo| ssh_algorithm_hashes(algo) }.compact + SSH_ALGORITHMS.select { |algo| ssh_algorithm_enabled?(algo) }.map { |algo| ssh_algorithm_hashes(algo) }.compact + end + + def ssh_algorithm_enabled?(algorithm) + algorithm_key_restriction = application_settings["#{algorithm.downcase}_key_restriction"] + algorithm_key_restriction.nil? || algorithm_key_restriction != ApplicationSetting::FORBIDDEN_KEY_VALUE end def host @@ -98,6 +103,11 @@ class InstanceConfiguration requests_per_period: application_settings[:throttle_authenticated_packages_api_requests_per_period], period_in_seconds: application_settings[:throttle_authenticated_packages_api_period_in_seconds] }, + authenticated_git_lfs_api: { + enabled: application_settings[:throttle_authenticated_git_lfs_enabled], + requests_per_period: application_settings[:throttle_authenticated_git_lfs_requests_per_period], + period_in_seconds: application_settings[:throttle_authenticated_git_lfs_period_in_seconds] + }, issue_creation: application_setting_limit_per_minute(:issues_create_limit), note_creation: application_setting_limit_per_minute(:notes_create_limit), project_export: application_setting_limit_per_minute(:project_export_limit), |