From 4dda891389611dff057b4d2bbd114a7eae3411fa Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Wed, 23 Oct 2019 11:41:12 +0300 Subject: [PATCH] redis store changed, ok --- app.js | 3 ++- package-lock.json | 25 +++++++++++++++++++++++++ package.json | 1 + 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index efac98b..0983801 100644 --- a/app.js +++ b/app.js @@ -9,6 +9,7 @@ const path = require('path') const toml = require('toml') const fs = require('fs') const uuid = require('uuid/v4') +const redis = require('redis') const connectSession = require('connect-redis') require('express-async-errors') @@ -98,7 +99,7 @@ app.use(session({ secret: config['Streaming']['Secret'], resave: false, saveUninitialized: true, - store: new SessionStore(), + store: new SessionStore({ client: redis.createClient() }), cookie: { secure: !dev, maxAge: 2678400000 // 1 month diff --git a/package-lock.json b/package-lock.json index f0ad916..9e21ad4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1804,6 +1804,11 @@ "is-obj": "^1.0.0" } }, + "double-ended-queue": { + "version": "2.1.0-0", + "resolved": "https://registry.npmjs.org/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz", + "integrity": "sha1-ED01J/0xUo9AGIEwyEHv3XgmTlw=" + }, "duplexer3": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", @@ -4887,6 +4892,26 @@ "strip-indent": "^2.0.0" } }, + "redis": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/redis/-/redis-2.8.0.tgz", + "integrity": "sha512-M1OkonEQwtRmZv4tEWF2VgpG0JWJ8Fv1PhlgT5+B+uNq2cA3Rt1Yt/ryoR+vQNOQcIEgdCdfH0jr3bDpihAw1A==", + "requires": { + "double-ended-queue": "^2.1.0-0", + "redis-commands": "^1.2.0", + "redis-parser": "^2.6.0" + } + }, + "redis-commands": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/redis-commands/-/redis-commands-1.5.0.tgz", + "integrity": "sha512-6KxamqpZ468MeQC3bkWmCB1fp56XL64D4Kf0zJSwDZbVLLm7KFkoIcHrgRvQ+sk8dnhySs7+yBg94yIkAK7aJg==" + }, + "redis-parser": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-2.6.0.tgz", + "integrity": "sha1-Uu0J2srBCPGmMcB+m2mUHnoZUEs=" + }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", diff --git a/package.json b/package.json index 43d0b96..61d8f9e 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "express-async-errors": "^3.1.1", "express-session": "^1.16.1", "nunjucks": "^3.2.0", + "redis": "^2.8.0", "request": "^2.88.0", "sqlite": "^3.0.3", "toml": "^3.0.0",