diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-05 23:11:43 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-05 23:11:43 +0000 |
commit | 13d327df4f3c52505bf8ec1144f2dedb6a351ad6 (patch) | |
tree | 546e42fe159cde302b5e4d0b923d399e79bfbf71 /app | |
parent | 9a70fcd2e277721bbe7b9a0c92ed925ddea201b6 (diff) | |
download | gitlab-ce-13d327df4f3c52505bf8ec1144f2dedb6a351ad6.tar.gz |
Add latest changes from gitlab-org/gitlab@13-9-stable-ee
Diffstat (limited to 'app')
-rw-r--r-- | app/models/application_setting.rb | 3 | ||||
-rw-r--r-- | app/models/application_setting_implementation.rb | 9 | ||||
-rw-r--r-- | app/services/application_settings/update_service.rb | 2 |
3 files changed, 10 insertions, 4 deletions
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb index 33c058dab96..4959401eb27 100644 --- a/app/models/application_setting.rb +++ b/app/models/application_setting.rb @@ -58,8 +58,9 @@ class ApplicationSetting < ApplicationRecord serialize :domain_allowlist, Array # rubocop:disable Cop/ActiveRecordSerialize serialize :domain_denylist, Array # rubocop:disable Cop/ActiveRecordSerialize serialize :repository_storages # rubocop:disable Cop/ActiveRecordSerialize - serialize :asset_proxy_allowlist, Array # rubocop:disable Cop/ActiveRecordSerialize + # See https://gitlab.com/gitlab-org/gitlab/-/issues/300916 + serialize :asset_proxy_allowlist, Array # rubocop:disable Cop/ActiveRecordSerialize serialize :asset_proxy_whitelist, Array # rubocop:disable Cop/ActiveRecordSerialize cache_markdown_field :sign_in_text diff --git a/app/models/application_setting_implementation.rb b/app/models/application_setting_implementation.rb index 2911ae6b1c8..08c16930b13 100644 --- a/app/models/application_setting_implementation.rb +++ b/app/models/application_setting_implementation.rb @@ -280,13 +280,18 @@ module ApplicationSettingImplementation self.notes_create_limit_allowlist = strings_to_array(values).map(&:downcase) end - def asset_proxy_allowlist=(values) + def asset_proxy_whitelist=(values) values = strings_to_array(values) if values.is_a?(String) # make sure we always allow the running host values << Gitlab.config.gitlab.host unless values.include?(Gitlab.config.gitlab.host) - self[:asset_proxy_allowlist] = values + self[:asset_proxy_whitelist] = values + end + alias_method :asset_proxy_allowlist=, :asset_proxy_whitelist= + + def asset_proxy_allowlist + read_attribute(:asset_proxy_whitelist) end def repository_storages diff --git a/app/services/application_settings/update_service.rb b/app/services/application_settings/update_service.rb index 5e5c8ae2177..7792b811b4e 100644 --- a/app/services/application_settings/update_service.rb +++ b/app/services/application_settings/update_service.rb @@ -6,7 +6,7 @@ module ApplicationSettings attr_reader :params, :application_setting - MARKDOWN_CACHE_INVALIDATING_PARAMS = %w(asset_proxy_enabled asset_proxy_url asset_proxy_secret_key asset_proxy_allowlist).freeze + MARKDOWN_CACHE_INVALIDATING_PARAMS = %w(asset_proxy_enabled asset_proxy_url asset_proxy_secret_key asset_proxy_whitelist).freeze def execute result = update_settings |