mirror of
https://github.com/YunoHost-Apps/etherpad_mypads_ynh.git
synced 2024-09-03 18:36:09 +02:00
commit
985545de39
12 changed files with 55 additions and 17 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
upgrade=1
|
||||
backup_restore=1
|
||||
multi_instance=0
|
||||
incorrect_path=1
|
||||
port_already_use=1 (9001)
|
||||
change_url=1
|
||||
;; Test sans mypads
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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": {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -30,6 +30,23 @@ final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
|||
mypads=$(ynh_app_setting_get --app=$app --key=mypads)
|
||||
port=$(ynh_app_setting_get --app=$app --key=port)
|
||||
|
||||
#=================================================
|
||||
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backing up the app before changing its url (may take a while)..." --weight=40
|
||||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
# Remove the new domain config file, the remove script won't do it as it doesn't know yet its location.
|
||||
ynh_secure_remove --file="/etc/nginx/conf.d/$new_domain.d/$app.conf"
|
||||
|
||||
# restore it if the upgrade fails
|
||||
ynh_restore_upgradebackup
|
||||
}
|
||||
# Exit if an error occurs during the execution of the script
|
||||
ynh_abort_if_errors
|
||||
|
||||
#=================================================
|
||||
# ACTIVATE MAINTENANCE MODE
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -28,7 +28,7 @@ export=$(ynh_app_setting_get --app=$app --key=export)
|
|||
#=================================================
|
||||
|
||||
# Remove a service from the admin panel, added by `yunohost service add`
|
||||
if yunohost service status $app >/dev/null 2>&1
|
||||
if ynh_exec_fully_quiet yunohost service status $app
|
||||
then
|
||||
ynh_script_progression --message="Removing $app service..."
|
||||
yunohost service remove $app
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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_")")
|
||||
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue