In dev, always allow access to health endpoints from localhost

This change will allow developers to easily hook up a Prometheus
instance to their local development instance, without making any
configuration changes.
This commit is contained in:
Andrew Newdigate 2019-06-26 09:27:19 +00:00 committed by Douwe Maan
parent 2b9ddc2f99
commit 26140f9185
2 changed files with 9 additions and 0 deletions

View File

@ -14,6 +14,10 @@ module RequiresWhitelistedMonitoringClient
end
def client_ip_whitelisted?
# Always allow developers to access http://localhost:3000/-/metrics for
# debugging purposes
return true if Rails.env.development? && request.local?
ip_whitelist.any? { |e| e.include?(Gitlab::RequestContext.client_ip) }
end

View File

@ -0,0 +1,5 @@
---
title: Always allow access to health endpoints from localhost in dev
merge_request: 29930
author:
type: other