Hubot 无法连接到 Rocket Chat?

标签 hubot rocket.chat

我是第一次测试 Rocket Chat,我正在关注 this guide to Deploy with Docker

我已成功启动 Rocket Chat,现在正在尝试启用 Hubot。 我创建了一个名为 bot 的用户,并使用更新的登录信息修改了文件 docker-compose.yml

这是我的文件:

mongo:
  image: mongo
# volumes:
#    - ./data/runtime/db:/data/db
#    - ./data/dump:/dump
  command: mongod --smallfiles --oplogSize 128

rocketchat:
  image: rocketchat/rocket.chat:latest
# volumes:
#    - ./uploads:/app/uploads
  environment:
    - PORT=3000
    - ROOT_URL=http://localhost:3000
    - MONGO_URL=mongodb://mongo:27017/rocketchat
  links:
    - mongo:mongo
  ports:
    - 3000:3000

# hubot, the popular chatbot (add the bot user first and change the password before starting this image)
hubot:
  image: rocketchat/hubot-rocketchat
  environment:
    - ROCKETCHAT_URL=localhost:3000
    - LISTEN_ON_ALL_PUBLIC=true
    - ROCKETCHAT_ROOM=''
    - ROCKETCHAT_USER=bot
    - ROCKETCHAT_PASSWORD=hubot
    # - RESPOND_TO_DM=true
    #- ROCKETCHAT_AUTH=password
    - BOT_NAME=bot
# you can add more scripts as you'd like here, they need to be installable by npm
    - EXTERNAL_SCRIPTS=hubot-help,hubot-seen,hubot-links,hubot-diagnostics
  links:
    - rocketchat:rocketchat
# this is used to expose the hubot port for notifications on the host on port 3001, e.g. for hubot-jenkins-notifier
  ports:
    - 3001:8080

我已经使用 Hubot 启动了容器,但它似乎没有响应 Rocket Chat 中的命令。 我不确定预期的输出是什么,但他似乎无法连接到 localhost:3000,这是我用来打开 Rocket Chat 的 URL。

> docker-compose up hubot   
Recreating rocketchat_mongo_1...
Recreating rocketchat_rocketchat_1...
Recreating rocketchat_hubot_1...
Attaching to rocketchat_hubot_1
hubot_1 | <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a4ccd1c6cbd089ccc1c8d4e4948a958a97" rel="noreferrer noopener nofollow">[email protected]</a> node_modules/hubot-help
hubot_1 | 
hubot_1 | <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e58d90878a91c8818c84828b8a96918c8696a5d5cbd5cbd4" rel="noreferrer noopener nofollow">[email protected]</a> node_modules/hubot-diagnostics
hubot_1 | 
hubot_1 | <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9af2eff8f5eeb7f6f3f4f1e9daaab4aab4ab" rel="noreferrer noopener nofollow">[email protected]</a> node_modules/hubot-links
hubot_1 | 
hubot_1 | <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="147c61767b60396771717a54243a263a27" rel="noreferrer noopener nofollow">[email protected]</a> node_modules/hubot-seen
hubot_1 | ├── <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="77031e1a12161018374759465947" rel="noreferrer noopener nofollow">[email protected]</a>
hubot_1 | └── <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="583b373e3e3d3d752b3b2a31282c1869766e766b" rel="noreferrer noopener nofollow">[email protected]</a>
hubot_1 | [Sat Feb 20 2016 16:37:18 GMT+0000 (UTC)] INFO Starting Rocketchat adapter...
hubot_1 | [Sat Feb 20 2016 16:37:18 GMT+0000 (UTC)] INFO Once connected to rooms I will respond to the name: bot
hubot_1 | [Sat Feb 20 2016 16:37:18 GMT+0000 (UTC)] INFO Connecting To: localhost:3000

你有什么建议吗?

谢谢!

最佳答案

您在计算机上使用 localhost:3000,但在 hubot 容器内,它应该是 rocketchat:3000,如您在链接中定义的那样。

关于Hubot 无法连接到 Rocket Chat?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35540386/

相关文章:

bots - 如何让 Hubot 知道他/她正在私聊中收到消息?

irc - Hubot 启动时挂起/卡住

http - 阻止在反向代理模式下通过 http 端口访问 rocket.chat

kubernetes - RocketChat android应用SSL连接问题

javascript - Hubot - 未输入参数/未输入参数

coffeescript - 如何使用 hubot 将项目固定在 slack channel 中?

rocket.chat - 如何在不提供日期的情况下通过Rocket.chat中的rest api获取未读消息?

ssl - 如何在 docker 容器中为 rocketchat 启用 HTTPS

hubot - 如何设置Hubot基本权限?

ubuntu-16.04 - 错误 : snap "rocketchat-server" not found