diff --git a/docker/HOW_TO_USE_DOCKER.md b/docker/HOW_TO_USE_DOCKER.md index 6a429ba2db7e5e02aed235e99f17f44220ba6c0a..0fa0346e53f4a88fb5d685437b1457cce929a1c1 100644 --- a/docker/HOW_TO_USE_DOCKER.md +++ b/docker/HOW_TO_USE_DOCKER.md @@ -49,6 +49,18 @@ CHROMA_ENDPOINT='http://host.docker.internal:8000' # Allow docker to look on hos ``` +### Common questions and fixes + +# API is not working, cannot login, LLM is "offline"? +You are likely running the docker container on a remote machine like EC2 or some other instance where the reachable URL +is not `http://localhost:3001` and instead is something like `http://193.xx.xx.xx:3001` - in this case all you need to do is add the following to your `frontend/.env.production` before running `docker-compose up -d --build` +``` +# frontend/.env.production +GENERATE_SOURCEMAP=false +VITE_API_BASE="http://<YOUR_REACHABLE_IP_ADDRESS>:3001/api" +``` +For example, if the docker instance is available on `192.186.1.222` your `VITE_API_BASE` would look like `VITE_API_BASE="http://192.186.1.222:3001/api"` in `frontend/.env.production`. + ## Still not working? [Ask for help on Discord](https://discord.gg/6UyHPeGZAC) diff --git a/frontend/.env.production b/frontend/.env.production index 4f79a0f8e2c453e3d66ea13e945c81f1fcafab78..e22e4b58978c2392f5737a8cfe6f56aef53c4dbc 100644 --- a/frontend/.env.production +++ b/frontend/.env.production @@ -1 +1,2 @@ -GENERATE_SOURCEMAP=false \ No newline at end of file +GENERATE_SOURCEMAP=false +# VITE_API_BASE="http://example.com/api" \ No newline at end of file diff --git a/server/endpoints/utils.js b/server/endpoints/utils.js index c9b946dfdd0879822525d2f83bb90860748602fd..82be00f9d7345d66054d453e5bd08feed8c42c1d 100644 --- a/server/endpoints/utils.js +++ b/server/endpoints/utils.js @@ -1,10 +1,15 @@ const { SystemSettings } = require("../models/systemSettings"); function getGitVersion() { - return require("child_process") - .execSync("git rev-parse HEAD") - .toString() - .trim(); + try { + return require("child_process") + .execSync("git rev-parse HEAD") + .toString() + .trim(); + } catch (e) { + console.error("getGitVersion", e.message); + return "--"; + } } function byteToGigaByte(n) {