rstrouse / nodejs-poolController-dashPanel

A dashboard panel for tagyoureit/nodejs-poolController
33 stars 20 forks source link

Authentication support? #37

Open jarrah42 opened 2 years ago

jarrah42 commented 2 years ago

I notice that the configuration file has authentication and authFile options but I can't see how these are used. Is there any way to set up simple password authentication? It would be nice to be able to expose the app outside my local network, but I wouldn't want to do that without at least some basic protection. Thanks!

rstrouse commented 2 years ago

I will look at this deeper. There is the start of role based security in the system and pin codes for unlocking specific features.

mguinness commented 1 year ago

How about using Basic Authentication? You can use express-basic-auth to get it working. It's rudimentary but it works well especially when HTTPS is being used.

mguinness commented 1 year ago

Another way to achieve this is to use the NGINX Reverse Proxy with the module ngx_http_auth_basic_module.

See config example below and note "Use Proxy to njsPC Server" must be enabled in the Pool Control Dashboard.

server {
    listen 443 ssl http2;
    location / {
        proxy_pass http://raspberrypi:5150;
        auth_basic "Pool Controller";
        auth_basic_user_file .htpasswd;
    }
}
tagyoureit commented 1 year ago

I had this enabled at some point in the past. Maybe it was with Express 3? It shouldn't be too hard to add back in. One of us will look at it (and I added it to the wish list).

EDIT - Oh, right... that was before dashPanel. Would we want auth on njsPC as well as dashPanel? Not sure both are needed if dashPanel is acting as a proxy.