I am using the image quay.io/rh-aiservices-bu/rh-kb-chat:3.0.0 and noticed the following.
The file app/frontend/src/app/config.tsx contains incorrect code for resolving the backend_api_url:
const config = {
backend_api_url: process.env.BACKEND_API_URL || window.location.protocol + '//' + window.location.hostname + '/api',
};
because process.env is only defined in Node.js at build time. In the compiled js bundle the above (after deobfuscation) results in this code:
const cu = {
backend_api_url: "MISSING_ENV_VAR".BACKEND_API_URL || window.location.protocol + "//" + window.location.hostname + "/api"
}
but the fallback value after || is likewise incorrect, because the port (by default 5555) is missing.
In my local environment with podman I can indeed see that the requests from the browser to the backend go to http://localhost/api/llms and http://localhost/api/collections, respectively, which obviously lead to net::ERR_CONNECTION_REFUSED.
However I believe the following config.tsx should work:
const config = {
backend_api_url: window.location.protocol + '//' + window.location.hostname + ':' + window.location.port + '/api'
}
export default config;
I am using the image
quay.io/rh-aiservices-bu/rh-kb-chat:3.0.0and noticed the following.The file
app/frontend/src/app/config.tsxcontains incorrect code for resolving thebackend_api_url:because
process.envis only defined in Node.js at build time. In the compiled js bundle the above (after deobfuscation) results in this code:but the fallback value after
||is likewise incorrect, because the port (by default 5555) is missing.In my local environment with podman I can indeed see that the requests from the browser to the backend go to
http://localhost/api/llmsandhttp://localhost/api/collections, respectively, which obviously lead tonet::ERR_CONNECTION_REFUSED.However I believe the following
config.tsxshould work: