mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-05-20 08:24:43 +02:00
chore: update dependencies
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
require("dotenv").config();
|
import { config } from "dotenv";
|
||||||
|
config();
|
||||||
|
|
||||||
import server from "./src/server";
|
import server from "./src/server";
|
||||||
|
|
||||||
|
|||||||
Generated
+1099
-611
File diff suppressed because it is too large
Load Diff
+21
-22
@@ -27,53 +27,52 @@
|
|||||||
"@octokit/oauth-app": "^3.3.2",
|
"@octokit/oauth-app": "^3.3.2",
|
||||||
"@octokit/rest": "^18.5.3",
|
"@octokit/rest": "^18.5.3",
|
||||||
"@pm2/io": "^5.0.0",
|
"@pm2/io": "^5.0.0",
|
||||||
"archiver": "^5.3.0",
|
"archiver": "^5.3.1",
|
||||||
"aws-sdk": "^2.958.0",
|
"aws-sdk": "^2.1180.0",
|
||||||
"bull": "^3.29.2",
|
"bull": "^3.29.2",
|
||||||
"compression": "^1.7.4",
|
"compression": "^1.7.4",
|
||||||
"connect-redis": "^6.0.0",
|
"connect-redis": "^6.1.3",
|
||||||
"decompress-stream-to-s3": "^1.2.1",
|
"decompress-stream-to-s3": "^1.2.1",
|
||||||
"dotenv": "^10.0.0",
|
"dotenv": "^16.0.1",
|
||||||
"express": "^4.17.1",
|
"express": "^4.18.1",
|
||||||
"express-rate-limit": "^5.2.6",
|
"express-rate-limit": "^6.4.0",
|
||||||
"express-session": "^1.17.1",
|
"express-session": "^1.17.3",
|
||||||
"got": "^11.8.5",
|
"got": "^11.8.5",
|
||||||
"istextorbinary": "^6.0.0",
|
"istextorbinary": "^6.0.0",
|
||||||
"mime-types": "^2.1.30",
|
"mime-types": "^2.1.35",
|
||||||
"mongoose": "^5.13.5",
|
"mongoose": "^5.13.5",
|
||||||
"node-schedule": "^2.0.0",
|
"node-schedule": "^2.1.0",
|
||||||
"parse-github-url": "^1.0.2",
|
"parse-github-url": "^1.0.2",
|
||||||
"passport": "^0.4.1",
|
"passport": "^0.6.0",
|
||||||
"passport-github2": "^0.1.12",
|
"passport-github2": "^0.1.12",
|
||||||
"rate-limit-redis": "^2.1.0",
|
"rate-limit-redis": "^3.0.1",
|
||||||
"redis": "^3.1.2",
|
"redis": "^4.2.0",
|
||||||
"textextensions": "^5.12.0",
|
"textextensions": "^5.15.0",
|
||||||
"ts-custom-error": "^3.2.0",
|
"ts-custom-error": "^3.2.0",
|
||||||
"unzip-stream": "^0.3.1",
|
"unzip-stream": "^0.3.1",
|
||||||
"xml-flow": "^1.0.4"
|
"xml-flow": "^1.0.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/archiver": "^5.1.1",
|
"@types/archiver": "^5.3.1",
|
||||||
"@types/bull": "^3.15.4",
|
"@types/bull": "^3.15.4",
|
||||||
"@types/compression": "^1.7.1",
|
"@types/compression": "^1.7.1",
|
||||||
"@types/connect-redis": "^0.0.17",
|
"@types/connect-redis": "^0.0.18",
|
||||||
"@types/express": "^4.17.13",
|
"@types/express": "^4.17.13",
|
||||||
"@types/express-rate-limit": "^5.1.3",
|
"@types/express-rate-limit": "^6.0.0",
|
||||||
"@types/express-session": "^1.17.4",
|
"@types/express-session": "^1.17.5",
|
||||||
"@types/got": "^9.6.12",
|
"@types/got": "^9.6.12",
|
||||||
"@types/mime-types": "^2.1.0",
|
"@types/mime-types": "^2.1.0",
|
||||||
"@types/parse-github-url": "^1.0.0",
|
"@types/parse-github-url": "^1.0.0",
|
||||||
"@types/passport": "^1.0.7",
|
"@types/passport": "^1.0.9",
|
||||||
"@types/passport-github2": "^1.2.5",
|
"@types/passport-github2": "^1.2.5",
|
||||||
"@types/rate-limit-redis": "^1.7.2",
|
"@types/rate-limit-redis": "^1.7.4",
|
||||||
"@types/redis": "^2.8.31",
|
|
||||||
"@types/tar-fs": "^2.0.1",
|
"@types/tar-fs": "^2.0.1",
|
||||||
"@types/unzip-stream": "^0.3.1",
|
"@types/unzip-stream": "^0.3.1",
|
||||||
"@types/xml-flow": "^1.0.1",
|
"@types/xml-flow": "^1.0.1",
|
||||||
"chai": "^4.3.4",
|
"chai": "^4.3.4",
|
||||||
"mocha": "^9.0.3",
|
"mocha": "^9.0.3",
|
||||||
"ts-node": "^10.1.0",
|
"ts-node": "^10.9.1",
|
||||||
"typescript": "^4.3.5"
|
"typescript": "^4.7.4"
|
||||||
},
|
},
|
||||||
"nodemonConfig": {
|
"nodemonConfig": {
|
||||||
"ignore": [
|
"ignore": [
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import * as redis from "redis";
|
import { createClient } from "redis";
|
||||||
import * as passport from "passport";
|
import * as passport from "passport";
|
||||||
import * as session from "express-session";
|
import * as session from "express-session";
|
||||||
import * as connectRedis from "connect-redis";
|
import * as connectRedis from "connect-redis";
|
||||||
@@ -84,13 +84,19 @@ passport.deserializeUser((user: Express.User, done) => {
|
|||||||
done(null, user);
|
done(null, user);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const redisClient = createClient({
|
||||||
|
legacyMode: true,
|
||||||
|
socket: {
|
||||||
|
port: config.REDIS_PORT,
|
||||||
|
host: config.REDIS_HOSTNAME,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
redisClient.on("error", (err) => console.log("Redis Client Error", err));
|
||||||
|
redisClient.connect();
|
||||||
export const appSession = session({
|
export const appSession = session({
|
||||||
secret: "keyboard cat",
|
secret: "keyboard cat",
|
||||||
store: new RedisStore({
|
store: new RedisStore({
|
||||||
client: redis.createClient({
|
client: redisClient,
|
||||||
port: config.REDIS_PORT,
|
|
||||||
host: config.REDIS_HOSTNAME,
|
|
||||||
}),
|
|
||||||
}),
|
}),
|
||||||
saveUninitialized: false,
|
saveUninitialized: false,
|
||||||
resave: false,
|
resave: false,
|
||||||
|
|||||||
+16
-7
@@ -1,8 +1,8 @@
|
|||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
import * as ofs from "fs";
|
import * as ofs from "fs";
|
||||||
import * as redis from "redis";
|
import { createClient } from "redis";
|
||||||
import * as rateLimit from "express-rate-limit";
|
import rateLimit from "express-rate-limit";
|
||||||
import * as RedisStore from "rate-limit-redis";
|
import RedisStore from "rate-limit-redis";
|
||||||
import * as express from "express";
|
import * as express from "express";
|
||||||
import * as compression from "compression";
|
import * as compression from "compression";
|
||||||
import * as db from "./database/database";
|
import * as db from "./database/database";
|
||||||
@@ -44,15 +44,24 @@ export default async function start() {
|
|||||||
app.use(passport.initialize());
|
app.use(passport.initialize());
|
||||||
app.use(passport.session());
|
app.use(passport.session());
|
||||||
|
|
||||||
|
const redisClient = createClient({
|
||||||
|
socket: {
|
||||||
|
host: config.REDIS_HOSTNAME,
|
||||||
|
port: config.REDIS_PORT,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
redisClient.on('error', (err) => console.log('Redis Client Error', err));
|
||||||
|
|
||||||
|
await redisClient.connect();
|
||||||
|
|
||||||
const rate = rateLimit({
|
const rate = rateLimit({
|
||||||
store: new RedisStore({
|
store: new RedisStore({
|
||||||
client: redis.createClient({
|
sendCommand: (...args: string[]) => redisClient.sendCommand(args),
|
||||||
host: config.REDIS_HOSTNAME,
|
|
||||||
port: config.REDIS_PORT,
|
|
||||||
}),
|
|
||||||
}),
|
}),
|
||||||
windowMs: 15 * 60 * 1000, // 15 minutes
|
windowMs: 15 * 60 * 1000, // 15 minutes
|
||||||
max: 200, // limit each IP
|
max: 200, // limit each IP
|
||||||
|
standardHeaders: true,
|
||||||
|
legacyHeaders: false,
|
||||||
// delayMs: 0, // disable delaying - full speed until the max limit is reached
|
// delayMs: 0, // disable delaying - full speed until the max limit is reached
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user