From 0c32e0d5b58597fd1513cb731f53543841697ed9 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Wed, 11 Apr 2018 20:24:17 +0530 Subject: [PATCH 1/2] Fix for the issue https://github.com/YunoHost-Apps/peertube_ynh/issues/14 --- scripts/install | 1 + scripts/upgrade | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/install b/scripts/install index e1fdd91..8d9466a 100644 --- a/scripts/install +++ b/scripts/install @@ -132,6 +132,7 @@ ynh_app_setting_set "$app" final_path "$final_path" # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source "$final_path" cp ../conf/production.yaml "$final_path/config/production.yaml" +touch "$final_path/config/local-production.json" (cd "$final_path" && yarn install --production --pure-lockfile) #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 3288e91..336965b 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -104,6 +104,7 @@ path_url=$(ynh_normalize_url_path "$path_url") # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source "$final_path" cp ../conf/production.yaml "$final_path/config/production.yaml" +touch "$final_path/config/local-production.json" (cd "$final_path" && yarn install --production --pure-lockfile) From 12043e72992e2b5bae5a406b44513e42d9f34511 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Wed, 11 Apr 2018 21:21:42 +0530 Subject: [PATCH 2/2] Fix:restore the saved admin settings while upgrade --- scripts/upgrade | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 336965b..930d85f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -56,7 +56,11 @@ ynh_abort_if_errors #================================================= # REMOVE APP MAIN DIR #================================================= - + +# Create a temporary directory +tmpdir="$(mktemp -d)" +# Backup the config file in the temp dir +cp -a "$final_path/config/local-production.json" "$tmpdir/local-production.json" # Remove the app directory securely ynh_secure_remove "$final_path" @@ -104,7 +108,12 @@ path_url=$(ynh_normalize_url_path "$path_url") # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source "$final_path" cp ../conf/production.yaml "$final_path/config/production.yaml" -touch "$final_path/config/local-production.json" + +#Copy the admin saved settings from tmp directory to final path +cp -a "$tmpdir/local-production.json" "$final_path/config/local-production.json" + +# Remove the tmp directory securely +ynh_secure_remove "$tmpdir" (cd "$final_path" && yarn install --production --pure-lockfile)