Rocket.Chat: Difference between revisions

From Bitpost wiki
 
(34 intermediate revisions by the same user not shown)
Line 1: Line 1:
[https://jaws.bitpost.com Server] is running, ask Mikey to get you registered at the "secret" registration url.
=== Status ===
Server is live and running as matryoshka container.  Updates are easy (see below).
 
But not much to chat about lately, boo...
 
==== Invite friends ====
Browse to [https://jaws.bitpost.com jaws], ask Mikey to get you registered at the "secret" registration url.


=== Clients ===
=== Clients ===
Line 8: Line 14:
* [https://itunes.apple.com/app/rocket-chat/id1148741252 iPhone]
* [https://itunes.apple.com/app/rocket-chat/id1148741252 iPhone]


=== [https://rocket.chat/docs/ Docs] ===
=== Server maintenance ===
Log:
docker logs -f rocketchat-rocketchat-1


=== Server maintenance ===
==== Start ====
* To update:
NOTE: This should not be needed on reboot now that we added *restart:always* to compose.yml.
ssh jaws
  cd ~/apps/RocketChat
  cd ~/apps/Rocket.Chat.github-source
  docker compose up -d rocketchat
  sudo service rocketchat stop
  docker logs -f rocketchat-rocketchat-1
  git pull
meteor npm install
sudo service rocketchat start


=== Server installation ===
==== Update ====
Snap install is a clusterfuck of imperfection... DO NOT SEEK THE TREASURE!


Don't leave your install un-updated for very long, this thing keeps roooollllling....
Don't leave your install un-updated for very long, this thing keeps roooollllling....


==== From source ====
* Find the latest release [https://github.com/RocketChat/Rocket.Chat/releases here].
sudo apt-get install -y git build-essential mongodb nodejs graphicsmagick
* Punch it into the /home/m/apps/RocketChat/.env file, eg:
cd ~/apps
  # MDM
git clone https://github.com/RocketChat/Rocket.Chat.git
RELEASE=6.13.0
  cd Rocket.Chat
* Restart
  curl https://install.meteor.com/ | sh
  🪆  m@matryoshka [~/apps/RocketChat] docker compose up -d
  meteor npm install
  🪆  m@matryoshka [~/apps/RocketChat] docker logs -f rocketchat-rocketchat-1
meteor npm start
 
Make sure that gets going.  Once it does, there are two more optional steps.
That's been it, it's been working like a charm!


===== Install system mongo =====
===== Notes =====


If you want to use a full system mongo installation instead of the dummy one that comes embedded in meteor, you'll need to tell meteor how to find it.  It should be configured as a replicaset (even though it's one node):
Here are more complete steps that may be needed... the .env on matryoshka did not need this...
  # install system mongo
* update RELEASE in .env to match the latest stable release
  # use a startup script like this:
* do the deed:
  cd ~/apps/Rocket.Chat.github-source
  docker compose stop rocketchat
  MONGO_URL=mongodb://localhost:27017/rocketchat?replicaSet=rs01 MONGO_OPLOG_URL=mongodb://localhost:27017/local?replicaSet=rs01 ROOT_URL=http://localhost:3000/ PORT=3000 meteor npm start
  docker compose rm rocketchat
docker pull registry.rocket.chat/rocketchat/rocket.chat:5.4.3
docker compose up -d rocketchat
docker logs -f rocketchat-rocketchat-1


===== Set up a systemd service =====
==== Back up database ====


  # Uninstall snap if needed
  # from docker host
  sudo snap remove rocketchat-server
  docker exec -u root -it rocketchat-mongodb-1 bash
mkdir -p dumps && cd dumps
mongodump --archive="rocketchat-backup-2022-10-13" --db=rocketchat


* Create a service file in your config folder, and stow it into /etc/systemd/system.  jaws example:
=== Server installation ===
💉 m@jaws  [~] cat config/etc/systemd/system/rocketchat.service
 
[Unit]
* First time installing, make sure you have [[Docker#Install_docker_compose]] installed, and set up an ~/apps/RocketChat folder with docker.compose and .env
Description=Jaws rocketchat server
* See matryoshka for an example.
After=network.target
* Refer to details [https://docs.rocket.chat/quick-start/deploying-rocket.chat/rapid-deployment-methods/docker-and-docker-compose here] if needed.
[Service]
WorkingDirectory=/home/m/apps/Rocket.Chat.github-source
Environment=MONGO_URL=mongodb://localhost:27017/rocketchat?replicaSet=rs01
Environment=MONGO_OPLOG_URL=mongodb://localhost:27017/local?replicaSet=rs01
Environment=ROOT_URL=http://localhost:3000/
Environment=PORT=3000
User=m
Type=simple
ExecStart=meteor npm start
[Install]
WantedBy=multi-user.target
* Install it
sudo systemctl daemon-reload
sudo systemctl start rocketchat
# Give it a GOOD 5 MINUTES to start up, sigh... once it does:
sudo systemctl enable rocketchat


==== Now FINISH UP ====
==== Now FINISH UP ====
Line 76: Line 69:


=== Configuration ===
=== Configuration ===
[https://rocket.chat/docs/ Docs]
Once you log in as admin, you get a SHITTON of settings to manage.  Important ones:
Once you log in as admin, you get a SHITTON of settings to manage.  Important ones:
* Admin > Settings > search > site > CHANGE THE SITE from http://localhost to your FQDN!
* Admin > Settings > search > site > CHANGE THE SITE from http://localhost to your FQDN!

Latest revision as of 17:29, 26 October 2024

Status

Server is live and running as matryoshka container. Updates are easy (see below).

But not much to chat about lately, boo...

Invite friends

Browse to jaws, ask Mikey to get you registered at the "secret" registration url.

Clients

The Linux and android clients are tested and working out of the box. How nice.

Server maintenance

Log:

docker logs -f rocketchat-rocketchat-1

Start

NOTE: This should not be needed on reboot now that we added *restart:always* to compose.yml.

cd ~/apps/RocketChat
docker compose up -d rocketchat
docker logs -f rocketchat-rocketchat-1

Update

Don't leave your install un-updated for very long, this thing keeps roooollllling....

  • Find the latest release here.
  • Punch it into the /home/m/apps/RocketChat/.env file, eg:
# MDM
RELEASE=6.13.0
  • Restart
 🪆  m@matryoshka  [~/apps/RocketChat] docker compose up -d
 🪆  m@matryoshka  [~/apps/RocketChat] docker logs -f rocketchat-rocketchat-1

That's been it, it's been working like a charm!

Notes

Here are more complete steps that may be needed... the .env on matryoshka did not need this...

  • update RELEASE in .env to match the latest stable release
  • do the deed:
docker	compose	stop rocketchat
docker compose rm rocketchat
docker pull registry.rocket.chat/rocketchat/rocket.chat:5.4.3
docker	compose up -d rocketchat
docker logs -f rocketchat-rocketchat-1

Back up database

# from docker host
docker exec -u root -it rocketchat-mongodb-1 bash
mkdir -p dumps && cd dumps
mongodump --archive="rocketchat-backup-2022-10-13" --db=rocketchat

Server installation

  • First time installing, make sure you have Docker#Install_docker_compose installed, and set up an ~/apps/RocketChat folder with docker.compose and .env
  • See matryoshka for an example.
  • Refer to details here if needed.

Now FINISH UP

  • Browse to admin panel at http://yourserver:3000
  • Register with rocket.chat (I think you have to to get mobile updates???)
  • Set up an admin account
  • Update haproxy and certbot to support a subdomain that is publicly available

Configuration

Docs

Once you log in as admin, you get a SHITTON of settings to manage. Important ones:

  • Admin > Settings > search > site > CHANGE THE SITE from http://localhost to your FQDN!
  • I updated my admin layout Content. It includes Home page text, TOS etc.
  • Admin > Accounts > Registration > Manually Approve New Users
  • Admin > Accounts > Registration > Registration Form > Secret URL (URL will be /register/(secret)/ )
  • Admin > Layout > User Interface > Allow Special Characters in Room Names > Toggle ON
  • Admin > Search > Default Provider > Global Search ON (to add a toggleable global search option)
  • Admin > Video Conference > Jitsu > Enable (NOTE desktop app doesn't find my camera, but chrome does)
  • Should I? Admin > Accounts > Registration > Use DNS Domain Check

Enable mobile push

This is not as simple as it should be...

  • Admin > Setup Wizard > Cloud Info > Cloud Service Agree Privacy > Toggle ON

YOU MUST restart server for setting to be applied! This apparently sets:

Admin > Settings > Push > Production read-only toggle ON

This is necessary for mobile chat notifications to work!

  • Register for cloud services
  • When creating an account, I did NOT get email confirmation. I had to use "Forgot password" to reset and get access.
  • Click Register Self-managed, and get the token.
  • Admin > Connectivity Services > Register > paste the token
  • Admin > Connectivity Services > Login to Rocket.Chat Cloud
  • Admin > Settings > Push > Send a test push

Holy hell, it worked!

SMTP

  • Create a google APP password
google > account > create App password > Mail/custom > jaws.bitpost.com > put pw in private
  • Set up Admin > Email > SMTP settings to allow outbound email
protocol: smtps
host: smtp.gmail.com
port: [] (default)
[ ] Ignore TLS
[X] Pool
username: thedigitalmachine
password: (see private)
from email: m@bitpost.com

2fa hell

If 2fa is on and SMTP doesn't work for any reason, it can really fuck you trying to get any settings changed to fix the problem. Catch-22 loop of hell.

I tried adding some bullshit hack ENV vars to the rocketchat service with no luck:

sudo service rocketchat stop
emacs ~/config/etc/systemd/system/rocketchat.service 
 Environment=SHA_256_HASH_OF_API_USER_PASSWORD=047c5647b586286f839377306252cf99e7f1bbddb93c2f84a6a7377ef2dd6122
 Environment=Accounts_TwoFactorAuthentication_Enforce_Password_Fallback=false
sudo systemctl daemon-reload
sudo service rocketchat start

Didn't seem to do shit.

Try turning 2fa settings off via shell... THIS DID IT.

ssh jaws
mongo
use rocketchat
db.rocketchat_settings.update({"_id":"Accounts_TwoFactorAuthentication_Enabled"},{$set:{"packageValue":false}});
db.rocketchat_settings.update({"_id":"Accounts_TwoFactorAuthentication_Enabled"},{$set:{"value":false}});
db.rocketchat_settings.update({"_id":"Accounts_TwoFactorAuthentication_By_Email_Enabled"},{$set:{"packageValue":false}});
db.rocketchat_settings.update({"_id":"Accounts_TwoFactorAuthentication_By_Email_Enabled"},{$set:{"value":false}});
db.rocketchat_settings.update({"_id":"Accounts_TwoFactorAuthentication_Enforce_Password_Fallback"},{$set:{"packageValue":false}});
db.rocketchat_settings.update({"_id":"Accounts_TwoFactorAuthentication_Enforce_Password_Fallback"},{$set:{"value":false}});

Then I could go in and manage my SMPT settings and get them working. Whew. I'm not turning 2fa back on for now, fuck that hardship.