mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-21 10:50:14 +01:00
🚀 feat: Support Redis Clusters, Trusted Proxy Setting, And Toggle Meilisearch Indexing (#5963)
* refactor: Improve MeiliSearch integration with environment-based configuration for running index sync * chore: Remove Question issue template from GitHub repository * feat: Enable indexing in MeiliSearch configuration and clean up error handling in indexSync * feat: Update .env.example to include optional indexing configuration * refactor: rename env var for disabling index sync to MEILI_NO_SYNC * Added the option to change the default trusted proxy * feat: Add TRUST_PROXY configuration to .env.example for reverse proxy settings * feat: Enhance Redis support with cluster configuration and TLS options * feat(redis): add cluster support, environment config and url mapping - Add Redis cluster configuration with isEnabled flag - Configure prefix and max listeners settings - Improve code formatting and readability - Fix URL vs host parameter handling - Update environment variables and regex patterns --------- Co-authored-by: Gil Assunção <gil.assuncao@parceiros.nos.pt> Co-authored-by: Pedro Reis <pedro.malheiro@parceiros.nos.pt> Co-authored-by: João Trigo Soares <joao.soares@parceiros.nos.pt>
This commit is contained in:
parent
46a96b9caa
commit
1e625f7557
5 changed files with 101 additions and 63 deletions
|
|
@ -22,10 +22,11 @@ const staticCache = require('./utils/staticCache');
|
|||
const noIndex = require('./middleware/noIndex');
|
||||
const routes = require('./routes');
|
||||
|
||||
const { PORT, HOST, ALLOW_SOCIAL_LOGIN, DISABLE_COMPRESSION } = process.env ?? {};
|
||||
const { PORT, HOST, ALLOW_SOCIAL_LOGIN, DISABLE_COMPRESSION, TRUST_PROXY } = process.env ?? {};
|
||||
|
||||
const port = Number(PORT) || 3080;
|
||||
const host = HOST || 'localhost';
|
||||
const trusted_proxy = Number(TRUST_PROXY) || 1; /* trust first proxy by default */
|
||||
|
||||
const startServer = async () => {
|
||||
if (typeof Bun !== 'undefined') {
|
||||
|
|
@ -53,7 +54,7 @@ const startServer = async () => {
|
|||
app.use(staticCache(app.locals.paths.dist));
|
||||
app.use(staticCache(app.locals.paths.fonts));
|
||||
app.use(staticCache(app.locals.paths.assets));
|
||||
app.set('trust proxy', 1); /* trust first proxy */
|
||||
app.set('trust proxy', trusted_proxy);
|
||||
app.use(cors());
|
||||
app.use(cookieParser());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue