From 4474a93a4fe34a9c6af7d4b311c1d1697c82bdb3 Mon Sep 17 00:00:00 2001 From: alsotang Date: Sun, 17 Jul 2016 18:01:00 +0800 Subject: [PATCH] add `redis_password` --- app.js | 2 ++ common/redis.js | 1 + config.default.js | 1 + 3 files changed, 4 insertions(+) diff --git a/app.js b/app.js index d44da96c94..0c20ec938e 100644 --- a/app.js +++ b/app.js @@ -97,6 +97,8 @@ app.use(session({ store: new RedisStore({ port: config.redis_port, host: config.redis_host, + db: config.redis_db, + pass: config.redis_password, }), resave: false, saveUninitialized: false, diff --git a/common/redis.js b/common/redis.js index a4d90225fb..01939b070c 100644 --- a/common/redis.js +++ b/common/redis.js @@ -6,6 +6,7 @@ var client = new Redis({ port: config.redis_port, host: config.redis_host, db: config.redis_db, + password: config.redis_password, }); client.on('error', function (err) { diff --git a/config.default.js b/config.default.js index ac403fbd3e..bb4b07c9a3 100644 --- a/config.default.js +++ b/config.default.js @@ -41,6 +41,7 @@ var config = { redis_host: '127.0.0.1', redis_port: 6379, redis_db: 0, + redis_password: '', session_secret: 'node_club_secret', // 务必修改 auth_cookie_name: 'node_club',