docbrown/config/initializers/docker.rb
rhymes cc8bfcb5c0
Enable Rubocop 0.89 cops and fix Lint/ violations (#9709)
* Enable new Lint/ cops and run rubocop -a

* Fixing last remaining things with rubocop -a

* Enable and fix Style/ExplicitBlockArgument and Style/GlobalStdStream

* Forgot parenthesis
2020-08-10 16:57:12 +02:00

13 lines
486 B
Ruby

# Docker specific development configuration
if Rails.env.development? && File.file?("/.dockerenv")
# Using shell tools so we don't need to require Socket and IPAddr
host_ip = `ip route|awk '/default/ { print $3 }'`.strip
logger = Logger.new($stdout)
logger.info "Allowing #{host_ip} for BetterErrors and Web Console"
if defined?(BetterErrors::Middleware)
BetterErrors::Middleware.allow_ip!(host_ip)
end
Rails.application.config.web_console.permissions = host_ip
end