Closed DocCyblade closed 3 years ago
As this is a good idea, I am not going to implement this as of yet.
For my own install at home, I will be using the watch folders. The issue is getting the data to the watch folder in a safe way, and ensure both the upload user and the www-data user has r/w to the uploaded files. There a few ways I can think of doing this
www-data
and set the setgid so that the group ID is set for new folders. Need to make sure when uploading our UMASK is set to that owner and group has r/wNot sure the best TKL way.
As for what I will do until this feature gets added if at all, I will be setting up folders on my mac file server, and using scheduled tasks running a script that will upload the files to the mayan server via transmit.
Here's another thought, not sure if it's a good one or not...!?
You could have a user accessible directory to upload files. Then have cron job that runs every minute or so that rsyncs from the upload directory to the "proper" watch folder. The rsync could ignore the permissions of the uploaded files (so they'd always just inherit the permissions of the directory they're rsynced into).
Assuming that the files are auto deleted from the watch folder once they're added to Mayan rsync could also clean up the upload directory too?!
Using rsync (instead of something else like mv
or cp
) would also mean that it would use minimal resources as is would only copy anything that has changed.
OTOH maybe a clunky way to do it if one of your suggestions works better...
@JedMeister - I like the rsync idea, kinda of what I was thinking in number 4. I think I will proceed in that direction. I would like to create a service of sorts so it can be "started" or enabled/disabled.
Would be a good start to add a default upload folder and user so that it's easy to setup watch and stage folders. This would ensure permissions would be setup right.