Documentserver: To allow to specify redis password

Created on 23 Jul 2018  路  12Comments  路  Source: ONLYOFFICE/DocumentServer

Feature request / bug / missing feature ?

it is impossible to connect to redit it it has specified connection password.

My suggestion is to add new configuration option "password" to redis part and chage "createClientRedis" function in "pubsubRedis.js" javascript as follow:

function createClientRedis() {
  var redisClient;
  if(cfgRedisPort == 0) {
    redisClient = redis.createClient(cfgRedisHost, {});
  } else {
    redisClient = redis.createClient(cfgRedisPort, cfgRedisHost, {});
  }
  if(cfgRedisPasswd && cfgRedisPasswd != "") {
    redisClient.auth(cfgRedisPasswd);
  }
  redisClient.on('error', function(err) {
    logger.error('redisClient error %s', err.toString());
  });
  return redisClient;
}

The snippet above involves also unix domain socked as it is suggested in #227.
In the same JS file I neede to add new configuration variable as follow:

var cfgRedisPrefix = config.get('prefix');
var cfgRedisHost = config.get('host');
var cfgRedisPort = config.get('port');
// the next row is added due redis password
var cfgRedisPasswd = config.get('password');

Both changes (including the unix socket) I have implemented and tested locally, they seem to work well.

enhancement fixed

Most helpful comment

Hi, we at Cloudron are currently looking at packaging onlyoffice for our platfrom and would also require a redis password to be specified. I would be happy to contribute this if there is any chance of this getting merged.

All 12 comments

@konovalovsergey take a look

Hello,

What is the current status of this issue? Does Onlyoffice still not work with redis when a password (requirepass) is defined in /etc/redis.conf?
I had a password defined and couldn't any place (on file basis) where I could place the password for onlyoffice to know.

Hi, we at Cloudron are currently looking at packaging onlyoffice for our platfrom and would also require a redis password to be specified. I would be happy to contribute this if there is any chance of this getting merged.

I would also love to have this feature...

I inserted the code from @rarapost and saved my redis password in the local.json file... However, unfortunately, it doesn't work for me...
I am on Debian 10, installed onlyoffice/squeeze 8.1.233-5 via the official apt repository of onlyoffice. My redis version is 5:5.0.3-4+deb10u1 .

Without password, everything works fine.

any suggestions what I could do to get onlyoffice running when a requirepass value is set in redis? Do I need to edit another file?

@ShockwaveNN What does "fixed" mean? Do you have any hint for me?
As said, I edited the var/www/onlyoffice/documentserver/server/DocService/sources/pubsubRedis.js and inserted the code from @rarapost as well the /etc/onlyoffice/local.json file and saved my redis password there..
I also tried the /etc/onlyoffice/default.json for saving the password, but no difference unfortunately...

which further files do I need to edit?

@phonon112358 This mean @konovalovsergey fix original issue and this code will aviable in next public release 5.5.0 very soon

Nice to see this has been fixed/improved! Thanks for the great work.

Excuse me @agolybev , but how to use password option? How to set password there?

@krakazyabra Hi, you should be able to specify password via options config value

Also please note that this feature only available on paid version of DocumentServer, since we remove redis from DocumentServer CommunityEdition version

If you got any trouble - I think it's better to create new issue

hi! @ShockwaveNN! I'm surprised with such a quick response :-D
I saw the commit and option there. Am I right, that on Community version I'm not able to configure and use redis for OO? I only wondered, how to specify password in option object :)

If you're using Community Version there is no need of redis server since release of 5.5.0
It's still required as dependency if 5.5.x version, but we remove it in v5.6.0

Oh, now I see. Thank you anyway!

Was this page helpful?
0 / 5 - 0 ratings