I did the following (if itâs a good idea ⌠you should decide)
In my NC Dir /var/www/ i created a Script named â.upd_nc.shâ (Update Mode) with following code
#!/bin/bash
#Sets permissions of the Nextcloud instance for updating
ncpath=â/var/www/nextcloudâ
htuser=âwww-dataâ
htgroup=âwww-dataâ
cp /var/www/nextcloud/.htaccess /var/www/Backup/.htaccess
cp /var/www/nextcloud/.user.ini /var/www/Backup/.user.ini
chown -R ${htuser}:${htgroup} ${ncpath}
I made the script executable and run it before the Updater starts
After the Update, very important that the Updater once passed the integrity check with the original .user.ini and .htaccess files (!), I use a second Script named â.run_nc.shâ (to get my settings back) with following code
#!/bin/bash
ncpath=â/var/www/nextcloudâ
htuser=âwww-dataâ
htgroup=âwww-dataâ
rootuser=ârootâ
printf âCreating possible missing Directories\nâ
mkdir -p $ncpath/updater
printf âchmod Files and Directories\nâ
find ${ncpath} -type f -print0 | xargs -0 chmod 0640
find ${ncpath} -type d -print0 | xargs -0 chmod 0750
printf âchown Directories\nâ
chown -R ${rootuser}:${htgroup} ${ncpath}
chown -R ${htuser}:${htgroup} ${ncpath}/apps/
chown -R ${htuser}:${htgroup} ${ncpath}/config/
chown -R ${htuser}:${htgroup} ${ncpath}/themes/
chown -R ${htuser}:${htgroup} ${ncpath}/updater/
cp /var/www/Backup/.htaccess /var/www/nextcloud/.htaccess
cp /var/www/Backup/.user.ini /var/www/nextcloud/.user.ini
chmod +x ${ncpath}/occ
printf âchmod/chown .htaccess\nâ
if [ -f ${ncpath}/.htaccess ]
then
chmod 0644 ${ncpath}/.htaccess
chown ${rootuser}:${htgroup} ${ncpath}/.htaccess
fi
if [ -f ${ncpath}/data/.htaccess ]
then
chmod 0644 ${ncpath}/data/.htaccess
chown ${rootuser}:${htgroup} ${ncpath}/data/.htaccess
fi
With that I get back my own values in .htaccess and .user.ini by bash script.
MayBe a way to workaround the âproblemâ ?