1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/cryptpad_ynh.git synced 2024-09-03 18:26:14 +02:00

Merge pull request #82 from YunoHost-Apps/preserve-config

Preserve config
This commit is contained in:
Éric Gaspar 2021-04-25 17:51:54 +02:00 committed by GitHub
commit 784b8d7e65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -87,8 +87,20 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=1
# Create a temporary directory
tmpdir="$(mktemp -d)"
# Backup the config file in the temp dir
cp -a "$final_path/config/config.js" "$tmpdir/config.js"
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path"
# Copy the admin saved settings from tmp directory to final path
cp -a "$tmpdir/config.js" "$final_path/config/config.js"
# Remove the tmp directory securely
ynh_secure_remove --file="$tmpdir"
fi
#=================================================
@ -111,17 +123,19 @@ ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version
# CONFIGURE CONFIG.JS
#=================================================
ynh_add_config --template="../conf/config.js" --destination="$final_path/config/config.js"
#ynh_add_config --template="../conf/config.js" --destination="$final_path/config/config.js"
#=================================================
# INSTALL CRYPTPAD
#=================================================
ynh_script_progression --message="Building CryptPad... (this will take some time and resources!)" --weight=60
pushd "$final_path" || ynh_die
pushd "$final_path"
ynh_exec_warn_less npm install --allow-root
ynh_exec_warn_less npm install -g bower
ynh_exec_warn_less bower update --allow-root
ynh_exec_warn_less npm i
popd || ynh_die
popd
#=================================================
# SETUP SYSTEMD