Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The UI is currently hardcoded to support two environments: a development deployment from `localhost:3000` to `localhost:8000`, and the API explicitly allows `http://localhost:3000` as a cross-site origin; and an OpenShift deployment where cross-site scripting is unnecessary as the cluster API reverse proxy hides the port numbers. Partly for more general testing and deployment, but specifically because the RHEL AI InstructLab project requires CPT dashboard access now before our code has been integrated into the production OpenShift deployment, it's convenient to support a third "bare metal" mode where the containerized UI and backend are hosted at ports 3000 and 8000 on some host (e.g., in the RDU3 Performance Lab). For this, the UI needs to recognize that a non-`localhost` `window.location` with a `3000` port needs to call the API at port `8000` on the same host (for our "bare metal" deployment) while an empty port indicates we're using the OpenShift API reverse proxy routing. Similarly, the backend code cross-site scripting protection needs to allow port 3000 from the same host as a valid origin.
- Loading branch information