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

Merge branch 'Fix-upgrade' into testing

This commit is contained in:
ericgaspar 2022-01-28 10:50:06 +01:00
commit c04cbf6cb0
No known key found for this signature in database
GPG key ID: 574F281483054D44
2 changed files with 11 additions and 20 deletions

View file

@ -6,6 +6,11 @@
# NOTE: If any of your values contain a space or a hash you will need to # NOTE: If any of your values contain a space or a hash you will need to
# wrap the entire value in quotes. (eg. MAIL_FROM_NAME="BookStack Mailer") # wrap the entire value in quotes. (eg. MAIL_FROM_NAME="BookStack Mailer")
# Enable debug mode
# Shows advanced debug information and errors.
# CAN EXPOSE OTHER VARIABLES, LEAVE DISABLED
APP_DEBUG=false
# Application key # Application key
APP_KEY=SomeRandomString APP_KEY=SomeRandomString
@ -67,3 +72,7 @@ SESSION_DRIVER=redis
# Example of using a single local Redis server # Example of using a single local Redis server
REDIS_SERVERS=127.0.0.1:6379:__REDIS_DB__ REDIS_SERVERS=127.0.0.1:6379:__REDIS_DB__
# Storage system to use
# Can be 'local', 'local_secure' or 's3'
STORAGE_TYPE=local

View file

@ -63,26 +63,8 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading source files..." --weight=1 ynh_script_progression --message="Upgrading source files..." --weight=1
# Create a temporary directory
tmpdir="$(mktemp -d)"
#cp -a "$final_path/.env " "$tmpdir/.env "
[[ -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
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" ynh_setup_source --dest_dir="$final_path" --keep="$final_path/.env $final_path/public/uploads $final_path/storage/uploads"
#cp -a "$tmpdir/.env " "$final_path/.env "
[[ -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"
ynh_add_config --template=../conf/.env.example --destination=$final_path/.env
fi fi
#================================================= #=================================================
@ -132,7 +114,7 @@ popd
chmod 755 $final_path chmod 755 $final_path
chmod -R o-rwx $final_path chmod -R o-rwx $final_path
chown -R $app:www-data $final_path chown -R $app:www-data $final_path
chmod 600 $final_path/.env #chmod 600 $final_path/.env
#================================================= #=================================================
# RELOAD NGINX # RELOAD NGINX