<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hello again!<br>
<br>
I would like to implement Redis authentication as an additional
option in config.json file.<br>
<br>
This is what I've investigated so far:<br>
</p>
<p><br>
I am assuming that we are using this <b>version of redis</b>:
<a class="moz-txt-link-freetext" href="https://www.npmjs.com/package/redis">https://www.npmjs.com/package/redis</a><br>
</p>
<p><br>
Regarding the file <b>/lib/config.coffee</b> in
<a class="moz-txt-link-freetext" href="https://github.com/zaidka/genieacs/blob/ba33fc0fe09b9d1b0cd12dc876d0fafda1c9fa33/lib/config.coffee">https://github.com/zaidka/genieacs/blob/ba33fc0fe09b9d1b0cd12dc876d0fafda1c9fa33/lib/config.coffee</a>
, What would be the best thing to do regarding this new
functionality? I think the best is to add a new option whose name
would be <i>REDIS_PWD : {type: 'string', default : ''}</i> so
when you call it in other files, maybe you can have a function
which "extracts its content, and if it's blank, don't make any
auth". I don't know if this can be done<br>
<br>
But maybe the best is to have two independent entries, like <i>REDIS_AUTH
: {type: 'bool', default : false}</i> and REDIS_PWD : <i>{type:
'string', default : ''}</i><br>
</p>
<p><br>
Regarding the file <b>/lib/db.coffee</b> in
<a class="moz-txt-link-freetext" href="https://github.com/zaidka/genieacs/blob/1537603945335bb166ccb3fe8b0945fddaf623b8/lib/db.coffee">https://github.com/zaidka/genieacs/blob/1537603945335bb166ccb3fe8b0945fddaf623b8/lib/db.coffee</a>
, then, supposing we choose the first option, in the line 98, we
would rewrite it as the following:<br>
<i>exports.redisClient = redisClient =
redis.createClient(config.get('REDIS_PORT'),
config.get('REDIS_HOST'), config.get('REDIS_PWD'))</i> , isn't
it? Or would it create problems if the password is not set?<br>
</p>
<p><br>
Do you think that we need to change any more files? <br>
<br>
If you say to me that it would be OK, then I could test it using a
fork of the master branch, so then I could make a pull request. Do
you have any compiler/bundler script that makes the test easier?
What will I have to test/verify when everything is compiled?<br>
<br>
Thank you for your kind help<br>
</p>
</body>
</html>