mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-12 04:24:24 +01:00
feat: bun support 🥟 (#907)
* feat: bun 🥟
* check if playwright/linux workflow is fixed
* fix: backend issues exposed by bun
* feat: update scripts for bun
This commit is contained in:
parent
a9215ed9ce
commit
75be9a3279
11 changed files with 33 additions and 13 deletions
|
|
@ -63,7 +63,7 @@
|
|||
"passport-local": "^1.0.0",
|
||||
"pino": "^8.12.1",
|
||||
"sanitize": "^2.1.2",
|
||||
"sharp": "^0.32.1",
|
||||
"sharp": "^0.32.5",
|
||||
"zod": "^3.22.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ const errorController = require('./controllers/ErrorController');
|
|||
const passport = require('passport');
|
||||
const configureSocialLogins = require('./socialLogins');
|
||||
|
||||
const port = process.env.PORT || 3080;
|
||||
const port = Number(process.env.PORT) || 3080;
|
||||
const host = process.env.HOST || 'localhost';
|
||||
const projectPath = path.join(__dirname, '..', '..', 'client');
|
||||
const { jwtLogin, passportLogin } = require('../strategies');
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ const loginLimiter = rateLimit({
|
|||
windowMs,
|
||||
max,
|
||||
message: `Too many login attempts from this IP, please try again after ${windowInMinutes} minutes.`,
|
||||
keyGenerator: function (req) {
|
||||
// Strip out the port number from the IP address
|
||||
return req.ip.replace(/:\d+[^:]*$/, '');
|
||||
},
|
||||
});
|
||||
|
||||
module.exports = loginLimiter;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ const registerLimiter = rateLimit({
|
|||
windowMs,
|
||||
max,
|
||||
message: `Too many accounts created from this IP, please try again after ${windowInMinutes} minutes`,
|
||||
keyGenerator: function (req) {
|
||||
// Strip out the port number from the IP address
|
||||
return req.ip.replace(/:\d+[^:]*$/, '');
|
||||
},
|
||||
});
|
||||
|
||||
module.exports = registerLimiter;
|
||||
|
|
|
|||
|
|
@ -50,9 +50,10 @@ async function passportLogin(req, email, password, done) {
|
|||
}
|
||||
|
||||
function logError(title, parameters) {
|
||||
const entries = Object.entries(parameters).map(([name, value]) => ({ name, value }));
|
||||
DebugControl.log.functionName(title);
|
||||
if (parameters) {
|
||||
DebugControl.log.parameters(parameters);
|
||||
if (entries) {
|
||||
DebugControl.log.parameters(entries);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue