mirror of
https://github.com/YunoHost-Apps/rocketchat_ynh.git
synced 2024-09-03 20:16:25 +02:00
Upgrade to newer versions (#68)
- Update to rocket chat 0.73.2 - Update install routine based on https://rocket.chat/docs/installation/manual-installation/debian/ - Conditional service init for mongodb on armhf. Addresses #64. - Minor improvements to upgrade and restore
This commit is contained in:
parent
1952823a98
commit
dfc1bb75f5
5 changed files with 40 additions and 34 deletions
|
@ -7,7 +7,7 @@
|
||||||
},
|
},
|
||||||
"url": "https://github.com/YunoHost-Apps/rocketchat_ynh",
|
"url": "https://github.com/YunoHost-Apps/rocketchat_ynh",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"version": "0.70.4",
|
"version": "0.73.2",
|
||||||
"maintainer": {
|
"maintainer": {
|
||||||
"name": "selamanse",
|
"name": "selamanse",
|
||||||
"email": "selamanse@scheinfrei.info",
|
"email": "selamanse@scheinfrei.info",
|
||||||
|
@ -40,13 +40,13 @@
|
||||||
"default": "/rocketchat"
|
"default": "/rocketchat"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "is_public",
|
"name": "is_public",
|
||||||
"ask": {
|
"ask": {
|
||||||
"en": "Is it a public application?"
|
"en": "Is it a public application?"
|
||||||
},
|
},
|
||||||
"choices": ["Yes", "No"],
|
"choices": ["Yes", "No"],
|
||||||
"default": "No"
|
"default": "Yes"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "lang",
|
"name": "lang",
|
||||||
"ask": {
|
"ask": {
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
# common.sh
|
# common.sh
|
||||||
|
|
||||||
ROCKETCHAT_VERSION=0.70.4
|
ROCKETCHAT_VERSION=0.73.2
|
||||||
ROCKETCHAT_SHASUM=62be1d3be0c12f37c69b24c7b898030a43550afcb9d4fac24c8f301b939b7dc1
|
ROCKETCHAT_SHASUM=3dc3eb11f383f7b72b0f23fedb305b6a566fa536a1e5087a4398255deeb864d8
|
||||||
NODE_VERSION=8.11.3
|
ROCKETCHAT_DOWNLOAD_URI=https://releases.rocket.chat/${ROCKETCHAT_VERSION}/download
|
||||||
|
NODE_VERSION=8.11.4
|
||||||
DEBIAN_ISSUE=$(grep 9 /etc/debian_version >/dev/null && echo stretch || echo jessie)
|
DEBIAN_ISSUE=$(grep 9 /etc/debian_version >/dev/null && echo stretch || echo jessie)
|
||||||
|
|
||||||
checkcmd() {
|
checkcmd() {
|
||||||
|
@ -38,8 +39,8 @@ installnode(){
|
||||||
sudo apt-get install -y nodejs
|
sudo apt-get install -y nodejs
|
||||||
else
|
else
|
||||||
sudo apt-get install -y npm
|
sudo apt-get install -y npm
|
||||||
# Meteor needs at least this version of node to work.
|
# Using npm install inherits and n, and the node version required by Rocket.Chat:
|
||||||
sudo npm install -g n
|
sudo npm install -g inherits n
|
||||||
sudo n $NODE_VERSION
|
sudo n $NODE_VERSION
|
||||||
fi
|
fi
|
||||||
echo "node version is now: "
|
echo "node version is now: "
|
||||||
|
@ -52,23 +53,30 @@ installdeps(){
|
||||||
#Install mongodb for debian armhf
|
#Install mongodb for debian armhf
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y mongodb-server
|
sudo apt-get install -y mongodb-server
|
||||||
|
|
||||||
|
# start mongodb service
|
||||||
|
sudo systemctl enable mongodb.service
|
||||||
|
sudo systemctl start mongodb.service
|
||||||
|
|
||||||
|
# add mongodb to services
|
||||||
|
sudo yunohost service add mongodb -l /var/log/mongodb/mongodb.log
|
||||||
else
|
else
|
||||||
#Install mongodb for debian x86/x64
|
#Install mongodb for debian x86/x64
|
||||||
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
|
sudo apt-get install dirmngr && sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
|
||||||
echo "deb http://repo.mongodb.org/apt/debian ${DEBIAN_ISSUE}/mongodb-org/4.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
|
echo "deb http://repo.mongodb.org/apt/debian ${DEBIAN_ISSUE}/mongodb-org/4.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y mongodb-org
|
sudo apt-get install -y mongodb-org
|
||||||
|
|
||||||
|
# start mongodb service
|
||||||
|
sudo systemctl enable mongod.service
|
||||||
|
sudo systemctl start mongod.service
|
||||||
|
|
||||||
|
# add mongodb to services
|
||||||
|
sudo yunohost service add mongod -l /var/log/mongodb/mongod.log
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# start mongodb service
|
|
||||||
sudo systemctl enable mongod.service
|
|
||||||
sudo systemctl start mongod.service
|
|
||||||
|
|
||||||
# add mongodb to services
|
|
||||||
sudo yunohost service add mongod -l /var/log/mongodb/mongod.log
|
|
||||||
|
|
||||||
#Install other dependencies
|
#Install other dependencies
|
||||||
sudo apt-get install -y gzip curl graphicsmagick
|
sudo apt-get install -y build-essential gzip curl graphicsmagick
|
||||||
|
|
||||||
installnode
|
installnode
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,8 +103,8 @@ sed -i "s@#DBNAME#@$dbname@g" ../conf/rocketchat_ldap.js
|
||||||
sudo cp ../conf/nginx.conf "$nginx_conf"
|
sudo cp ../conf/nginx.conf "$nginx_conf"
|
||||||
|
|
||||||
# download and extract rocketchat
|
# download and extract rocketchat
|
||||||
echo "Downloading rocket.chat-$ROCKETCHAT_VERSION.gtar from https://s3.amazonaws.com/download.rocket.chat/build/rocket.chat-${ROCKETCHAT_VERSION}.tgz."
|
echo "Downloading rocket.chat-$ROCKETCHAT_VERSION.gtar from ${ROCKETCHAT_DOWNLOAD_URI}."
|
||||||
sudo curl -s -L -o $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar "https://s3.amazonaws.com/download.rocket.chat/build/rocket.chat-${ROCKETCHAT_VERSION}.tgz"
|
sudo curl -s -L -o $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar "${ROCKETCHAT_DOWNLOAD_URI}"
|
||||||
SHA_DOWNLOAD=$(sha256sum $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar | grep -o "^[a-f0-9]*")
|
SHA_DOWNLOAD=$(sha256sum $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar | grep -o "^[a-f0-9]*")
|
||||||
if [[ ! "$SHA_DOWNLOAD" == "$ROCKETCHAT_SHASUM" ]]; then
|
if [[ ! "$SHA_DOWNLOAD" == "$ROCKETCHAT_SHASUM" ]]; then
|
||||||
ynh_die "The sha256sum does not match the configured one"
|
ynh_die "The sha256sum does not match the configured one"
|
||||||
|
|
|
@ -1,16 +1,14 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# GENERIC START
|
||||||
#=================================================
|
#=================================================
|
||||||
# IMPORT GENERIC HELPERS
|
# IMPORT GENERIC HELPERS
|
||||||
#=================================================
|
#=================================================
|
||||||
if [ ! -e _common.sh ]; then
|
|
||||||
# Fetch helpers file if not in current directory
|
source ./_common.sh
|
||||||
sudo cp ../settings/scripts/_common.sh ./_common.sh
|
|
||||||
sudo chmod a+rx _common.sh
|
|
||||||
fi
|
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
source _common.sh
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC START
|
# GENERIC START
|
||||||
|
|
|
@ -18,6 +18,14 @@ serviceuser=$(ynh_app_setting_get $app serviceuser)
|
||||||
path=$(ynh_app_setting_get $app path)
|
path=$(ynh_app_setting_get $app path)
|
||||||
port=$(ynh_app_setting_get $app port)
|
port=$(ynh_app_setting_get $app port)
|
||||||
|
|
||||||
|
# download and extract rocketchat
|
||||||
|
echo "Downloading rocket.chat-$ROCKETCHAT_VERSION.gtar from ${ROCKETCHAT_DOWNLOAD_URI}."
|
||||||
|
sudo curl -s -L -o $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar "${ROCKETCHAT_DOWNLOAD_URI}"
|
||||||
|
SHA_DOWNLOAD=$(sha256sum $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar | grep -o "^[a-f0-9]*")
|
||||||
|
if [[ ! "$SHA_DOWNLOAD" == "$ROCKETCHAT_SHASUM" ]]; then
|
||||||
|
ynh_die "The sha256sum does not match the configured one"
|
||||||
|
fi
|
||||||
|
|
||||||
sudo systemctl stop rocketchat
|
sudo systemctl stop rocketchat
|
||||||
|
|
||||||
sudo rm -rf $final_path
|
sudo rm -rf $final_path
|
||||||
|
@ -26,14 +34,6 @@ sudo mkdir -p $final_path
|
||||||
# update to latest required node setup
|
# update to latest required node setup
|
||||||
installnode
|
installnode
|
||||||
|
|
||||||
# download and extract rocketchat
|
|
||||||
echo "Downloading rocket.chat-$ROCKETCHAT_VERSION.gtar from https://s3.amazonaws.com/download.rocket.chat/build/rocket.chat-${ROCKETCHAT_VERSION}.tgz."
|
|
||||||
sudo curl -s -L -o $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar "https://s3.amazonaws.com/download.rocket.chat/build/rocket.chat-${ROCKETCHAT_VERSION}.tgz"
|
|
||||||
SHA_DOWNLOAD=$(sha256sum $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar | grep -o "^[a-f0-9]*")
|
|
||||||
if [[ ! "$SHA_DOWNLOAD" == "$ROCKETCHAT_SHASUM" ]]; then
|
|
||||||
ynh_die "The sha256sum does not match the configured one"
|
|
||||||
fi
|
|
||||||
|
|
||||||
sudo tar -xzf $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar -C $final_path --strip-components=1 bundle
|
sudo tar -xzf $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar -C $final_path --strip-components=1 bundle
|
||||||
sudo rm $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar
|
sudo rm $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue