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

Feature not being enabled #24

Open odscjames opened 1 week ago

odscjames commented 1 week ago

Description of problem

We enable an user & pass; it doesn't work

How reproducible

Steps to Reproduce

root@server:~# dokku apps:create test
-----> Creating test...
-----> Creating new app virtual host file...
root@server:~# dokku http-auth:enable test user pass
-----> Enabling HTTP auth for test...
       Done
root@server:~# dokku git:sync  test https://github.com/pedropaf/node-sample-dokku.git main
-----> Cloning test from https://github.com/pedropaf/node-sample-dokku.git#main
       Detected branch, setting deploy-branch to main

root@server:~# dokku ps:rebuild test
...
=====> Application deployed:
       http://test.server.com

EXPECT: http://test.server.com to have a user and password on

ACTUALLY: It doesn't.


root@server:~# dokku ps:restart test
...
-----> Shutting down old containers in 60 seconds

RESULT: Still no user and password

root@server:~# dokku http-auth:disable test
-----> Disabling HTTP auth for test...
       Done
root@server:~# dokku http-auth:enable test
-----> Enabling HTTP auth for test...
 !     Skipping user initialization
       Done

RESULT: Now it has a user name and password

Environment Information

dokku report APP_NAME output

It's just a sample app I found online and full commands are above to reproduce

How (deb/make) and where (AWS, VirtualBox, physical, etc.) was Dokku installed?:

Virtual server, Ubuntu, package from https://packagecloud.io/dokku/dokku/ubuntu/

dokku version 0.35.4

dokku plugin:list == http-auth 0.10.0 enabled HTTP authentication for apps

odscjames commented 1 week ago

dokku http-auth:report test reports that the auth is enabled while the problem exists.

Changing the order has no effect; problem still happens. (ie app create, git sync, rebuild, THEN auth enable )

odscjames commented 1 week ago

Separating the auth commands doesn't work either:

root@server:~# dokku http-auth:enable test3
-----> Enabling HTTP auth for test3...
 !     Skipping user initialization
       Done
root@server:~# dokku http-auth:add-user test3 user pass
-----> Adding user to basic auth list
odscjames commented 1 week ago

Clue: When in the broken state, this happens:

root@server:~# dokku http-auth:show-config test4

(ie, no config shown)

After disabling and reenabling auth to get it working, this happens:


root@server:~# dokku http-auth:show-config test4

auth_basic           "Restricted";
auth_basic_user_file /home/dokku/test4/htpasswd;