Switch to mainline maintained librechat
I can't build my custom version anymore anyway.
This commit is contained in:
parent
27779f8256
commit
4cf7bc285b
5 changed files with 3 additions and 145 deletions
|
|
@ -1,8 +1,5 @@
|
||||||
{ lib, config, nixpkgs, pkgs, ... }:
|
{ lib, config, nixpkgs, pkgs, ... }:
|
||||||
with lib;
|
with lib;
|
||||||
let
|
|
||||||
librechat = (pkgs.callPackage (./librechat/package.nix ) { });
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
options.myModules.librechat.enable = mkEnableOption "custom librechat configuration";
|
options.myModules.librechat.enable = mkEnableOption "custom librechat configuration";
|
||||||
|
|
||||||
|
|
@ -14,8 +11,9 @@ in
|
||||||
group = "librechat";
|
group = "librechat";
|
||||||
};
|
};
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
librechat
|
pkgs.librechat
|
||||||
pkgs.meilisearch
|
pkgs.meilisearch
|
||||||
|
pkgs.mongodb-tools
|
||||||
];
|
];
|
||||||
services.caddy.virtualHosts."ai.gleipnir.technology".extraConfig = ''
|
services.caddy.virtualHosts."ai.gleipnir.technology".extraConfig = ''
|
||||||
reverse_proxy http://localhost:10050
|
reverse_proxy http://localhost:10050
|
||||||
|
|
@ -133,7 +131,7 @@ in
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
User = "librechat";
|
User = "librechat";
|
||||||
Group = "librechat";
|
Group = "librechat";
|
||||||
ExecStart = "${librechat}/bin/librechat-server";
|
ExecStart = "${pkgs.librechat}/bin/librechat-server";
|
||||||
TimeoutStopSec = "5s";
|
TimeoutStopSec = "5s";
|
||||||
PrivateTmp = true;
|
PrivateTmp = true;
|
||||||
WorkingDirectory = "/opt/librechat";
|
WorkingDirectory = "/opt/librechat";
|
||||||
|
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
diff --git a/package.json b/package.json
|
|
||||||
index 011551594..f4f98c1a8 100644
|
|
||||||
--- a/package.json
|
|
||||||
+++ b/package.json
|
|
||||||
@@ -160,5 +160,16 @@
|
|
||||||
"admin/",
|
|
||||||
"packages/"
|
|
||||||
]
|
|
||||||
+ },
|
|
||||||
+ "files": [
|
|
||||||
+ "api",
|
|
||||||
+ "client/dist",
|
|
||||||
+ "config",
|
|
||||||
+ "packages/data-provider",
|
|
||||||
+ "packages/data-schemas",
|
|
||||||
+ "packages/mcp"
|
|
||||||
+ ],
|
|
||||||
+ "bin": {
|
|
||||||
+ "librechat-server": "api/server/index.js"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
diff --git a/api/config/meiliLogger.js b/api/config/meiliLogger.js
|
|
||||||
index 398672da5..fcd6864f8 100644
|
|
||||||
--- a/api/config/meiliLogger.js
|
|
||||||
+++ b/api/config/meiliLogger.js
|
|
||||||
@@ -26,7 +26,7 @@ const getLogDir = () => {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Local development: use api/logs relative to this file
|
|
||||||
- return path.join(__dirname, '..', 'logs');
|
|
||||||
+ return path.join('.', 'logs');
|
|
||||||
};
|
|
||||||
|
|
||||||
const logDir = getLogDir();
|
|
||||||
diff --git a/api/config/winston.js b/api/config/winston.js
|
|
||||||
index 93b84f7c4..4276bd6c2 100644
|
|
||||||
--- a/api/config/winston.js
|
|
||||||
+++ b/api/config/winston.js
|
|
||||||
@@ -27,7 +27,7 @@ const getLogDir = () => {
|
|
||||||
}
|
|
||||||
|
|
||||||
// Local development: use api/logs relative to this file
|
|
||||||
- return path.join(__dirname, '..', 'logs');
|
|
||||||
+ return path.join('.', 'logs');
|
|
||||||
};
|
|
||||||
|
|
||||||
const logDir = getLogDir();
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
diff --git a/api/config/paths.js b/api/config/paths.js
|
|
||||||
index 165e9e6..fc85083 100644
|
|
||||||
--- a/api/config/paths.js
|
|
||||||
+++ b/api/config/paths.js
|
|
||||||
@@ -2,13 +2,13 @@ const path = require('path');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
root: path.resolve(__dirname, '..', '..'),
|
|
||||||
- uploads: path.resolve(__dirname, '..', '..', 'uploads'),
|
|
||||||
+ uploads: path.resolve('.', 'uploads'),
|
|
||||||
clientPath: path.resolve(__dirname, '..', '..', 'client'),
|
|
||||||
dist: path.resolve(__dirname, '..', '..', 'client', 'dist'),
|
|
||||||
publicPath: path.resolve(__dirname, '..', '..', 'client', 'public'),
|
|
||||||
fonts: path.resolve(__dirname, '..', '..', 'client', 'public', 'fonts'),
|
|
||||||
assets: path.resolve(__dirname, '..', '..', 'client', 'public', 'assets'),
|
|
||||||
- imageOutput: path.resolve(__dirname, '..', '..', 'client', 'public', 'images'),
|
|
||||||
+ imageOutput: path.resolve('.', 'images'),
|
|
||||||
structuredTools: path.resolve(__dirname, '..', 'app', 'clients', 'tools', 'structured'),
|
|
||||||
pluginManifest: path.resolve(__dirname, '..', 'app', 'clients', 'tools', 'manifest.json'),
|
|
||||||
};
|
|
||||||
|
|
@ -1,73 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
buildNpmPackage,
|
|
||||||
fetchFromGitHub,
|
|
||||||
pkg-config,
|
|
||||||
node-gyp,
|
|
||||||
vips,
|
|
||||||
nix-update-script,
|
|
||||||
}:
|
|
||||||
|
|
||||||
buildNpmPackage rec {
|
|
||||||
pname = "librechat";
|
|
||||||
version = "0.8.2-rc2";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "danny-avila";
|
|
||||||
repo = "LibreChat";
|
|
||||||
tag = "v${version}";
|
|
||||||
hash = "sha256-3H+ixVnamGYjSYHsn9f4IpY1834bXIJxs8am+vPi6I0=";
|
|
||||||
};
|
|
||||||
|
|
||||||
patches = [
|
|
||||||
# `buildNpmPackage` relies on `npm pack`, which only includes files explicitly
|
|
||||||
# listed in the project's package.json `files` array if this property is set.
|
|
||||||
# LibreChat does not set this property, but we can avoid packaging the whole
|
|
||||||
# workspace by simply adding the relevant paths here ourselves.
|
|
||||||
# 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
|
|
||||||
];
|
|
||||||
|
|
||||||
npmDepsHash = "sha256-3Q9FCyGCYcMQ1Vab2W2PFNBre6BYtx7DLKRY0G351N0=";
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
pkg-config
|
|
||||||
node-gyp
|
|
||||||
];
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
vips
|
|
||||||
];
|
|
||||||
|
|
||||||
# required for sharp
|
|
||||||
makeCacheWritable = true;
|
|
||||||
|
|
||||||
npmBuildScript = "frontend";
|
|
||||||
npmPruneFlags = [ "--omit=dev" ];
|
|
||||||
|
|
||||||
passthru = {
|
|
||||||
updateScript = nix-update-script {
|
|
||||||
extraArgs = [
|
|
||||||
"--version-regex"
|
|
||||||
"^v(\\d+\\.\\d+\\.\\d+)$"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
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";
|
|
||||||
license = lib.licenses.mit;
|
|
||||||
maintainers = with lib.maintainers; [ niklaskorz ];
|
|
||||||
mainProgram = "librechat-server";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue