Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To allow to specify redis password #353

Closed
rarapost opened this issue Jul 23, 2018 · 13 comments
Closed

To allow to specify redis password #353

rarapost opened this issue Jul 23, 2018 · 13 comments
Assignees
Labels
feature request Issues that request new features to be added to OnlyOffice fixed Issues that fixed and released

Comments

@rarapost
Copy link

rarapost commented Jul 23, 2018

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.

@ShockwaveNN ShockwaveNN added the feature request Issues that request new features to be added to OnlyOffice label Jul 23, 2018
@ShockwaveNN
Copy link
Contributor

@konovalovsergey take a look

@Schmuuu
Copy link

Schmuuu commented Jan 6, 2019

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.

@nebulade
Copy link

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.

@phonon112358
Copy link

phonon112358 commented Jan 29, 2020

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 ShockwaveNN added the fixed Issues that fixed and released label Jan 30, 2020
@phonon112358
Copy link

@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?

@ShockwaveNN
Copy link
Contributor

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

@Quedale
Copy link

Quedale commented Feb 6, 2020

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

@krakazyabra
Copy link

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

@ShockwaveNN
Copy link
Contributor

@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

@krakazyabra
Copy link

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 :)

@ShockwaveNN
Copy link
Contributor

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

@krakazyabra
Copy link

Oh, now I see. Thank you anyway!

@CSchmidtDD
Copy link

CSchmidtDD commented Feb 1, 2021

@agolybev How is this issue closed when there is still no way to include a password in the documentation (options fine, but what syntax / semantics to use there?)
I'd recommend to open this issue until a way to use a redis with password is documented.

Edit: Thanks to Redis-Documentation Link
For everyone who wants to add Redis with password Authentication, add inside the "services" brackets:

"redis": {
      "host": "YOUR-REDIS-HOST",
      "options": {
          "password": "YOURPASSWORD"
    }
},

For Redis < 2.5 replace password with auth_pass!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to OnlyOffice fixed Issues that fixed and released
Projects
None yet
Development

No branches or pull requests

9 participants