diff --git a/scripts/install b/scripts/install index 73e565c..cf00df4 100755 --- a/scripts/install +++ b/scripts/install @@ -56,9 +56,9 @@ SETUP_SOURCE "dokuwiki-c5525093cf2c4f47e2e5d2439fe13964.tgz" sudo cp ../conf/dokuwiki.php $final_path/conf sudo cp ../conf/acl.auth.php $final_path/conf -# Files owned by root, www-data can just read -find $final_path -type f -print0 | sudo xargs -0 chmod 0644 -find $final_path -type d -print0 | sudo xargs -0 chmod 0755 +# Files owned by www-data can just read +sudo find $final_path -type f -print0 | xargs -0 chmod 0644 +sudo find $final_path -type d -print0 | xargs -0 chmod 0755 sudo chown -R www-data: $final_path # except for conf, data, some data subfolders, and lib/plugin, where www-data must have write permissions diff --git a/scripts/upgrade b/scripts/upgrade index f892aab..fea7a1a 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -1,7 +1,7 @@ #!/bin/bash -# causes the shell to exit if any subcommand or pipeline returns a non-zero status -set -e +# Exit on command errors and treat unset variables as an error +set -eu # Source app helpers source /usr/share/yunohost/helpers @@ -59,10 +59,10 @@ sudo touch $final_path/doku.php # See https://www.dokuwiki.org/install:unused_files grep -Ev '^($|#)' ../sources/data/deleted.files | xargs -I {} sudo rm -vrf $final_path/{} -# Files owned by root, www-data can just read -find $final_path -type f -print0 | sudo xargs -0 chmod 0644 -find $final_path -type d -print0 | sudo xargs -0 chmod 0755 -sudo chown -R root: $final_path +# Files owned by www-data can just read +sudo find $final_path -type f -print0 | xargs -0 chmod 0644 +sudo find $final_path -type d -print0 | xargs -0 chmod 0755 +sudo chown -R www-data: $final_path # except for conf, data, some data subfolders, and lib/plugin, where www-data must have write permissions sudo chown -R www-data:root $final_path/{conf,data,data/attic,data/cache,data/index,data/locks,data/media*,data/meta,data/pages,data/tmp,lib/plugins,lib/tpl}