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:
authorThong Kuah <tkuah@gitlab.com>2019-09-12 01:35:10 +0300
committerThong Kuah <tkuah@gitlab.com>2019-09-12 01:35:10 +0300
commiteef1a7fe2c0964e0b507e3d7e557fc437570454c (patch)
tree6a1e5fdfb8014e68d75d6fca2a612d0824deff96 /app/models/application_setting.rb
parent6c89bc7eae70ad9a63c4014d6457a80c18412fe5 (diff)
parent3c2b4a1cede956d5160ccf08d0a561bf31248161 (diff)
Merge branch 'static-objects-external-storage' into 'master'
Enable serving static objects from an external storage See merge request gitlab-org/gitlab-ce!31025
Diffstat (limited to 'app/models/application_setting.rb')
-rw-r--r--app/models/application_setting.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb
index a2cf081375e..c9cd0140ed8 100644
--- a/app/models/application_setting.rb
+++ b/app/models/application_setting.rb
@@ -8,6 +8,7 @@ class ApplicationSetting < ApplicationRecord
add_authentication_token_field :runners_registration_token, encrypted: -> { Feature.enabled?(:application_settings_tokens_optional_encryption, default_enabled: true) ? :optional : :required }
add_authentication_token_field :health_check_access_token
+ add_authentication_token_field :static_objects_external_storage_auth_token
belongs_to :instance_administration_project, class_name: "Project"
@@ -202,6 +203,13 @@ class ApplicationSetting < ApplicationRecord
allow_blank: false,
if: :asset_proxy_enabled?
+ validates :static_objects_external_storage_url,
+ addressable_url: true, allow_blank: true
+
+ validates :static_objects_external_storage_auth_token,
+ presence: true,
+ if: :static_objects_external_storage_url?
+
SUPPORTED_KEY_TYPES.each do |type|
validates :"#{type}_key_restriction", presence: true, key_restriction: { type: type }
end