Implementing Redis authentication in GenieACS
Sergio
sergio.fernandez at electronicamartinez.com
Fri Aug 19 16:14:26 EDT 2016
Hello again!
I would like to implement Redis authentication as an additional option
in config.json file.
This is what I've investigated so far:
I am assuming that we are using this *version of redis*:
https://www.npmjs.com/package/redis
Regarding the file */lib/config.coffee* in
https://github.com/zaidka/genieacs/blob/ba33fc0fe09b9d1b0cd12dc876d0fafda1c9fa33/lib/config.coffee
, 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 /REDIS_PWD :
{type: 'string', default : ''}/ 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
But maybe the best is to have two independent entries, like /REDIS_AUTH
: {type: 'bool', default : false}/ and REDIS_PWD : /{type: 'string',
default : ''}/
Regarding the file */lib/db.coffee* in
https://github.com/zaidka/genieacs/blob/1537603945335bb166ccb3fe8b0945fddaf623b8/lib/db.coffee
, then, supposing we choose the first option, in the line 98, we would
rewrite it as the following:
/exports.redisClient = redisClient =
redis.createClient(config.get('REDIS_PORT'), config.get('REDIS_HOST'),
config.get('REDIS_PWD'))/ , isn't it? Or would it create problems if the
password is not set?
Do you think that we need to change any more files?
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?
Thank you for your kind help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genieacs.com/pipermail/users/attachments/20160819/76c5215c/attachment.html>
More information about the Users
mailing list