这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion clean.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Easily kill process on port because sometimes nodemon fails to reboot
kill -9 $(lsof -t -i tcp:5000)
kill -9 $(lsof -t -i tcp:5000) &
kill -9 $(lsof -t -i tcp:3001) # if running default for MacOS Monterey
25 changes: 8 additions & 17 deletions frontend/src/components/Modals/Keys.jsx
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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
Expand Down Expand Up @@ -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) : ""}
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/Modals/Password.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utils/constants.js
Original file line number Diff line number Diff line change
@@ -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";
2 changes: 1 addition & 1 deletion server/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SERVER_PORT=5000
SERVER_PORT=3001
OPEN_AI_KEY=
OPEN_MODEL_PREF='gpt-3.5-turbo'
CACHE_VECTORS="true"
Expand Down
12 changes: 5 additions & 7 deletions server/endpoints/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions server/utils/vectorDbProviders/pinecone/PINECONE_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down