nodejs-poolController-dashPanel icon indicating copy to clipboard operation
nodejs-poolController-dashPanel copied to clipboard

Authentication support?

Open jarrah42 opened this issue 4 years ago • 4 comments

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!

jarrah42 avatar Sep 14 '21 14:09 jarrah42

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

rstrouse avatar Sep 15 '21 18:09 rstrouse

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 avatar Sep 23 '22 15:09 mguinness

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;
    }
}

mguinness avatar Sep 24 '22 17:09 mguinness

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.

tagyoureit avatar Sep 25 '22 03:09 tagyoureit