Closed cllasyx closed 2 months ago
I fixed it myself - found out in this youtube video that I need hash of the password in the credentials.yml file instead of plain-text password itself.
If you have deployed the dashboard with backend-api and emqx-broker via docker from this git repo, then do the following steps THE SAME WAY (only change your password)!
Head over to the hummingbot/deploy folder and issue these commands in your console:
user@hostname:~/deploy$ docker exec -it dashboard /bin/bash
(base) root@afc549bfd12b:/home/dashboard# conda activate dashboard
← IMPORTANT(dashboard) root@afc549bfd12b:/home/dashboard# python
>>> import streamlit_authenticator as stauth
>>> stauth.Hasher(["abc"]).generate()
['$2b$12$u.vcJD6bFvI0nhJPjWc7/uQNJWbBYAvkGde8LAbE.gbbQZXqqM5s6']
Edit your credentials.yml for the password abc
(in my case) with the password hash without single quoations generated in step 5.
# This only works if you change the env variable in the docker-compose.yml
credentials:
usernames:
admin:
email: test@mail.com
name: Test User
logged_in: False
password: $2b$12$u.vcJD6bFvI0nhJPjWc7/uQNJWbBYAvkGde8LAbE.gbbQZXqqM5s6
cookie:
expiry_days: 0
key: some_key # Must be string
name: some_name
pre-authorized:
emails:
- test@mail.com
Don't forget to restart the container:
user@hostname:~$ docker restart dashboard
Result:
Successful login with username admin
and password abc
into the hummingbot dashboard at URL 192.168.0.100:8501.
Fantastic ! Thanks for documenting this! Ran into the same confusion.
Note to future encounters: humminbot-dashboard
has evolved since then, so the preconfigured conda
environment that is supposed to be used here does not come with the clone of hummingbot-deploy
. Instead, just create a local Python environment wherever with streamlit_authenticator
to run the Python commands.
Further, the API of streamlit_authenticator
has changed since to now:
stauth.Hasher([plainTextPW]).hash(plainTextPW)
Syntax seems redundant to me, yet it works just fine.
Describe the bug
I started the hummingbot via docker compose from the deploy repository and tested it out little bit. After some time I wanted to try the authorization screen so I changed the
AUTH-SYSTEM-ENABLED
toTrue
and used almost default credentials in credentials.yml such as:Next I ran the bash script via
bash setup.sh
as stated in documentation but after accessing the web UI and entering the credentials I see this:Web UI was in a "Running" state when I clicked on login but after a few seconds error popped up.
Docker logs do not show any useful information.
My docker-compose.yml looks like this:
Steps to reproduce bug
user@hostname:~$ git clone https://github.com/hummingbot/deploy.git; cd deploy
user@hostname:~/deploy$ bash setup.sh