diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 09:55:51 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 09:55:51 +0000 |
commit | e8d2c2579383897a1dd7f9debd359abe8ae8373d (patch) | |
tree | c42be41678c2586d49a75cabce89322082698334 /app/models/application_setting.rb | |
parent | fc845b37ec3a90aaa719975f607740c22ba6a113 (diff) | |
download | gitlab-ce-e8d2c2579383897a1dd7f9debd359abe8ae8373d.tar.gz |
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'app/models/application_setting.rb')
-rw-r--r-- | app/models/application_setting.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index f8047ed9b78..a7140cc0718 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -172,6 +172,11 @@ class ApplicationSetting < ApplicationRecord addressable_url: { enforce_sanitization: true }, if: :gitpod_enabled + validates :mailgun_signing_key, + presence: true, + length: { maximum: 255 }, + if: :mailgun_events_enabled + validates :snowplow_collector_hostname, presence: true, hostname: true, @@ -288,7 +293,7 @@ class ApplicationSetting < ApplicationRecord validates :user_default_internal_regex, js_regex: true, allow_nil: true validates :personal_access_token_prefix, - format: { with: /\A[a-zA-Z0-9_+=\/@:.-]+\z/, + format: { with: %r{\A[a-zA-Z0-9_+=/@:.-]+\z}, message: _("can contain only letters of the Base64 alphabet (RFC4648) with the addition of '@', ':' and '.'") }, length: { maximum: 20, message: _('is too long (maximum is %{count} characters)') }, allow_blank: true @@ -372,6 +377,8 @@ class ApplicationSetting < ApplicationRecord end end + validate :check_valid_runner_registrars + validate :terms_exist, if: :enforce_terms? validates :external_authorization_service_default_label, @@ -550,6 +557,7 @@ class ApplicationSetting < ApplicationRecord attr_encrypted :secret_detection_token_revocation_token, encryption_options_base_32_aes_256_gcm attr_encrypted :cloud_license_auth_token, encryption_options_base_32_aes_256_gcm attr_encrypted :external_pipeline_validation_service_token, encryption_options_base_32_aes_256_gcm + attr_encrypted :mailgun_signing_key, encryption_options_base_32_aes_256_gcm.merge(encode: false) validates :disable_feed_token, inclusion: { in: [true, false], message: _('must be a boolean value') } @@ -582,7 +590,7 @@ class ApplicationSetting < ApplicationRecord end def sourcegraph_url_is_com? - !!(sourcegraph_url =~ /\Ahttps:\/\/(www\.)?sourcegraph\.com/) + !!(sourcegraph_url =~ %r{\Ahttps://(www\.)?sourcegraph\.com}) end def instance_review_permitted? |