librechat: 0.8.0 -> 0.8.4 (#497688)
This commit is contained in:
@@ -85,6 +85,15 @@ in
|
||||
example = 2309;
|
||||
description = "The value that will be passed to the PORT environment variable, telling LibreChat what to listen on.";
|
||||
};
|
||||
LIBRECHAT_LOG_DIR = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "${cfg.dataDir}/logs";
|
||||
defaultText = lib.literalExpression "/var/lib/librechat/logs";
|
||||
description = ''
|
||||
Logs will be saved into this directory.
|
||||
By default it is relative to `services.librechat.dataDir`.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
example = {
|
||||
@@ -120,9 +129,11 @@ in
|
||||
type = lib.types.submodule {
|
||||
freeformType = format.type;
|
||||
};
|
||||
default = { };
|
||||
default = {
|
||||
version = "1.2.1";
|
||||
};
|
||||
example = {
|
||||
version = "1.0.8";
|
||||
version = "1.2.1";
|
||||
cache = true;
|
||||
interface = {
|
||||
privacyPolicy = {
|
||||
|
||||
@@ -2,7 +2,7 @@ diff --git a/package.json b/package.json
|
||||
index 2131951..91e4846 100644
|
||||
--- a/package.json
|
||||
+++ b/package.json
|
||||
@@ -114,5 +114,15 @@
|
||||
@@ -114,5 +114,13 @@
|
||||
"admin/",
|
||||
"packages/"
|
||||
]
|
||||
@@ -10,9 +10,7 @@ index 2131951..91e4846 100644
|
||||
+ "files": [
|
||||
+ "api",
|
||||
+ "client/dist",
|
||||
+ "packages/data-provider",
|
||||
+ "packages/data-schemas",
|
||||
+ "packages/mcp"
|
||||
+ "packages"
|
||||
+ ],
|
||||
+ "bin": {
|
||||
+ "librechat-server": "api/server/index.js"
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
diff --git a/api/config/meiliLogger.js b/api/config/meiliLogger.js
|
||||
index 195b387..d445e54 100644
|
||||
--- a/api/config/meiliLogger.js
|
||||
+++ b/api/config/meiliLogger.js
|
||||
@@ -2,7 +2,7 @@ const path = require('path');
|
||||
const winston = require('winston');
|
||||
require('winston-daily-rotate-file');
|
||||
|
||||
-const logDir = path.join(__dirname, '..', 'logs');
|
||||
+const logDir = path.join('.', 'logs');
|
||||
|
||||
const { NODE_ENV } = process.env;
|
||||
|
||||
diff --git a/api/config/winston.js b/api/config/winston.js
|
||||
index 8f51b99..2ebd041 100644
|
||||
--- a/api/config/winston.js
|
||||
+++ b/api/config/winston.js
|
||||
@@ -3,7 +3,7 @@ const winston = require('winston');
|
||||
require('winston-daily-rotate-file');
|
||||
const { redactFormat, redactMessage, debugTraverse, jsonTruncateFormat } = require('./parsers');
|
||||
|
||||
-const logDir = path.join(__dirname, '..', 'logs');
|
||||
+const logDir = path.join('.', 'logs');
|
||||
|
||||
const { NODE_ENV, DEBUG_LOGGING = true, DEBUG_CONSOLE = false, CONSOLE_JSON = false } = process.env;
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
diff --git a/client/package.json b/client/package.json
|
||||
index f96aefa2d..ef3050f72 100644
|
||||
--- a/client/package.json
|
||||
+++ b/client/package.json
|
||||
@@ -121,7 +121,7 @@
|
||||
"@tanstack/react-query-devtools": "^4.29.0",
|
||||
"@testing-library/dom": "^9.3.0",
|
||||
"@testing-library/jest-dom": "^5.16.5",
|
||||
- "@testing-library/react": "^14.0.0",
|
||||
+ "@testing-library/react": "^14.3.1",
|
||||
"@testing-library/user-event": "^14.4.3",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/js-cookie": "^3.0.6",
|
||||
diff --git a/package-lock.json b/package-lock.json
|
||||
index 5b484fd55..7cbc13f49 100644
|
||||
--- a/package-lock.json
|
||||
+++ b/package-lock.json
|
||||
@@ -20,6 +20,7 @@
|
||||
"@eslint/js": "^9.20.0",
|
||||
"@microsoft/eslint-formatter-sarif": "^3.1.0",
|
||||
"@playwright/test": "^1.50.1",
|
||||
+ "@testing-library/react": "^14.3.1",
|
||||
"@types/react-virtualized": "^9.22.0",
|
||||
"caniuse-lite": "^1.0.30001741",
|
||||
"cross-env": "^7.0.3",
|
||||
@@ -2718,7 +2719,7 @@
|
||||
"@tanstack/react-query-devtools": "^4.29.0",
|
||||
"@testing-library/dom": "^9.3.0",
|
||||
"@testing-library/jest-dom": "^5.16.5",
|
||||
- "@testing-library/react": "^14.0.0",
|
||||
+ "@testing-library/react": "^14.3.1",
|
||||
"@testing-library/user-event": "^14.4.3",
|
||||
"@types/jest": "^29.5.14",
|
||||
"@types/js-cookie": "^3.0.6",
|
||||
@@ -51744,7 +51745,7 @@
|
||||
"@rollup/plugin-replace": "^5.0.5",
|
||||
"@rollup/plugin-terser": "^0.4.4",
|
||||
"@tanstack/react-query": "^4.28.0",
|
||||
- "@testing-library/react": "^14.0.0",
|
||||
+ "@testing-library/react": "^16.3.0",
|
||||
"@types/react": "^18.2.11",
|
||||
"@types/react-dom": "^18.2.4",
|
||||
"caniuse-lite": "^1.0.30001741",
|
||||
diff --git a/package.json b/package.json
|
||||
index 693de111d..5e58ab1f0 100644
|
||||
--- a/package.json
|
||||
+++ b/package.json
|
||||
@@ -99,6 +99,7 @@
|
||||
"@eslint/js": "^9.20.0",
|
||||
"@microsoft/eslint-formatter-sarif": "^3.1.0",
|
||||
"@playwright/test": "^1.50.1",
|
||||
+ "@testing-library/react": "^14.3.1",
|
||||
"@types/react-virtualized": "^9.22.0",
|
||||
"caniuse-lite": "^1.0.30001741",
|
||||
"cross-env": "^7.0.3",
|
||||
diff --git a/packages/client/package.json b/packages/client/package.json
|
||||
index 71aac0c29..ab6fabca1 100644
|
||||
--- a/packages/client/package.json
|
||||
+++ b/packages/client/package.json
|
||||
@@ -75,7 +75,7 @@
|
||||
"@rollup/plugin-replace": "^5.0.5",
|
||||
"@rollup/plugin-terser": "^0.4.4",
|
||||
"@tanstack/react-query": "^4.28.0",
|
||||
- "@testing-library/react": "^14.0.0",
|
||||
+ "@testing-library/react": "^16.3.0",
|
||||
"@types/react": "^18.2.11",
|
||||
"@types/react-dom": "^18.2.4",
|
||||
"caniuse-lite": "^1.0.30001741",
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
lib,
|
||||
buildNpmPackage,
|
||||
fetchNpmDeps,
|
||||
fetchFromGitHub,
|
||||
nodejs_22,
|
||||
pkg-config,
|
||||
@@ -11,15 +10,15 @@
|
||||
nixosTests,
|
||||
}:
|
||||
|
||||
buildNpmPackage rec {
|
||||
buildNpmPackage (finalAttrs: {
|
||||
pname = "librechat";
|
||||
version = "0.8.0";
|
||||
version = "0.8.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "danny-avila";
|
||||
repo = "LibreChat";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-DTmb9J2nsMy6f+V6BgRtFgpTwOi9OQnvikSx4QZQ0HI=";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-XiPnTKiSOMezUZuhkaGJ0xHiT7jrz8OYbZrvq5gb/V8=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
@@ -30,28 +29,13 @@ buildNpmPackage rec {
|
||||
# Also, we set the `bin` property to the server script to benefit from the
|
||||
# auto-generated wrapper.
|
||||
./0001-npm-pack.patch
|
||||
# LibreChat tries writing logs to the package directory, which is immutable
|
||||
# in our case. We patch the log directory to target the current working directory
|
||||
# instead, which in case of NixOS will be the service's data directory.
|
||||
./0002-logs.patch
|
||||
# Similarly to the logs, user uploads are by default written to the package
|
||||
# directory as well. Again, we patch this to be relative to the current working
|
||||
# directory instead.
|
||||
./0003-upload-paths.patch
|
||||
# The npm dependencies are causing issues with the build. The package @testing-library/react
|
||||
# appears to not be included in NPM deps, even though it is present in the project
|
||||
# This patch fixes this by placing the dependency in different files and regenerating the
|
||||
# lock file.
|
||||
./0004-fix-deps-v080.patch
|
||||
# User uploads are by default written to the package directory as well.
|
||||
# We patch this to be relative to the current working directory instead.
|
||||
./0002-upload-paths.patch
|
||||
];
|
||||
|
||||
npmDepsHash = "sha256-97cEw6VD7FoVayrxClHuS1iUcQmDw7/aUoUV6ektvOY=";
|
||||
npmDeps = fetchNpmDeps {
|
||||
inherit src;
|
||||
name = "${pname}-${version}-npm-deps-patched";
|
||||
hash = npmDepsHash;
|
||||
patches = [ ./0004-fix-deps-v080.patch ];
|
||||
};
|
||||
npmDepsFetcherVersion = 2;
|
||||
npmDepsHash = "sha256-h15rNYl2QYnh7/cJvA7lrRqmXw8Ri2QKTfTr7w7+mMo=";
|
||||
|
||||
# npm dependency install fails with nodejs_24: https://github.com/NixOS/nixpkgs/issues/474535
|
||||
nodejs = nodejs_22;
|
||||
@@ -65,12 +49,21 @@ buildNpmPackage rec {
|
||||
vips
|
||||
];
|
||||
|
||||
# required for sharp
|
||||
makeCacheWritable = true;
|
||||
|
||||
npmBuildScript = "frontend";
|
||||
npmPruneFlags = [ "--production" ];
|
||||
|
||||
makeWrapperArgs = [
|
||||
# Upstream defaults to the immutable package directory.
|
||||
# As a functioning default, we set this to the current working directory (through a relative logs path),
|
||||
# but make it easy for the module to override.
|
||||
"--set-default LIBRECHAT_LOG_DIR ./logs"
|
||||
];
|
||||
|
||||
# npmConfigHook only patches the root node_modules
|
||||
postConfigure = ''
|
||||
patchShebangs client/node_modules
|
||||
'';
|
||||
|
||||
# For reasons beyond my understanding, the api and client directory disappears after the build finishes.
|
||||
# Hence, the build fails with broken symlinks and if the symlink is removed,
|
||||
# starting LibreChat fails with a "module not found" error.
|
||||
@@ -97,8 +90,12 @@ buildNpmPackage rec {
|
||||
meta = {
|
||||
description = "Open-source app for all your AI conversations, fully customizable and compatible with any AI provider";
|
||||
homepage = "https://github.com/danny-avila/LibreChat";
|
||||
changelog = "https://www.librechat.ai/changelog/${finalAttrs.src.tag}";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ niklaskorz ];
|
||||
maintainers = with lib.maintainers; [
|
||||
gepbird
|
||||
niklaskorz
|
||||
];
|
||||
mainProgram = "librechat-server";
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user