mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
* feat: Add configurable retention period for temporary chats * Addressing eslint errors * Fix: failing test due to missing registration * Update: variable name and use hours instead of days for chat retention * Addressing comments * chore: fix import order in Conversation.js * chore: import order in Message.js * chore: fix import order in config.ts * chore: move common methods to packages/api to reduce potential for circular dependencies * refactor: update temp chat retention config type to Partial<TCustomConfig> * refactor: remove unused config variable from AppService and update loadCustomConfig tests with logger mock * refactor: handle model undefined edge case by moving Session model initialization inside methods --------- Co-authored-by: Rakshit Tiwari <rak1729e@gmail.com>
36 lines
969 B
JavaScript
36 lines
969 B
JavaScript
const removePorts = require('./removePorts');
|
|
const countTokens = require('./countTokens');
|
|
const handleText = require('./handleText');
|
|
const sendEmail = require('./sendEmail');
|
|
const queue = require('./queue');
|
|
const files = require('./files');
|
|
|
|
/**
|
|
* Check if email configuration is set
|
|
* @returns {Boolean}
|
|
*/
|
|
function checkEmailConfig() {
|
|
// Check if Mailgun is configured
|
|
const hasMailgunConfig =
|
|
!!process.env.MAILGUN_API_KEY && !!process.env.MAILGUN_DOMAIN && !!process.env.EMAIL_FROM;
|
|
|
|
// Check if SMTP is configured
|
|
const hasSMTPConfig =
|
|
(!!process.env.EMAIL_SERVICE || !!process.env.EMAIL_HOST) &&
|
|
!!process.env.EMAIL_USERNAME &&
|
|
!!process.env.EMAIL_PASSWORD &&
|
|
!!process.env.EMAIL_FROM;
|
|
|
|
// Return true if either Mailgun or SMTP is properly configured
|
|
return hasMailgunConfig || hasSMTPConfig;
|
|
}
|
|
|
|
module.exports = {
|
|
checkEmailConfig,
|
|
...handleText,
|
|
countTokens,
|
|
removePorts,
|
|
sendEmail,
|
|
...files,
|
|
...queue,
|
|
};
|