diff --git a/.env.example b/.env.example index 6ecd2d8d0d..ab9b57756a 100644 --- a/.env.example +++ b/.env.example @@ -40,6 +40,12 @@ DEBUG_CONSOLE=false # UID=1000 # GID=1000 +#===============# +# Configuration # +#===============# + +# CONFIG_PATH="/alternative/path/to/librechat.yaml" + #===================================================# # Endpoints # #===================================================# diff --git a/api/server/services/Config/loadCustomConfig.js b/api/server/services/Config/loadCustomConfig.js index eecf8eff82..dc29e3329c 100644 --- a/api/server/services/Config/loadCustomConfig.js +++ b/api/server/services/Config/loadCustomConfig.js @@ -5,7 +5,7 @@ const { getLogStores } = require('~/cache'); const { logger } = require('~/config'); const projectRoot = path.resolve(__dirname, '..', '..', '..', '..'); -const configPath = path.resolve(projectRoot, 'librechat.yaml'); +const defaultConfigPath = path.resolve(projectRoot, 'librechat.yaml'); let i = 0; @@ -16,6 +16,9 @@ let i = 0; * @returns {Promise} A promise that resolves to null or the custom config object. * */ async function loadCustomConfig() { + // Use CONFIG_PATH if set, otherwise fallback to defaultConfigPath + const configPath = process.env.CONFIG_PATH || defaultConfigPath; + const customConfig = loadYaml(configPath); if (!customConfig) { i === 0 &&