newmissions
Chevereto Member
Working on importing photos to Chevereto.
My problem is with file permissions.
- With root SFTP account, I upload photos to ./importing/parse-users (Any of the parse options work the same)
- If I run the CLI command sudo -u www-data php /var/www/html/cli.php -C importing (from the Dashboard->Bulk Importer)
I get errors where Chevereto can't delete the photos from the importing directory, as they're owned by root.
- If I run the CLI command without the sudo (while logged in as root) php /var/www/html/cli.php -C importing
Import runs correctly. Imports the albums/photos, then deletes them from the importing directory
However
Chevereto then can't delete the albums/photos due to permissions, as the imported photos were created/'owned' by root. (since I didn't run the CLI as sudo -u www-admin)
So one way I can't import them, the other way I can't delete (and presumably otherwise modify them)
...
I'm experienced on Windows and MacOS, but my linux permissions skills are lacking. I tried various ways to change the file/directory permissions but haven't been able to figure it out.
I tried adding a linux user imguploader (not a chevereto user) and putting that user in the www-data group.
I then sftp'd the test album to importing with rwx group permissions set for the www-data group.
(The thinking was, www-data user is in the www-data group. So if I give www-data group write permissions, it could import then delete the files.)
I then run the cli importer as sudo -u www-data ...
That didnt work. I get other permissions errors:
I'm just unclear how this is supposed to be setup. I must be missing something simple. Can't find any threads on the community with similar issues.
(I am getting good at rebuilding the linode server from scratch though...)
Thanks for any pointers.
My problem is with file permissions.
- With root SFTP account, I upload photos to ./importing/parse-users (Any of the parse options work the same)
- If I run the CLI command sudo -u www-data php /var/www/html/cli.php -C importing (from the Dashboard->Bulk Importer)
I get errors where Chevereto can't delete the photos from the importing directory, as they're owned by root.
- If I run the CLI command without the sudo (while logged in as root) php /var/www/html/cli.php -C importing
Import runs correctly. Imports the albums/photos, then deletes them from the importing directory
However
Chevereto then can't delete the albums/photos due to permissions, as the imported photos were created/'owned' by root. (since I didn't run the CLI as sudo -u www-admin)
So one way I can't import them, the other way I can't delete (and presumably otherwise modify them)
...
I'm experienced on Windows and MacOS, but my linux permissions skills are lacking. I tried various ways to change the file/directory permissions but haven't been able to figure it out.
I tried adding a linux user imguploader (not a chevereto user) and putting that user in the www-data group.
I then sftp'd the test album to importing with rwx group permissions set for the www-data group.
(The thinking was, www-data user is in the www-data group. So if I give www-data group write permissions, it could import then delete the files.)
I then run the cli importer as sudo -u www-data ...
That didnt work. I get other permissions errors:
1639599749 - [Thread #0] About to parse image: /var/www/html/importing/parse-users/newmissions/C04906/C04906-(2019-12-03)_SP.jpg
1639599749 - [Thread #0] Using DB lock for content context data (id and type)
1639599750 - [Thread #0] Failed to insert image, exception thrown: file_put_contents(/tmp/chvtempHE2HKa): failed to open stream: Permission denied
1639599750 - [Thread #0] Adding "errors" flag to import row
I'm just unclear how this is supposed to be setup. I must be missing something simple. Can't find any threads on the community with similar issues.
(I am getting good at rebuilding the linode server from scratch though...)
Thanks for any pointers.