Przeglądaj źródła

simplify configuration for RedisStore

Yuki Takei 8 lat temu
rodzic
commit
81eaacee3d
3 zmienionych plików z 3 dodań i 14 usunięć
  1. 2 12
      lib/crowi/index.js
  2. 0 1
      package.json
  3. 1 1
      yarn.lock

+ 2 - 12
lib/crowi/index.js

@@ -181,22 +181,12 @@ Crowi.prototype.setupSessionConfig = function() {
     };
 
     if (self.env.SESSION_NAME) {
-        sessionConfig.name = self.env.SESSION_NAME;
+      sessionConfig.name = self.env.SESSION_NAME;
     }
 
     if (redisUrl) {
-      var ru   = require('url').parse(redisUrl);
-      var redis = require('redis');
-      var redisClient = redis.createClient(ru.port, ru.hostname);
-      if (ru.auth) {
-        redisClient.auth(ru.auth.split(':')[1]);
-      }
-
       RedisStore = require('connect-redis')(session);
-      sessionConfig.store = new RedisStore({
-        prefix: 'crowi:sess:',
-        client: redisClient,
-      });
+      sessionConfig.store = new RedisStore({ url: redisUrl });
     }
 
     self.sessionConfig = sessionConfig;

+ 0 - 1
package.json

@@ -132,7 +132,6 @@
     "react-codemirror2": "^4.2.1",
     "react-dom": "^16.2.0",
     "react-dropzone": "^4.2.7",
-    "redis": "^2.7.1",
     "reveal.js": "^3.5.0",
     "rimraf": "^2.6.1",
     "sass-loader": "^7.0.1",

+ 1 - 1
yarn.lock

@@ -6083,7 +6083,7 @@ redis-parser@^2.6.0:
   version "2.6.0"
   resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-2.6.0.tgz#52ed09dacac108f1a631c07e9b69941e7a19504b"
 
-redis@^2.1.0, redis@^2.7.1:
+redis@^2.1.0:
   version "2.8.0"
   resolved "https://registry.yarnpkg.com/redis/-/redis-2.8.0.tgz#202288e3f58c49f6079d97af7a10e1303ae14b02"
   dependencies: