Skip to content
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

chore: handle DASHBOARD_API_BASE_URL env at docker run time #1231

Merged
merged 1 commit into from
Mar 6, 2025

Conversation

peppescg
Copy link
Contributor

@peppescg peppescg commented Mar 5, 2025

In order to allow the users to specify the dashboard base api url (by default it is http://localhost:8989) we can add a docker env DASHBOARD_API_BASE_URL that the users can use to set dashboard api base url in the UI.
Rather than using sed for replace the env var in the js file, we can use envsubst through the index.html that includes the env var used in the UI for handle the API requests.

If custom env var, DASHBOARD_API_BASE_URL, miss the default base path,http://localhost:8989, will be used.

The UI is already updated and able to handle the env var.
All the changes are backward compatible.

Discord thread

Custom dashboard api base url
Set the env DASHBOARD_API_BASE_URL="https://api.example.com", all the request will have https://api.example.com as base path.

Kapture.2025-03-05.at.15.31.52.mp4

@peppescg peppescg self-assigned this Mar 5, 2025
@peppescg peppescg requested review from blkt and aponcedeleonch March 5, 2025 15:21
@peppescg peppescg linked an issue Mar 5, 2025 that may be closed by this pull request
@peppescg peppescg added the docker Pull requests that update Docker code label Mar 5, 2025
@peppescg peppescg merged commit 96aa48d into main Mar 6, 2025
11 checks passed
@peppescg peppescg deleted the issues/1229 branch March 6, 2025 14:07
danbarr added a commit to stacklok/codegate-docs that referenced this pull request Mar 10, 2025
New DASHBOARD_BASE_API_URL parameter added in
stacklok/codegate#1231
danbarr added a commit to stacklok/codegate-docs that referenced this pull request Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker Pull requests that update Docker code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Chore]: define dashboard api base url using docker env
2 participants