Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/application_setting_implementation.rb')
-rw-r--r--app/models/application_setting_implementation.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/models/application_setting_implementation.rb b/app/models/application_setting_implementation.rb
index b613e698471..d7a594af84c 100644
--- a/app/models/application_setting_implementation.rb
+++ b/app/models/application_setting_implementation.rb
@@ -15,6 +15,7 @@ module ApplicationSettingImplementation
# forbidden.
FORBIDDEN_KEY_VALUE = KeyRestrictionValidator::FORBIDDEN
SUPPORTED_KEY_TYPES = %i[rsa dsa ecdsa ed25519].freeze
+ VALID_RUNNER_REGISTRAR_TYPES = %w(project group).freeze
DEFAULT_PROTECTED_PATHS = [
'/users/password',
@@ -103,6 +104,8 @@ module ApplicationSettingImplementation
issues_create_limit: 300,
local_markdown_version: 0,
login_recaptcha_protection_enabled: false,
+ mailgun_signing_key: nil,
+ mailgun_events_enabled: false,
max_artifacts_size: Settings.artifacts['max_size'],
max_attachment_size: Settings.gitlab['max_attachment_size'],
max_import_size: 0,
@@ -186,6 +189,7 @@ module ApplicationSettingImplementation
user_default_external: false,
user_default_internal_regex: nil,
user_show_add_ssh_key_message: true,
+ valid_runner_registrars: VALID_RUNNER_REGISTRAR_TYPES,
wiki_page_max_content_bytes: 50.megabytes,
container_registry_delete_tags_service_timeout: 250,
container_registry_expiration_policies_worker_capacity: 0,
@@ -373,6 +377,10 @@ module ApplicationSettingImplementation
Settings.gitlab.usage_ping_enabled
end
+ def usage_ping_features_enabled?
+ usage_ping_enabled? && usage_ping_features_enabled
+ end
+
def usage_ping_enabled
usage_ping_can_be_configured? && super
end
@@ -507,6 +515,17 @@ module ApplicationSettingImplementation
end
end
+ def check_valid_runner_registrars
+ valid = valid_runner_registrar_combinations.include?(valid_runner_registrars)
+ errors.add(:valid_runner_registrars, _("%{value} is not included in the list") % { value: valid_runner_registrars }) unless valid
+ end
+
+ def valid_runner_registrar_combinations
+ 0.upto(VALID_RUNNER_REGISTRAR_TYPES.size).flat_map do |n|
+ VALID_RUNNER_REGISTRAR_TYPES.permutation(n).to_a
+ end
+ end
+
def terms_exist
return unless enforce_terms?