mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 12:05:57 +01:00
updated configuration file with redis params, and updated all redis wrapper to read configs from config file instead of defaulting to localhost -- same for express.session store
This commit is contained in:
@@ -1,11 +1,17 @@
|
|||||||
var config = {
|
var config = {
|
||||||
"base_url": "http://localhost",
|
"base_url": "http://localhost",
|
||||||
"port": 4567,
|
"port": 4567,
|
||||||
"url": undefined, // Leave this alone
|
|
||||||
"mailer": {
|
"mailer": {
|
||||||
host: 'localhost',
|
host: 'localhost',
|
||||||
port: '25',
|
port: '25',
|
||||||
from: 'mailer@localhost.lan'
|
from: 'mailer@localhost.lan'
|
||||||
|
},
|
||||||
|
"redis": {
|
||||||
|
port: "6379",
|
||||||
|
host: "127.0.0.1",
|
||||||
|
options: {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
ERROR_LOGS = true,
|
ERROR_LOGS = true,
|
||||||
|
|
||||||
redis = require('redis'),
|
redis = require('redis'),
|
||||||
db = redis.createClient();
|
config = require('../config.js'),
|
||||||
|
db = redis.createClient(config.redis.port, config.redis.host, config.redis.options);
|
||||||
|
|
||||||
// todo (holy cow): append,auth,bgrewriteaof,bgsave,bitcount,bitop,blpop,brpop,brpoplpush,client kill,client list,client getname,client setname,config get,config set,config resetstat,dbsize,debug object,debug segfault,decrby,discard,dump,echo,eval,evalsha,exec,exists,expireat,flushall,flushdb,getbit,getrange,getset,hdel,hexists,hget,hgetall,hincrby,hincrbyfloat,hkeys,hlen,hmget,hmset,hset,hsetnx,hvals,incrby,incrbyfloat,info,lastsave,lindex,linsert,llen,lpop,lpushx,lrem,lset,ltrim,migrate,monitor,move,mset,msetnx,object,persist,pexpire,pexpireat,ping,psetex,psubscribe,pttl,publish,punsubscribe,quit,randomkey,rename,renamenx,restore,rpop,rpoplpush,rpush,rpushx,sadd,save,scard,script exists,script flush,script kill,script load,sdiff,sdiffstore,select,setbit,setex,setnx,setrange,shutdown,sinter,sinterstore,sismember,slaveof,slowlog,smembers,smove,sort,spop,srandmember,srem,strlen,subscribe,sunion,sunionstore,sync,time,ttl,type,unsubscribe,unwatch,watch,zadd,zcard,zcount,zincrby,zinterstore,zrange,zrangebyscore,zrank,zrem,zremrangebyrank,zremrangebyscore,zrevrange,zrevrangebyscore,zrevrank,zscore,zunionstore
|
// todo (holy cow): append,auth,bgrewriteaof,bgsave,bitcount,bitop,blpop,brpop,brpoplpush,client kill,client list,client getname,client setname,config get,config set,config resetstat,dbsize,debug object,debug segfault,decrby,discard,dump,echo,eval,evalsha,exec,exists,expireat,flushall,flushdb,getbit,getrange,getset,hdel,hexists,hget,hgetall,hincrby,hincrbyfloat,hkeys,hlen,hmget,hmset,hset,hsetnx,hvals,incrby,incrbyfloat,info,lastsave,lindex,linsert,llen,lpop,lpushx,lrem,lset,ltrim,migrate,monitor,move,mset,msetnx,object,persist,pexpire,pexpireat,ping,psetex,psubscribe,pttl,publish,punsubscribe,quit,randomkey,rename,renamenx,restore,rpop,rpoplpush,rpush,rpushx,sadd,save,scard,script exists,script flush,script kill,script load,sdiff,sdiffstore,select,setbit,setex,setnx,setrange,shutdown,sinter,sinterstore,sismember,slaveof,slowlog,smembers,smove,sort,spop,srandmember,srem,strlen,subscribe,sunion,sunionstore,sync,time,ttl,type,unsubscribe,unwatch,watch,zadd,zcard,zcount,zincrby,zinterstore,zrange,zrangebyscore,zrank,zrem,zremrangebyrank,zremrangebyscore,zrevrange,zrevrangebyscore,zrevrank,zscore,zunionstore
|
||||||
// done: get, set, incr, decr, del, mget, multi, expire, lpush, lrange, keys
|
// done: get, set, incr, decr, del, mget, multi, expire, lpush, lrange, keys
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ var express = require('express'),
|
|||||||
server = require('http').createServer(WebServer),
|
server = require('http').createServer(WebServer),
|
||||||
RedisStore = require('connect-redis')(express),
|
RedisStore = require('connect-redis')(express),
|
||||||
path = require('path'),
|
path = require('path'),
|
||||||
config = require('../config.js');
|
config = require('../config.js'),
|
||||||
|
redis = require('redis'),
|
||||||
|
redisServer = redis.createClient(config.redis.port, config.redis.host, config.redis.options);
|
||||||
|
|
||||||
(function(app) {
|
(function(app) {
|
||||||
var templates = global.templates;
|
var templates = global.templates;
|
||||||
@@ -24,6 +26,7 @@ var express = require('express'),
|
|||||||
app.use(express.compress());
|
app.use(express.compress());
|
||||||
app.use(express.session({
|
app.use(express.session({
|
||||||
store: new RedisStore({
|
store: new RedisStore({
|
||||||
|
client: redisServer,
|
||||||
ttl: 60*60*24*14
|
ttl: 60*60*24*14
|
||||||
}),
|
}),
|
||||||
secret: 'nodebb',
|
secret: 'nodebb',
|
||||||
|
|||||||
Reference in New Issue
Block a user