wrr / wwwhisper

Access control for web servers
MIT License
106 stars 13 forks source link

Configure a Docker container to run wwwhisper #3

Open wrr opened 10 years ago

wrr commented 10 years ago

Using Docker can simplify setup of a standalone wwwhisper instance.

xeor commented 10 years ago

I hacked together a docker version @ https://github.com/xeor/dockerfiles/tree/master/wwwhisper Might need some changes to wwwhisper to get it clean tho..

wrr commented 10 years ago

This looks cool, I'll play with it. Thank you :) Do you have any suggestions what could be improved in wwwhisper to improve/clean the Docker setup?

xeor commented 10 years ago

It really depends on how you want it used in docker. I made it very specific and locked down to use only linked containers that exposes port 80 (hardcoded port for now).

I think the ultimate solution here would be to have it listen to the docker socket and generates the a dynamic nginx file that wwwhisper uses when a container is created with an evironmentvariable, example '-e WWWHISPER=gitlab' would creates a /gitlab directory protected by wwwhisper. See https://github.com/jwilder/nginx-proxy for something that does almost this..

The biggest annoyance getting this to work with docker was the virtualhost dependencies. Even tho virtualhost is supernice, its not something you need in docker. I tried to do it without virtualhost, but was digging myself longer and longer down into what could considered "more clean than just using virtualhost" :)

wrr commented 10 years ago

Thanks, I'll experiment with different approaches and see if things can be simplified. I was also thinking about running wwwhisper in a container that is separate from nginx container. There are middlewares that allow to use wwwhisper without nginx from Ruby Rack and nodejs. Running wwwhisper in its own Docker container could potentially allow to easily setup these middlewares (but this also will require some changes in wwwhisper).