From 7b3503f15a93f4ae7768e5502b2faa6fec2bbf1f Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Wed, 1 Dec 2021 22:27:01 +0100 Subject: [PATCH] Fix --- conf/.env.example | 2 +- scripts/install | 1 - scripts/upgrade | 8 ++++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/conf/.env.example b/conf/.env.example index 1d62d3d..b7c1110 100644 --- a/conf/.env.example +++ b/conf/.env.example @@ -7,7 +7,7 @@ # wrap the entire value in quotes. (eg. MAIL_FROM_NAME="BookStack Mailer") # Application key -APP_KEY=__KEY__ +APP_KEY=SomeRandomString # Application URL APP_URL=https://__DOMAIN____PATH__ diff --git a/scripts/install b/scripts/install index e6c0800..1a7a80d 100644 --- a/scripts/install +++ b/scripts/install @@ -120,7 +120,6 @@ ynh_install_composer --phpversion=$phpversion --workdir=$final_path --install_ar redis_db=$(ynh_redis_get_free_db) ynh_app_setting_set --app="$app" --key=redis_db --value="$redis_db" mail_pwd=$(ynh_string_random --length=12) -key=$(ynh_string_random --length=12) ynh_add_config --template=../conf/.env.example --destination=$final_path/.env chmod 600 $final_path/.env diff --git a/scripts/upgrade b/scripts/upgrade index 9867e38..7f2191f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -67,8 +67,8 @@ then tmpdir="$(mktemp -d)" #cp -a "$final_path/.env " "$tmpdir/.env " - cp -a "$final_path/public/uploads" "$tmpdir/public/uploads" - cp -a "$final_path/storage/uploads" "$tmpdir/storage/uploads" + [[ -f "$final_path/public/uploads" ]] && cp -a "$final_path/public/uploads" "$tmpdir/public/uploads" + [[ -f "$final_path/storage/uploads" ]] && cp -a "$final_path/storage/uploads" "$tmpdir/storage/uploads" # Remove the app directory securely ynh_secure_remove --file=$final_path @@ -76,8 +76,8 @@ then ynh_setup_source --dest_dir="$final_path" #cp -a "$tmpdir/.env " "$final_path/.env " - cp -a "$tmpdir/public/uploads" "$final_path/public/uploads" - cp -a "$tmpdir/storage/uploads" "$final_path/storage/uploads" + [[ -f "$tmpdir/public/uploads" ]] && cp -a "$tmpdir/public/uploads" "$final_path/public/uploads" + [[ -f "$tmpdir/storage/uploads" ]] && cp -a "$tmpdir/storage/uploads" "$final_path/storage/uploads" # Remove the tmp directory securely ynh_secure_remove --file="$tmpdir"