From 8828898e4b97d95780cadd4aab98b6cbdd8c79ff Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 24 Apr 2021 19:38:38 +0200 Subject: [PATCH 1/3] Update upgrade --- scripts/upgrade | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 74e6435..ad8b48b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -118,10 +118,12 @@ ynh_add_config --template="../conf/config.js" --destination="$final_path/config/ #================================================= 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 From fbfa00bb9e122c3cf3c2f3890f121fbaded99dca Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 24 Apr 2021 20:25:01 +0200 Subject: [PATCH 2/3] Update upgrade --- scripts/upgrade | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index ad8b48b..d3fa48f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -139,7 +139,6 @@ ynh_add_systemd_config #================================================= # SECURE FILES AND DIRECTORIES #================================================= -ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 # Set permissions on app files chown -R $app: $final_path From d480d76839c9b7dc210c29566c0fa5b2513681f2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 25 Apr 2021 08:47:54 +0200 Subject: [PATCH 3/3] Update upgrade --- scripts/upgrade | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index d3fa48f..8eb6fe1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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,7 +123,7 @@ 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