From c83b418957fb16924e9ef32df7a40be93697c4ff Mon Sep 17 00:00:00 2001 From: maniack Date: Mon, 30 Dec 2019 20:01:19 +0100 Subject: [PATCH] Update to v1.8.0 --- README.md | 2 +- README_fr.md | 2 +- conf/app.src | 4 ++-- manifest.json | 2 +- scripts/_common.sh | 15 +++++++++++++++ scripts/_variables | 2 +- scripts/install | 11 +++++++++-- scripts/restore | 3 +-- scripts/upgrade | 11 ++++++----- 9 files changed, 37 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index ad5d437..8ddf8cd 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ If you don't have YunoHost, please see [here](https://yunohost.org/#/install) to Etherpad is a highly customizable Open Source online editor providing collaborative editing in really real-time. This package will install the same plugins than [Framapad](https://framapad.org/). -**Shipped version:** 1.7.5 +**Shipped version:** 1.8.0 ## Screenshots diff --git a/README_fr.md b/README_fr.md index 303b6ef..b192165 100644 --- a/README_fr.md +++ b/README_fr.md @@ -12,7 +12,7 @@ Si vous n'avez pas YunoHost, merci de regarder [ici](https://yunohost.org/#/inst Etherpad est un éditeur en ligne Open Source hautement personnalisable qui permet l'édition collaborative en temps réel. Ce paquet installera les mêmes plugins que [Framapad](https://framapad.org/). -**Version embarquée:** 1.7.5 +**Version embarquée:** 1.8.0 ## Captures d'écran diff --git a/conf/app.src b/conf/app.src index 2ed7470..14d481e 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/ether/etherpad-lite/archive/1.7.5.tar.gz -SOURCE_SUM=01971447ff7b4d0d2af52faf02edb032 +SOURCE_URL=https://github.com/ether/etherpad-lite/archive/1.8.0.tar.gz +SOURCE_SUM=f5fc307e4206b1db13d12833024968bc SOURCE_SUM_PRG=md5sum ARCH_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/manifest.json b/manifest.json index 066b9e1..b0f63b9 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Framapad clone, a online editor providing collaborative editing in real-time.", "fr": "Clone de Framapad, un éditeur en ligne fournissant l'édition collaborative en temps réel." }, - "version": "1.7.5~ynh3", + "version": "1.8.0~ynh1", "url": "https://framapad.org", "license": "Apache-2.0", "maintainer": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 89c5a7b..89b259c 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -361,3 +361,18 @@ ynh_maintenance_mode_OFF () { systemctl reload nginx } + +#================================================= + +# Execute a command as another user +# usage: ynh_exec_as USER COMMAND [ARG ...] +ynh_exec_as() { + local USER=$1 + shift 1 + + if [[ $USER = $(whoami) ]]; then + eval "$@" + else + sudo -u "$USER" "$@" + fi +} diff --git a/scripts/_variables b/scripts/_variables index 9d86eaa..4336050 100644 --- a/scripts/_variables +++ b/scripts/_variables @@ -7,7 +7,7 @@ abiword_app_depencencies="abiword" libreoffice_app_dependencies="unoconv libreoffice-writer" # NodeJS version -nodejs_version=6 +nodejs_version=10 # Mypads version # This variable is mostly used to force an upgrade of the package in case of new versions of mypads. diff --git a/scripts/install b/scripts/install index 94e5cda..92fd0b1 100644 --- a/scripts/install +++ b/scripts/install @@ -162,8 +162,15 @@ ynh_script_progression --message="Installing Etherpad..." --weight=90 # Install dependencies and proceed to the installation ynh_use_nodejs -"$final_path/bin/installDeps.sh" > $install_log 2>&1 || ( ynh_exec_err cat "$install_log"; false ) -npm install forever -g >> $install_log 2>&1 || ( ynh_exec_err cat "$install_log"; false ) +( + cd "$final_path" + mkdir -p node_modules + cd node_modules + [ -e ep_etherpad-lite ] || ln -s ../src ep_etherpad-lite + cd ep_etherpad-lite + chown -R $app: $final_path + ynh_exec_as $app PATH="$nodejs_path:$PATH" "$nodejs_path/npm" install --save --loglevel warn +) #================================================= # CONFIGURE ETHERPAD diff --git a/scripts/restore b/scripts/restore index 1948604..24c6f93 100644 --- a/scripts/restore +++ b/scripts/restore @@ -127,8 +127,7 @@ ynh_install_nodejs --nodejs_version=$nodejs_version ynh_script_progression --message="Reinstalling Etherpad node dependencies..." --weight=17 ynh_use_nodejs -npm cache clean -npm install forever -g >> $install_log 2>&1 +ynh_exec_warn_less npm cache clean --force #================================================= # RESTORE USER RIGHTS diff --git a/scripts/upgrade b/scripts/upgrade index e15c693..fa8c481 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -220,17 +220,18 @@ ynh_install_nodejs --nodejs_version=$nodejs_version ynh_script_progression --message="Upgrading Etherpad npm modules..." --weight=60 # Update the main modules of etherpad +chown -R $app: $final_path (cd "$final_path/src" -npm cache clean -ynh_exec_warn_less npm update) +ynh_exec_warn_less npm cache clean --force +ynh_exec_warn_less ynh_exec_as $app PATH="$nodejs_path:$PATH" "$nodejs_path/npm" update) # Then update the additionnal modules (cd "$final_path" -npm cache clean +ynh_exec_warn_less npm cache clean --force while read node_module do - echo "Update $node_module" - ynh_exec_warn_less npm install --upgrade $node_module || true + echo "Update $node_module" + ynh_exec_warn_less ynh_exec_as $app PATH="$nodejs_path:$PATH" "$nodejs_path/npm" install --upgrade $node_module || true done <<< "$(ls -1 "$final_path/node_modules" | grep "^ep_")") #=================================================