Browse Source

Fix failed access after first installation

Don't create the user data folder (automatically created by Nextcloud), thus avoiding giving wrong ownership...
pull/119/head
Jimmy Monin 8 years ago
parent
commit
8cd01bdc8d
  1. 1
      hooks/post_user_create
  2. 11
      scripts/install
  3. 11
      scripts/upgrade

1
hooks/post_user_create

@ -2,5 +2,4 @@
user=$1 user=$1
sudo mkdir -p /home/$user
sudo setfacl -m g:#GROUP#:rwx /home/$user sudo setfacl -m g:#GROUP#:rwx /home/$user

11
scripts/install

@ -183,6 +183,10 @@ exec_occ ldap:test-config \'\' \
if [ $user_home -eq 1 ]; then if [ $user_home -eq 1 ]; then
exec_occ app:enable files_external exec_occ app:enable files_external
create_external_storage "/home/\$user" "Home" create_external_storage "/home/\$user" "Home"
# Iterate over users to extend their home folder permissions
for u in $(ynh_user_list); do
setfacl -m g:$app:rwx "/home/$u" || true
done
fi fi
#================================================= #=================================================
@ -265,13 +269,6 @@ find ${datadir}/ -type d -print0 | xargs -0 chmod 0750
chmod 640 "${final_path}/config/config.php" chmod 640 "${final_path}/config/config.php"
chmod 755 /home/yunohost.app chmod 755 /home/yunohost.app
# Iterate over users to extend their home folder permissions - for the external
# storage plugin usage - and create relevant Nextcloud directories
for u in $(ynh_user_list); do
mkdir -p "${datadir}/${u}"
setfacl -m g:$app:rwx "/home/$u" || true
done
#================================================= #=================================================
# SETUP LOGROTATE # SETUP LOGROTATE
#================================================= #=================================================

11
scripts/upgrade

@ -271,6 +271,10 @@ if [ $user_home -eq 1 ]; then
exec_occ files_external:list --output=json \ exec_occ files_external:list --output=json \
| grep -q '"storage":"\\\\OC\\\\Files\\\\Storage\\\\Local"' \ | grep -q '"storage":"\\\\OC\\\\Files\\\\Storage\\\\Local"' \
|| create_external_storage "/home/\$user" "Home" || create_external_storage "/home/\$user" "Home"
# Iterate over users to extend their home folder permissions
for u in $(ynh_user_list); do
setfacl -m g:$app:rwx "/home/$u" || true
done
fi fi
#================================================= #=================================================
@ -329,13 +333,6 @@ find ${datadir}/ -type d -print0 | xargs -0 chmod 0750
chmod 640 "${final_path}/config/config.php" chmod 640 "${final_path}/config/config.php"
chmod 755 /home/yunohost.app chmod 755 /home/yunohost.app
# Iterate over users to extend their home folder permissions - for the external
# storage plugin usage - and create relevant Nextcloud directories
for u in $(ynh_user_list); do
mkdir -p "${datadir}/${u}"
setfacl -m g:$app:rwx "/home/$u" || true
done
#================================================= #=================================================
# WARNING ABOUT THIRD-PARTY APPS # WARNING ABOUT THIRD-PARTY APPS
#================================================= #=================================================

Loading…
Cancel
Save