-
-
Notifications
You must be signed in to change notification settings - Fork 252
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
Multi-user server with nginx authentication #236
Comments
Hi @Nottt, if you want to use authentication of nginx, you would need to use this feature: #219 So, in the Script server config file, you would need to put smth like:
Where X-Auth-Name stands for the username header, sent by the proxy Also, please note, that it works only on dev version (wasn't yet released to a stable version) |
I still don't understand. I'm not very good with nginx... What do you mean sent by the proxy? How the proxy is going to know who is who? You are assuming I can somehow know that IP Y is person X. I don't see hows that possible |
Hi @Nottt,
|
I use jwilder/nginx-proxy, so it handles most of the stuff automatically, but I did create a htpasswd in my host, that gets mapped to somewhere inside the container and does what a htpasswd file does. |
But do users see authentication window, when they try to connect?
Nottt <[email protected]> schrieb am Do., 29. Aug. 2019, 12:05:
… I use jwilder/nginx-proxy, so it handles most of the stuff automatically,
but I did create a htpasswd in my host, that gets mapped to somewhere
inside the container and does what a htpasswd file does.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#236?email_source=notifications&email_token=AAJXPJI2BXNU6DN2LQVK37LQG6NP7A5CNFSM4ISADZC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5N64VY#issuecomment-526118487>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJXPJJZCKMXIOC7T3SNXWTQG6NP7ANCNFSM4ISADZCQ>
.
|
Could you try to add the following setting to nginx
proxy_set_header X-Forwarded-User $remote_user
And then use X-Forwarded-User for the script server config
PS I'm not nginx proxy expert, this advice was taken from stack overflow :)
And i would be able to check it only in several hours
Nottt <[email protected]> schrieb am Do., 29. Aug. 2019, 12:45:
… Yes...
[image: image]
<https://user-images.githubusercontent.com/13532436/63934117-ffc74080-ca30-11e9-92f5-68a1eba1bc66.png>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#236?email_source=notifications&email_token=AAJXPJIPZRE3EBN4ONAL5FLQG6SFZA5CNFSM4ISADZC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5OCDMA#issuecomment-526131632>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJXPJOFEXOSFV2PRLTSOSTQG6SFZANCNFSM4ISADZCQ>
.
|
OK I haven't been able to test this yet, but I already found another issue. When I enabled cloudflare, everyone lost access. I do plan on having cloudflare after my nginx-docker to hide my server IP. What needs to be changed to accomplish this together with what you said? That's why relying on IPs is the worst method possible for authentication, who was static and immutable IPs nowadays? LDAP is cool and all, but sometimes the basic is all we need |
Hi Nott, to be honest i don't know how cloudflare works and don't aware of
any issues with it.
May be you can check logs in a browser and also a network tab there.
Nottt <[email protected]> schrieb am Fr., 30. Aug. 2019, 03:27:
… OK I haven't been able to test this yet, but I already found another issue.
When I enabled cloudflare, everyone lost access. I do plan on having
cloudflare after my nginx-docker to hide my server IP.
What needs to be changed to accomplish this together with what you said?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#236?email_source=notifications&email_token=AAJXPJOHI47VDSDIW6WYAXDQHBZRFA5CNFSM4ISADZC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5QIKYI#issuecomment-526419297>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJXPJKDPRH26AOEOPPM7U3QHBZRFANCNFSM4ISADZCQ>
.
|
Hi @Nottt, so, I checked nginx locally, and with these settings, basic auth works on nginx and
I can perfectly agree with it. IP is just a default setting if people don't want or don't need anything more advanced (for example, my scripts at work are not doing anything dangerous and anyone can run them).
Do you mean they cannot access the server, because their IPs are not whitelisted? Or there is some different error? |
Update The correct header to forward according to #219 is:
Thanks :) Ok, so I changed my docker to
And my configuration file look like this:
But after bypassing the login page, I get a 403 forbidden from the script server unless I allow my internal docker IP on the allowed users.
I think the nginx thing is working, because when looking at my nginx-docker logs I see the username of the logged in user after the IPs like this
If I allow my docker IP, I can access the page but can't see the scripts I locked to that user only Interestingly this is the output of
Any ideas? |
Hi @Nottt, in the script server config please use X-Forwarded-User (as in nginx) instead of X-Auth-Name |
I just edited it to say I found the cause of the issue...thanks for the support! This would be handy in the wiki btw. Just noticed there's a |
After enabling cloudflare, the script-server breaks.... at the logs I see:
I tried to google, but it seems to be a tornado thing... It'd be nice if we could run cloudflare to hide the server IP :/ |
Hi @Nottt, seems that websocket connections are not forwarded properly. Also, to double-check: you left your nginx configuration untouched, right? And it was working without any issues before? |
Actually this doesn't seem to be related to cloudflare, but something else. I can't load/execute any script after doing this changes and disabling cloudflare. I was only testing for access, so I didn't notice before that running the scripts was broken. I'm still investigating what could be causing it |
Please make sure, that the following parameters are in your nginx configuration:
(as per https://github.com/bugy/script-server/wiki/Reverse-Proxy-setup#nginx) |
Ok this stopped that error, but now for all scripts that I locked to a specific user, can't be accessed:
This is my templates, I made sure there is one for each user, I only changed the allowed user and the script path, they are 777... Could it be because the name and description is the same for every |
Hi @Nottt, the names should be unique |
Ok just renaming the name of the task to But that's not ideal, the name of the script/task is the same for everyone, since they do the same thing, just using different variables for each user. The UI gets a little weird, but at least it works! Thanks |
My goal is to have a multi-user server where users can login with their own username and passwords, and only have access to the scripts I allow them.
I have setup script-server behind a nginx docker, the only way to reach the script-server is via the nginx proxy, and the only public ports in my server are 80 and 443.
I created a htpasswd for my user, up to here everything is fine. But there are 2 issues:
I need to put my internal docker IP in trusted IPs, and it's not really static, while this could be fixed, it would be better if trusted IPs allowed to set a range... like
172.18.0.0/24
Biggest issue is all I see as identified as user is this:
Obviously none of my users will have static IPs so this won't work! Am I missing something here?
The text was updated successfully, but these errors were encountered: