将Hydra-CLI连接到密码保护Redis服务器吗? [英] Conecting Hydra-CLI to a password protect redis server?

查看:178
本文介绍了将Hydra-CLI连接到密码保护Redis服务器吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在node.js本地系统上使用Hydra-CLI,同时连接到Redislabs上托管的Redis数据库.但是,redislabs数据库需要密码,我似乎在Hydra-CLI配置选项中找不到密码的任何配置.

I am trying to use Hydra-CLI on a node.js local system, while connecting to a redis db that is hosted on redislabs. Howver, the redislabs db requires a password and I can't seem to find any configuration for password in the Hydra-CLI configuration options.

我可以使用hydra-express连接到数据库,并在config.json hydra对象中设置密码.

I can connect to the database using hydra-express with a password set in the config.json hydra object.

{
  "environment": "development",
  "hydra": {
    "serviceName": "hydraApp",
    "serviceIP": "",
    "servicePort": 3000,
    "serviceType": "sending back simple response to server",
    "serviceDescription": "Simple messaging between server and service",
    "redis": {
      "url": <redislabs db url>,
      "port": <port>,
      "db": 0,
      "password": <password>
    }
  }
}

但是我想尝试一下hydra-cli,以了解更多有关其工作原理的信息,而我对此一无所知.

But i would like to experiment with the hydra-cli to learn more about how it works and i get stuck on this.

谢谢!

推荐答案

更新解决方案:

因此,在浏览了他们的代码之后,我只结束了hydra-cli的github项目的克隆.在配置中根本没有设置密码,因此如果不更改一些代码就无法解决该密码.

So I ended just cloning the github project of hydra-cli after going through their code. There's simply no password set in the configuration, thus there's no way to solve it without changing some code.

我已经进行了必要的调整,并发送了请求请求.现在,提示符将要求用户输入选项密码,并且可以连接到受密码保护的Redis数据库.

I have made the adjustments needed and sent a pull-request. Now the prompt asks the user for an option password and can connect to a password protected redis database.

如果您看到此消息并需要尽快解决,我在这里是我的代码分支的链接,因此您可以复制它,直到请求被批准并且hydra-cli npm更新为止.

If you see this and need the solution asap i here is a link to my branch of the code so you can copy it until the request is approved and the hydra-cli npm is updated.

https://github.com/aviyacohen/hydra-cli

您将需要在本地系统上找到hydra-cli.js文件(因为它已全局安装),只需将我的代码复制粘贴到其中即可,而不是现在复制的代码.所做的更改很小,如果您想查看我的操作,可以先比较文件,这只是添加了几行以在redis数据中加入密码.

You will need to find the hydra-cli.js file on your local system (as it is installed globally) and just copy paste my code into it instead of the one there now. The changes are minor you can compare files first if you want to check out what i did, it was just adding a couple of lines to incorporate a password in the redis data.

这篇关于将Hydra-CLI连接到密码保护Redis服务器吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆