BetterErrors / better_errors

Better error page for Rack apps
MIT License
6.88k stars 437 forks source link

Doesn't work with Rails 5.0.0 and docker-compose with BetterErrors::Middleware.allow_ip! '172.19.0.1' #349

Closed sullyme closed 7 years ago

sullyme commented 8 years ago

I have Rails 5.0.0, fresh new app, fresh new Gemfile and I just and only installed Better Errors with instructions in Readme on Github.

But nothing, I still have old and standard Rails errors.

I'm using docker-compose standard from "Docker.com" instruction (Compose Rails).

And in my config/environments/development.rb I have this:

BetterErrors::Middleware.allow_ip! '172.19.0.1' which is my REMOTE_ADDR in dump.

I also tried

'0.0.0.0' and '0.0.0.0/0'.

How to allow all ips range? I need it just in development.

frsantos commented 7 years ago

@sullyme I have something like this in my config/initializers/development/better_errors.rb config file:

if defined? BetterErrors
  # Private subnets defined by RFC1918 as stated in https://docs.docker.com/v1.5/articles/networking/
  BetterErrors::Middleware.allow_ip! '10.0.0.0/8'
  BetterErrors::Middleware.allow_ip! '172.16.0.0/12'
  BetterErrors::Middleware.allow_ip! '192.168.0.0/16'
end
waclock commented 7 years ago

@frsantos's solution worked flawlessly running a rails app using docker. Thank you.

RobinDaugherty commented 7 years ago

Can anyone confirm the cause of the original issue? Was it the lack of the bitmask length? Or was it moving to a different file from config/environment/development.rb?

RobinDaugherty commented 7 years ago

https://github.com/charliesome/better_errors/wiki/Running-on-virtual-machines for a way to configure on Docker. I'm going to close this, since there doesn't seem to be any documentation missing.

glacials commented 6 years ago

The linked wiki page did not work for me, but @frsantos's method did. I know very little about networking; are both solutions safe from an attacker on my local network?