1

I’m running a Rails 6 application from a Docker container. When I start my application, I get errors like this on the log

rails.1      | Cannot render console from 142.29.0.1! Allowed networks: 0.0.0.0, 127.0.0.0/127.255.255.255, ::1

How do I allow connections from any network? I don’t want to hard-code IPs because that won’t scale to other developers machines. I tried adding this in config/environments/development.rb

  config.web_console.permissions = '0.0.0.0/255.255.255.255'

But after restarting my server I get the same error.

Dave
  • 15,639
  • 133
  • 442
  • 830

2 Answers2

1

I would say that '0.0.0.0/255.255.255.255' is not correct syntax - especially network part after /. Valid CIDR notation should be use there.

If you want to allow all IPv4 IPs, then correct CIDR notation is:

config.web_console.permissions = '0.0.0.0/0'

See: AWS: What does 0.0.0.0/0 and ::/0 mean?

If you want to allow all local IPv4 IPs, then you need to know right CIDR notation of your local network, e.g.192.168.0.0/16:

config.web_console.permissions = '192.168.0.0/16'

See also rail doc https://github.com/rails/web-console#configweb_consolepermissions

Jan Garaj
  • 25,598
  • 3
  • 38
  • 59
0

If you are using ngrok, you can enable all IPv6 networks using

config.web_console.permissions = '::/0'