diff --git a/clean.sh b/clean.sh index e93aba6a2b6f388df3c91f02a6542f3881d85653..966cc1773170a5c2f7e0b1c228123cd831acff19 100644 --- a/clean.sh +++ b/clean.sh @@ -1,2 +1,3 @@ # Easily kill process on port because sometimes nodemon fails to reboot -kill -9 $(lsof -t -i tcp:5000) \ No newline at end of file +kill -9 $(lsof -t -i tcp:5000) & +kill -9 $(lsof -t -i tcp:3001) # if running default for MacOS Monterey diff --git a/frontend/src/components/Modals/Keys.jsx b/frontend/src/components/Modals/Keys.jsx index 2ef84459296b3296d2d01817ddda3c74c5f65c05..cffd40a89abb276f60d24a851037268ac78285a0 100644 --- a/frontend/src/components/Modals/Keys.jsx +++ b/frontend/src/components/Modals/Keys.jsx @@ -1,5 +1,5 @@ import React, { useState, useEffect } from "react"; -import { X } from "react-feather"; +import { AlertCircle, X } from "react-feather"; import System from "../../models/system"; const noop = () => false; @@ -16,8 +16,6 @@ export default function KeysModal({ hideModal = noop }) { fetchKeys(); }, []); - const allSettingsValid = - !!settings && Object.values(settings).every((val) => !!val); return ( <div class="fixed top-0 left-0 right-0 z-50 w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-[calc(100%-1rem)] h-full bg-black bg-opacity-50 flex items-center justify-center"> <div @@ -48,20 +46,13 @@ export default function KeysModal({ hideModal = noop }) { </div> ) : ( <div className="w-full flex flex-col gap-y-4"> - {allSettingsValid ? ( - <div className="bg-green-300 p-4 rounded-lg border border-green-600 text-green-700 w-full"> - <p>All system settings are defined. You are good to go!</p> - </div> - ) : ( - <div className="bg-red-300 p-4 rounded-lg border border-red-600 text-red-700 w-full text-sm"> - <p> - ENV setttings are missing - this software will not - function fully. - <br /> - After updating restart the server. - </p> - </div> - )} + <div className="bg-orange-300 p-4 rounded-lg border border-orange-600 text-orange-700 w-full items-center flex gap-x-2"> + <AlertCircle className="h-8 w-8" /> + <p> + Ensure all fields are green before attempting to use + AnythingLLM or it may not function as expected! + </p> + </div> <ShowKey name="OpenAI API Key" value={settings?.OpenAiKey ? "*".repeat(20) : ""} diff --git a/frontend/src/components/Modals/Password.jsx b/frontend/src/components/Modals/Password.jsx index 67f554f84cc629db5a6bc4b71dfe485e0cf8571a..1a0fb1966668c9315442951be0e6384fd0b6ab2f 100644 --- a/frontend/src/components/Modals/Password.jsx +++ b/frontend/src/components/Modals/Password.jsx @@ -88,7 +88,9 @@ export function usePasswordModal() { if (import.meta.env.DEV) { setRequiresAuth(false); } else { - const currentToken = window.localStorage.getItem("anythingllm_authtoken"); + const currentToken = window.localStorage.getItem( + "anythingllm_authtoken" + ); const settings = await System.keys(); const requiresAuth = settings?.RequiresAuth || false; diff --git a/frontend/src/utils/constants.js b/frontend/src/utils/constants.js index 0a15df4ad675992d4c086194f0ed87e7e8742a97..af209d8842f7dc9f90f2e0fe45303dd5b487a984 100644 --- a/frontend/src/utils/constants.js +++ b/frontend/src/utils/constants.js @@ -1,2 +1,2 @@ export const API_BASE = - import.meta.env.VITE_API_BASE || "http://localhost:5000"; + import.meta.env.VITE_API_BASE || "http://localhost:3001"; diff --git a/server/.env.example b/server/.env.example index 3934fd6a2747d43768ef95cbcb66c9fe9459bfbc..3a7bf9c0b2f65eabb708c302662229a5f1e4ee32 100644 --- a/server/.env.example +++ b/server/.env.example @@ -1,4 +1,4 @@ -SERVER_PORT=5000 +SERVER_PORT=3001 OPEN_AI_KEY= OPEN_MODEL_PREF='gpt-3.5-turbo' CACHE_VECTORS="true" diff --git a/server/endpoints/system.js b/server/endpoints/system.js index 1d225d0bf5cbbcb8abbece276eb3e0843f09acdb..350afcf9da6f51d3b589263671a176a2a771ecd3 100644 --- a/server/endpoints/system.js +++ b/server/endpoints/system.js @@ -48,13 +48,11 @@ function systemEndpoints(app) { try { const { password } = reqBody(request); if (password !== process.env.AUTH_TOKEN) { - response - .status(402) - .json({ - valid: false, - token: null, - message: "Invalid password provided", - }); + response.status(402).json({ + valid: false, + token: null, + message: "Invalid password provided", + }); return; } diff --git a/server/utils/vectorDbProviders/pinecone/PINECONE_SETUP.md b/server/utils/vectorDbProviders/pinecone/PINECONE_SETUP.md index 38b641017bd5f361cb0915de01cbed891b2c2cec..86033f0860bfe4d8b975ca7040284ddb7956569c 100644 --- a/server/utils/vectorDbProviders/pinecone/PINECONE_SETUP.md +++ b/server/utils/vectorDbProviders/pinecone/PINECONE_SETUP.md @@ -5,9 +5,11 @@ ### How to get started **Requirements** + - Pinecone account (free or paid) **Instructions** + - Create an index on your Pinecone account. Name can be anything eg: `my-primary-index` - Metric `cosine` - Dimensions `1536` since we use OpenAI for embeddings