mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-16 16:30:15 +01:00
🔧 feat: optional librechat.yaml path via environment variable (#1858)
Co-authored-by: afel <andreas.feldl@netlight.com>
This commit is contained in:
parent
c1a4733d50
commit
7a55132e42
2 changed files with 10 additions and 1 deletions
|
|
@ -40,6 +40,12 @@ DEBUG_CONSOLE=false
|
||||||
# UID=1000
|
# UID=1000
|
||||||
# GID=1000
|
# GID=1000
|
||||||
|
|
||||||
|
#===============#
|
||||||
|
# Configuration #
|
||||||
|
#===============#
|
||||||
|
|
||||||
|
# CONFIG_PATH="/alternative/path/to/librechat.yaml"
|
||||||
|
|
||||||
#===================================================#
|
#===================================================#
|
||||||
# Endpoints #
|
# Endpoints #
|
||||||
#===================================================#
|
#===================================================#
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ const { getLogStores } = require('~/cache');
|
||||||
const { logger } = require('~/config');
|
const { logger } = require('~/config');
|
||||||
|
|
||||||
const projectRoot = path.resolve(__dirname, '..', '..', '..', '..');
|
const projectRoot = path.resolve(__dirname, '..', '..', '..', '..');
|
||||||
const configPath = path.resolve(projectRoot, 'librechat.yaml');
|
const defaultConfigPath = path.resolve(projectRoot, 'librechat.yaml');
|
||||||
|
|
||||||
let i = 0;
|
let i = 0;
|
||||||
|
|
||||||
|
|
@ -16,6 +16,9 @@ let i = 0;
|
||||||
* @returns {Promise<TCustomConfig | null>} A promise that resolves to null or the custom config object.
|
* @returns {Promise<TCustomConfig | null>} A promise that resolves to null or the custom config object.
|
||||||
* */
|
* */
|
||||||
async function loadCustomConfig() {
|
async function loadCustomConfig() {
|
||||||
|
// Use CONFIG_PATH if set, otherwise fallback to defaultConfigPath
|
||||||
|
const configPath = process.env.CONFIG_PATH || defaultConfigPath;
|
||||||
|
|
||||||
const customConfig = loadYaml(configPath);
|
const customConfig = loadYaml(configPath);
|
||||||
if (!customConfig) {
|
if (!customConfig) {
|
||||||
i === 0 &&
|
i === 0 &&
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue