diff options
Diffstat (limited to 'app/models/application_setting.rb')
-rw-r--r-- | app/models/application_setting.rb | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 9b9db7f93fd..5655ea4d4bf 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -171,7 +171,7 @@ class ApplicationSetting < ApplicationRecord validates :default_artifacts_expire_in, presence: true, duration: true validates :container_expiration_policies_enable_historic_entries, - inclusion: { in: [true, false], message: 'must be a boolean value' } + inclusion: { in: [true, false], message: _('must be a boolean value') } validates :container_registry_token_expire_delay, presence: true, @@ -303,9 +303,15 @@ class ApplicationSetting < ApplicationRecord validates :container_registry_delete_tags_service_timeout, numericality: { only_integer: true, greater_than_or_equal_to: 0 } + validates :container_registry_cleanup_tags_service_max_list_size, + numericality: { only_integer: true, greater_than_or_equal_to: 0 } + validates :container_registry_expiration_policies_worker_capacity, numericality: { only_integer: true, greater_than_or_equal_to: 0 } + validates :invisible_captcha_enabled, + inclusion: { in: [true, false], message: _('must be a boolean value') } + SUPPORTED_KEY_TYPES.each do |type| validates :"#{type}_key_restriction", presence: true, key_restriction: { type: type } end @@ -400,6 +406,42 @@ class ApplicationSetting < ApplicationRecord validates :ci_jwt_signing_key, rsa_key: true, allow_nil: true + validates :rate_limiting_response_text, + length: { maximum: 255, message: _('is too long (maximum is %{count} characters)') }, + allow_blank: true + + validates :throttle_unauthenticated_requests_per_period, + presence: true, + numericality: { only_integer: true, greater_than: 0 } + + validates :throttle_unauthenticated_period_in_seconds, + presence: true, + numericality: { only_integer: true, greater_than: 0 } + + validates :throttle_authenticated_api_requests_per_period, + presence: true, + numericality: { only_integer: true, greater_than: 0 } + + validates :throttle_authenticated_api_period_in_seconds, + presence: true, + numericality: { only_integer: true, greater_than: 0 } + + validates :throttle_authenticated_web_requests_per_period, + presence: true, + numericality: { only_integer: true, greater_than: 0 } + + validates :throttle_authenticated_web_period_in_seconds, + presence: true, + numericality: { only_integer: true, greater_than: 0 } + + validates :throttle_protected_paths_requests_per_period, + presence: true, + numericality: { only_integer: true, greater_than: 0 } + + validates :throttle_protected_paths_period_in_seconds, + presence: true, + numericality: { only_integer: true, greater_than: 0 } + attr_encrypted :asset_proxy_secret_key, mode: :per_attribute_iv, key: Settings.attr_encrypted_db_key_base_truncated, @@ -430,7 +472,7 @@ class ApplicationSetting < ApplicationRecord attr_encrypted :cloud_license_auth_token, encryption_options_base_truncated_aes_256_gcm validates :disable_feed_token, - inclusion: { in: [true, false], message: 'must be a boolean value' } + inclusion: { in: [true, false], message: _('must be a boolean value') } before_validation :ensure_uuid! |