Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for digest authentication #12

Closed
fablarosa opened this issue May 16, 2020 · 5 comments
Closed

Add support for digest authentication #12

fablarosa opened this issue May 16, 2020 · 5 comments

Comments

@fablarosa
Copy link

The openvpn-monitor mini-site is visible by everyone right now and this poses serious privacy and security issues in large companies like mine (I work for a university).
Other similar projects like auspexeu/openvpn-status support http basic authentication.
Could you please add this feature or point me the right direction so that I can eventually try myself and contribute to this project?

@ruimarinho
Copy link
Owner

It's quite simple to add basic auth via a server like nginx. If you want something out of the box:

docker run -d --name web ruimarinho/openvpn-monitor
docker run -d -p 80:80 --link web:web --name auth beevelop/nginx-basic-auth

Then you can login with username foo and password bar. I don't know if this would be the best image to run but it's an example of how you can do it. Hope this helps.

@fablarosa
Copy link
Author

Ok thanks I'll give it a try.
I'm relatively new to containers so I was doing it the old way, installing apache2 to use it as a reverse proxy with digest auth, but a nginx container-based solution is better.

@emoxam
Copy link

emoxam commented Jul 18, 2023

What we should use ?
docker run -d -p 80:80 --link openvpn-monitor:openvpn-monitor--name auth beevelop/nginx-basic-auth
this one ?

@emoxam
Copy link

emoxam commented Jul 18, 2023

Or this one ?

docker run -d \
           -e HTPASSWD='remote:$apr1$7dGgNNuG$VfPfwHBIdn4BJb3f5hgG1/' \
           -e FORWARD_PORT=5555 \
           --link openvpn-monitor:openvpn-monitor -p 80:80 \
           --name auth \
           beevelop/nginx-basic-auth

@fablarosa
Copy link
Author

This is how i did it, please notice that the password protected container is available on port 8000:

creds=$(htpasswd -n monitoruser)
# enter the password you want to use

docker run --name openvpn-monitor \
  --restart always \
  -d -p 127.0.0.1:80:80 \
  ruimarinho/openvpn-monitor

docker run --name web-auth \
  -e HTPASSWD="$creds" \
  --link openvpn-monitor:web \
  --restart always \
  -d -p 8000:80 \
  beevelop/nginx-basic-auth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants