diff --git a/manifest.json b/manifest.json index 09d6549..28c25ae 100644 --- a/manifest.json +++ b/manifest.json @@ -7,7 +7,7 @@ }, "url": "https://github.com/YunoHost-Apps/rocketchat_ynh", "license": "GPL-3.0", - "version": "0.70.4", + "version": "0.73.2", "maintainer": { "name": "selamanse", "email": "selamanse@scheinfrei.info", @@ -40,13 +40,13 @@ "default": "/rocketchat" }, { - "name": "is_public", + "name": "is_public", "ask": { "en": "Is it a public application?" }, "choices": ["Yes", "No"], - "default": "No" - }, + "default": "Yes" + }, { "name": "lang", "ask": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 2416f4c..eddb1d4 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -1,8 +1,9 @@ # common.sh -ROCKETCHAT_VERSION=0.70.4 -ROCKETCHAT_SHASUM=62be1d3be0c12f37c69b24c7b898030a43550afcb9d4fac24c8f301b939b7dc1 -NODE_VERSION=8.11.3 +ROCKETCHAT_VERSION=0.73.2 +ROCKETCHAT_SHASUM=3dc3eb11f383f7b72b0f23fedb305b6a566fa536a1e5087a4398255deeb864d8 +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) checkcmd() { @@ -38,8 +39,8 @@ installnode(){ sudo apt-get install -y nodejs else sudo apt-get install -y npm - # Meteor needs at least this version of node to work. - sudo npm install -g n + # Using npm install inherits and n, and the node version required by Rocket.Chat: + sudo npm install -g inherits n sudo n $NODE_VERSION fi echo "node version is now: " @@ -52,23 +53,30 @@ installdeps(){ #Install mongodb for debian armhf sudo apt-get update 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 #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 sudo apt-get update 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 - # 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 - sudo apt-get install -y gzip curl graphicsmagick + sudo apt-get install -y build-essential gzip curl graphicsmagick installnode } diff --git a/scripts/install b/scripts/install index c24bd10..11073e0 100644 --- a/scripts/install +++ b/scripts/install @@ -103,8 +103,8 @@ sed -i "s@#DBNAME#@$dbname@g" ../conf/rocketchat_ldap.js sudo cp ../conf/nginx.conf "$nginx_conf" # 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" +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" diff --git a/scripts/restore b/scripts/restore index 4ac6360..683657e 100644 --- a/scripts/restore +++ b/scripts/restore @@ -1,16 +1,14 @@ #!/bin/bash set -eu +#================================================= +# GENERIC START #================================================= # IMPORT GENERIC HELPERS #================================================= -if [ ! -e _common.sh ]; then - # Fetch helpers file if not in current directory - sudo cp ../settings/scripts/_common.sh ./_common.sh - sudo chmod a+rx _common.sh -fi + +source ./_common.sh source /usr/share/yunohost/helpers -source _common.sh #================================================= # GENERIC START diff --git a/scripts/upgrade b/scripts/upgrade index dbba587..38e5ed1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,6 +18,14 @@ serviceuser=$(ynh_app_setting_get $app serviceuser) path=$(ynh_app_setting_get $app path) 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 rm -rf $final_path @@ -26,14 +34,6 @@ sudo mkdir -p $final_path # update to latest required node setup 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 rm $final_path/rocket.chat-$ROCKETCHAT_VERSION.gtar