Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Suggestion: RocketChat #66

Closed
fr3fou opened this issue May 27, 2019 · 19 comments · Fixed by #579
Closed

App Suggestion: RocketChat #66

fr3fou opened this issue May 27, 2019 · 19 comments · Fixed by #579

Comments

@fr3fou
Copy link

fr3fou commented May 27, 2019

Please tell us what app you'd like to see on CapRover as a one-click app.

https://github.com/RocketChat/Rocket.Chat
https://rocket.chat/

Do you know if there is any official Docker image for the app?

Yes, https://hub.docker.com/r/rocketchat/rocket.chat/

@dg-otrs
Copy link

dg-otrs commented Dec 14, 2019

Hey,

here some infos to deploy rocketchat with a mongodb replica cluster:

Caprover settings Chat

image/captain-definition:
github.com/dg-otrs/rocket-chat master

App details:
Enable HTTPS
Force HTTPS
Port 3000
Websocket yes

ENV:
MONGO_URL=mongodb://rocketchat:xxx@srv-captain--mongodb:27017/rocketchat
MONGO_OPLOG_URL=mongodb://rocketchat:xxx@srv-captain--mongodb:27017/local?replSet=rs0&authSource=admin

Persistent data:
/app rocketchat

Caprover settings DB

Image:
github.com/dg-otrs/mongodb master

App details:
Do not expose
Setup a replica cluster with arbiter and secondary node, this means 3 separate mongodb instances see ENV for details

ENV mongodb:
MONGO_INITDB_ROOT_USERNAME=root
MONGODB_ROOT_PASSWORD=xxx
MONGO_INITDB_ROOT_PASSWORD=xxx
MONGODB_EXTRA_FLAGS=--oplogSize=128 --enableMajorityReadConcern=false
MONGODB_REPLICA_SET_MODE=primary
MONGODB_ADVERTISED_HOSTNAME=srv-captain--mongodb
MONGODB_REPLICA_SET_KEY=key123
MONGODB_PRIMARY_PORT_NUMBER=27017

ENV mongodb arbiter:
MONGODB_ADVERTISED_HOSTNAME=srv-captain--mongodb-arbiter
MONGODB_REPLICA_SET_MODE=arbiter
MONGODB_PRIMARY_HOST=srv-captain--mongodb
MONGODB_PRIMARY_PORT_NUMBER=27017
MONGODB_PRIMARY_ROOT_PASSWORD=xxx
MONGODB_REPLICA_SET_KEY=key123

ENV mongod secondary:
MONGODB_ADVERTISED_HOSTNAME=srv-captain--mongodb-secondery
MONGODB_REPLICA_SET_MODE=secondary
MONGODB_PRIMARY_HOST=srv-captain--mongodb
MONGODB_PRIMARY_PORT_NUMBER=27017
MONGODB_PRIMARY_ROOT_PASSWORD=xxx
MONGODB_REPLICA_SET_KEY=key123

Persistent data:
/bitnami mongodb

docu

https://rocket.chat/docs/installation/manual-installation/mongo-replicas/
https://hub.docker.com/r/bitnami/mongodb/
https://hub.docker.com/_/rocketchat

prepare mongodb

Login with bash into DB container

docker exec -it XXX bash

mongo --username root --password xxx
rs0:PRIMARY>
use rocketchat
db.movie.insert({"name":"tutorials point“})
db.createUser(
{
user: "rocketchat",
pwd: "xxx",
roles: [ { role: "readWrite", db: "rocketchat" },
]
}
)

use admin
db.createUser(
{
user: "rocketchat",
pwd: "xxx",
roles: [ { role: "readWrite", db: "local" }
]
}
)

@ckc
Copy link

ckc commented Apr 27, 2020

+1

Look forward to add it in one-click

@dg-otrs
Copy link

dg-otrs commented Apr 27, 2020

I'm more or less than with RC as one click app.

The only thing missing is the setup of replica set of the mongo db: rs.inistate()

currently a manual task, via:
docker exec -it xxx bash

prepare mongodb
mongo --username root --password

@dg-otrs
Copy link

dg-otrs commented Apr 27, 2020

I'm more or less than with RC as one click app.

The only thing missing is the setup of replica set of the mongo db: rs.inistate()

currently a manual task, via:
docker exec -it xxx bash

prepare mongodb
mongo --username root --password

So if someone has an idea...

I'm using the bitnami mongo db image, with MONGODB_EXTRA_FLAGS:
--oplogSize=128 --enableMajorityReadConcern=false --smallfiles --replSet=rs01

But the replset is not there, until I do it manually. see above

@adolfombarros
Copy link

looking forward to this feature

@nileshtrivedi
Copy link

nileshtrivedi commented Jun 9, 2021

Hey @dg-otrs, were you able to finish the one-click template for Rocketchat? If not, can you describe what's missing in some detail so I could take a stab at it?

@nileshtrivedi
Copy link

I believe one approach can be to package Rocket Chat without the database, similar to Wordpress. Then it can connect to existing MongoDB install within CapRover and does not need to run this db preparation script.

@johncrisp
Copy link

Hi

I'm John, Community Manager at Rocket.Chat

So how can we help? Someone asked in our #support channel.

Late for me now so I'll take a look tomorrow.

You can get me at https://open.rocket.chat as john.crisp if you want to chat.

I can setup a channel or team there if you need somewhere to liaise as we want help projects like this, and we can get some of our devs to help if needs be.

@mdehollander
Copy link

I would also love to see rocket chat supported in caprover :). I haven't look at this recipe in detail, but I think the replication of mongodb is the bottleneck. Can rocket chat also work with a single database instance? @johncrisp, great if some of the rc devs can help out here.

@mdehollander
Copy link

mdehollander commented Aug 8, 2021

Maybe the configuration of the Rocket Chat app for The Coop Cloud can help: https://git.coopcloud.tech/coop-cloud/rocketchat/src/branch/main/compose.yml#L73 The Coop Cloud is a similar (new) project that also uses the Docker Compose specification for it's apps: https://docs.coopcloud.tech/faq/#why-use-the-compose-specification

@debdutdeb
Copy link
Contributor

debdutdeb commented Aug 12, 2021

Hello everyone ! (except John, you see me everyday :p) 👋🏼

I'm the Deployment Specialist at Rocket.Chat

Can rocket chat also work with a single database instance?

Yes. You just need to initiate the replicaset, no need for an arbiter or secondary. Surely you can add them later if you want/need to scale. Most of our existing deployment methods - e.g. snaps, docker - use a single node mongo resplicaset.

rs.initiate({
    _id: 'rs0',
    members: [ { _id: 0, host: 'localhost:27017' } ]
})

We'd love to see Rocket on as many platforms as possible! At least I know I do :p

As John said, please do not hesitate to contact us on Open - debdut.chakraborty - I know, not the easiest - but you'll see me lurking in the #support, #ubuntu-snap and many other places.

In the meantime, I'll look into this more in detail. I do have some platforms/methods in priority queue this quarter - so I don't know if I can promise anything. But since John himself sent me this link, it has now become important 🍷

Again, come to our open server! We'd love to have a chat 😉

@aaron5670
Copy link

Looking forward 😃

@andrekutianski
Copy link
Contributor

I almost get running Rocket.Chat on Caprover, but the only issue is the MongoDB replica set that requires some additional commands not supported on the Caprover file definition.

From my understanding of this threat, a post-command will possible to define the replica command?

@githubsaturn
Copy link
Collaborator

@andrekutianski - there are a few ways to get around this limitation on CMD.

1- You can embedded in as a Dockerfile line, like this:

dockerfileLines:
- FROM chatwoot/chatwoot:$$cap_chatwoot_version
- RUN chmod +x docker/entrypoints/rails.sh
- ENTRYPOINT ["docker/entrypoints/rails.sh"]
- EXPOSE 3000
- CMD bundle exec rails db:chatwoot_prepare; bundle exec rails s -b 0.0.0.0 -p 3000

2- More complex: you can have a note after installation asking users to copy paste this content into their service override of their MongoDB:

TaskTemplate:
  ContainerSpec:
    Command:
      - "echo 1 && sleep 10m"

@debdutdeb
Copy link
Contributor

Hey everyone, just a heads up, I believe I forgot to update it here. I will be opening a PR by the end of this month (worst case scenario). Rocketchat will be available in caprover very soon.

I'm currently making changes to our docker image and compose file, simplifying it a bit more. After that change adding an one click template for caprover is not gonna be a problem anymore.

@JohnTrabusca
Copy link

@debdutdeb any eta when this will be available ? Thank you

@nileshtrivedi
Copy link

@debdutdeb Did you get a chance to prepare the docker/compose file and update the one-click template?

@nileshtrivedi
Copy link

I was able to reach @debdutdeb and he told me about the two PRs that have been raised in RocketChat repo and are being reviewed:

RocketChat/Rocket.Chat#23426
RocketChat/Rocket.Chat#23594

I (representing https://polyglot.network/ ) am offering a small bounty (55$) for packaging RocketChat as a one-click app for CapRover. I use RocketChat as an embedded chat room for https://learnawesome.org/ but not being available in CapRover means that I'm paying 5EUR/month for an additional server on Hetzner. I know 55$ is a very small amount but I hope this motivates somebody to submit a PR and close this issue. :-)

@waylon-gmail
Copy link

waylon-gmail commented Nov 9, 2021

I was able to reach @debdutdeb and he told me about the two PRs that have been raised in RocketChat repo and are being reviewed:

RocketChat/Rocket.Chat#23426 RocketChat/Rocket.Chat#23594

I (representing https://polyglot.network/ ) am offering a small bounty (55$) for packaging RocketChat as a one-click app for CapRover. I use RocketChat as an embedded chat room for https://learnawesome.org/ but not being available in CapRover means that I'm paying 5EUR/month for an additional server on Hetzner. I know 55$ is a very small amount but I hope this motivates somebody to submit a PR and close this issue. :-)

It is recommended to add a password to Mongo's configuration. After all, passwords are required in most cases.

I tried several existing configurations, but I couldn't complete the password configuration without manual operation. I hope the official can make a configuration so that we can deploy the environment with password only by changing the password.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.