From 5a080fab2947d1077614a643e2b5278e115bbc31 Mon Sep 17 00:00:00 2001 From: orhtej2 <2871798+orhtej2@users.noreply.github.com> Date: Sat, 28 Oct 2023 23:12:24 +0200 Subject: [PATCH] Fixup $data_dir permissions. --- scripts/install | 4 ++++ scripts/upgrade | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/scripts/install b/scripts/install index 8b2c659..e699d82 100755 --- a/scripts/install +++ b/scripts/install @@ -69,6 +69,10 @@ ynh_add_config --template=".env.example" --destination="$install_dir/.env" chmod 600 $install_dir/.env chown $app:www-data "$install_dir/.env" +mkdir -p $data_dir/media +chmod -R 644 $data_dir +chgrp -R www-data $data_dir + #================================================= # RUN MIGRATIONS #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 57015a2..5c2cfa1 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -89,6 +89,13 @@ pushd $install_dir ynh_exec_warn_less ynh_exec_as $app php${phpversion} spark cache:clear popd +if [ $(ynh_compare_current_package_version --comparison le --version "1.1.2~ynh2") ]; then + ynh_script_progression --message="Moving data..." --weight=3 + mv $install_dir/public/media $data_dir + chmod -R 644 $data_dir + chgrp -R www-data $data_dir +endif + #================================================= # END OF SCRIPT #=================================================