In this article, we will explain how we are using Rocket.chat as our internal chat and how we deploy this tool.
You can use IRC, Jabber (XMPP) or any other "modern" chat system: Slack, Rocket.Chat, etc. After using XMPP for a couple of months, we decided to move to Rocket.Chat.
Why to use a chat internally?
Even in our small team, having a team chat has great benefits:
we share/broadcast information to the whole team without disturbing individuals
we historize what we discussed and search in the history
you copy/paste code snippets or links to your team mates
you discuss with your team whether you are at the same location or traveling
all notifications go though a chat channel your team is free to join or not instead of filling your mailbox
Why to move from XMPP to Rocket.chat?
We have been happy users of XMPP (eJabberd on the server side and Pidgin on the client side) for years. It works quite well, it is robust, it consumes few resources and it is a standard. But sadly, we have identified some drawbacks:
no easy integration with other services. You can use a bot, but you have to do a lot by yourself.
server development (even if eJabberd made great progress int he last two years) is slow.
client side is our biggest deception: my mobile client (Conversation) is much better than my desktop. And nobody is really investing in this aera those days.
After evaluating a couple of solutions: Mattermost, Slack, Rocket.chat, we deviced use Rocket.chat. They got an easy way to bootstrap with their Docker images and we were able to integrate the service with our development stack. We have an Open Source culture, a couple of "spare" servers, so Rocket.chat was perfect for us. Slack seems to be a very common choice those days :).
We deploy our Rocket.chat using Docker and docker-compose just like the rest of our tools (that may change in the future with Docker 1.12 and services, but for the moment, we are still using our compose files to describe our stack: containers, networks and volumes).
Basically, our docker-compose file looks like this:
command: mongod --smallfiles --oplogSize 128
# hubot, the popular chatbot (add the bot user first and change the password before starting this image)
That's mostly the same docker-compose file provided by the Rocket.Chat project in their documentation, with some small changes:
we added some labels to connect to Traefik. Check our previous blog post on how we deploy our internal tools with Traefik.
we added our URLs
on the hubot stuff: we allowed the bot to communicate on all public channels (LISTEN_ON_ALL_PUBLIC=true) to respond direct messages (RESPOND_TO_DM=true) and also when a message is edited (when you press key up and update your message, in Rocket.Chat you don't send a new message but edit your message).
We will discuss external integrations later in this blog post. We activate some additional hubot plugins: hubot-shipit, hubot-maps, hubot-youtube. Honestly, this is pure fun, and we will go in details on the serious stuff later.
Let's start our instance:
When the instances is started, you get a banner in your terminal:
You can connect to your chat with your favorite browser. The first registered user will be administrator of your instance.
After login as administrator, you can go in Administration and update your configuration. For our internal chat, we want to:
connect our Rocket.Chat instance to our LDAP directory
disable external registrations on the instance
update branding to match our corporate colors :)
Here are the steps and screenshots for performing our customization.
Go into Administration, Accounts, Registration:
disable Registration Form
set Password Reset to False (as we will be using LDAP)
Go into Administration, Assets, Logo:
update your logo
Go into Administration, Email:
set smtp, port and mail from
Go into Administration, General:
set Site Name
Go into Administration, LDAP:
set Host to ldap.bleemeo.work
set Domain Base to dc=bleemeo,dc=work
set Domain Search User ID to uid
set Domain Search Object Class to inetOrgPerson
set Domain Search Object Category to empty
set Sync Data to True
set Sync User Avatar
Bot Account Creation
If you have not created an account for your bot yet, it is time to do it. Account can be a local Rocket.Chat user or a LDAP account. When created, you have to restart your bot to connect-it. Bot will join the "#general" channel. To restart your bot, just restart the container:
docker-compose restart hubot
You should see your bot connecting.
In next articles, we will integrate our Rocket.chat to: