summaryrefslogtreecommitdiff
path: root/app/models/application_setting_implementation.rb
diff options
context:
space:
mode:
authorReuben Pereira <rpereira@gitlab.com>2019-07-31 17:38:15 +0000
committerDouwe Maan <douwe@gitlab.com>2019-07-31 17:38:15 +0000
commitf5213a38cc6f9a80e98e1cbdf59f84352f0731cb (patch)
tree7bfbd92c5b58717a9c3bf339e1cca6e0ccfc4492 /app/models/application_setting_implementation.rb
parent3e63fe70ccff3dc477a1740c0a7f164b7caada1f (diff)
downloadgitlab-ce-f5213a38cc6f9a80e98e1cbdf59f84352f0731cb.tar.gz
Add prometheus listen address to whitelist
- Add to whitelist so that even if local requests from hooks and services are not allowed, the prometheus manual configuration will still succeed.
Diffstat (limited to 'app/models/application_setting_implementation.rb')
-rw-r--r--app/models/application_setting_implementation.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/application_setting_implementation.rb b/app/models/application_setting_implementation.rb
index 6efd07a6008..4bb09bf3b53 100644
--- a/app/models/application_setting_implementation.rb
+++ b/app/models/application_setting_implementation.rb
@@ -158,9 +158,20 @@ module ApplicationSettingImplementation
end
def outbound_local_requests_whitelist_raw=(values)
+ clear_memoization(:outbound_local_requests_whitelist_arrays)
+
self.outbound_local_requests_whitelist = domain_strings_to_array(values)
end
+ def add_to_outbound_local_requests_whitelist(values_array)
+ clear_memoization(:outbound_local_requests_whitelist_arrays)
+
+ self.outbound_local_requests_whitelist ||= []
+ self.outbound_local_requests_whitelist += values_array
+
+ self.outbound_local_requests_whitelist.uniq!
+ end
+
def outbound_local_requests_whitelist_arrays
strong_memoize(:outbound_local_requests_whitelist_arrays) do
next [[], []] unless self.outbound_local_requests_whitelist