From f5213a38cc6f9a80e98e1cbdf59f84352f0731cb Mon Sep 17 00:00:00 2001 From: Reuben Pereira Date: Wed, 31 Jul 2019 17:38:15 +0000 Subject: 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. --- app/services/application_settings/update_service.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app/services/application_settings') diff --git a/app/services/application_settings/update_service.rb b/app/services/application_settings/update_service.rb index 7eeaf8aade1..471df6e2d0c 100644 --- a/app/services/application_settings/update_service.rb +++ b/app/services/application_settings/update_service.rb @@ -15,6 +15,8 @@ module ApplicationSettings update_terms(@params.delete(:terms)) + add_to_outbound_local_requests_whitelist(@params.delete(:add_to_outbound_local_requests_whitelist)) + if params.key?(:performance_bar_allowed_group_path) params[:performance_bar_allowed_group_id] = performance_bar_allowed_group_id end @@ -32,6 +34,13 @@ module ApplicationSettings params.key?(:usage_ping_enabled) || params.key?(:version_check_enabled) end + def add_to_outbound_local_requests_whitelist(values) + values_array = Array(values).reject(&:empty?) + return if values_array.empty? + + @application_setting.add_to_outbound_local_requests_whitelist(values_array) + end + def update_terms(terms) return unless terms.present? -- cgit v1.2.3