Put devtools behind feature flags

This commit is contained in:
Paul Chavard 2019-05-15 15:57:57 +02:00
parent 905145c5e5
commit 348b15f595
4 changed files with 11 additions and 3 deletions

View file

@ -24,7 +24,7 @@ class ApplicationController < ActionController::Base
end
def authorize_request_for_profiler
if administration_signed_in?
if Flipflop.mini_profiler_enabled?
Rack::MiniProfiler.authorize_request
end
end

View file

@ -21,7 +21,7 @@
= Gon::Base.render_data(camel_case: true, init: true, nonce: request.content_security_policy_nonce)
- if Rails.env.development?
- if Flipflop.xray_enabled?
= stylesheet_link_tag :xray
%body{ id: content_for(:page_id), class: browser.platform.ios? ? 'ios' : nil }
@ -39,7 +39,7 @@
- if content_for?(:footer)
= content_for(:footer)
- if Rails.env.development?
- if Flipflop.xray_enabled?
= javascript_include_tag :xray
= yield :charts_js

View file

@ -18,6 +18,13 @@ Flipflop.configure do
feature :operation_log_serialize_subject
group :development do
feature :mini_profiler_enabled,
default: Rails.env.development?
feature :xray_enabled,
default: Rails.env.development?
end
group :production do
feature :remote_storage,
default: ENV['FOG_ENABLED'] == 'enabled'

View file

@ -0,0 +1 @@
Rack::MiniProfiler.config.authorization_mode = :whitelist