dokku / dokku-http-auth

dokku plugin that gives the ability to manage HTTP basic auth for an application
MIT License
84 stars 20 forks source link

.htpasswd permission issue resulting in 500 error. #19

Closed Jarrodsz closed 1 year ago

Jarrodsz commented 1 year ago

Steps to reproduce:

When the auth plugin is enabled, after entering correct login details it throws a 500 server error.

When disabling the auth plugin, the application runs correctly again. Could we fix this in a collaboration? I really need a specific site deployed with dokku to be behind "closed doors" until released.

sensedrive commented 1 year ago

@Jarrodsz I am getting also a 500 error ... how did you resolve this issue?

Jarrodsz commented 1 year ago

Not fixed it, its broken. Perhaps its an idea to mention it to @josegonzalez on discord. I would like it to work also but did not have time to check why its broken.

sensedrive commented 1 year ago

Thank you for the quick resonse @Jarrodsz! I just asked, because this issue was close by you.

Maybe we can reopen this?

sensedrive commented 1 year ago

After spending some time figuring out, what causes the issue ...

Now it comes:

A possible solution for this could be to make the path to the htpasswd file executable for others:

But please please be aware of the security issues, this might could bring with it.

sudo chmod o+x /home sudo chmod o+x /home/dokku sudo chmod o+x /home/dokku/project-folder

This gist also helped me a lot: https://gist.github.com/windsting/038858d2c41f442a00669f901c550b5c

Jarrodsz commented 1 year ago

Im not sure setting the permissions is a good idea (?)

josegonzalez commented 1 year ago

Interesting. What OS version are ya'll on? This works fine for me on Ubuntu 18.04 and appears to work fine on 20.04 (need to re-check). Might be that perms got a bit more strict recently.

sensedrive commented 1 year ago

I am using Ubuntu 22.04.1 LTS, but it was not administrated by myself. I just got an account with sudo permissions.

trival commented 1 year ago

notice this is probably the same issue as #15

louwers commented 1 year ago

Same problem here on Ubuntu 22.04.1 LTS