From 02891bf06d34eac5dee4a733b018acec2e049dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 9 Oct 2023 10:09:28 +0200 Subject: [PATCH] fix --- scripts/install | 5 ++++- scripts/restore | 3 ++- scripts/upgrade | 12 ++++++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 51a3fe2..2bdb5b4 100644 --- a/scripts/install +++ b/scripts/install @@ -84,7 +84,10 @@ pushd $install_dir php$phpversion artisan bookstack:create-admin --email="$email" --name="$admin" --external-auth-id="$admin" popd -# Set permissions to app files +#================================================= +# SET PERMISSIONS +#================================================= + chmod -R o-rwx $install_dir chmod -R 775 $install_dir/storage $install_dir/bootstrap/cache $install_dir/public/uploads chown -R $app:www-data $install_dir diff --git a/scripts/restore b/scripts/restore index 8a6cbfc..a2ea5e3 100644 --- a/scripts/restore +++ b/scripts/restore @@ -18,8 +18,9 @@ ynh_restore_file --origin_path="$install_dir" # Restore permissions on app files chmod -R o-rwx $install_dir +chmod -R 775 $install_dir/storage $install_dir/bootstrap/cache $install_dir/public/uploads chown -R $app:www-data $install_dir -chmod 600 $install_dir/.env +chmod 640 $install_dir/.env #================================================= # RESTORE THE MYSQL DATABASE diff --git a/scripts/upgrade b/scripts/upgrade index 0d5d5d1..d821c52 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -50,10 +50,6 @@ then ynh_setup_source --dest_dir="$install_dir" --keep=".env public/uploads storage/uploads" fi -chmod -R o-rwx $install_dir -chmod -R 775 $install_dir/storage $install_dir/bootstrap/cache $install_dir/public/uploads -chown -R $app:www-data $install_dir - #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= @@ -101,6 +97,14 @@ pushd $install_dir php$phpversion artisan view:clear popd +#================================================= +# SET PERMISSIONS +#================================================= + +chmod -R o-rwx $install_dir +chmod -R 775 $install_dir/storage $install_dir/bootstrap/cache $install_dir/public/uploads +chown -R $app:www-data $install_dir + #================================================= # START SYSTEMD SERVICE #=================================================