knossos
knossos copied to clipboard
Support subdirectories in tasks fetched from heidelbrain
Heidelbrain should be able to send task info of this form to Knossos:
This seems to be currently unsupported, because Knossos would have to create subdirectories for its tasks directory. Knossos should create these subdirectories.
Why? I already found it odd enough that new tasks contained paths as their filename. Yeah, it’s possible to remove the filename part and create the directory, but it would also allow something like "../../../some file somewhere" to work, which is bad.
The reason we do this is to organize data on the server side, just copying that on the client would have the nice side effect of also organizing the data locally. I'm sure you can validate paths to make sure they are safe. If this really is a huge stumbling block, just remove the path and keep only the file name, it will be unique anyway.
I don’t underdtand why the folder is transmitted at all. It’s not like Downloads from somewhere else contain folders in their filename. But anyway, i can build something for that. Will think about it.
OK, I didn't write this code so I just assumed the transmitted path was actually used by Knossos. But you're saying it's not? Is the file not GET'ed from there? Either way, it's actually fine to discard the path since the file name is unique, but it could provide additional organization of the local task files folder. Think about it not like downloads in a web-browser but selective mirroring of some remote directory hierarchy. But if Knossos doesn't need it anyway we can also remove it from the server's response.
It is used, but the task-files subdirectory for new tasks is created explicitly. I don’t like that that’s the case though. (when i built that i was pretty confused that a filename property would contain a path) I thought of the tasks directory to just be a location for temporary files, not an archive. (because that’s already available online) Personally, i would load the file directly from the download and only save the filename as suggestion on save later.
Is it still a path (and the subfolder stuff still wanted) or a filename now?