Difference between revisions of "Rocket Chat:Contrib"

From SME Server
Jump to navigationJump to search
m
Line 19: Line 19:
 
  exit
 
  exit
  
cd /root
+
You should now be able to install the rocketchat bundle with:
curl -L https://rocket.chat/releases/latest/download -o rocket.chat.tgz
 
tar zxvf rocket.chat.tgz
 
mv bundle /opt/Rocket.Chat
 
  
  cd /opt/Rocket.Chat/programs/server
+
  yum --enablerepo=reetp install rocketchat
npm install
 
npm install -g forever
 
  
patch mailcomposer.js to add From header. You can use this from wherever the patch file is (where should it be ?):
+
This may take a while on first install as it installs the npm modules for the first time.
patch -p0 -i /opt/mailcomposer.patch
 
  
Install rocket chat contrib:
+
Now you should be able to install the rocketchat contrib:
  
 
  yum enablerepo=reetp install smeserver-rocketchat
 
  yum enablerepo=reetp install smeserver-rocketchat
Line 80: Line 74:
  
 
If you have an issue with no email sent/received then login using the email address and password you just set
 
If you have an issue with no email sent/received then login using the email address and password you just set
 +
 +
===Updates===
 +
 +
If there is an update to rocket chat you should just be able to run:
 +
 +
yum --enablerepo=reetp install rocketchat
 +
  
 
===Bugs===
 
===Bugs===
  
 
Look for bugs :-) As the contrib is not in CVS please report them in the forum
 
Look for bugs :-) As the contrib is not in CVS please report them in the forum
 +
 +
You ay get an error on install of the rocketchat rpm as follows:
 +
 +
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
 +
 +
This is due to the installed version of npm/node from SCL. Rocket.Chat should till work
  
 
===SSL - in progress===
 
===SSL - in progress===
  
You will need smeserver-rocketchat-0.1-4
+
This works for me. You will need a minimum version of smeserver-rocketchat-0.1-4  
  
 
We need some extra settings to enable SSL with ProxyPass.
 
We need some extra settings to enable SSL with ProxyPass.
Line 112: Line 119:
  
  
We need to set Rocketchat to listen on localhost now:
+
We need to set Rocket.Chat to listen on localhost now:
  
 
  config setprop rocketchat rootURL localhost
 
  config setprop rocketchat rootURL localhost
Line 122: Line 129:
 
  config setprop rocketchat access private
 
  config setprop rocketchat access private
 
  signal-event remoteaccess-update
 
  signal-event remoteaccess-update
 
  
 
==Letsencrypt support==
 
==Letsencrypt support==

Revision as of 16:00, 24 August 2016

Contrib: John Crisp

Important.png Note:
Please note that there is also a howto on installing Rcoket.Chat manually here


smeserver-rocketchat contrib

Warning.png Work in Progress:
This page is a Work in Progress. The contents off this page may be in flux, please have a look at this page history the to see list of changes.


This contrib aims to reduce some of the setup for rocketchat and add some flexibility with settings

Add repos:

yum install rh-python34-python rh-mongodb26-mongodb rh-mongodb26-mongodb-server nodejs010 GraphicsMagick --enablerepo=centos-sclo-rh,epel
scl enable nodejs010 bash
npm install -g inherits
npm install -g n
n 0.10.40
exit

You should now be able to install the rocketchat bundle with:

yum --enablerepo=reetp install rocketchat

This may take a while on first install as it installs the npm modules for the first time.

Now you should be able to install the rocketchat contrib:

yum enablerepo=reetp install smeserver-rocketchat
db setprop rocketchat status enabled
signal-event post-upgrade;signal-event reboot

DB settings

rocketchat=service
   TCPPort=3000
   access=public
   mailPort=25
   mailURL=localhost
   status=enabled
rh-mongodb26-mongod=service
   TCPPort=27017
   access=private
   mongoURL=localhost
   status=enabled

BEFORE we login for the first time we need to set up mail settings correctly:

From bash:

mongo rocketchat --eval 'db.rocketchat_settings.update({"_id" : "SMTP_Host"}, {$set: {"value":"localhost"}});'
mongo rocketchat --eval 'db.rocketchat_settings.update({"_id" : "From_Email"}, {$set: {"value":"admin@yourdomain.com"}});'

We can check the individual values set like this:

mongo rocketchat --eval 'db.rocketchat_settings.find({"_id":"From_Email"}, {_id:0, value:1}).shellPrint();'
mongo rocketchat --eval 'db.rocketchat_settings.find({"_id":"SMTP_Host"}, {_id:0, value: 1}).shellPrint();'

All values per _id:

mongo rocketchat --eval 'db.rocketchat_settings.find({"_id" : "SMTP_Host"}).shellPrint();'
mongo rocketchat --eval 'db.rocketchat_settings.find({"_id" : "From_Email"}).shellPrint();'


Now restart rocketchat to reread the DB settings:

service rocketchat restart

Login at http://yourdomain:3000

It will first get you to create an admin user.

If you have an issue with no email sent/received then login using the email address and password you just set

Updates

If there is an update to rocket chat you should just be able to run:

yum --enablerepo=reetp install rocketchat


Bugs

Look for bugs :-) As the contrib is not in CVS please report them in the forum

You ay get an error on install of the rocketchat rpm as follows:

npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue

This is due to the installed version of npm/node from SCL. Rocket.Chat should till work

SSL - in progress

This works for me. You will need a minimum version of smeserver-rocketchat-0.1-4

We need some extra settings to enable SSL with ProxyPass.

First install proxy pass rpm:

yum --enablerepo=fws install mod_proxy_wstunnel

Regenerate httpd.conf

signal-event remoteaccess-update

Now we need to setup our subdomain

db domains set chat.mycompany.local domain Description RocketChat Nameservers internet \
TemplatePath ProxyPassVirtualRocketchat ProxyPassTarget http://localhost:3000/

It should look like this:

chat.mycompany.local=domain
   Nameservers=internet
   ProxyPassTarget=http://127.0.0.1:3000/
   TemplatePath=ProxyPassVirtualRocketchat


We need to set Rocket.Chat to listen on localhost now:

config setprop rocketchat rootURL localhost
signal-event remoteaccess-update
service rocketchat restart

If you can now successfully get to Rocketchat on your subdomain https://chat.mycompany.local you can disable default access on port 3000:

config setprop rocketchat access private
signal-event remoteaccess-update

Letsencrypt support

You can add letsencrypt should you wish - please see https://wiki.contribs.org/Letsencrypt

You will need to add the domain key as follows, and add your letsencrypt certificates:

db domains setprop chat.mycompany.local letsencryptSSLcert enabled

Mongo DB examples

Example using mongo itself:

mongo
use rocketchat
db.rocketchat_settings.find({"_id" : "SMTP_Host"})
db.rocketchat_settings.find({"_id" : "From_Email"})
db.rocketchat_settings.findOne({_id : "From_Email"}, {_id:0, value: 1})
db.rocketchat_settings.findOne({_id : "SMTP_Host"}, {_id:0, value: 1})


db.rocketchat_settings.update({"_id" : "From_Email"}, {$set: {"value":"admin@reetspetit.info"}})
db.rocketchat_settings.update({"_id" : "SMTP_Host"}, {$set: {"value":"mail.reetspetit.info"}})