[PATCH] settings: Wildcard 'ALLOWED_HOSTS' settings

Stephen Finucane stephen at that.guru
Tue Feb 14 21:34:17 AEDT 2017


On Tue, 2017-02-14 at 08:21 +1100, Daniel Axtens wrote:
> Hi Stephen,
> 
> Are you connecting using the IP address of the container/VM itself,
> or
> are you using the port bound to localhost?

The former. This is necessary if I want to connect to Patchwork from
another container or VM, where 'localhost' refers to something other
than the host. In my case, I want to talk to Patchwork from a Jenkins
container [1]. For development approaches, this seems easier than
asking someone to find their docker container IP address and set the
option manually.

> Without this patch, I can access localhost:8000 fine when I run
> "docker-compose up". It's only when I try to connect directly to the
> container using the container's IP address (In my case
> 172.17.0.3:8000)
> that I get a DisallowedHost error.

Yup, same thing here.

> I'm guessing the same thing occurs with Vagrant - if memory serves
> you'd
> usually connect to the port bound to localhost - which should work. 

I haven't tested this (nor used the Vagrant image in a while - I really
need to bump that to Xenial) but I'd imagine so, yes.

> But,
> if you connect to the VM directly it won't work.
> 
> I'm not opposed to the patch, I'm just curious as to why you'd ever
> connect using the IP address.

Cheers,
Stephen

[1] https://that.guru/blog/patchwork-and-ci-in-a-tree/


More information about the Patchwork mailing list