§2024-09-08

Updateing Rocket.Chat to 6.12.0

試作機器: a odroid-HC4 with ubuntu 24.04 (Noble Numbat)

  1. Install requirements
sudo apt update && sudo apt install -y curl build-essential graphicsmagick
  1. install fnm
# installs fnm (Fast Node Manager)
curl -fsSL https://fnm.vercel.app/install | bash
Downloading https://github.com/Schniz/fnm/releases/latest/download/fnm-arm64.zip...
######################################################################## 100.0%
Installing for Bash. Appending the following to /home/alexlai/.bashrc:

# fnm
FNM_PATH="/home/alexlai/.local/share/fnm"
if [ -d "$FNM_PATH" ]; then
  export PATH="$FNM_PATH:$PATH"
  eval "`fnm env`"
fi

In order to apply the changes, open a new terminal or run the following command:

  source /home/alexlai/.bashrc
$ source ~/.bashrc

$ fnm list
* v14.21.3 default
* v22.6.0
* system
alexlai@hc4Noble:~$ fnm install v14.21.3
Installing Node v14.21.3 (arm64)
warning: Version already installed at "/home/alexlai/.local/share/fnm/node-versions/v14.21.3"
  1. Download and extract the latest release of Rocket.Chat
$ cd ~/build/src
$ wget https://github.com/RocketChat/Rocket.Chat/archive/refs/tags/6.12.0.tar.gz
$ cd .. && tar xvf ./src/6.12.0.tar.gz

$ cd Rocket.Chat-6.12.0/



tar -xvzf /tmp/rocket.chat.tgz -C /tmp
  1. run npm install --production
cd /tmp/bundle/programs/server && npm install --production
  1. Move the extracted files to the /opt directory.
sudo mv /tmp/bundle /opt/Rocket.Chat.Dragonfly28
  1. Configure the Rocket.Chat service

Add the rocketchat user and set the right permissions on the Rocket.Chat folder.

$ sudo useradd -M rocketchat && sudo usermod -L rocketchat
$ sudo chown -R rocketchat:rocketchat /opt/Rocket.Chat.Dragonfly28
  1. /etc/systemd/system/RocketChatDrangonfly28.service

/home/alexlai/.local/share/fnm/node-versions/v14.21.3/installation/bin/node <-- make sure it is executable rom service file

[Unit]
Description=The Rocket.Chat Drangonfly28 server
After=network.target remote-fs.target nss-lookup.target nginx.service mongod.service
[Service]
# ExecStart=/home/alexlai/.local/share/fnm/node-versions/v14.21.3/installation/bin/node /opt/Rocket.Chat/main.js
ExecStart=/bin/bash -c 'printenv; /home/alexlai/.local/share/fnm/node-versions/v14.21.3/installation/bin/node /opt/Rocket.Chat.Dragonfly28/main.js'
#  >> /opt/Rocket.Chat.Dragonfly28/RocketchatDragonfly28.log 2>&1'
# StandardOutput=syslog # By default, systemd sends output to the journal, so you don't need to specify these unless you have specific requirements. 
# StandardError=syslog
SyslogIdentifier=RocketChatDragonfly28
User=rocketchat

Environment="MONGO_URL=mongodb://siteRootAdmin:b23258585@x8664Arch.yushei.com.tw:27017,n2Bookworm.yushei.com.tw:27017,n2Jammy.yushei.com.tw:27017/Dragonfly28?replicaSet=odroid01&authSource=admin"
Environment="MONGO_OPLOG_URL=mongodb://siteRootAdmin:b23258585@x8664Arch.yushei.com.tw:27017,n2Bookworm.yushei.com.tw:27017,n2Jammy.yushei.com.tw:27017/Dragonfly28?replicaSet=odroid01&authSource=admin"
Environment="ROOT_URL=https://munetaka.me:43885/"
Environment="PORT=43885"
Environment="ADMIN_USERNAME=DragonFly28Admin"  # this will be autocreated
Environment="ADMIN_PASS=DragonFly28Admin#1765"
Environment="ADMIN_EMAIL=rai.sousuke@mac.com"
Environment="MAIL_URL=smtp://alexlai:alex1765@mail.h2Jammy.yushei.net:25/"
[Install]
WantedBy=multi-user.target