knossos icon indicating copy to clipboard operation
knossos copied to clipboard

Support subdirectories in tasks fetched from heidelbrain

Open fabiansvara opened this issue 8 years ago • 6 comments

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.

fabiansvara avatar Apr 30 '16 18:04 fabiansvara

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.

Optiligence avatar Apr 30 '16 18:04 Optiligence

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.

fabiansvara avatar Apr 30 '16 19:04 fabiansvara

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.

Optiligence avatar Apr 30 '16 19:04 Optiligence

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.

fabiansvara avatar Apr 30 '16 19:04 fabiansvara

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.

Optiligence avatar Apr 30 '16 20:04 Optiligence

Is it still a path (and the subfolder stuff still wanted) or a filename now?

Optiligence avatar Jun 24 '16 00:06 Optiligence