From 66df5a54788baa8492553c7f70edb50131860169 Mon Sep 17 00:00:00 2001 From: david-hummingbot <85695272+david-hummingbot@users.noreply.github.com> Date: Thu, 1 Aug 2024 18:56:48 +0800 Subject: [PATCH 1/6] update README.md - add authentication instructions --- README.md | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/README.md b/README.md index 595b8f39..7d51957c 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,78 @@ If you are a developer, and want to make changes to the code then we recommend u For more detailed instructions on how to install and update the dashboard, refer to [INSTALLATION.md](INSTALLATION.md). + +## Authentication + +Authentication is disabled by default. To enable Dashboard Authentication please follow the steps below: + +**Set Credentials (Optional):** + +The dashboard uses `admin` and `abc` as the default username and password respectively. It's strongly recommended to change these credentials for enhanced security.: + +- For Docker, navigate to the `deploy` folder or `dashboard` folder if using Source and open the `credentials.yml` file. +- Add or modify the current username / password and save the changes afterward + + ``` + credentials: + usernames: + admin: + email: admin@gmail.com + name: Admin User + logged_in: False + password: abc + cookie: + expiry_days: 0 + key: some_signature_key # Must be string + name: some_cookie_name + pre-authorized: + emails: + - admin@admin.com + ``` + +### Docker + +- Ensure the dashboard container is not running. +- Open the `docker-compose.yml` file within the `deploy` folder using a text editor. +- Locate the environment variable `AUTH_SYSTEM_ENABLED` under the dashboard service configuration. + + ``` + services: + dashboard: + container_name: dashboard + image: hummingbot/dashboard:latest + ports: + - "8501:8501" + environment: + - AUTH_SYSTEM_ENABLED=True + - BACKEND_API_HOST=backend-api + - BACKEND_API_PORT=8000 + ``` +- Change the value of `AUTH_SYSTEM_ENABLED` from `False` to `True`. +- Save the changes to the `docker-compose.yml` file. +- Relaunch Dashboard by running `bash setup.sh` + +### Source + +- Open the `CONFIG.py` file located in the dashboard root folder +- Locate the line `AUTH_SYSTEM_ENABLED = os.getenv("AUTH_SYSTEM_ENABLED", "False").lower() in ("true", "1", "t")`. + + ``` + CERTIFIED_EXCHANGES = ["ascendex", "binance", "bybit", "gate.io", "hitbtc", "huobi", "kucoin", "okx", "gateway"] + CERTIFIED_STRATEGIES = ["xemm", "cross exchange market making", "pmm", "pure market making"] + + AUTH_SYSTEM_ENABLED = os.getenv("AUTH_SYSTEM_ENABLED", "False").lower() in ("true", "1", "t") + + BACKEND_API_HOST = os.getenv("BACKEND_API_HOST", "127.0.0.1") + ``` +- Change the value from `False` to `True` to enable dashboard authentication. +- Save the CONFIG.py file. +- Relaunch dashboard by running `make run` + +### Known Issues +- Refreshing the browser window may log you out and display the login screen again. This is a known issue that might be addressed in future updates. + + ## Latest Updates Stay informed about the latest updates and enhancements to Hummingbot Dashboard by subscribing to our [newsletter](https://hummingbot.substack.com/). From a4fcf2606a4946870e156867ed3dd8b7caa30e0d Mon Sep 17 00:00:00 2001 From: david-hummingbot <85695272+david-hummingbot@users.noreply.github.com> Date: Thu, 1 Aug 2024 21:25:58 +0800 Subject: [PATCH 2/6] Update credentials.yml --- credentials.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/credentials.yml b/credentials.yml index e4c35693..53f15beb 100644 --- a/credentials.yml +++ b/credentials.yml @@ -2,7 +2,7 @@ credentials: usernames: admin: email: admin@gmail.com - name: Admin User + name: John Doe logged_in: False password: abc cookie: From 19cf35252cfac6dbf0d1516201b96c808f31ab50 Mon Sep 17 00:00:00 2001 From: david-hummingbot <85695272+david-hummingbot@users.noreply.github.com> Date: Thu, 1 Aug 2024 22:05:17 +0800 Subject: [PATCH 3/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7d51957c..a83ba70c 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ The dashboard uses `admin` and `abc` as the default username and password respec usernames: admin: email: admin@gmail.com - name: Admin User + name: John Doe logged_in: False password: abc cookie: From 520cbca3912d0def86bfda5745b8423f91b79e7d Mon Sep 17 00:00:00 2001 From: Wojak Date: Mon, 9 Sep 2024 20:18:46 +0700 Subject: [PATCH 4/6] Fix wrong parameter name --- backend/services/backend_api_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/services/backend_api_client.py b/backend/services/backend_api_client.py index 91b9979c..a7ae1548 100644 --- a/backend/services/backend_api_client.py +++ b/backend/services/backend_api_client.py @@ -185,7 +185,7 @@ def get_historical_candles(self, connector: str, trading_pair: str, interval: st """Get historical candles data.""" endpoint = "historical-candles" payload = { - "connector": connector, + "connector_name": connector, "trading_pair": trading_pair, "interval": interval, "start_time": start_time, From 7587320d4f7d54a4870a3687ce073ee52a66dd09 Mon Sep 17 00:00:00 2001 From: cardosofede Date: Mon, 23 Sep 2024 22:53:40 +0800 Subject: [PATCH 5/6] (feat) add error handling for dates --- frontend/pages/data/download_candles/app.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/pages/data/download_candles/app.py b/frontend/pages/data/download_candles/app.py index 52454589..e6050842 100644 --- a/frontend/pages/data/download_candles/app.py +++ b/frontend/pages/data/download_candles/app.py @@ -27,6 +27,9 @@ if get_data_button: start_datetime = datetime.combine(start_date, time.min) end_datetime = datetime.combine(end_date, time.max) + if end_datetime < start_datetime: + st.error("End Date should be greater than Start Date.") + st.stop() candles = backend_api_client.get_historical_candles( connector=connector, From 2224bf094cfcc377a92bccb09d5b7cfcac860b20 Mon Sep 17 00:00:00 2001 From: cardosofede Date: Tue, 1 Oct 2024 12:28:49 -0300 Subject: [PATCH 6/6] (feat) add error message for backend api not running --- frontend/st_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/st_utils.py b/frontend/st_utils.py index 7a23fdb4..984399e1 100644 --- a/frontend/st_utils.py +++ b/frontend/st_utils.py @@ -74,14 +74,14 @@ def style_metric_cards( def get_backend_api_client(): from backend.services.backend_api_client import BackendAPIClient from CONFIG import BACKEND_API_HOST, BACKEND_API_PORT - backend_api_client = BackendAPIClient.get_instance(host=BACKEND_API_HOST, port=BACKEND_API_PORT) is_docker_running = False try: + backend_api_client = BackendAPIClient.get_instance(host=BACKEND_API_HOST, port=BACKEND_API_PORT) is_docker_running = backend_api_client.is_docker_running() except Exception as e: st.error( - f"There was an error trying to connect to the Backend API: " - f"\n\n{str(e)} \n\nPlease make sure the Backend API is running.") + f"There was an error trying to connect to the Backend API. Please make sure the Backend API is running.\n\n" + f"Error: \n\n{str(e)}") st.stop() if not is_docker_running: st.error("Docker is not running. Please make sure Docker is running.")