Closed NZI closed 6 years ago
I'll try to describe the situation where this is an issue. Sensitive data replaced.
Machine has two users, backup and www-data.
User backup is in groups backup and www-data, and is also a sudoer
User www-data is only in the group www-data
Execute sudo chown -R www-data:www-data /var/www/mysite.com
Initial assets folder:
backup@machine:~$ ls -la /var/www/mysite.com/assets/
total 20
drwxrwxr-x 3 www-data www-data 4096 Dec 15 15:51 .
drwxrwxr-x 4 www-data www-data 4096 Jan 22 10:31 ..
-rw-rw-r-- 1 www-data www-data 3711 Nov 24 09:31 error-404.html
-rw-rw-r-- 1 www-data www-data 3707 Nov 24 09:31 error-500.html
drwxr-xr-x 2 www-data www-data 4096 Dec 21 15:41 Uploads
Execute sspak load --sudo=www-data restore.sspak /var/www/mysite.com
as user backup
Folder structure now:
backup@machine:~$ ls -la /var/www/mysite.com/assets/
total 20
drwxrwxr-x 3 backup backup 4096 Dec 15 15:51 .
drwxrwxr-x 4 www-data www-data 4096 Jan 22 10:33 ..
-rw-rw-r-- 1 backup backup 3711 Nov 24 09:31 error-404.html
-rw-rw-r-- 1 backup backup 3707 Nov 24 09:31 error-500.html
drwxr-xr-x 2 backup backup 4096 Dec 21 15:41 Uploads
Thanks @NZI - much better explanation of the problem, appreciated!
I have an issue where the folder ownership of assets was not being respected.
example:
sspak load --sudo=www-data restore.sspak /var/www/mysite.com
error:
if [ -d /var/www/mysite.com/shared/assets.old ]; then rm -rf /var/www/mysite.com/shared/assets.old; fi
Among other issues in the surrounding code