Rocket.Chat: Difference between revisions

From Bitpost wiki
Line 94: Line 94:
   🪆  m@matryoshka  [~/apps/RocketChat] docker compose up -d
   🪆  m@matryoshka  [~/apps/RocketChat] docker compose up -d


===== ES =====
===== Full steps =====
1348  docker exec -it rocketchat-mongodb-1 bash
* find the latest rc release: https://github.com/RocketChat/Rocket.Chat/releases
1349  docker exec -u root -it rocketchat-mongodb-1 bash
* update RELEASE in .env to match the latest stable release
1350  docker ps
* do the deed:
1351  docker commit - p 388dfd6193ac rocket.chat-2022-10-13-backup
  docker compose stop rocketchat
1352  man docker-commit
  docker compose rm rocketchat
1353 docker commit -p 388dfd6193ac rocket.chat-2022-10-13-backup
  docker pull registry.rocket.chat/rocketchat/rocket.chat:5.4.3
1354 docker images
  docker componse up -d rocketchat
1355  ls
  docker logs -f rocketchat-rocketchat-1
1356  cd apps/
1357  ls
1358  cd rocketchat/
1359  ls
1360 docker pull registry.rocket.chat/rocketchat/rocket.chat:latest
1361  docker-compose stop rocketchat
1362  history | grep rocket
1363  ls
1364  cat compose.yml
1365  emacs .env
1366  docker-compose stop rocketchat
1367  ls
1368  history | grep rocket -C 3
1369  docker compose rm rocketchat
1370  ls
1371  emacs compose.yml
--
1373  docker commit -p b0657e84d3bd mongodb-2022-10-13-backup
1374  df
1375  docker compose rm rocketchat
1376 docker compose up -d rocketchat
1377  docker logs rocketchat-rocketchat-1
1378 docker logs -f rocketchat-rocketchat-1
1379  history


==== Back up database ====
==== Back up database ====

Revision as of 15:03, 21 February 2023

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.

Docs

Configuration

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.

Server maintenance

Log:

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=5.4.1
  • Restart
 🪆  m@matryoshka  [~/apps/RocketChat] docker compose up -d
Full steps
docker	compose	stop rocketchat
docker compose rm rocketchat
docker pull registry.rocket.chat/rocketchat/rocket.chat:5.4.3
docker	componse 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