Rocket.Chat - SLACK alternative (with MongoDB as backend)

Docker Rocket.Chat - SLACK alternative (with MongoDB as backend)

Currently reading
Docker Rocket.Chat - SLACK alternative (with MongoDB as backend)

I am beginning to doubt my sanity. Tried it on another NAS now... Same problem. 😭 Unfortunately, there is not much time for further tests at the moment. I will continue reading here and try again sometime. Maybe others will encounter the same problem and find a solution...
Hi Karlsson
You are not alone. I had the same issue. I was so mad that I ditched it. I created a docker-compose.yml. Took me about 10 minutes and worked perfectly. If you are interested, I will post it here.
 
YAML:
version: '2'

services:
  rocketchat:
    image: rocketchat/rocket.chat:latest
    container_name: rocketchat_app
    restart: unless-stopped
    volumes:
      - /volume1/docker/rocketchat/app:/app/uploads
    environment:
      - PORT=3000
      - ROOT_URL=https://yourdomain.com
      - MONGO_URL=mongodb://mongo:27017/rocketchat
      - MONGO_OPLOG_URL=mongodb://mongo:27017/local
    depends_on:
      - mongo
    ports:
      - 2999:3000

  mongo:
    image: mongo:latest
    container_name: rocketchat_db
    restart: unless-stopped
    volumes:
     - /volume1/docker/rocketchat/db:/data/db
     #- ./data/dump:/dump
    command: mongod --oplogSize 128 --replSet rs0

  # this container's job is just run the command to initialize the replica set.
  # it will run the command and remove himself (it will not stay running)
  mongo-init-replica:
    image: mongo:latest
    command: >
      bash -c
        "for i in `seq 1 30`; do
          mongo mongo/rocketchat --eval \"
            rs.initiate({
              _id: 'rs0',
              members: [ { _id: 0, host: 'localhost:27017' } ]})\" &&
          s=$$? && break || s=$$?;
          echo \"Tried $$i times. Waiting 5 secs...\";
          sleep 5;
        done; (exit $$s)"
    depends_on:
      - mongo

Maybe someone could have a look over it. If there is any error in it.
Place it on your synology. Connect via ssh to the synology. Go to the place where you saved the file. Make sure it is named docker-compose.yml and run as sudo.
First: docker-compose up -d mongo
second; docker-compose up -d mongo-init-replica
third: docker-compose up -d rocketchat

@ all
A question from my side: How to enable the iOS support? I can connect via browser and the destkop app. But not with a mobile app. There is a websocket error. I read about it the web. This could be a problem with the reverse proxy. Does anybody know how to deal with that?
 
This could be a problem with the reverse proxy. Does anybody know how to deal with that?
Screenshot 2020-11-04 at 13.47.57.png



Add this in your RP entry for the chat. Use the Create dropdown menu and select WebSocket. Then mobile will work just fine.
 
Place it on your synology. Connect via ssh to the synology. Go to the place where you saved the file. Make sure it is named docker-compose.yml and run as sudo.
First: docker-compose up -d mongo
second; docker-compose up -d mongo-init-replica
third: docker-compose up -d rocketchat
It works!!! 😀👍 Thank you very much!! It seems to be running perfectly. I will play around with it and test some things. Next project would be to implement login over the LDAP server on the diskstation...
 
R.Ch. notification:
Please note that push to official Rocket.Chat mobile apps is unavailable for non-registered servers. See how to register your server [here], and check our forum for more details.

Why they need such registration, when they know how much Smart app they have in operation?
Why they need confirm a registration token into Administration console of the hosted R.Ch. server?
It's really sensitive step to privacy of the server operation.
OFC:
- they have cost with the Smart App dev and support
- they can charge yearly subscription for the Smart App, why not
- just they need count with feedback from the market

Desktop APP is out of this step.
 
Hi,
i have successfully followed the instructions, the Rocket Chat server is running in docker at DSM.
1609064468055.png

However, I'm not able to connect to it. To be sure i do it correctly, I connect via a browser with a computer in the same network via the ip of the network card from the NAS that is connected to the network, right? That would be http://10.61.69.20:3000
There is however nothing happening, while i can connect to the quickconnect via http://10.61.69.20:5000 without problems...

What could go wrong?
 
Hi,
i have successfully followed the instructions, the Rocket Chat server is running in docker at DSM.
View attachment 2657
However, I'm not able to connect to it. To be sure i do it correctly, I connect via a browser with a computer in the same network via the ip of the network card from the NAS that is connected to the network, right? That would be http://10.61.69.20:3000
There is however nothing happening, while i can connect to the quickconnect via http://10.61.69.20:5000 without problems...

What could go wrong?
Try and change your SITE_URL varaible to your NASIP address on port 3000. Give that a go. Also, you will not be able to use RC on any mobile app until you start using it over https with a valid domain name and certificate. If you do plan on using it that way they set those up beforehand and change your SITEURL to match your new domain name.
 
Try and change your SITE_URL varaible to your NASIP address on port 3000. Give that a go. Also, you will not be able to use RC on any mobile app until you start using it over https with a valid domain name and certificate. If you do plan on using it that way they set those up beforehand and change your SITEURL to match your new domain name.
thanks Rusty, that worked!

Martin
 
I have installed in synology docker Rocket.chat and mongo. Everything works well.
But the container generates messages every second.
This puts a strain on the disk system.
I ask for advice and correct this error. As a last resort, how can I disable writing these messages to disk?

"2021-01-04 08:49:57,stdout,"{\"t\":{\"$date\":\"2021-01-04T11:49:57.752+03:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":3856202, \"ctx\":\"IndexBuildsCoordinatorMongod-2\",\"msg\":\"'voteCommitIndexBuild' command failed.\",\"attr\":{\"indexBuildUUID\":{\"uuid\":{\"$uuid\":\"d90def3b-4dc1-4cce-aa19-53c3f7eb094e\"}},\"responseStatus\":{\"operationTime\":{\"$timestamp\":{\"t\":1609750196,\"i\":1}},\"ok\":0.0,\"errmsg\":\"command voteCommitIndexBuild requires authentication\",\"code\":13,\"codeName\":\"Unauthorized\",\"$clusterTime\":{\"clusterTime\":{\"$timestamp\":{\"t\":1609750196,\"i\":1}},\"signature\":{\"hash\":{\"$binary\":{\"base64\":\"RtULaapbdm/5ooRgGl6jfYeyu4k=\",\"subType\":\"0\"}},\"keyId\":6890507829308817412}}}}}
"2021-01-04 08:49:57,stdout,"{\"t\":{\"$date\":\"2021-01-04T11:49:57.649+03:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":3856202, \"ctx\":\"IndexBuildsCoordinatorMongod-1\",\"msg\":\"'voteCommitIndexBuild' command failed.\",\"attr\":{\"indexBuildUUID\":{\"uuid\":{\"$uuid\":\"5038dec8-d17f-49a7-afe8-896d37876686\"}},\"responseStatus\":{\"operationTime\":{\"$timestamp\":{\"t\":1609750196,\"i\":1}},\"ok\":0.0,\"errmsg\":\"command voteCommitIndexBuild requires authentication\",\"code\":13,\"codeName\":\"Unauthorized\",\"$clusterTime\":{\"clusterTime\":{\"$timestamp\":{\"t\":1609750196,\"i\":1}},\"signature\":{\"hash\":{\"$binary\":{\"base64\":\"RtULaapbdm/5ooRgGl6jfYeyu4k=\",\"subType\":\"0\"}},\"keyId\":6890507829308817412}}}}}
"2021-01-04 08:49:57,stdout,"{\"t\":{\"$date\":\"2021-01-04T11:49:57.648+03:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":3856202, \"ctx\":\"IndexBuildsCoordinatorMongod-0\",\"msg\":\"'voteCommitIndexBuild' command failed.\",\"attr\":{\"indexBuildUUID\":{\"uuid\":{\"$uuid\":\"7b61f52d-9904-4dc8-9b06-aedb8fcadfad\"}},\"responseStatus\":{\"operationTime\":{\"$timestamp\":{\"t\":1609750196,\"i\":1}},\"ok\":0.0,\"errmsg\":\"command voteCommitIndexBuild requires authentication\",\"code\":13,\"codeName\":\"Unauthorized\",\"$clusterTime\":{\"clusterTime\":{\"$timestamp\":{\"t\":1609750196,\"i\":1}},\"signature\":{\"hash\":{\"$binary\":{\"base64\":\"RtULaapbdm/5ooRgGl6jfYeyu4k=\",\"subType\":\"0\"}},\"keyId\":6890507829308817412}}}}}
"2021-01-04 08:49:56,stdout,"{\"t\":{\"$date\":\"2021-01-04T11:49:56.751+03:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":3856202, \"ctx\":\"IndexBuildsCoordinatorMongod-2\",\"msg\":\"'voteCommitIndexBuild' command failed.\",\"attr\":{\"indexBuildUUID\":{\"uuid\":{\"$uuid\":\"d90def3b-4dc1-4cce-aa19-53c3f7eb094e\"}},\"responseStatus\":{\"operationTime\":{\"$timestamp\":{\"t\":1609750186,\"i\":2}},\"ok\":0.0,\"errmsg\":\"command voteCommitIndexBuild requires authentication\",\"code\":13,\"codeName\":\"Unauthorized\",\"$clusterTime\":{\"clusterTime\":{\"$timestamp\":{\"t\":1609750186,\"i\":2}},\"signature\":{\"hash\":{\"$binary\":{\"base64\":\"2TFFt43KcKYAPhR+rXwog/vqyOI=\",\"subType\":\"0\"}},\"keyId\":6890507829308817412}}}}}
"2021-01-04 08:49:56,stdout,"{\"t\":{\"$date\":\"2021-01-04T11:49:56.647+03:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":3856202, \"ctx\":\"IndexBuildsCoordinatorMongod-1\",\"msg\":\"'voteCommitIndexBuild' command failed.\",\"attr\":{\"indexBuildUUID\":{\"uuid\":{\"$uuid\":\"5038dec8-d17f-49a7-afe8-896d37876686\"}},\"responseStatus\":{\"operationTime\":{\"$timestamp\":{\"t\":1609750186,\"i\":2}},\"ok\":0.0,\"errmsg\":\"command voteCommitIndexBuild requires authentication\",\"code\":13,\"codeName\":\"Unauthorized\",\"$clusterTime\":{\"clusterTime\":{\"$timestamp\":{\"t\":1609750186,\"i\":2}},\"signature\":{\"hash\":{\"$binary\":{\"base64\":\"2TFFt43KcKYAPhR+rXwog/vqyOI=\",\"subType\":\"0\"}},\"keyId\":6890507829308817412}}}}}
"2021-01-04 08:49:56,stdout,"{\"t\":{\"$date\":\"2021-01-04T11:49:56.645+03:00\"},\"s\":\"I\", \"c\":\"STORAGE\", \"id\":3856202, \"ctx\":\"IndexBuildsCoordinatorMongod-0\",\"msg\":\"'voteCommitIndexBuild' command failed.\",\"attr\":{\"indexBuildUUID\":{\"uuid\":{\"$uuid\":\"7b61f52d-9904-4dc8-9b06-aedb8fcadfad\"}},\"responseStatus\":{\"operationTime\":{\"$timestamp\":{\"t\":1609750186,\"i\":2}},\"ok\":0.0,\"errmsg\":\"command voteCommitIndexBuild requires authentication\",\"code\":13,\"codeName\":\"Unauthorized\",\"$clusterTime\":{\"clusterTime\":{\"$timestamp\":{\"t\":1609750186,\"i\":2}},\"signature\":{\"hash\":{\"$binary\":{\"base64\":\"2TFFt43KcKYAPhR+rXwog/vqyOI=\",\"subType\":\"0\"}},\"keyId\":6890507829308817412}}}}}
 
@mmggmmgg best to post this on Rocket.Chat in #support channel and ask there with this error sample. They should respond to the matter and tell you how to fix this problem. Be sure to give them enough info on your system using Administration > Info section
 
Latest versions of mongo cannot work without authorization. Even on the same local machine, multiple replicas must use authorized access to each other. In the config file you need to add:
security:
keyFile: <path-to-keyfile>
Interesting... Haven't seen the need to implement this even with the latest version of RC/Mongo
Screenshot 2021-01-05 at 13.56.11.png
 
YAML:
version: '2'

services:
  rocketchat:
    image: rocketchat/rocket.chat:latest
    container_name: rocketchat_app
    restart: unless-stopped
    volumes:
      - /volume1/docker/rocketchat/app:/app/uploads
    environment:
      - PORT=3000
      - ROOT_URL=https://yourdomain.com
      - MONGO_URL=mongodb://mongo:27017/rocketchat
      - MONGO_OPLOG_URL=mongodb://mongo:27017/local
    depends_on:
      - mongo
    ports:
      - 2999:3000

  mongo:
    image: mongo:latest
    container_name: rocketchat_db
    restart: unless-stopped
    volumes:
     - /volume1/docker/rocketchat/db:/data/db
     #- ./data/dump:/dump
    command: mongod --oplogSize 128 --replSet rs0

  # this container's job is just run the command to initialize the replica set.
  # it will run the command and remove himself (it will not stay running)
  mongo-init-replica:
    image: mongo:latest
    command: >
      bash -c
        "for i in `seq 1 30`; do
          mongo mongo/rocketchat --eval \"
            rs.initiate({
              _id: 'rs0',
              members: [ { _id: 0, host: 'localhost:27017' } ]})\" &&
          s=$$? && break || s=$$?;
          echo \"Tried $$i times. Waiting 5 secs...\";
          sleep 5;
        done; (exit $$s)"
    depends_on:
      - mongo

Maybe someone could have a look over it. If there is any error in it.
Place it on your synology. Connect via ssh to the synology. Go to the place where you saved the file. Make sure it is named docker-compose.yml and run as sudo.
First: docker-compose up -d mongo
second; docker-compose up -d mongo-init-replica
third: docker-compose up -d rocketchat

@ all
A question from my side: How to enable the iOS support? I can connect via browser and the destkop app. But not with a mobile app. There is a websocket error. I read about it the web. This could be a problem with the reverse proxy. Does anybody know how to deal with that?
Many thanks -- like others, I was able to get RC up and running thanks to this docker-compose.

My noob question now is, how to I update/upgrade RC? I've received many alerts, like I'm sure many of you have, to update thanks to an urgent security hotfix.

Since the mongo instance is baked into this, I don't want to mess around with the docker-compose for fear it'll nuke the DB.
 
How are you running this command exactly? Are you running it after you have started the container or are you starting the container with that command? The idea is to run the container with that command line not run it afterward.
Hi,
I am a new user with synology and linux os, please help me.
How to run cmd "mongod --oplogSize 128 --replSet rs0" ? I login by SSH then run this command but it show "-ash: command not found" like attatch picture.

I am using DSM 7.0 and installed the last version of mongo from docker GUI
 

Attachments

  • Capture.PNG
    Capture.PNG
    4.5 KB · Views: 8
Hi,
I am a new user with synology and linux os, please help me.
How to run cmd "mongod --oplogSize 128 --replSet rs0" ? I login by SSH then run this command but it show "-ash: command not found" like attatch picture.

I am using DSM 7.0 and installed the last version of mongo from docker GUI
This needs to be set in the Environment tab on the bottom (CMD line) before you create mongodb container
 
Try and change your SITE_URL varaible to your NASIP address on port 3000. Give that a go. Also, you will not be able to use RC on any mobile app until you start using it over https with a valid domain name and certificate. If you do plan on using it that way they set those up beforehand and change your SITEURL to match your new domain name.
Hi Rusty,

Thank for your fast reply, I have successfully followed the instructions, the Rocket Chat server is running in docker at DSM.
1626888603404.png

I'm not able to connect to it 192.168.0.254:3000 (not run)

192.168.0.254:5000(running DSM ok)

Now, I don't know to check for next step.
 
I have successfully followed the instructions, the Rocket Chat server is running in docker at DSM.
Well done!

Regarding accessing it you need to use the URL that you have defined in your ROOT_URL variable in Docker.

If you haven't changed the parameter then it will expect access on localhost:3000 as the image presents. But ofc that will not work as localhost will in your case mean the device you are accessing it from, and there is no RC instance there.

What did you configure your ROOT_URL to?
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending threads

Back
Top